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
id path number yes Mailbox 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
success boolean Always true on success
data.id number Mailbox identifier
data.name string Mailbox display name
data.email string Mailbox email address
data.senderName string Sender 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
400 INVALID_PARAMS The :id in the path is non-numeric or negative — message id must be a non-negative integer
404 ENTITY_NOT_FOUND Mailbox with the given ID not found
403 SCOPE_DENIED API key does not have the mail scope
401 TOKEN_MISSING API key has no configured tokens
429 RATE_LIMITED Request limit exceeded
502 BITRIX_UNAVAILABLE The Bitrix24 portal is unavailable
422 BITRIX_ERROR Bitrix24 returned an error

Full list of common API errors — Errors.

See also