For AI agents: markdown of this page — /docs-content-en/mail/mailboxes/get.md documentation index — /llms.txt

Get mailbox

GET /v1/mail/mailboxes/:id

Returns the data of a single mailbox by its identifier.

Parameters

Parameter In Type Required Default Description
Parameterid Inpath Typenumber Requiredyes Default— DescriptionMailbox identifier (from the mailbox list)

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/mail/mailboxes/1" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/mail/mailboxes/1" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/mail/mailboxes/1', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { success, data } = await res.json()
console.log(data.email)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/mail/mailboxes/1', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})
const { success, data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.id Typenumber DescriptionMailbox identifier
Fielddata.name Typestring DescriptionMailbox display name
Fielddata.email Typestring DescriptionMailbox email address
Fielddata.senderName Typestring DescriptionSender name placed into the "From" field

Response example

JSON
{
  "success": true,
  "data": {
    "id": 1,
    "name": "Work mail",
    "email": "info@example.com",
    "senderName": "Company"
  }
}

Error response example

404 — mailbox not found:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Record with ID = `42` not found"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionThe :id in the path is non-numeric or negative — message id must be a non-negative integer
HTTP404 CodeENTITY_NOT_FOUND DescriptionMailbox with the given ID not found
HTTP403 CodeSCOPE_DENIED DescriptionAPI key does not have the mail scope
HTTP401 CodeTOKEN_MISSING DescriptionAPI key has no configured tokens
HTTP429 CodeRATE_LIMITED DescriptionRequest limit exceeded
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionThe Bitrix24 portal is unavailable
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 returned an error

Full list of common API errors — Errors.

See also