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 the active App State configuration
Returns enabled data groups and effective limits for the authenticated OAuth client. Call it before writing so the app knows which names are available and which require ETag preconditions. Requires a user-delegated access token with app_state, app_state.read, or app_state.write. Client-credentials tokens are rejected because App State is always scoped to a real user.
- 200
- 400
- 401
- 403
- 429
- 500
- 503
Active data groups and effective limits for this client.
Schema
- Array [
- ]
Possible values: [true]
data object required
Possible values: >= 1
Monotonic policy version used to detect configuration changes.
limits object required
Effective App State limits for this client and environment.
Possible values: >= 1
Possible values: >= 1
Possible values: >= 1
Possible values: >= 1
collections object[] required
Enabled data groups. Use only names returned here.
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.
Whether mutations require an ETag precondition.
Possible values: >= 1
Effective per-user limit for this data group.
{
"success": true,
"data": {
"configVersion": 7,
"limits": {
"quotaBytesPerUser": 1048576,
"maxDocumentBytes": 65536,
"maxDocumentsPerUser": 500,
"changeRetentionDays": 30
},
"collections": [
{
"name": "settings",
"requiresPrecondition": true,
"maxDocumentsPerUser": 100
}
]
}
}
App State configuration
{
"success": true,
"data": {
"configVersion": 7,
"limits": {
"quotaBytesPerUser": 1048576,
"maxDocumentBytes": 65536,
"maxDocumentsPerUser": 500,
"changeRetentionDays": 30
},
"collections": [
{
"name": "settings",
"requiresPrecondition": true,
"maxDocumentsPerUser": 100
}
]
}
}
The API Gateway rejects missing authentication headers.
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
}
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
}
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
}