Accept the AI terms
POST
/api/v1/mailbox/ai/consentRecords the holder's acceptance of the current terms (terms_version from GET /ai/terms). accept_training is a separate, optional choice.
Errors
| Status | When |
|---|---|
401 |
No token, or the session expired or was signed out. Sign in again with POST /mailbox-auth/login. |
403 |
The account has a temporary password: until POST /security/password succeeds, every other call answers this with error_code: password_change_required. |
409 |
The terms changed since they were read; show the current ones. |
422 |
accept_assistant must be true (withdraw with DELETE /ai/consent). |
Request body
accept_assistantbooleanrequiredMust be true: accepting the assistant terms.
accept_trainingbooleanAlso allow use for improving the assistant. Optional, separate.
terms_versionstringrequiredThe
versionfromGET /ai/termsthat the holder read.
Request
POST
/api/v1/mailbox/ai/consentcurl -X POST 'https://courier.mailyte.com/api/v1/mailbox/ai/consent' \
-H 'Authorization: Bearer MAILBOX_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"accept_assistant": true,
"accept_training": false,
"terms_version": "2026-09"
}'const response = await fetch('https://courier.mailyte.com/api/v1/mailbox/ai/consent', {
method: 'POST',
headers: {
Authorization: 'Bearer MAILBOX_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"accept_assistant": true,
"accept_training": false,
"terms_version": "2026-09"
}),
});
const { data } = await response.json();import requests
response = requests.post(
"https://courier.mailyte.com/api/v1/mailbox/ai/consent",
headers={"Authorization": "Bearer MAILBOX_TOKEN"},
json={
"accept_assistant": true,
"accept_training": false,
"terms_version": "2026-09"
},
)
data = response.json()["data"]<?php
$response = Http::withToken('MAILBOX_TOKEN')
->post('https://courier.mailyte.com/api/v1/mailbox/ai/consent', [
'accept_assistant' => true,
'accept_training' => false,
'terms_version' => '2026-09',
]);
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://courier.mailyte.com/api/v1/mailbox/ai/consent")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer MAILBOX_TOKEN"
request["Content-Type"] = "application/json"
request.body = {
"accept_assistant": true,
"accept_training": false,
"terms_version": "2026-09"
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
Successful Response
dataobjectdocument_urlstringconsent_idstring
200
application/json{
"type": "success",
"msg": "Consent recorded",
"data": {
"document_url": "/api/v1/mailbox/ai/consent/01JABC/document",
"consent_id": "01JABC"
}
}Returned inside the standard envelope.
Errors
| Status | When |
|---|---|
401 | No token, or the session expired or was signed out. Sign in again with `POST /mailbox-auth/login`. |
403 | The account has a temporary password: until `POST /security/password` succeeds, every other call answers this with `error_code: password_change_required`. |
409 | The terms changed since they were read; show the current ones. |
422 | `accept_assistant` must be true (withdraw with `DELETE /ai/consent`). |
Every status, with what causes it and what to do, is on the error reference.