# Response status codes (/en/api-reference/api-ref/cloud-recording/status-codes)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

When you call the Cloud Recording RESTful API, each response includes an HTTP status code. A `200` status code means the request was successful. If the request fails, use the status code together with the following response body fields to troubleshoot:

* `message`

  ```json
  // 401 Unauthorized
  {
    "message": "Invalid authentication credentials"
  }
  ```

* `code` and `reason`

  ```json
  // 400 Bad Request
  {
    "code": 2,
    "reason": "Acquire: invalid resourceExpiredHour value!"
  }
  ```

## General status codes [#general-status-codes]

| Status code             | `message`                              | Description                      | Resolution                                                                                                                                                                 |
| ----------------------- | -------------------------------------- | -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400 Bad Request`       | `"appid is invalid"`                   | Invalid App ID.                  | Enable the cloud recording service for this App ID before calling the API.                                                                                                 |
| `401 Unauthorized`      | `"Unauthorized"`                       | Authorization header is missing. | Ensure you are using [HTTP Basic Auth](/en/api-reference/api-ref/cloud-recording/authentication) and that the `Authorization` field is included in the request header.     |
| `401 Unauthorized`      | `"Invalid authentication credentials"` | Invalid Authorization.           | Check that your Customer ID and Customer Secret are correct, that the Authorization is generated correctly, and that the Customer ID and Customer Secret match the App ID. |
| `404 Not Found`         | `"no Route matched with those values"` | Incorrect request route.         | Check that the HTTP method and URL are correct.                                                                                                                            |
| `429 Too Many Requests` | `"API rate limit exceeded"`            | Request rate limit exceeded.     | Reduce the frequency of API calls. To request a higher quota, contact [support@agora.io](mailto\:support@agora.io).                                                        |

## Endpoint-specific status codes [#endpoint-specific-status-codes]

### Acquire [#acquire]

| Status code                 | `code` and `reason`                                | Description                     | Resolution                                                                                                                              |
| --------------------------- | -------------------------------------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `400 Bad Request`           | `code: 2`                                          | Invalid request parameters.     | Check the request header, URL, and body. Refer to the `reason` field for details.                                                       |
| `400 Bad Request`           | `code: 400, reason: "invalid_appid"`               | Invalid App ID.                 | Enable the cloud recording service for this App ID before calling the API.                                                              |
| `400 Bad Request`           | `code: 401, reason: "invalid_channel_name"`        | Invalid channel name.           | The `cname` field in the request body contains unsupported characters. Check your integration.                                          |
| `400 Bad Request`           | `code: 405, reason: "no_active_status"`            | App status abnormal.            | The App service is unavailable, possibly due to an overdue account. Check your account status.                                          |
| `400 Bad Request`           | `code: 406, reason: "vendor_over_load"`            | Concurrent task limit exceeded. | Retry later and check your integration for task leaks. To request a higher quota, contact [support@agora.io](mailto\:support@agora.io). |
| `500 Internal Server Error` | `code: 500, reason: "internal_error"`              | Internal server error.          | Retry with a backoff strategy.                                                                                                          |
| `500 Internal Server Error` | `code: 501, reason: "no_worker_manager_available"` | No resources available.         | Retry with a backoff strategy.                                                                                                          |
| `500 Internal Server Error` | `code: 504, reason: "allocate_timeout"`            | Request timed out.              | Retry with a backoff strategy.                                                                                                          |

### Start [#start]

| Status code                 | `code` and `reason`                              | Description                                                                        | Resolution                                                                                                                  |
| --------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `201 Created`               | `code: 7, reason: "already started"`             | Recording is already running. Duplicate `start` request.                           | Do not repeat the `start` request with the same resource ID.                                                                |
| `206 Partial Content`       | `code: 65, reason: "request not completed"`      | Request not completed. The request reached the backend but the response timed out. | Retry the request. If the retry fails, call `acquire` and `start` again to initiate a new session.                          |
| `400 Bad Request`           | `code: 2`                                        | Invalid request parameters.                                                        | Check the request header, URL, and body. Refer to the `reason` field for details.                                           |
| `400 Bad Request`           | `code: 53, reason: "task conflict"`              | A task with the same `cname` and `uid` already exists.                             | Check your integration to avoid duplicate tasks, or use a different `cname` and `uid` and call `acquire` and `start` again. |
| `500 Internal Server Error` | `code: 502, reason: "Failed to allocate worker"` | No resources available.                                                            | Call `acquire` and `start` again to initiate a new session.                                                                 |
| `500 Internal Server Error` | `code: 62, reason: "request timeout"`            | Request timed out.                                                                 | Retry the request. If the retry fails, call `acquire` and `start` again to initiate a new session.                          |

### Query [#query]

| Status code           | `code` and `reason`                          | Description                                                                        | Resolution                                                                                           |
| --------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `206 Partial Content` | `code: 65, reason: "request not completed"`  | Request not completed. The request reached the backend but the response timed out. | Retry the request.                                                                                   |
| `400 Bad Request`     | `code: 2`                                    | Invalid request parameters.                                                        | Check the request header, URL, and body. Refer to the `reason` field for details.                    |
| `404 Not Found`       | `code: 404, reason: "failed to find worker"` | Task does not exist.                                                               | The task may have already exited. Check whether this requires handling based on your business logic. |
| `504 Gateway Timeout` | `code: 62, reason: "request timeout"`        | Request timed out.                                                                 | The backend service is temporarily unavailable. Retry the request.                                   |

### Update [#update]

| Status code           | `code` and `reason`                          | Description                                                                        | Resolution                                                                                           |
| --------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `206 Partial Content` | `code: 65, reason: "request not completed"`  | Request not completed. The request reached the backend but the response timed out. | Retry the request.                                                                                   |
| `400 Bad Request`     | `code: 2`                                    | Invalid request parameters.                                                        | Check the request header, URL, and body. Refer to the `reason` field for details.                    |
| `404 Not Found`       | `code: 404, reason: "failed to find worker"` | Task does not exist.                                                               | The task may have already exited. Check whether this requires handling based on your business logic. |
| `504 Gateway Timeout` | `code: 62, reason: "request timeout"`        | Request timed out.                                                                 | The backend service is temporarily unavailable. Retry the request.                                   |

### Update layout [#update-layout]

| Status code           | `code` and `reason`                          | Description                                                                        | Resolution                                                                                           |
| --------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `206 Partial Content` | `code: 65, reason: "request not completed"`  | Request not completed. The request reached the backend but the response timed out. | Retry the request.                                                                                   |
| `400 Bad Request`     | `code: 2`                                    | Invalid request parameters.                                                        | Check the request header, URL, and body. Refer to the `reason` field for details.                    |
| `404 Not Found`       | `code: 404, reason: "failed to find worker"` | Task does not exist.                                                               | The task may have already exited. Check whether this requires handling based on your business logic. |
| `504 Gateway Timeout` | `code: 62, reason: "request timeout"`        | Request timed out.                                                                 | The backend service is temporarily unavailable. Retry the request.                                   |

### Stop [#stop]

| Status code           | `code` and `reason`                          | Description                                                                        | Resolution                                                                                                                                                                    |
| --------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `206 Partial Content` | `code: 65, reason: "request not completed"`  | Request not completed. The request reached the backend but the response timed out. | Retry the request.                                                                                                                                                            |
| `206 Partial Content` | `code: 435, reason: "no recorded data"`      | No recorded files generated.                                                       | No users were sending streams in the channel. Check whether this is expected based on your business logic.                                                                    |
| `400 Bad Request`     | `code: 2`                                    | Invalid request parameters.                                                        | Check the request header, URL, and body. Refer to the `reason` field for details.                                                                                             |
| `400 Bad Request`     | `code: 49, reason: "invalid operation"`      | Invalid operation.                                                                 | The task is already exiting. This may be caused by a duplicate `stop` call, the recording bot being removed from the channel, or `maxIdleTime` being triggered automatically. |
| `404 Not Found`       | `code: 404, reason: "failed to find worker"` | Task does not exist.                                                               | The task may have already exited. Check whether this requires handling based on your business logic.                                                                          |
| `504 Gateway Timeout` | `code: 62, reason: "request timeout"`        | Request timed out.                                                                 | The backend service is temporarily unavailable. Retry the request.                                                                                                            |

If you encounter errors not listed on this page, contact [support@agora.io](mailto\:support@agora.io).

## FAQs [#faqs]

### Why do I get a 404 when calling `query`, `updateLayout`, or `stop`? [#why-do-i-get-a-404-when-calling-query-updatelayout-or-stop]

Cloud recording uses a high availability mechanism that automatically recovers from server failures. During recovery, these endpoints temporarily return `404` even though the recording session is still active.

Recovery time depends on the type of failure:

* **Server process failure**: The service switches to a new server within 30 seconds.
* **Server disconnection**: The service attempts to reconnect. If reconnection fails within one minute, it switches to a different server.
