> ## Documentation Index
> Fetch the complete documentation index at: https://docs.livingsecurity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tham chiếu lỗi

> Tất cả các lỗi mà API công khai /v1 của Living Security có thể trả về, kèm mã máy ổn định, trạng thái HTTP và cách khắc phục.

Mọi phản hồi lỗi `/v1` đều ở định dạng `application/problem+json` ([RFC 9457](https://www.rfc-editor.org/rfc/rfc9457)) với một tập trường cố định:

```json theme={null}
{
  "type": "https://docs.livingsecurity.com/developers/v1/errors/resource_not_found",
  "title": "Not Found",
  "status": 404,
  "detail": "No such organization.",
  "code": "resource_not_found",
  "request_id": "req_...",
  "doc_url": "https://docs.livingsecurity.com/developers/v1/errors/resource_not_found",
  "retryable": false
}
```

Hãy phân nhánh xử lý dựa trên `code`, không dựa trên `detail` — `code` là một hợp đồng máy ổn định; `detail` là nội dung dành cho người đọc và có thể thay đổi. `param` xuất hiện khi lỗi có thể quy cho một tham số yêu cầu cụ thể. Hãy đính kèm `request_id` khi liên hệ bộ phận hỗ trợ.

## Mã lỗi

| Mã | Trạng thái HTTP | Có thể thử lại |
| - | - | - |
| [`unauthorized`](/vi/developers/v1/errors/unauthorized) | 401 | Không |
| [`credential_inactive`](/vi/developers/v1/errors/credential_inactive) | 401 | Không |
| [`credential_expired`](/vi/developers/v1/errors/credential_expired) | 401 | Không |
| [`credential_revoked`](/vi/developers/v1/errors/credential_revoked) | 401 | Không |
| [`not_entitled`](/vi/developers/v1/errors/not_entitled) | 403 | Không |
| [`insufficient_permission`](/vi/developers/v1/errors/insufficient_permission) | 403 | Không |
| [`permission_denied`](/vi/developers/v1/errors/permission_denied) | 403 | Không |
| [`resource_not_found`](/vi/developers/v1/errors/resource_not_found) | 404 | Không |
| [`invalid_request`](/vi/developers/v1/errors/invalid_request) | 400 hoặc 409 | Không |
| [`invalid_filter`](/vi/developers/v1/errors/invalid_filter) | 400 | Không |
| [`unsupported_version`](/vi/developers/v1/errors/unsupported_version) | 400 | Không |
| [`idempotency_key_reuse`](/vi/developers/v1/errors/idempotency_key_reuse) | 409 | Tùy theo xung đột |
| [`rate_limited`](/vi/developers/v1/errors/rate_limited) | 429 | Có |
| [`service_unavailable`](/vi/developers/v1/errors/service_unavailable) | 503 | Có |
| [`internal_error`](/vi/developers/v1/errors/internal_error) | 500 | Có |

Tập mã lỗi là cố định: việc bổ sung mã mới là một thay đổi đối với hợp đồng công khai và sẽ được thông báo qua nhật ký thay đổi của API. Phản hồi `retryable: true` cho biết tình trạng lỗi có thể tự khắc phục; điều này không chứng minh rằng thao tác ghi không có tác động nào. Hãy thử lại các thao tác đọc với số lần thử và ngân sách thời gian hữu hạn, cùng cơ chế backoff theo cấp số nhân và jitter. Hãy tuân thủ `Retry-After` khi có, kể cả với phản hồi `409` hoặc `429` có thể thử lại.

Đối với các thao tác thay đổi dữ liệu, hãy tuân theo hợp đồng về tính idempotent và khôi phục được ghi trong tài liệu của thao tác đó. Hãy giữ nguyên khóa gốc và yêu cầu gốc khi được hỗ trợ. Không tạo khóa mới sau khi hết thời gian chờ hoặc `5xx`: làm vậy có thể lặp lại một thao tác ghi đã thành công. Tiêu đề `Idempotency-Key` không mang lại bất kỳ sự bảo vệ nào trên thao tác không hỗ trợ tiêu đề này.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.