{
  "id": "availability",
  "title": "Database availability requests",
  "url": "https://redis.io/docs/latest/operate/rs/8.0/references/rest-api/requests/bdbs/availability/",
  "summary": "REST API requests to check database availability",
  "content": "\n| Method | Path | Description |\n|--------|------|-------------|\n| [GET](#get-db-endpoint-availability) | `/v1/local/bdbs/{uid}/endpoint/availability` | Verifies local database endpoint availability |\n| [GET](#get-db-availability) | `/v1/bdbs/{uid}/availability` | Verifies database availability |\n\n## Get database endpoint availability {#get-db-endpoint-availability}\n\n```sh\nGET /v1/local/bdbs/{uid}/endpoint/availability\n```\n\nVerifies the local database endpoint is available. This request does not redirect to the primary node.\n\n### Permissions\n\n| Permission name | Roles |\n|-----------------|-------|\n| [view_bdb_info](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_bdb_info) | admin\u003cbr /\u003ecluster_member\u003cbr /\u003ecluster_viewer\u003cbr /\u003edb_member\u003cbr /\u003edb_viewer\u003cbr /\u003euser_manager |\n\n### Request {#get-endpoint-request}\n\n#### Example HTTP requests\n\nTo check database endpoint availability without any additional checks:\n\n```sh\nGET /v1/local/bdbs/1/endpoint/availability\n```\n\nTo perform a lag-aware database endpoint availability check using the cluster's default lag tolerance threshold:\n\n```sh\nGET /v1/local/bdbs/1/endpoint/availability?extend_check=lag\n```\n\nTo perform a lag-aware database endpoint availability check and override the cluster's default lag tolerance threshold:\n\n```sh\nGET /v1/local/bdbs/1/endpoint/availability?extend_check=lag\u0026availability_lag_tolerance_ms=100\n```\n\n#### Headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The unique ID of the database. |\n\n#### Query parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| extend_check | list of comma-separated strings | List of additional availability checks to perform (optional)\u003cbr /\u003eValues:\u003cbr /\u003e**lag**: Enables lag-aware checks to assess replication health. Determines if a replica is sufficiently synced with the primary for failover/failback scenarios. |\n| availability_lag_tolerance_ms | integer | Overrides the cluster's default lag tolerance threshold when using `extend_check=lag`. Recommended value: 100 milliseconds. |\n\n### Response {#get-endpoint-response}\n\nReturns the status code `200 OK` if the local database endpoint is available.\n\nIf the local database endpoint is unavailable, returns an error status code and a JSON object that contains `error_code` and `description` fields.\n\n### Error codes {#get-endpoint-error-codes}\n\nWhen errors are reported, the server may return a JSON object with\n`error_code` and `description` fields that provide additional information.\nThe following are possible `error_code` values:\n\n| Code | Description |\n|------|-------------|\n| no_quorum | Master healthcheck failed (no quorum in the cluster) |\n| db_not_found | Database does not exist in the cluster |\n| bdb_endpoint_unavailable | Local database endpoint is not available | \n\n### Status codes {#get-endpoint-status-codes}\n\n| Code | Description |\n|------|-------------|\n| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | Database endpoint is available. |\n| [400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request) | Invalid schema. |\n| [404 Not Found](https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found) | Database not found. |\n| [503 Service Unavailable](https://www.rfc-editor.org/rfc/rfc9110.html#name-503-service-unavailable) | Database endpoint is unavailable. |\n\n\n## Get database availability {#get-db-availability}\n\n```sh\nGET /v1/bdbs/{uid}/availability\n```\n\nGets the availability status of a database.\n\n- If the OSS Cluster API is enabled, verifies all endpoints for this database are available.\n\n- Otherwise, verifies the database has at least one available endpoint.\n\n### Permissions\n\n| Permission name | Roles |\n|-----------------|-------|\n| [view_bdb_info](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_bdb_info) | admin\u003cbr /\u003ecluster_member\u003cbr /\u003ecluster_viewer\u003cbr /\u003edb_member\u003cbr /\u003edb_viewer\u003cbr /\u003euser_manager |\n\n### Request {#get-db-request}\n\n#### Example HTTP requests\n\n\nTo check database availability without any additional checks:\n\n```sh\nGET /v1/bdbs/1/availability\n```\n\nTo perform a lag-aware database availability check using the cluster's default lag tolerance threshold:\n\n```sh\nGET /v1/bdbs/1/availability?extend_check=lag\n```\n\nTo perform a lag-aware database availability check and override the cluster's default lag tolerance threshold:\n\n```sh\nGET /v1/bdbs/1/availability?extend_check=lag\u0026availability_lag_tolerance_ms=100\n```\n\n#### Headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The unique ID of the database. |\n\n#### Query parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| extend_check | list of comma-separated strings | List of additional availability checks to perform (optional)\u003cbr /\u003eValues:\u003cbr /\u003e**lag**: Enables lag-aware checks to assess replication health. Determines if a replica is sufficiently synced with the primary for failover/failback scenarios. |\n| availability_lag_tolerance_ms | integer | Overrides the cluster's default lag tolerance threshold when using `extend_check=lag`. Recommended value: 100 milliseconds. |\n\n### Response {#get-db-response}\n\nReturns the status code `200 OK` if the database is available.\n\nIf the database is unavailable, returns an error status code and a JSON object that contains `error_code` and `description` fields.\n\n### Error codes {#get-db-error-codes}\n\nWhen errors are reported, the server may return a JSON object with\n`error_code` and `description` fields that provide additional information.\nThe following are possible `error_code` values:\n\n| Code | Description |\n|------|-------------|\n| no_quorum | Master healthcheck failed (no quorum in the cluster) |\n| db_not_found | Database does not exist in the cluster |\n| bdb_unavailable | Database is not available | \n\n### Status codes {#get-db-status-codes}\n\n| Code | Description |\n|------|-------------|\n| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | Database is available. |\n| [400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request) | Invalid schema. |\n| [404 Not Found](https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found) | Database not found. |\n| [503 Service Unavailable](https://www.rfc-editor.org/rfc/rfc9110.html#name-503-service-unavailable) | Database is unavailable or doesn't have quorum. |\n",
  "tags": ["docs","operate","rs"],
  "last_updated": "2026-07-23T12:05:56-05:00"
}
