
## Mailbox sender addresses

`GET /v1/mail/mailboxes/:id/senders`

Returns the list of addresses on whose behalf messages can be sent from the given mailbox.

## Parameters

| Parameter | In | Type | Required | Default | Description |
|----------|---|-----|:-----:|-----------|----------|
| `id` | path | number | yes | — | Mailbox identifier (from the [mailbox list](./list.md)) |

## Examples

### curl — personal key

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

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/mail/mailboxes/1/senders" \
  -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/senders', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { success, data } = await res.json()
console.log(data.items)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/mail/mailboxes/1/senders', {
  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.items` | array | List of sender addresses |
| `data.items[].email` | string | Sender email address |
| `data.items[].name` | string | Sender display name |
| `data.items[].sender` | string | String for the `From` header in the format `"Name <email>"` |

## Response example

```json
{
  "success": true,
  "data": {
    "items": [
      {
        "email": "info@example.com",
        "name": "Work mail",
        "sender": "Company <info@example.com>"
      },
      {
        "email": "support@example.com",
        "name": "Support",
        "sender": "Support team <support@example.com>"
      },
      {
        "email": "sales@example.com",
        "name": "Sales department",
        "sender": "Sales department <sales@example.com>"
      }
    ]
  }
}
```

## Error response example

400 — non-numeric ID:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "id must be a positive integer"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 400 | `INVALID_PARAMS` | `id` is not a positive integer |
| 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](/docs/errors).

## Known specifics

**Sending addresses.** Call this endpoint before composing a message to get the list of allowed sender addresses and let the user pick the one they need.

## See also

- [List mailboxes](./list.md)
- [Get mailbox](./get.md)
