User-related API environment
Pre-live user-related API docs
These pages describe the Pre-live user-related API stack.
Use pre-live OAuth credentials, pre-live API base URLs, and pre-live app URLs when following this documentation. Keep your OAuth flow, API requests, callback URLs, and manual testing within the pre-live environment.
- Use prelive.quran.com for auth-related testing.
- Use prelive.quranreflect.org for Quran Reflect paths where applicable.
- Do not mix production sessions or production user data with pre-live testing.
Get an App State document
Returns one live document and its quoted ETag. Send the ETag unchanged in If-Match for a strict replacement. Requires a user-delegated access token with app_state or app_state.read. Client-credentials tokens are rejected because App State is always scoped to a real user.
Path Parameters
Possible values: Value must match regular expression ^[a-z0-9][a-z0-9._-]{0,79}$
Enabled data-group name returned by GET /v1/app-state:config.
Possible values: non-empty and <= 512 characters, Value must match regular expression ^(?=(?:(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF])){1,512}$)[^\u0000-\u001f\u007f/\\]+$
Application-defined document key of 1-512 Unicode scalar values. Keys are compared by exact code points without Unicode normalization, so canonically equivalent spellings are distinct keys. It cannot contain slashes, backslashes, or control characters.
- 200
- 400
- 401
- 403
- 404
- 429
- 500
- 503
The current live document.
Response Headers
ETag string
Example: "s_6UYAfR2WOsf0gHaRMUXBw2kP1S-kRXyCmbCl6yZpk"Opaque quoted document validator. An intermediary may add W/. Store it and send it unchanged in If-Match; never construct it from version.
Schema
Possible values: [true]
data object required
Possible values: Value must match regular expression ^[a-z0-9][a-z0-9._-]{0,79}$
Enabled data group containing the document.
Possible values: non-empty and <= 512 characters, Value must match regular expression ^(?=(?:(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF])){1,512}$)[^\u0000-\u001f\u007f/\\]+$
Document key within the data group.
Possible values: >= 1 and <= 2147483647
Application-owned schema version for the document value.
Possible values: >= 1
Server-assigned document version.
Application-owned JSON value. The service never merges document fields.
{
"success": true,
"data": {
"collection": "settings",
"key": "theme",
"schemaVersion": 1,
"version": 3,
"updatedAt": "2026-08-27T00:15:00.000Z",
"value": {
"mode": "dark",
"fontScale": 1.1
}
}
}
Current setting
{
"success": true,
"data": {
"collection": "settings",
"key": "theme",
"schemaVersion": 1,
"version": 3,
"value": {
"mode": "dark",
"fontScale": 1.1
},
"updatedAt": "2026-08-27T00:15:00.000Z"
}
}
The API Gateway rejects missing authentication headers. The App State service can also return this status: The data-group name or document key is invalid.
Schema
Possible values: [false]
details object
The upstream service error body, when the failure came from a service.
The upstream service error body, when the failure came from a service.
{
"message": "string",
"type": "string",
"success": false,
"details": {}
}
Missing authentication headers
{
"message": "The request is missing required headers or is invalid",
"type": "invalid_request",
"success": false
}
Invalid document key
{
"details": {
"success": false,
"error": {
"code": "invalid_key",
"message": "The document key is invalid."
}
},
"message": "The document key is invalid.",
"type": "invalid_request",
"success": false
}
The Gateway and App State service reject malformed, expired, inactive, revoked, or non-user-delegated access tokens and tokens associated with another client. The service can also reject a banned authenticated user.
Response Headers
WWW-Authenticate string
Example: Bearer error="invalid_token"Bearer challenge returned for invalid App State credentials.
Schema
Possible values: [false]
details object
The upstream service error body, when the failure came from a service.
The upstream service error body, when the failure came from a service.
{
"message": "string",
"type": "string",
"success": false,
"details": {}
}
Malformed access token
{
"message": "The access token is not a valid JWT",
"type": "invalid_token",
"success": false
}
Expired or inactive access token
{
"message": "The access token is expired or inactive",
"type": "invalid_token",
"success": false
}
Revoked access token
{
"message": "The access token is expired or inactive",
"type": "invalid_token",
"success": false
}
Token belongs to another client
{
"message": "The access token is not associated with the client",
"type": "invalid_token",
"success": false
}
Invalid access token rejected by App State
{
"details": {
"success": false,
"error": {
"code": "invalid_token",
"message": "The access token is invalid."
}
},
"message": "The access token is invalid.",
"type": "unauthorized",
"success": false
}
Banned user
{
"details": {
"success": false,
"name": "external.banned",
"error": {
"code": "BANNED",
"message": "Sorry, Your account is banned. Contact Quran.Foundation",
"details": {
"email": "BANNED"
}
}
},
"message": "Sorry, Your account is banned. Contact Quran.Foundation",
"type": "unauthorized",
"success": false
}
The Gateway rejects insufficient scopes. The service additionally requires an active App State policy and an enabled data group.
Schema
Possible values: [false]
details object
The upstream service error body, when the failure came from a service.
The upstream service error body, when the failure came from a service.
{
"message": "string",
"type": "string",
"success": false,
"details": {}
}
Insufficient App State scope
{
"message": "The access token does not have the required scopes",
"type": "insufficient_scope",
"success": false
}
App State disabled
{
"details": {
"success": false,
"error": {
"code": "app_state_disabled",
"message": "App State is disabled."
}
},
"message": "App State is disabled.",
"type": "forbidden",
"success": false
}
Data group not enabled
{
"details": {
"success": false,
"error": {
"code": "collection_not_allowed",
"message": "The collection is not approved."
}
},
"message": "The collection is not approved.",
"type": "forbidden",
"success": false
}
No live document exists at this data group and key.
Schema
Possible values: [false]
details object
The upstream service error body, when the failure came from a service.
The upstream service error body, when the failure came from a service.
{
"message": "string",
"type": "string",
"success": false,
"details": {}
}
Document not found
{
"details": {
"success": false,
"error": {
"code": "document_not_found",
"message": "The document was not found."
}
},
"message": "The document was not found.",
"type": "not_found",
"success": false
}
The request was rate limited by the public API Gateway. Retry after the communicated interval.
Schema
Possible values: [false]
details object
The upstream service error body, when the failure came from a service.
The upstream service error body, when the failure came from a service.
{
"message": "string",
"type": "string",
"success": false,
"details": {}
}
Client rate limited
{
"message": "Too many requests, please try again later",
"type": "rate_limit_exceeded",
"success": false
}
An unexpected server or database failure prevented the request from completing.
Schema
Possible values: [false]
details object
The upstream service error body, when the failure came from a service.
The upstream service error body, when the failure came from a service.
{
"message": "string",
"type": "string",
"success": false,
"details": {}
}
Unexpected server error
{
"details": {
"success": false,
"error": {
"code": "ServerError",
"message": "Something went wrong"
}
},
"message": "Something went wrong",
"type": "internal_server_error",
"success": false
}
App State policy or stream state could not be resolved. Retry with backoff.
Schema
Possible values: [false]
details object
The upstream service error body, when the failure came from a service.
The upstream service error body, when the failure came from a service.
{
"message": "string",
"type": "string",
"success": false,
"details": {}
}
Namespace resolution unavailable
{
"details": {
"success": false,
"error": {
"code": "namespace_resolution_unavailable",
"message": "App State namespace resolution is temporarily unavailable."
}
},
"message": "App State namespace resolution is temporarily unavailable.",
"type": "service_unavailable",
"success": false
}
App State unavailable
{
"details": {
"success": false,
"error": {
"code": "app_state_unavailable",
"message": "The App State stream or document is temporarily unavailable."
}
},
"message": "The App State stream or document is temporarily unavailable.",
"type": "service_unavailable",
"success": false
}