User-related API environment
Production user-related API docs
These pages describe the Production user-related API stack.
Use production OAuth credentials, production API base URLs, and production app URLs when following this documentation.
Need to test before going live? Switch to the Pre-live docs using the environment switcher above.
Add/update activity day
Create or update the user's daily activity record for one date and one activity type. Activity Days power streaks, goals, and calendar-style progress.
This endpoint is for crediting what the user read, not for saving the latest resume location. Use POST /v1/reading-sessions separately to store the latest visible Surah/Ayah for "Continue reading" and "Recently read" UX.
For type=QURAN, send:
type: useQURANwhen the activity is Quran reading progress.seconds: active reading time, in seconds, for this sync batch. Quran.com increments this while the reader tab is focused and flushes it every few seconds.ranges: inclusive verse ranges read in this sync batch, formatted aschapter:verse-chapter:verse. Quran.com queues visible verse keys and merges nearby keys into ranges before sending.mushafId: the Mushaf layout/font the user is reading with. This lets the backend calculate page-based progress consistently with the client.date: optional activity date inYYYY-MM-DD. If omitted, the server uses today's date in thex-timezonetimezone. If passed, it must be today or a past date.
A robust client implementation can follow this pattern, adapted from Quran.com's reader flow.
- When a verse becomes visible, queue its verse key and debounce a
POST /v1/reading-sessionscall for the latest location. - Track active reading seconds while the browser tab is focused.
- Every few seconds, merge the queued verse keys into ranges and call
POST /v1/activity-dayswithtype,seconds,ranges, andmushafId. - Keep in-flight queue entries recoverable until the activity-days request succeeds. If it fails, requeue them for retry and keep the buffered seconds.
Header Parameters
The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.
Request Body
Possible values: >= 1
Active reading time, in seconds, to credit for this sync batch of ranges.
Possible values: Value must match regular expression ^(\d+:\d+-\d+:\d+(?:,\d+:\d+-\d+:\d+)*)$
Inclusive Ayah ranges read in this sync batch, formatted as chapter:verse-chapter:verse.
Possible values: [1, 2, 3, 4, 5, 6, 7, 11, 19]
The id of the Mushaf being used.
1 = QCFV2
2 = QCFV1
3 = Indopak
4 = UthmaniHafs
5 = KFGQPCHAFS
6 = Indopak15Lines
7 = Indopak16Lines
11 = Tajweeed
19 = QCFTajweedV4
Possible values: Value must match regular expression ^\d{4}-\d{2}-\d{2}$
Optional activity date for the activity day. If omitted, the server uses today in the x-timezone timezone. If passed, it must be today or a past date.
Possible values: [QURAN, LESSON, QURAN_READING_PROGRAM]
The activity category. Use QURAN for Quran reading progress; other values are for lessons and Quran reading programs.
- 200
- 400
- 401
- 403
- 404
- 422
- 429
- 500
- 502
- 503
- 504
Request has been handled successfully.
Schema
{
"success": true,
"data": {}
}
{
"success": true,
"data": {}
}
The request is missing required parameters or is invalid.
Schema
{
"message": "The request is missing required headers or is invalid",
"type": "invalid_request",
"success": false
}
The request is unauthorized.
Schema
{
"message": "The request requires user authentication",
"type": "unauthorized",
"success": false
}
Forbidden error. Can either be due to access token not being passed, having been expired or the caller trying to access a resource without enough permissions.
Schema
{
"message": "The server understood the request, but refuses to authorize it",
"type": "forbidden",
"success": false
}
Not Found. The resource being accessed does not exist.
Schema
{
"message": "The requested resource could not be found",
"type": "not_found",
"success": false
}
Validation Error. The request includes one or more invalid params. Please check the request params and try again.
Schema
{
"message": "The request was well-formed but was unable to be followed due to semantic errors",
"type": "unprocessable_entity",
"success": false
}
Too many requests, please try again later.
Schema
{
"message": "Too many requests, please try again later",
"type": "rate_limit_exceeded",
"success": false
}
Server Error. Something went wrong, try again later.
Schema
{
"message": "The server encountered an internal error and was unable to complete your request",
"type": "internal_server_error",
"success": false
}
Invalid response from the upstream server
Schema
{
"message": "The server was acting as a gateway or proxy and received an invalid response from the upstream server",
"type": "bad_gateway",
"success": false
}
The server is currently unable to handle the request due to a temporary overload or scheduled maintenance
Schema
{
"message": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance",
"type": "service_unavailable",
"success": false
}
The server did not receive a timely response from the upstream server.
Schema
{
"message": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server",
"type": "gateway_timeout",
"success": false
}