## Change meeting participation status

`PUT /v1/calendar-events/:id/meeting-status`

Accepts or declines an invitation to a calendar meeting, or withdraws the response to it. The status changes only for the employee the request runs as.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|----------|
| `id` (path) | number | yes | Meeting ID. Either the event ID in the organizer's calendar or the ID of the meeting copy in an invitee's calendar works — the copy's `parentId` field points to the organizer's event. List: [`GET /v1/calendar-events`](/docs/entities/calendar-events/list) |

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|----------|
| `status` | string | yes | New status: `accepted` — accept the invitation, `declined` — decline it, `invited` — withdraw the response. Any other value, including `host`, `DECLINED`, and the letters `Y`, `N`, `Q`, returns `400 INVALID_PARAMS` |

## Examples

### curl — personal key

```bash
curl -X PUT "https://vibecode.bitrix24.com/v1/calendar-events/7773/meeting-status" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status": "declined"}'
```

### curl — OAuth application

```bash
curl -X PUT "https://vibecode.bitrix24.com/v1/calendar-events/7773/meeting-status" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"status": "declined"}'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/calendar-events/7773/meeting-status', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    status: 'declined',
  }),
})

const { success, data } = await res.json()
console.log('Participation status:', data.status)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/calendar-events/7773/meeting-status', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    status: 'declined',
  }),
})

const { success, data } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | Always `true` on success |
| `data.status` | string | The status read back after the write: `accepted`, `declined`, or `invited` |

## Response example

```json
{
  "success": true,
  "data": {
    "status": "declined"
  }
}
```

## Error response example

422 — the meeting organizer tries to change their own status:

```json
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Bitrix24 did not persist meeting status"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 400 | `INVALID_PARAMS` | `id must be a positive safe integer` — `id` is not a positive integer |
| 400 | `INVALID_PARAMS` | `status must be accepted, declined or invited` — `status` is missing or not in the list |
| 400 | `FST_ERR_CTP_EMPTY_JSON_BODY` | The `Content-Type: application/json` header is sent, but the request body is empty |
| 404 | `ENTITY_NOT_FOUND` | `Calendar record not found` — no event with this `id` exists |
| 422 | `BITRIX_ERROR` | `Bitrix24 did not persist meeting status` — the status stayed unchanged after the write. The meeting organizer gets this response: their `host` status cannot be changed |
| 422 | `BITRIX_ERROR` | `Bitrix24 did not return a participation status` — the employee was not invited to this meeting. The status does not change |
| 422 | `BITRIX_ERROR` | `Bitrix24 did not confirm meeting status` — Bitrix24 did not confirm the write |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request; the error text is in `message`. This is the response for an event that is not a meeting: `isMeeting` is `false` |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode. `error.details` contains the key mode and the URL of the page where the mode is switched |
| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied the employee access due to insufficient permissions |
| 403 | `SCOPE_DENIED` | The API key does not have the `calendar` scope |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 429 | `RATE_LIMITED` | Bitrix24 rejected the call under its request rate limit for the portal |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a response of an unexpected shape |
| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in time |

Full list of common API errors — [Errors](/docs/errors).

## Known specifics

- **Retrying is safe.** Writing the same status again returns `200` with the same value, so the request can be retried after a network failure or a `503`.
- **The organizer sees the response.** After the write, the employee's status changes in the event's `attendeeList` field — [`GET /v1/calendar-events/:id`](/docs/entities/calendar-events/get): `Y` — accepted, `N` — declined, `Q` — has not responded.

## See also

- [Meeting RSVP](/docs/entities/calendar-events/meeting-status)
- [Get meeting participation status](/docs/entities/calendar-events/meeting-status-list)
- [Get event](/docs/entities/calendar-events/get)
- [List events](/docs/entities/calendar-events/list)
