## Check whether an uploaded file exists

`POST /v1/chats/files/uploads/status`

Checks whether a file exists by ID after upload. No chat is needed in the path. The route calls Bitrix24 on the server and never returns its token-bearing download link.

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|:--------:|-------------|
| `fileId` (body) | number | yes | Positive uploaded file ID |

Requires the `im` scope. A read-only key is allowed. Other fields and query parameters are rejected with `400 INVALID_PARAMS`.

## Examples

### curl — personal key

```bash
curl -X POST https://vibecode.bitrix24.com/v1/chats/files/uploads/status \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fileId":7701}'
```

### curl — OAuth application

```bash
curl -X POST https://vibecode.bitrix24.com/v1/chats/files/uploads/status \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"fileId":7701}'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/files/uploads/status', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"fileId": 7701}),
})
const { success, data, error } = await res.json()
console.log(success ? data : error)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/files/uploads/status', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"fileId": 7701}),
})
const { success, data, error } = await res.json()
console.log(success ? data : error)
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | `true` on success |
| `data.exists` | boolean | `true` when the file exists; publication is not distinguished |

## Response example

```json
{
  "success": true,
  "data": {
    "exists": true
  }
}
```

## Error response example

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "File not found",
    "b24Code": "FILE_NOT_FOUND"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | Invalid `fileId` or unexpected parameters |
| 401 | `TOKEN_MISSING` | No Bitrix24 access tokens |
| 403 | `SCOPE_DENIED`, `BITRIX_ACCESS_DENIED` | Missing scope or file access |
| 404 | `ENTITY_NOT_FOUND` | File not found; `FILE_NOT_FOUND` is returned in `error.b24Code` |
| 422 | `BITRIX_ERROR` | Other Bitrix24 refusal |
| 429 | `QUEUE_TIMEOUT` | Bitrix24 request queue is busy; retry later |

The Bitrix24 download descriptor remains on the server and is never returned by the API. `exists: true` does not distinguish published from unpublished files.

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

## See also

- [Upload to folder](/docs/chats/files/upload-to-folder)
- [Discard file](/docs/chats/files/upload-discard)
- [Publish files](/docs/chats/files/upload-publish)
- [Chat files](/docs/chats/files)
