# Create calendar resource

`POST /v1/calendar-resources` · **Bitrix24 API:** `calendar.resource.add` · **Scope:** `calendar`

## Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Resource name. |

## Examples

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/calendar-resources" -H "X-Api-Key: $VIBE_API_KEY" -H 'Content-Type: application/json' -d '{"name": "Meeting room"}'
```

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/calendar-resources" -H "X-Api-Key: $VIBE_API_KEY" -H "Authorization: Bearer $VIBE_USER_TOKEN" -H 'Content-Type: application/json' -d '{"name": "Meeting room"}'
```

```javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/calendar-resources', {
  method: 'POST',
  headers: { 'X-Api-Key': apiKey, 'Content-Type': 'application/json' },
  body: JSON.stringify({"name": "Meeting room"})
});
console.log(await response.json());
```

```javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/calendar-resources', {
  method: 'POST',
  headers: { 'X-Api-Key': apiKey , 'Authorization': `Bearer ${userToken}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"name": "Meeting room"})
});
console.log(await response.json());
```

## Response

```json
{
  "success": true,
  "data": {
    "id": 7
  }
}
```

## Response fields

| Field | Type | Description |
|---|---|---|
| success | boolean | True on success. |
| data.id | integer | Created resource ID. No get-by-id method is available. |

## Errors

| HTTP | Code | Condition |
|---|---|---|
| 400 | INVALID_PARAMS | Invalid IDs, dates or status. |
| 400 | MISSING_REQUIRED_FIELDS | Required values are absent. |
| 401 | TOKEN_MISSING | The key has no usable B24 credentials. |
| 403 | SCOPE_DENIED | calendar scope is missing. |
| 403 | WRITE_BLOCKED_READONLY_KEY | The key forbids a write. |
| 403 | BITRIX_ACCESS_DENIED | Bitrix24 denied access. |
| 422 | BITRIX_ERROR | B24 refused the operation or did not persist the write. |
| 429 | RATE_LIMITED | Request limit exceeded. |
| 502 | BITRIX_UNAVAILABLE | Invalid or unavailable B24 response. |
| 503 | BITRIX_TIMEOUT | B24 timed out. |

Invalid input returns an error instead of an empty result:

```json
{"success":false,"error":{"code":"INVALID_PARAMS","message":"Invalid calendar parameters"}}
```

[All errors](/docs/errors)

## See also

- [Calendar](/docs/calendar)
- [Calendar resources](/docs/entities/calendar-resources)
- [Calendar events](/docs/entities/calendar-events)
