diff --git a/docs/content_apis_versioned/4.0.0/posts-controller-feed.api.mdx b/docs/content_apis_versioned/4.0.0/posts-controller-feed.api.mdx index 974bb08c..ce94dc18 100644 --- a/docs/content_apis_versioned/4.0.0/posts-controller-feed.api.mdx +++ b/docs/content_apis_versioned/4.0.0/posts-controller-feed.api.mdx @@ -36,4 +36,3 @@ Quran Reflect lessons and reflections feed retrieved successfully with paginatio Most recent visible comment summary when available. Use the dedicated comment endpoints to retrieve full comment objects.
author object required
avatarUrls object required
room object nullable
mentions object[]
  • Array [
  • avatarUrls object required
  • ]
  • ]
  • - \ No newline at end of file diff --git a/docs/content_apis_versioned/4.0.0/posts-controller-find-one.api.mdx b/docs/content_apis_versioned/4.0.0/posts-controller-find-one.api.mdx index 9898e57d..f5ecd8c5 100644 --- a/docs/content_apis_versioned/4.0.0/posts-controller-find-one.api.mdx +++ b/docs/content_apis_versioned/4.0.0/posts-controller-find-one.api.mdx @@ -40,4 +40,3 @@ Most recent visible comment summary when available. Use the dedicated comment en Quran Reflect lesson or reflection not found or has been deleted
    - \ No newline at end of file diff --git a/docs/content_apis_versioned/4.0.0/posts-controller-get-all-comment.api.mdx b/docs/content_apis_versioned/4.0.0/posts-controller-get-all-comment.api.mdx index 7f9c46c2..7d8d75fb 100644 --- a/docs/content_apis_versioned/4.0.0/posts-controller-get-all-comment.api.mdx +++ b/docs/content_apis_versioned/4.0.0/posts-controller-get-all-comment.api.mdx @@ -36,4 +36,3 @@ All comments for the Quran Reflect lesson or reflection returned with total coun Quran Reflect lesson or reflection not found
    - \ No newline at end of file diff --git a/docs/content_apis_versioned/4.0.0/posts-controller-get-comments.api.mdx b/docs/content_apis_versioned/4.0.0/posts-controller-get-comments.api.mdx index 0b8efe2d..a5c3c8d1 100644 --- a/docs/content_apis_versioned/4.0.0/posts-controller-get-comments.api.mdx +++ b/docs/content_apis_versioned/4.0.0/posts-controller-get-comments.api.mdx @@ -36,4 +36,3 @@ Comments for the Quran Reflect lesson or reflection retrieved with pagination me Quran Reflect lesson or reflection not found
    - \ No newline at end of file diff --git a/docs/content_apis_versioned/4.0.0/posts-controller-get-user-post.api.mdx b/docs/content_apis_versioned/4.0.0/posts-controller-get-user-post.api.mdx index 5714d2e9..605eb06f 100644 --- a/docs/content_apis_versioned/4.0.0/posts-controller-get-user-post.api.mdx +++ b/docs/content_apis_versioned/4.0.0/posts-controller-get-user-post.api.mdx @@ -36,4 +36,3 @@ User Quran Reflect lessons and reflections retrieved with pagination metadata Most recent visible comment summary when available. Use the dedicated comment endpoints to retrieve full comment objects.
    author object required
    avatarUrls object required
    room object nullable
    mentions object[]
  • Array [
  • avatarUrls object required
  • ]
  • ]
  • - \ No newline at end of file diff --git a/docs/content_apis_versioned/posts-controller-feed.api.mdx b/docs/content_apis_versioned/posts-controller-feed.api.mdx index 76f9fff2..b45b43b2 100644 --- a/docs/content_apis_versioned/posts-controller-feed.api.mdx +++ b/docs/content_apis_versioned/posts-controller-feed.api.mdx @@ -36,4 +36,3 @@ Quran Reflect lessons and reflections feed retrieved successfully with paginatio Most recent visible comment summary when available. Use the dedicated comment endpoints to retrieve full comment objects.
    author object required
    avatarUrls object required
    room object nullable
    mentions object[]
  • Array [
  • avatarUrls object required
  • ]
  • ]
  • - \ No newline at end of file diff --git a/docs/content_apis_versioned/posts-controller-find-one.api.mdx b/docs/content_apis_versioned/posts-controller-find-one.api.mdx index d017b6a6..3d87935a 100644 --- a/docs/content_apis_versioned/posts-controller-find-one.api.mdx +++ b/docs/content_apis_versioned/posts-controller-find-one.api.mdx @@ -40,4 +40,3 @@ Most recent visible comment summary when available. Use the dedicated comment en Quran Reflect lesson or reflection not found or has been deleted
    - \ No newline at end of file diff --git a/docs/content_apis_versioned/posts-controller-get-all-comment.api.mdx b/docs/content_apis_versioned/posts-controller-get-all-comment.api.mdx index a5153725..c8a60a7f 100644 --- a/docs/content_apis_versioned/posts-controller-get-all-comment.api.mdx +++ b/docs/content_apis_versioned/posts-controller-get-all-comment.api.mdx @@ -36,4 +36,3 @@ All comments for the Quran Reflect lesson or reflection returned with total coun Quran Reflect lesson or reflection not found
    - \ No newline at end of file diff --git a/docs/content_apis_versioned/posts-controller-get-comments.api.mdx b/docs/content_apis_versioned/posts-controller-get-comments.api.mdx index c66ba869..0cb7e942 100644 --- a/docs/content_apis_versioned/posts-controller-get-comments.api.mdx +++ b/docs/content_apis_versioned/posts-controller-get-comments.api.mdx @@ -36,4 +36,3 @@ Comments for the Quran Reflect lesson or reflection retrieved with pagination me Quran Reflect lesson or reflection not found
    - \ No newline at end of file diff --git a/docs/content_apis_versioned/posts-controller-get-user-post.api.mdx b/docs/content_apis_versioned/posts-controller-get-user-post.api.mdx index 745a8027..1ed6279f 100644 --- a/docs/content_apis_versioned/posts-controller-get-user-post.api.mdx +++ b/docs/content_apis_versioned/posts-controller-get-user-post.api.mdx @@ -36,4 +36,3 @@ User Quran Reflect lessons and reflections retrieved with pagination metadata Most recent visible comment summary when available. Use the dedicated comment endpoints to retrieve full comment objects.
    author object required
    avatarUrls object required
    room object nullable
    mentions object[]
  • Array [
  • avatarUrls object required
  • ]
  • ]
  • - \ No newline at end of file diff --git a/docs/tutorials/oidc/example-integration.mdx b/docs/tutorials/oidc/example-integration.mdx index 9670ae1f..8195fe1c 100644 --- a/docs/tutorials/oidc/example-integration.mdx +++ b/docs/tutorials/oidc/example-integration.mdx @@ -235,6 +235,7 @@ fly deploy ## Next Steps -- **[Full OAuth2 Guide](/docs/tutorials/oidc/getting-started-with-oauth2)** — Detailed walkthrough with AI prompts -- **[Mobile Apps](/docs/tutorials/oidc/mobile-apps)** — iOS, Android, React Native guides -- **[User APIs Reference](/docs/category/user-related-apis)** — All available endpoints +- **[Full OAuth2 Guide](/docs/tutorials/oidc/getting-started-with-oauth2)** - Detailed walkthrough with AI prompts +- **[SDK](/docs/sdk)** - Client SDK for mobile and web apps +- **[Mobile Apps](/docs/tutorials/oidc/mobile-apps)** - iOS, Android, React Native guides +- **[User APIs Reference](/docs/category/user-related-apis)** - All available endpoints diff --git a/docs/tutorials/sync/getting-started.mdx b/docs/tutorials/sync/getting-started.mdx index 79bee5a6..614078c5 100644 --- a/docs/tutorials/sync/getting-started.mdx +++ b/docs/tutorials/sync/getting-started.mdx @@ -124,8 +124,9 @@ When the user creates data offline, push mutations to the server using `POST /v1 ### API References -- [GET /v1/sync (Get mutations)](/docs/user_related_apis_prelive/auth-get-v-1-sync) -- [POST /v1/sync (Sync local mutations)](/docs/user_related_apis_prelive/auth-post-v-1-sync) +- [GET /v1/sync (Get mutations)](/docs/user_related_apis_versioned/get-mutations) +- [POST /v1/sync (Sync local mutations)](/docs/user_related_apis_versioned/sync-local-mutations) +- [POST /v1/bookmarks (Add bookmark)](/docs/user_related_apis_versioned/auth-post-v-1-bookmarks) — for bookmark field requirements ## Using metadataOnly for Efficiency @@ -139,7 +140,7 @@ This is significantly faster than a full sync (single DB query vs multiple joins For the full request/response schema, see: -- [GET /v1/sync (Get mutations)](/docs/user_related_apis_prelive/auth-get-v-1-sync) +- [GET /v1/sync (Get mutations)](/docs/user_related_apis_versioned/get-mutations) ## Filtering & Pagination @@ -154,6 +155,7 @@ When `metadataOnly=true`, the response includes only `lastMutationAt` (no pagina ## Important Notes - **Mutation limits** — `POST /v1/sync` accepts a maximum of 100 mutations per request. +- **Direct endpoints** — Direct mutation endpoints (e.g. `POST /v1/bookmarks`) require `lastMutationAt` as a query param and return the `X-Mutation-At` header for updating `lastMutationAt`. ## Next Steps diff --git a/docs/tutorials/sync/handling-conflicts.mdx b/docs/tutorials/sync/handling-conflicts.mdx index 558345e4..dba477da 100644 --- a/docs/tutorials/sync/handling-conflicts.mdx +++ b/docs/tutorials/sync/handling-conflicts.mdx @@ -117,7 +117,19 @@ This quickly retrieves the current `lastMutationAt` without fetching all mutatio See the full request/response schema in the API reference: -- [GET /v1/sync (Get mutations)](/docs/user_related_apis_prelive/auth-get-v-1-sync) +- [GET /v1/sync (Get mutations)](/docs/user_related_apis_versioned/get-mutations) + +## Direct Mutation Endpoints + +When using direct mutation endpoints (e.g., `POST /v1/bookmarks`), the same conflict rules apply: + +1. Include `lastMutationAt` as a query parameter +2. Check for 409 responses +3. Update `lastMutationAt` from the `X-Mutation-At` response header + +:::tip Always Capture the Header +Store the `X-Mutation-At` header value after every successful mutation. If you miss it, use `metadataOnly=true` to recover. +::: ## Best Practices diff --git a/docs/tutorials/sync/offline-first-patterns.mdx b/docs/tutorials/sync/offline-first-patterns.mdx index 3ad31d25..505b668a 100644 --- a/docs/tutorials/sync/offline-first-patterns.mdx +++ b/docs/tutorials/sync/offline-first-patterns.mdx @@ -118,7 +118,7 @@ Apply local changes immediately, then enqueue mutations for sync. When the serve ### Handling Sync Results -When the server returns mutation results, update local records with server IDs and timestamps, then dequeue the synced mutations and persist the returned `lastMutationAt`. +When the server returns mutation results, update local records with server IDs and timestamps, then dequeue the synced mutations and persist the new cursor. Use the returned `lastMutationAt` for `/v1/sync` responses, and read `X-Mutation-At` from direct mutation endpoints such as `POST /v1/bookmarks`. ## Error Handling & Retry diff --git a/docs/user-related-apis/1.0.0/reading-sessions-vs-activity-days.mdx b/docs/user-related-apis/1.0.0/reading-sessions-vs-activity-days.mdx index cf060c66..1c857f53 100644 --- a/docs/user-related-apis/1.0.0/reading-sessions-vs-activity-days.mdx +++ b/docs/user-related-apis/1.0.0/reading-sessions-vs-activity-days.mdx @@ -33,4 +33,3 @@ Tracks daily activity/progress (by date + type). This powers streaks, goals, and - [Add/update activity day](/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-activity-days) - [Get activity days](/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-activity-days) - [Estimate reading time](/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-activity-days-estimate-reading-time) - diff --git a/docs/user-related-apis/reading-sessions-vs-activity-days.mdx b/docs/user-related-apis/reading-sessions-vs-activity-days.mdx index f0a43af5..b6b567ef 100644 --- a/docs/user-related-apis/reading-sessions-vs-activity-days.mdx +++ b/docs/user-related-apis/reading-sessions-vs-activity-days.mdx @@ -33,4 +33,3 @@ Tracks daily activity/progress (by date + type). This powers streaks, goals, and - [Add/update activity day](/docs/user_related_apis_versioned/auth-post-v-1-activity-days) - [Get activity days](/docs/user_related_apis_versioned/auth-get-v-1-activity-days) - [Estimate reading time](/docs/user_related_apis_versioned/auth-get-v-1-activity-days-estimate-reading-time) - diff --git a/docs/user_related_apis_prelive/add-collection-bookmark.api.mdx b/docs/user_related_apis_prelive/add-collection-bookmark.api.mdx index 20aef6b7..2f2228df 100644 --- a/docs/user_related_apis_prelive/add-collection-bookmark.api.mdx +++ b/docs/user_related_apis_prelive/add-collection-bookmark.api.mdx @@ -75,4 +75,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/add-collection.api.mdx b/docs/user_related_apis_prelive/add-collection.api.mdx index eb921a5d..ceb6c3e4 100644 --- a/docs/user_related_apis_prelive/add-collection.api.mdx +++ b/docs/user_related_apis_prelive/add-collection.api.mdx @@ -75,4 +75,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/add-note.api.mdx b/docs/user_related_apis_prelive/add-note.api.mdx index ec617795..d3fece09 100644 --- a/docs/user_related_apis_prelive/add-note.api.mdx +++ b/docs/user_related_apis_prelive/add-note.api.mdx @@ -87,4 +87,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/add-user-bookmark.api.mdx b/docs/user_related_apis_prelive/add-user-bookmark.api.mdx index 23fdd700..6e03ddc6 100644 --- a/docs/user_related_apis_prelive/add-user-bookmark.api.mdx +++ b/docs/user_related_apis_prelive/add-user-bookmark.api.mdx @@ -75,4 +75,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/comments-controller-create.api.mdx b/docs/user_related_apis_prelive/comments-controller-create.api.mdx index e944f102..e1901547 100644 --- a/docs/user_related_apis_prelive/comments-controller-create.api.mdx +++ b/docs/user_related_apis_prelive/comments-controller-create.api.mdx @@ -51,4 +51,3 @@ User not authenticated Post or parent comment not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/comments-controller-delete-comment.api.mdx b/docs/user_related_apis_prelive/comments-controller-delete-comment.api.mdx index 29f99029..1731d8e1 100644 --- a/docs/user_related_apis_prelive/comments-controller-delete-comment.api.mdx +++ b/docs/user_related_apis_prelive/comments-controller-delete-comment.api.mdx @@ -43,4 +43,3 @@ User not authorized to delete this comment Comment not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/comments-controller-get.api.mdx b/docs/user_related_apis_prelive/comments-controller-get.api.mdx index 89a897e9..c3c90f00 100644 --- a/docs/user_related_apis_prelive/comments-controller-get.api.mdx +++ b/docs/user_related_apis_prelive/comments-controller-get.api.mdx @@ -35,4 +35,3 @@ Comment replies with pagination Parent comment not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/comments-controller-toggle-like.api.mdx b/docs/user_related_apis_prelive/comments-controller-toggle-like.api.mdx index 9c53b755..e1f60a33 100644 --- a/docs/user_related_apis_prelive/comments-controller-toggle-like.api.mdx +++ b/docs/user_related_apis_prelive/comments-controller-toggle-like.api.mdx @@ -39,4 +39,3 @@ User not authenticated Comment not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/delete-bookmark.api.mdx b/docs/user_related_apis_prelive/delete-bookmark.api.mdx index 265fe31a..ca80e900 100644 --- a/docs/user_related_apis_prelive/delete-bookmark.api.mdx +++ b/docs/user_related_apis_prelive/delete-bookmark.api.mdx @@ -75,4 +75,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/delete-collection-bookmark-by-details.api.mdx b/docs/user_related_apis_prelive/delete-collection-bookmark-by-details.api.mdx index 6d2e56ae..736ae0cc 100644 --- a/docs/user_related_apis_prelive/delete-collection-bookmark-by-details.api.mdx +++ b/docs/user_related_apis_prelive/delete-collection-bookmark-by-details.api.mdx @@ -75,4 +75,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/delete-collection.api.mdx b/docs/user_related_apis_prelive/delete-collection.api.mdx index 58c4ee58..5e66b7a9 100644 --- a/docs/user_related_apis_prelive/delete-collection.api.mdx +++ b/docs/user_related_apis_prelive/delete-collection.api.mdx @@ -75,4 +75,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/delete-note-by-id.api.mdx b/docs/user_related_apis_prelive/delete-note-by-id.api.mdx index 8deea2a4..74278857 100644 --- a/docs/user_related_apis_prelive/delete-note-by-id.api.mdx +++ b/docs/user_related_apis_prelive/delete-note-by-id.api.mdx @@ -75,4 +75,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/get-mutations.api.mdx b/docs/user_related_apis_prelive/get-mutations.api.mdx index 1bf3a39a..929b93b4 100644 --- a/docs/user_related_apis_prelive/get-mutations.api.mdx +++ b/docs/user_related_apis_prelive/get-mutations.api.mdx @@ -91,4 +91,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-create.api.mdx b/docs/user_related_apis_prelive/posts-controller-create.api.mdx index a6a5689c..04004404 100644 --- a/docs/user_related_apis_prelive/posts-controller-create.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-create.api.mdx @@ -43,4 +43,3 @@ Invalid post data - body too short, invalid references, or invalid room post sta User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-delete.api.mdx b/docs/user_related_apis_prelive/posts-controller-delete.api.mdx index d1f5fd65..d51e72d1 100644 --- a/docs/user_related_apis_prelive/posts-controller-delete.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-delete.api.mdx @@ -43,4 +43,3 @@ User not authorized to delete this post Post not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-edit.api.mdx b/docs/user_related_apis_prelive/posts-controller-edit.api.mdx index e43ebb66..9c9a7a1f 100644 --- a/docs/user_related_apis_prelive/posts-controller-edit.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-edit.api.mdx @@ -47,4 +47,3 @@ User not authorized to edit this post Post not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-export-multiple-posts.api.mdx b/docs/user_related_apis_prelive/posts-controller-export-multiple-posts.api.mdx index 2af4661f..a7113a8f 100644 --- a/docs/user_related_apis_prelive/posts-controller-export-multiple-posts.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-export-multiple-posts.api.mdx @@ -51,4 +51,3 @@ User not authenticated No accessible posts found for the given IDs
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-feed.api.mdx b/docs/user_related_apis_prelive/posts-controller-feed.api.mdx index 76a2ecee..8c9fa7dd 100644 --- a/docs/user_related_apis_prelive/posts-controller-feed.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-feed.api.mdx @@ -31,4 +31,3 @@ Retrieve a paginated feed of posts (reflections). Supports filtering by authors, Feed retrieved successfully with paginated posts
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-find-one.api.mdx b/docs/user_related_apis_prelive/posts-controller-find-one.api.mdx index 1fb3b306..ae8bd6bc 100644 --- a/docs/user_related_apis_prelive/posts-controller-find-one.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-find-one.api.mdx @@ -35,4 +35,3 @@ Post found and returned with all associated data Post not found or has been deleted
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-get-all-comment.api.mdx b/docs/user_related_apis_prelive/posts-controller-get-all-comment.api.mdx index 304964ad..eb2685b7 100644 --- a/docs/user_related_apis_prelive/posts-controller-get-all-comment.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-get-all-comment.api.mdx @@ -35,4 +35,3 @@ All comments returned with total count Post not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-get-comments.api.mdx b/docs/user_related_apis_prelive/posts-controller-get-comments.api.mdx index 1b4996a2..be0721db 100644 --- a/docs/user_related_apis_prelive/posts-controller-get-comments.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-get-comments.api.mdx @@ -35,4 +35,3 @@ Comments retrieved with pagination metadata Post not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-get-loggedin-user-posts.api.mdx b/docs/user_related_apis_prelive/posts-controller-get-loggedin-user-posts.api.mdx index 1ca27226..ed71c085 100644 --- a/docs/user_related_apis_prelive/posts-controller-get-loggedin-user-posts.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-get-loggedin-user-posts.api.mdx @@ -35,4 +35,3 @@ User posts retrieved successfully with pagination metadata User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-get-my-posts-by-verse.api.mdx b/docs/user_related_apis_prelive/posts-controller-get-my-posts-by-verse.api.mdx index b235a6e7..82d5fb4a 100644 --- a/docs/user_related_apis_prelive/posts-controller-get-my-posts-by-verse.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-get-my-posts-by-verse.api.mdx @@ -39,4 +39,3 @@ Invalid verse key format User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-get-my-posts-count-within-range.api.mdx b/docs/user_related_apis_prelive/posts-controller-get-my-posts-count-within-range.api.mdx index ece5123f..9e937991 100644 --- a/docs/user_related_apis_prelive/posts-controller-get-my-posts-count-within-range.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-get-my-posts-count-within-range.api.mdx @@ -39,4 +39,3 @@ Invalid verse range - malformed keys or from > to User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-get-user-post.api.mdx b/docs/user_related_apis_prelive/posts-controller-get-user-post.api.mdx index 6fd24145..138f0320 100644 --- a/docs/user_related_apis_prelive/posts-controller-get-user-post.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-get-user-post.api.mdx @@ -31,4 +31,3 @@ Retrieve public posts created by a specific user. If viewing own posts while aut User posts retrieved with pagination metadata
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-report-abuse.api.mdx b/docs/user_related_apis_prelive/posts-controller-report-abuse.api.mdx index c3c448fb..e1134836 100644 --- a/docs/user_related_apis_prelive/posts-controller-report-abuse.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-report-abuse.api.mdx @@ -39,4 +39,3 @@ Report submitted successfully for moderation review User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-toggle-like.api.mdx b/docs/user_related_apis_prelive/posts-controller-toggle-like.api.mdx index d0c506db..b32878f6 100644 --- a/docs/user_related_apis_prelive/posts-controller-toggle-like.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-toggle-like.api.mdx @@ -39,4 +39,3 @@ User not authenticated Post not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-toggle-save.api.mdx b/docs/user_related_apis_prelive/posts-controller-toggle-save.api.mdx index fb0d30c2..e309e1ed 100644 --- a/docs/user_related_apis_prelive/posts-controller-toggle-save.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-toggle-save.api.mdx @@ -39,4 +39,3 @@ User not authenticated Post not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/posts-controller-view-tracking.api.mdx b/docs/user_related_apis_prelive/posts-controller-view-tracking.api.mdx index 473d7d55..2d7c5848 100644 --- a/docs/user_related_apis_prelive/posts-controller-view-tracking.api.mdx +++ b/docs/user_related_apis_prelive/posts-controller-view-tracking.api.mdx @@ -31,4 +31,3 @@ Record that a post has been viewed by the current user (if authenticated). Used View tracked successfully
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/publish-note.api.mdx b/docs/user_related_apis_prelive/publish-note.api.mdx index 5fbe61c4..5200c27d 100644 --- a/docs/user_related_apis_prelive/publish-note.api.mdx +++ b/docs/user_related_apis_prelive/publish-note.api.mdx @@ -79,4 +79,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-accept-by-private-token.api.mdx b/docs/user_related_apis_prelive/rooms-controller-accept-by-private-token.api.mdx index f33f2a0e..57ede262 100644 --- a/docs/user_related_apis_prelive/rooms-controller-accept-by-private-token.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-accept-by-private-token.api.mdx @@ -39,4 +39,3 @@ Invalid or expired token User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-accept-invite.api.mdx b/docs/user_related_apis_prelive/rooms-controller-accept-invite.api.mdx index b6f915d6..f528f42a 100644 --- a/docs/user_related_apis_prelive/rooms-controller-accept-invite.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-accept-invite.api.mdx @@ -39,4 +39,3 @@ Invalid or expired token User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-admins-access.api.mdx b/docs/user_related_apis_prelive/rooms-controller-admins-access.api.mdx index 6e456260..50c7b14b 100644 --- a/docs/user_related_apis_prelive/rooms-controller-admins-access.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-admins-access.api.mdx @@ -43,4 +43,3 @@ User not authenticated User not authorized to modify admin access
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-create-new-group.api.mdx b/docs/user_related_apis_prelive/rooms-controller-create-new-group.api.mdx index 541068df..c123156e 100644 --- a/docs/user_related_apis_prelive/rooms-controller-create-new-group.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-create-new-group.api.mdx @@ -43,4 +43,3 @@ Invalid group data or URL already taken User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-create-new-page.api.mdx b/docs/user_related_apis_prelive/rooms-controller-create-new-page.api.mdx index 9bbd99d7..a423639a 100644 --- a/docs/user_related_apis_prelive/rooms-controller-create-new-page.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-create-new-page.api.mdx @@ -43,4 +43,3 @@ Invalid page data or URL already taken User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-follow-page.api.mdx b/docs/user_related_apis_prelive/rooms-controller-follow-page.api.mdx index 5b5a7876..fcf6ae72 100644 --- a/docs/user_related_apis_prelive/rooms-controller-follow-page.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-follow-page.api.mdx @@ -35,4 +35,3 @@ Successfully followed the page User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-get-room-members.api.mdx b/docs/user_related_apis_prelive/rooms-controller-get-room-members.api.mdx index f9d3916c..7c007742 100644 --- a/docs/user_related_apis_prelive/rooms-controller-get-room-members.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-get-room-members.api.mdx @@ -35,4 +35,3 @@ Room members retrieved with pagination Room not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-get-room-posts.api.mdx b/docs/user_related_apis_prelive/rooms-controller-get-room-posts.api.mdx index 044f4cdd..60239565 100644 --- a/docs/user_related_apis_prelive/rooms-controller-get-room-posts.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-get-room-posts.api.mdx @@ -35,4 +35,3 @@ Room posts with pagination Room not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-get-room-profile-by-id.api.mdx b/docs/user_related_apis_prelive/rooms-controller-get-room-profile-by-id.api.mdx index 105a1e99..c597e7dd 100644 --- a/docs/user_related_apis_prelive/rooms-controller-get-room-profile-by-id.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-get-room-profile-by-id.api.mdx @@ -35,4 +35,3 @@ Room profile retrieved successfully Room not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-get-room-profile.api.mdx b/docs/user_related_apis_prelive/rooms-controller-get-room-profile.api.mdx index 8ca5e6e4..88205fdf 100644 --- a/docs/user_related_apis_prelive/rooms-controller-get-room-profile.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-get-room-profile.api.mdx @@ -35,4 +35,3 @@ Room profile with details and membership info Room not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-get-rooms.api.mdx b/docs/user_related_apis_prelive/rooms-controller-get-rooms.api.mdx index 3bbc13ec..5e07df09 100644 --- a/docs/user_related_apis_prelive/rooms-controller-get-rooms.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-get-rooms.api.mdx @@ -35,4 +35,3 @@ Rooms retrieved with pagination User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-invite-user-to-room.api.mdx b/docs/user_related_apis_prelive/rooms-controller-invite-user-to-room.api.mdx index 62155243..acb3c976 100644 --- a/docs/user_related_apis_prelive/rooms-controller-invite-user-to-room.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-invite-user-to-room.api.mdx @@ -43,4 +43,3 @@ User not authenticated User not authorized to invite members
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-join-room.api.mdx b/docs/user_related_apis_prelive/rooms-controller-join-room.api.mdx index e788026b..3e739e7b 100644 --- a/docs/user_related_apis_prelive/rooms-controller-join-room.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-join-room.api.mdx @@ -39,4 +39,3 @@ User not authenticated Group is private - invitation required
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-leave-group.api.mdx b/docs/user_related_apis_prelive/rooms-controller-leave-group.api.mdx index 195246cb..59ba332f 100644 --- a/docs/user_related_apis_prelive/rooms-controller-leave-group.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-leave-group.api.mdx @@ -39,4 +39,3 @@ User not authenticated Owner cannot leave - transfer ownership first
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-reject-invite.api.mdx b/docs/user_related_apis_prelive/rooms-controller-reject-invite.api.mdx index a657dcd1..6f08a2c6 100644 --- a/docs/user_related_apis_prelive/rooms-controller-reject-invite.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-reject-invite.api.mdx @@ -39,4 +39,3 @@ Invalid or expired token User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-remove-member.api.mdx b/docs/user_related_apis_prelive/rooms-controller-remove-member.api.mdx index 119c86c6..a95f1b32 100644 --- a/docs/user_related_apis_prelive/rooms-controller-remove-member.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-remove-member.api.mdx @@ -39,4 +39,3 @@ User not authenticated User not authorized to remove this member
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-search-rooms.api.mdx b/docs/user_related_apis_prelive/rooms-controller-search-rooms.api.mdx index 9bb27959..fa55962e 100644 --- a/docs/user_related_apis_prelive/rooms-controller-search-rooms.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-search-rooms.api.mdx @@ -31,4 +31,3 @@ Search for public groups and pages by name or description. Results can be filter Matching rooms with pagination
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-unfollow-page.api.mdx b/docs/user_related_apis_prelive/rooms-controller-unfollow-page.api.mdx index 2631fed2..d10ad1e5 100644 --- a/docs/user_related_apis_prelive/rooms-controller-unfollow-page.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-unfollow-page.api.mdx @@ -35,4 +35,3 @@ Successfully unfollowed the page User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-update-group.api.mdx b/docs/user_related_apis_prelive/rooms-controller-update-group.api.mdx index 90e7251e..46153339 100644 --- a/docs/user_related_apis_prelive/rooms-controller-update-group.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-update-group.api.mdx @@ -43,4 +43,3 @@ User not authenticated User not authorized to update this group
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-update-page.api.mdx b/docs/user_related_apis_prelive/rooms-controller-update-page.api.mdx index 6e5c88d5..0983b8e8 100644 --- a/docs/user_related_apis_prelive/rooms-controller-update-page.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-update-page.api.mdx @@ -43,4 +43,3 @@ User not authenticated User not authorized to update this page
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/rooms-controller-update-post-privacy.api.mdx b/docs/user_related_apis_prelive/rooms-controller-update-post-privacy.api.mdx index d08522f8..88152f98 100644 --- a/docs/user_related_apis_prelive/rooms-controller-update-post-privacy.api.mdx +++ b/docs/user_related_apis_prelive/rooms-controller-update-post-privacy.api.mdx @@ -47,4 +47,3 @@ User not authorized to modify post privacy Room or post not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/sync-local-mutations.api.mdx b/docs/user_related_apis_prelive/sync-local-mutations.api.mdx index bb3f099f..0c415b7f 100644 --- a/docs/user_related_apis_prelive/sync-local-mutations.api.mdx +++ b/docs/user_related_apis_prelive/sync-local-mutations.api.mdx @@ -95,4 +95,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/tags-controller-find.api.mdx b/docs/user_related_apis_prelive/tags-controller-find.api.mdx index 987d5ab5..9b3d91c0 100644 --- a/docs/user_related_apis_prelive/tags-controller-find.api.mdx +++ b/docs/user_related_apis_prelive/tags-controller-find.api.mdx @@ -31,4 +31,3 @@ Search for tags by query string. Returns paginated results matching the search t Tags matching search query with pagination
    Schema
    • Array [
    • ]
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/update-collection.api.mdx b/docs/user_related_apis_prelive/update-collection.api.mdx index c2e5d720..e0614097 100644 --- a/docs/user_related_apis_prelive/update-collection.api.mdx +++ b/docs/user_related_apis_prelive/update-collection.api.mdx @@ -75,4 +75,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/update-note-by-id.api.mdx b/docs/user_related_apis_prelive/update-note-by-id.api.mdx index d7c5fd0a..d8c59a35 100644 --- a/docs/user_related_apis_prelive/update-note-by-id.api.mdx +++ b/docs/user_related_apis_prelive/update-note-by-id.api.mdx @@ -83,4 +83,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/user-related-apis.info.mdx b/docs/user_related_apis_prelive/user-related-apis.info.mdx index cbd6d888..48222657 100644 --- a/docs/user_related_apis_prelive/user-related-apis.info.mdx +++ b/docs/user_related_apis_prelive/user-related-apis.info.mdx @@ -21,19 +21,19 @@ import Export from "@theme/ApiDemoPanel/Export"; Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses. - ## How to get access + ## How to get access - We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). + We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). - ## Pagination + ## Pagination - We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. + We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. - Example - - `first: 10` will give you first 10 items - - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` - - `last: 10` will give you the last 10 items - - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` + Example + - `first: 10` will give you first 10 items + - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` + - `last: 10` will give you the last 10 items + - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` The only possible combinations are `first + after` or `last + before`. They should not be used together @@ -46,4 +46,3 @@ The JWT access token required for accessing the endpoints. Your client id
    Security Scheme Type:apiKey
    Header parameter name:x-client-id
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/users-controller-delete-account.api.mdx b/docs/user_related_apis_prelive/users-controller-delete-account.api.mdx index 4cfdc888..78d3aee9 100644 --- a/docs/user_related_apis_prelive/users-controller-delete-account.api.mdx +++ b/docs/user_related_apis_prelive/users-controller-delete-account.api.mdx @@ -35,4 +35,3 @@ Account deletion initiated successfully User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/users-controller-edit-profile.api.mdx b/docs/user_related_apis_prelive/users-controller-edit-profile.api.mdx index 564dd097..a8447b8f 100644 --- a/docs/user_related_apis_prelive/users-controller-edit-profile.api.mdx +++ b/docs/user_related_apis_prelive/users-controller-edit-profile.api.mdx @@ -43,4 +43,3 @@ Invalid settings data User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/users-controller-get-user-followers.api.mdx b/docs/user_related_apis_prelive/users-controller-get-user-followers.api.mdx index 9eb1cb54..3b332221 100644 --- a/docs/user_related_apis_prelive/users-controller-get-user-followers.api.mdx +++ b/docs/user_related_apis_prelive/users-controller-get-user-followers.api.mdx @@ -35,4 +35,3 @@ List of followers with pagination User not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/users-controller-get-user-following.api.mdx b/docs/user_related_apis_prelive/users-controller-get-user-following.api.mdx index 09c53a31..334a7e62 100644 --- a/docs/user_related_apis_prelive/users-controller-get-user-following.api.mdx +++ b/docs/user_related_apis_prelive/users-controller-get-user-following.api.mdx @@ -35,4 +35,3 @@ List of followed users with pagination User not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/users-controller-get-user-profile.api.mdx b/docs/user_related_apis_prelive/users-controller-get-user-profile.api.mdx index 6c6a1fd1..644fde79 100644 --- a/docs/user_related_apis_prelive/users-controller-get-user-profile.api.mdx +++ b/docs/user_related_apis_prelive/users-controller-get-user-profile.api.mdx @@ -35,4 +35,3 @@ Own profile with full data including settings User not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/users-controller-profile.api.mdx b/docs/user_related_apis_prelive/users-controller-profile.api.mdx index 70622335..56ef1047 100644 --- a/docs/user_related_apis_prelive/users-controller-profile.api.mdx +++ b/docs/user_related_apis_prelive/users-controller-profile.api.mdx @@ -35,4 +35,3 @@ Full user profile with all data User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/users-controller-remove-follower.api.mdx b/docs/user_related_apis_prelive/users-controller-remove-follower.api.mdx index e4758ec3..58c9ec56 100644 --- a/docs/user_related_apis_prelive/users-controller-remove-follower.api.mdx +++ b/docs/user_related_apis_prelive/users-controller-remove-follower.api.mdx @@ -39,4 +39,3 @@ User not authenticated Follower relationship not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/users-controller-rooms.api.mdx b/docs/user_related_apis_prelive/users-controller-rooms.api.mdx index 2fa33604..aea01a50 100644 --- a/docs/user_related_apis_prelive/users-controller-rooms.api.mdx +++ b/docs/user_related_apis_prelive/users-controller-rooms.api.mdx @@ -35,4 +35,3 @@ User rooms with pagination metadata User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/users-controller-search.api.mdx b/docs/user_related_apis_prelive/users-controller-search.api.mdx index 6b8bd530..c6ee05d0 100644 --- a/docs/user_related_apis_prelive/users-controller-search.api.mdx +++ b/docs/user_related_apis_prelive/users-controller-search.api.mdx @@ -31,4 +31,3 @@ Search users by name or username. Supports mentioning in posts, finding users fo Matching users with pagination
    Schema
      data object[] required
    • Array [
    • settings object required
    • ]
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/users-controller-toggle-follow.api.mdx b/docs/user_related_apis_prelive/users-controller-toggle-follow.api.mdx index c38e9d31..3372596a 100644 --- a/docs/user_related_apis_prelive/users-controller-toggle-follow.api.mdx +++ b/docs/user_related_apis_prelive/users-controller-toggle-follow.api.mdx @@ -43,4 +43,3 @@ Cannot follow yourself or action already in desired state User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_prelive/users-controller-update-profile.api.mdx b/docs/user_related_apis_prelive/users-controller-update-profile.api.mdx index 75b01138..d132abc9 100644 --- a/docs/user_related_apis_prelive/users-controller-update-profile.api.mdx +++ b/docs/user_related_apis_prelive/users-controller-update-profile.api.mdx @@ -43,4 +43,3 @@ Invalid profile data or username taken User not authenticated
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/add-collection.api.mdx b/docs/user_related_apis_versioned/1.0.0/add-collection.api.mdx deleted file mode 100644 index aeb860c8..00000000 --- a/docs/user_related_apis_versioned/1.0.0/add-collection.api.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: add-collection -title: "Add collection" -description: "Create a new collection under user's account." -sidebar_label: "Add collection" -hide_title: true -hide_table_of_contents: true -api: {"description":"Create a new collection under user's account.","tags":["Collections"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the new collection to be created.","example":"Woman in Quran"}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","example":"cmmav113800077e21b8bfgkgs"},"updatedAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"name":{"type":"string","example":"Woman in Quran"}},"required":["id","updatedAt","name"],"additionalProperties":false,"title":"Collection"}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/collections","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"Woman in Quran"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add collection","description":{"content":"Create a new collection under user's account.","type":"text/plain"},"url":{"path":["v1","collections"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} -sidebar_class_name: "post api-method" -info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsVersionedSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Add collection - - - -Create a new collection under user's account. - -
    Request Body
    - -Request has been handled successfully. - -
    Schema
      data object
    - -The request is missing required parameters or is invalid. - -
    Schema
    - -The request is unauthorized. - -
    Schema
    - -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
    - -Not Found. The resource being accessed does not exist. - -
    Schema
    - -Validation Error. The request includes one or more invalid params. Please check the request params and try again. - -
    Schema
    - -Too many requests, please try again later. - -
    Schema
    - -Server Error. Something went wrong, try again later. - -
    Schema
    - -Invalid response from the upstream server - -
    Schema
    - -The server is currently unable to handle the request due to a temporary overload or scheduled maintenance - -
    Schema
    - -The server did not receive a timely response from the upstream server. - -
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/add-note.api.mdx b/docs/user_related_apis_versioned/1.0.0/add-note.api.mdx deleted file mode 100644 index 6e9cc3c6..00000000 --- a/docs/user_related_apis_versioned/1.0.0/add-note.api.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -id: add-note -title: "Add note" -description: "Add a new note." -sidebar_label: "Add note" -hide_title: true -hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Add a new note.","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"saveToQR":{"type":"boolean","description":"Indicates whether the note should be saved to the QuranReflect.","example":true},"attachedEntity":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["body","saveToQR"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/notes","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"body":"This is a sample note body.","saveToQR":true,"attachedEntity":{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}},"ranges":["2:255-2:257"]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add note","description":{"content":"Add a new note.","type":"text/plain"},"url":{"path":["v1","notes"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} -sidebar_class_name: "post api-method" -info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsVersionedSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Add note - - - -Add a new note. - -
    Request Body
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
      attachedEntity object
      entityMetadata object
      - -Additional metadata for the attached entity. - -
    - -Request has been handled successfully. - -
    Schema
      data object
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
      attachedEntities object[]
      - -An array of attached entities associated with the note. - -
    • Array [
    • entityMetadata object
      - -Additional metadata for the attached entity. - -
    • ]
    - -The request is missing required parameters or is invalid. - -
    Schema
    - -The request is unauthorized. - -
    Schema
    - -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
    - -Not Found. The resource being accessed does not exist. - -
    Schema
    - -Validation Error. The request includes one or more invalid params. Please check the request params and try again. - -
    Schema
    - -Too many requests, please try again later. - -
    Schema
    - -Server Error. Something went wrong, try again later. - -
    Schema
    - -Invalid response from the upstream server - -
    Schema
    - -The server is currently unable to handle the request due to a temporary overload or scheduled maintenance - -
    Schema
    - -The server did not receive a timely response from the upstream server. - -
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/delete-bookmark.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-bookmarks-by-bookmark-id.api.mdx similarity index 51% rename from docs/user_related_apis_versioned/1.0.0/delete-bookmark.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-bookmarks-by-bookmark-id.api.mdx index cb7b2d07..3bc4a447 100644 --- a/docs/user_related_apis_versioned/1.0.0/delete-bookmark.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-bookmarks-by-bookmark-id.api.mdx @@ -1,11 +1,11 @@ --- -id: delete-bookmark +id: auth-delete-v-1-bookmarks-by-bookmark-id title: "Delete Bookmark" -description: "Delete a bookmark by id." +description: "Delete a standalone bookmark by id. This endpoint fully removes orphan bookmarks only. If the bookmark belongs to the virtual Favorites collection or any custom collection, it is not removed; this endpoint only sets `isReading` to `false` and leaves the bookmark attached to those collections. To remove it from Favorites or a custom collection, use the corresponding collection delete endpoint instead." sidebar_label: "Delete Bookmark" hide_title: true hide_table_of_contents: true -api: {"description":"Delete a bookmark by id.","tags":["Bookmarks"],"parameters":[{"in":"path","name":"bookmarkId","schema":{"type":"string","description":"The id of the bookmark to be deleted.","example":"cmmav10zi00067e215f09bzz7"},"required":true,"description":"The id of the bookmark to be deleted."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["bookmark deleted"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"delete","path":"/v1/bookmarks/{bookmarkId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete Bookmark","description":{"content":"Delete a bookmark by id.","type":"text/plain"},"url":{"path":["v1","bookmarks",":bookmarkId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The id of the bookmark to be deleted.","type":"text/plain"},"type":"any","value":"","key":"bookmarkId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +api: {"description":"Delete a standalone bookmark by id. This endpoint fully removes orphan bookmarks only. If the bookmark belongs to the virtual Favorites collection or any custom collection, it is not removed; this endpoint only sets `isReading` to `false` and leaves the bookmark attached to those collections. To remove it from Favorites or a custom collection, use the corresponding collection delete endpoint instead.","tags":["Bookmarks"],"parameters":[{"in":"path","name":"bookmarkId","schema":{"type":"string","description":"The id of the bookmark to be deleted.","example":"cmoa3wqk500077z3f018r4rzn"},"required":true,"description":"The id of the bookmark to be deleted."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["bookmark deleted"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"bookmark deleted"}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1BookmarksByBookmarkId","method":"delete","path":"/v1/bookmarks/{bookmarkId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete Bookmark","description":{"content":"Delete a standalone bookmark by id. This endpoint fully removes orphan bookmarks only. If the bookmark belongs to the virtual Favorites collection or any custom collection, it is not removed; this endpoint only sets `isReading` to `false` and leaves the bookmark attached to those collections. To remove it from Favorites or a custom collection, use the corresponding collection delete endpoint instead.","type":"text/plain"},"url":{"path":["v1","bookmarks",":bookmarkId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The id of the bookmark to be deleted.","type":"text/plain"},"type":"any","value":"","key":"bookmarkId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -25,13 +25,17 @@ import TabItem from "@theme/TabItem"; -Delete a bookmark by id. +Delete a standalone bookmark by id. This endpoint fully removes orphan bookmarks only. If the bookmark belongs to the virtual Favorites collection or any custom collection, it is not removed; this endpoint only sets `isReading` to `false` and leaves the bookmark attached to those collections. To remove it from Favorites or a custom collection, use the corresponding collection delete endpoint instead. -
    Path Parameters
    +
    Path Parameters
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object
    +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -47,7 +51,11 @@ Forbidden error. Can either be due to access token not being passed, having been Not Found. The resource being accessed does not exist. -
    Schema
    +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    Validation Error. The request includes one or more invalid params. Please check the request params and try again. diff --git a/docs/user_related_apis_versioned/1.0.0/delete-collection-bookmark-by-id.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-collections-by-collection-id-bookmarks-by-bookmark-id.api.mdx similarity index 50% rename from docs/user_related_apis_versioned/1.0.0/delete-collection-bookmark-by-id.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-collections-by-collection-id-bookmarks-by-bookmark-id.api.mdx index b82a6817..5da020fd 100644 --- a/docs/user_related_apis_versioned/1.0.0/delete-collection-bookmark-by-id.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-collections-by-collection-id-bookmarks-by-bookmark-id.api.mdx @@ -1,11 +1,11 @@ --- -id: delete-collection-bookmark-by-id +id: auth-delete-v-1-collections-by-collection-id-bookmarks-by-bookmark-id title: "Delete collection bookmark by id" -description: "Delete a bookmark from an existing collection by bookmark's id. When successfully deleted, the bookmark itself does not get deleted but rather only detached from the collection." +description: "Delete a bookmark from a collection by bookmark ID. Use `collectionId='__default__'` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan." sidebar_label: "Delete collection bookmark by id" hide_title: true hide_table_of_contents: true -api: {"description":"Delete a bookmark from an existing collection by bookmark's id. When successfully deleted, the bookmark itself does not get deleted but rather only detached from the collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be deleted.","example":"cmmav11b5000a7e212dpa1dnn"},"required":true,"description":"The Id of the collection to be deleted."},{"in":"path","name":"bookmarkId","schema":{"type":"string","description":"The Id of the bookmark to be deleted.","example":"cmmav11b5000b7e21a1jd79vo"},"required":true,"description":"The Id of the bookmark to be deleted."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection bookmark deleted"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"delete","path":"/v1/collections/{collectionId}/bookmarks/{bookmarkId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete collection bookmark by id","description":{"content":"Delete a bookmark from an existing collection by bookmark's id. When successfully deleted, the bookmark itself does not get deleted but rather only detached from the collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId","bookmarks",":bookmarkId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The Id of the collection to be deleted.","type":"text/plain"},"type":"any","value":"","key":"collectionId"},{"disabled":false,"description":{"content":"(Required) The Id of the bookmark to be deleted.","type":"text/plain"},"type":"any","value":"","key":"bookmarkId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +api: {"description":"Delete a bookmark from a collection by bookmark ID. Use `collectionId=\"__default__\"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection.","example":"cmoa3wqxe000b7z3f6d6ia4ih"},"required":true,"description":"The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection."},{"in":"path","name":"bookmarkId","schema":{"type":"string","description":"The Id of the bookmark to be deleted.","example":"cmoa3wqxe000c7z3f61siesdm"},"required":true,"description":"The Id of the bookmark to be deleted."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection bookmark deleted"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"collection bookmark deleted"}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1CollectionsByCollectionIdBookmarksByBookmarkId","method":"delete","path":"/v1/collections/{collectionId}/bookmarks/{bookmarkId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete collection bookmark by id","description":{"content":"Delete a bookmark from a collection by bookmark ID. Use `collectionId=\"__default__\"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId","bookmarks",":bookmarkId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection.","type":"text/plain"},"type":"any","value":"","key":"collectionId"},{"disabled":false,"description":{"content":"(Required) The Id of the bookmark to be deleted.","type":"text/plain"},"type":"any","value":"","key":"bookmarkId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -25,13 +25,17 @@ import TabItem from "@theme/TabItem"; -Delete a bookmark from an existing collection by bookmark's id. When successfully deleted, the bookmark itself does not get deleted but rather only detached from the collection. +Delete a bookmark from a collection by bookmark ID. Use `collectionId="__default__"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan. -
    Path Parameters
    +
    Path Parameters
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object
    +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -47,7 +51,11 @@ Forbidden error. Can either be due to access token not being passed, having been Not Found. The resource being accessed does not exist. -
    Schema
    +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    Validation Error. The request includes one or more invalid params. Please check the request params and try again. diff --git a/docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-collections-by-collection-id-bookmarks.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-collections-by-collection-id-bookmarks.api.mdx new file mode 100644 index 00000000..30e404cf --- /dev/null +++ b/docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-collections-by-collection-id-bookmarks.api.mdx @@ -0,0 +1,75 @@ +--- +id: auth-delete-v-1-collections-by-collection-id-bookmarks +title: "Delete collection bookmark by details" +description: "Delete a bookmark from a collection by bookmark details. Use `collectionId='__default__'` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan." +sidebar_label: "Delete collection bookmark by details" +hide_title: true +hide_table_of_contents: true +api: {"description":"Delete a bookmark from a collection by bookmark details. Use `collectionId=\"__default__\"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection.","example":"cmoa3wr2h000f7z3ffr5fc0z1"},"required":true,"description":"The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"}},"additionalProperties":false},"example":{"success":true,"data":{}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["key","verseNumber"],"additionalProperties":false,"title":"Ayah"},{"type":"object","required":["key"],"additionalProperties":false,"title":"Surah, Juz, Or Page"},{"type":"object","required":["bookmarkId"],"additionalProperties":false,"title":"Bookmark ID"}],"title":"input"},"example":{"key":2,"type":"ayah","verseNumber":3,"mushafId":4,"mushaf":4}}}},"operationId":"authDeleteV1CollectionsByCollectionIdBookmarks","method":"delete","path":"/v1/collections/{collectionId}/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"key":2,"type":"ayah","verseNumber":3,"mushafId":4,"mushaf":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete collection bookmark by details","description":{"content":"Delete a bookmark from a collection by bookmark details. Use `collectionId=\"__default__\"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId","bookmarks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"DELETE","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "delete api-method" +info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsVersionedSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Delete collection bookmark by details + + + +Delete a bookmark from a collection by bookmark details. Use `collectionId="__default__"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan. + +
    Path Parameters
    Query Parameters
    Request Body
      oneOf
    + +Request has been handled successfully. + +
    Schema
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    + \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/delete-collection.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-collections-by-collection-id.api.mdx similarity index 54% rename from docs/user_related_apis_versioned/1.0.0/delete-collection.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-collections-by-collection-id.api.mdx index 3ab06221..6f7253f9 100644 --- a/docs/user_related_apis_versioned/1.0.0/delete-collection.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-collections-by-collection-id.api.mdx @@ -1,11 +1,11 @@ --- -id: delete-collection +id: auth-delete-v-1-collections-by-collection-id title: "Delete collection" description: "Delete a an existing collection." sidebar_label: "Delete collection" hide_title: true hide_table_of_contents: true -api: {"description":"Delete a an existing collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be deleted.","example":"cmmav11ac00097e211kmcdj4z"},"required":true,"description":"The Id of the collection to be deleted."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection deleted"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"delete","path":"/v1/collections/{collectionId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete collection","description":{"content":"Delete a an existing collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The Id of the collection to be deleted.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +api: {"description":"Delete a an existing collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be deleted.","example":"cmoa3wqwh000a7z3f0d6y5mte"},"required":true,"description":"The Id of the collection to be deleted."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection deleted"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"collection deleted"}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1CollectionsByCollectionId","method":"delete","path":"/v1/collections/{collectionId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete collection","description":{"content":"Delete a an existing collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The Id of the collection to be deleted.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -27,11 +27,15 @@ import TabItem from "@theme/TabItem"; Delete a an existing collection. -
    Path Parameters
    +
    Path Parameters
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object
    +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -47,7 +51,11 @@ Forbidden error. Can either be due to access token not being passed, having been Not Found. The resource being accessed does not exist. -
    Schema
    +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    Validation Error. The request includes one or more invalid params. Please check the request params and try again. diff --git a/docs/user_related_apis_versioned/1.0.0/delete-a-goal.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-goals-by-id.api.mdx similarity index 71% rename from docs/user_related_apis_versioned/1.0.0/delete-a-goal.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-goals-by-id.api.mdx index 55d4b2d7..ee3e7a99 100644 --- a/docs/user_related_apis_versioned/1.0.0/delete-a-goal.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-goals-by-id.api.mdx @@ -1,11 +1,11 @@ --- -id: delete-a-goal +id: auth-delete-v-1-goals-by-id title: "Delete a goal" description: "Delete a goal by id." sidebar_label: "Delete a goal" hide_title: true hide_table_of_contents: true -api: {"description":"Delete a goal by id.","tags":["Goals"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The id of the goal.","example":"cmmav11g9000d7e219d05gas2"},"required":true,"description":"The id of the goal."},{"in":"query","name":"category","schema":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"},"required":true,"description":"The category of the goal"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["goal deleted"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"delete","path":"/v1/goals/{id}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete a goal","description":{"content":"Delete a goal by id.","type":"text/plain"},"url":{"path":["v1","goals",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The category of the goal","type":"text/plain"},"key":"category","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The id of the goal.","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +api: {"description":"Delete a goal by id.","tags":["Goals"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The id of the goal.","example":"cmoa3wr5c000g7z3fgv0y0rvo"},"required":true,"description":"The id of the goal."},{"in":"query","name":"category","schema":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"},"required":true,"description":"The category of the goal"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["goal deleted"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"goal deleted"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1GoalsById","method":"delete","path":"/v1/goals/{id}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete a goal","description":{"content":"Delete a goal by id.","type":"text/plain"},"url":{"path":["v1","goals",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The category of the goal","type":"text/plain"},"key":"category","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The id of the goal.","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"DELETE"}} sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; Delete a goal by id. -
    Path Parameters
    Query Parameters
    Header Parameters
    +
    Path Parameters
    Query Parameters
    Header Parameters
    Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/add-collection-bookmark.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-notes-by-note-id.api.mdx similarity index 55% rename from docs/user_related_apis_versioned/1.0.0/add-collection-bookmark.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-notes-by-note-id.api.mdx index c00f1621..d5c42900 100644 --- a/docs/user_related_apis_versioned/1.0.0/add-collection-bookmark.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-delete-v-1-notes-by-note-id.api.mdx @@ -1,12 +1,12 @@ --- -id: add-collection-bookmark -title: "Add collection Bookmark" -description: "Add a bookmark to an existing collection." -sidebar_label: "Add collection Bookmark" +id: auth-delete-v-1-notes-by-note-id +title: "Delete note by ID" +description: "Delete a note by its ID." +sidebar_label: "Delete note by ID" hide_title: true hide_table_of_contents: true -api: {"description":"Add a bookmark to an existing collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be added.","example":"cmmav119z00087e21czrofw1s"},"required":true,"description":"The Id of the collection to be added."}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["key","verseNumber","mushaf"],"additionalProperties":false,"title":"Ayah"},{"type":"object","required":["key","mushaf"],"additionalProperties":false,"title":"Surah, Juz, Or Page"}]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection bookmark added"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/collections/{collectionId}/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"key":2,"type":"ayah","verseNumber":3,"mushaf":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add collection Bookmark","description":{"content":"Add a bookmark to an existing collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId","bookmarks"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The Id of the collection to be added.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} -sidebar_class_name: "post api-method" +api: {"tags":["Notes"],"description":"Delete a note by its ID.","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The ID of the note to delete."},"required":true,"description":"The ID of the note to delete."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"success":{"type":"boolean"}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"success":true}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1NotesByNoteId","method":"delete","path":"/v1/notes/{noteId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete note by ID","description":{"content":"Delete a note by its ID.","type":"text/plain"},"url":{"path":["v1","notes",":noteId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The ID of the note to delete.","type":"text/plain"},"type":"any","value":"","key":"noteId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null displayed_sidebar: APIsVersionedSidebar @@ -21,17 +21,21 @@ import SchemaTabs from "@theme/SchemaTabs"; import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import TabItem from "@theme/TabItem"; -## Add collection Bookmark +## Delete note by ID -Add a bookmark to an existing collection. +Delete a note by its ID. -
    Path Parameters
    Request Body
      anyOf
    +
    Path Parameters
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object
    +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -47,7 +51,11 @@ Forbidden error. Can either be due to access token not being passed, having been Not Found. The resource being accessed does not exist. -
    Schema
    +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    Validation Error. The request includes one or more invalid params. Please check the request params and try again. diff --git a/docs/user_related_apis_versioned/1.0.0/estimate-reading-time.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-activity-days-estimate-reading-time.api.mdx similarity index 71% rename from docs/user_related_apis_versioned/1.0.0/estimate-reading-time.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-activity-days-estimate-reading-time.api.mdx index 36d3c889..bd5f65e7 100644 --- a/docs/user_related_apis_versioned/1.0.0/estimate-reading-time.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-activity-days-estimate-reading-time.api.mdx @@ -1,11 +1,11 @@ --- -id: estimate-reading-time +id: auth-get-v-1-activity-days-estimate-reading-time title: "Estimate reading time" description: "Estimate the number of seconds it would take to read a range. We estimate it based on the average reading speed we have collected on quran.com." sidebar_label: "Estimate reading time" hide_title: true hide_table_of_contents: true -api: {"description":"Estimate the number of seconds it would take to read a range. We estimate it based on the average reading speed we have collected on quran.com.","tags":["Activity Days"],"parameters":[{"in":"query","name":"ranges","schema":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"},"required":true,"description":"a comma separated string of Ayah ranges e.g. 1:1-1:2"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"seconds":{"type":"integer","description":"The number of seconds it would take on average to read the range of Ayahs.","example":66.8}},"required":["seconds"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/activity-days/estimate-reading-time","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Estimate reading time","description":{"content":"Estimate the number of seconds it would take to read a range. We estimate it based on the average reading speed we have collected on quran.com.","type":"text/plain"},"url":{"path":["v1","activity-days","estimate-reading-time"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) a comma separated string of Ayah ranges e.g. 1:1-1:2","type":"text/plain"},"key":"ranges","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Estimate the number of seconds it would take to read a range. We estimate it based on the average reading speed we have collected on quran.com.","tags":["Activity Days"],"parameters":[{"in":"query","name":"ranges","schema":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"},"required":true,"description":"a comma separated string of Ayah ranges e.g. 1:1-1:2"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"seconds":{"type":"integer","description":"The number of seconds it would take on average to read the range of Ayahs.","example":66.8}},"required":["seconds"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"seconds":66.8}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1ActivityDaysEstimateReadingTime","method":"get","path":"/v1/activity-days/estimate-reading-time","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Estimate reading time","description":{"content":"Estimate the number of seconds it would take to read a range. We estimate it based on the average reading speed we have collected on quran.com.","type":"text/plain"},"url":{"path":["v1","activity-days","estimate-reading-time"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) a comma separated string of Ayah ranges e.g. 1:1-1:2","type":"text/plain"},"key":"ranges","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Estimate the number of seconds it would take to read a range. We estimate it bas Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-activity-days.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-activity-days.api.mdx similarity index 77% rename from docs/user_related_apis_versioned/1.0.0/get-activity-days.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-activity-days.api.mdx index c9d561f2..f4b2552e 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-activity-days.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-activity-days.api.mdx @@ -1,11 +1,11 @@ --- -id: get-activity-days +id: auth-get-v-1-activity-days title: "Get activity days" description: "Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type." sidebar_label: "Get activity days" hide_title: true hide_table_of_contents: true -api: {"description":"Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type.","tags":["Activity Days"],"parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The start date of the activity days","example":"2023-09-01"},"description":"The start date of the activity days"},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The last date of the activity days","example":"2023-09-31"},"description":"The last date of the activity days"},{"in":"query","name":"dateOrderBy","schema":{"type":"string","enum":["asc","desc"],"description":"Order by activity day's date","example":"desc","default":"desc"},"description":"Order by activity day's date"},{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"description":"The type of the activity day"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The id of the activity day.","example":"cmmav10hr00047e21267o9efb"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day.","example":"2023-09-31"},"progress":{"type":"number","format":"float","minimum":0,"maximum":1,"description":"The progress of the reading goal of that activity day (if the user has a reading goal on that day).","example":0.695},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"ranges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The ranges read on that day (will be included only when the type is QURAN)","example":["1:1-1:2"]},"pagesRead":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages read on that day (will be included only when the type is QURAN)","example":1.637041020126048},"secondsRead":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading on that day (will be included only when the type is QURAN)","example":417},"versesRead":{"oneOf":[{"type":"integer"}],"description":"The number of Ayahs read on that day (will be included only when the type is QURAN)","example":24},"manuallyAddedSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading that was manually input by the user and not auto-tracked (will be included only when the type is QURAN)","example":24},"dailyTargetPages":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":1.637041020126048},"dailyTargetSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":5},"dailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"remainingDailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4}},"required":["id","date","progress","type","mushafId"],"additionalProperties":false,"description":"The Mushaf used to read on that day (will be included only when the type is QURAN) \n\nThe id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/activity-days","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get activity days","description":{"content":"Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type.","type":"text/plain"},"url":{"path":["v1","activity-days"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The start date of the activity days","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"The last date of the activity days","type":"text/plain"},"key":"to","value":""},{"disabled":false,"description":{"content":"Order by activity day's date","type":"text/plain"},"key":"dateOrderBy","value":""},{"disabled":false,"description":{"content":"The type of the activity day","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type.","tags":["Activity Days"],"parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The start date of the activity days","example":"2023-09-01"},"description":"The start date of the activity days"},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The last date of the activity days","example":"2023-09-31"},"description":"The last date of the activity days"},{"in":"query","name":"dateOrderBy","schema":{"type":"string","enum":["asc","desc"],"description":"Order by activity day's date","example":"desc","default":"desc"},"description":"Order by activity day's date"},{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"description":"The type of the activity day"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The id of the activity day.","example":"cmoa3wq2b00047z3fbl4c6ew0"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day.","example":"2023-09-31"},"progress":{"type":"number","format":"float","minimum":0,"maximum":1,"description":"The progress of the reading goal of that activity day (if the user has a reading goal on that day).","example":0.695},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"ranges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The ranges read on that day (will be included only when the type is QURAN)","example":["1:1-1:2"]},"pagesRead":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages read on that day (will be included only when the type is QURAN)","example":1.637041020126048},"secondsRead":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading on that day (will be included only when the type is QURAN)","example":417},"versesRead":{"oneOf":[{"type":"integer"}],"description":"The number of Ayahs read on that day (will be included only when the type is QURAN)","example":24},"manuallyAddedSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading that was manually input by the user and not auto-tracked (will be included only when the type is QURAN)","example":24},"dailyTargetPages":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":1.637041020126048},"dailyTargetSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":5},"dailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"remainingDailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4}},"required":["id","date","progress","type","mushafId"],"additionalProperties":false,"description":"The Mushaf used to read on that day (will be included only when the type is QURAN) \n\nThe id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wq2b00047z3fbl4c6ew0","date":"2023-09-31","progress":0.695,"type":"QURAN","ranges":["1:1-1:2"],"pagesRead":1.637041020126048,"secondsRead":417,"versesRead":24,"manuallyAddedSeconds":24,"dailyTargetPages":1.637041020126048,"dailyTargetSeconds":5,"dailyTargetRanges":["1:1-1:2"],"remainingDailyTargetRanges":["1:1-1:2"],"mushafId":4}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1ActivityDays","method":"get","path":"/v1/activity-days","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get activity days","description":{"content":"Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type.","type":"text/plain"},"url":{"path":["v1","activity-days"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The start date of the activity days","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"The last date of the activity days","type":"text/plain"},"key":"to","value":""},{"disabled":false,"description":{"content":"Order by activity day's date","type":"text/plain"},"key":"dateOrderBy","value":""},{"disabled":false,"description":{"content":"The type of the activity day","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type. -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ranges object
      +
      Schema
        data object[]
      • Array [
      • ranges object
        The ranges read on that day (will be included only when the type is QURAN) @@ -103,7 +103,7 @@ The remaining range of Ayahs user should read on that day to meet their goal's t The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN) -
      • ]
      • pagination object
      +
    • ]
    • pagination object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-bookmarks-within-a-range-of-ayahs.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks-ayahs-range.api.mdx similarity index 64% rename from docs/user_related_apis_versioned/1.0.0/get-bookmarks-within-a-range-of-ayahs.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks-ayahs-range.api.mdx index d5e3c15a..7daf7ef3 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-bookmarks-within-a-range-of-ayahs.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks-ayahs-range.api.mdx @@ -1,11 +1,11 @@ --- -id: get-bookmarks-within-a-range-of-ayahs +id: auth-get-v-1-bookmarks-ayahs-range title: "Get bookmarks within a range of Ayahs" description: "Get all bookmarks within a specific Ayahs range." sidebar_label: "Get bookmarks within a range of Ayahs" hide_title: true hide_table_of_contents: true -api: {"description":"Get all bookmarks within a specific Ayahs range.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"chapterNumber","schema":{"type":"integer","description":"The number of the Surah that the Ayahs range belong to."},"required":true,"description":"The number of the Surah that the Ayahs range belong to."},{"in":"query","name":"rangeStartAyahNumber","schema":{"type":"integer","description":"The Ayah number at which the range starts."},"required":true,"description":"The Ayah number at which the range starts."},{"in":"query","name":"rangeEndAyahNumber","schema":{"type":"integer","description":"The Ayah number at which the range ends."},"required":true,"description":"The Ayah number at which the range ends."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav10y500057e21hjilhplh"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5},"group":{"type":"string"},"isInDefaultCollection":{"type":"boolean","example":true}},"required":["id","createdAt","type","key","isInDefaultCollection"],"additionalProperties":false,"title":"Bookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/bookmarks/ayahs-range","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get bookmarks within a range of Ayahs","description":{"content":"Get all bookmarks within a specific Ayahs range.","type":"text/plain"},"url":{"path":["v1","bookmarks","ayahs-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The number of the Surah that the Ayahs range belong to.","type":"text/plain"},"key":"chapterNumber","value":""},{"disabled":false,"description":{"content":"(Required) The Ayah number at which the range starts.","type":"text/plain"},"key":"rangeStartAyahNumber","value":""},{"disabled":false,"description":{"content":"(Required) The Ayah number at which the range ends.","type":"text/plain"},"key":"rangeEndAyahNumber","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get all bookmarks within a specific Ayahs range.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"chapterNumber","schema":{"type":"integer","description":"The number of the Surah that the Ayahs range belong to."},"required":true,"description":"The number of the Surah that the Ayahs range belong to."},{"in":"query","name":"rangeStartAyahNumber","schema":{"type":"integer","description":"The Ayah number at which the range starts."},"required":true,"description":"The Ayah number at which the range starts."},{"in":"query","name":"rangeEndAyahNumber","schema":{"type":"integer","description":"The Ayah number at which the range ends."},"required":true,"description":"The Ayah number at which the range ends."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqiu00067z3fh6oieeiq"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"bookmarkType":{"oneOf":[{"type":"string","example":"ayah"},{"type":"object","properties":{"type":{"type":"string","example":"ayah"}},"required":["type"]}]},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"bookmarkGroup":{"oneOf":[{"type":"string","example":"verses_6236"},{"type":"object","properties":{"name":{"type":"string","example":"verses_6236"}},"required":["name"]}]},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false}},"required":["id","createdAt","bookmarkType","key","bookmarkGroup","isInDefaultCollection","isReading"],"title":"RawBookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wqiu00067z3fh6oieeiq","createdAt":"2023-01-21T07:28:13.023Z","bookmarkType":"ayah","key":1,"verseNumber":5,"bookmarkGroup":"verses_6236","isInDefaultCollection":true,"isReading":false}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1BookmarksAyahsRange","method":"get","path":"/v1/bookmarks/ayahs-range","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get bookmarks within a range of Ayahs","description":{"content":"Get all bookmarks within a specific Ayahs range.","type":"text/plain"},"url":{"path":["v1","bookmarks","ayahs-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The number of the Surah that the Ayahs range belong to.","type":"text/plain"},"key":"chapterNumber","value":""},{"disabled":false,"description":{"content":"(Required) The Ayah number at which the range starts.","type":"text/plain"},"key":"rangeStartAyahNumber","value":""},{"disabled":false,"description":{"content":"(Required) The Ayah number at which the range ends.","type":"text/plain"},"key":"rangeEndAyahNumber","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Get all bookmarks within a specific Ayahs range. Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    +
    Schema
      data object[]
    • Array [
    • bookmarkType object required
      oneOf

      string

      object

      bookmarkGroup object required
      oneOf

      string

      object

    • ]
    • pagination object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-bookmark-collections.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks-bookmark.api.mdx similarity index 62% rename from docs/user_related_apis_versioned/1.0.0/get-bookmark-collections.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks-bookmark.api.mdx index 93abc2db..0ddc5e4d 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-bookmark-collections.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks-bookmark.api.mdx @@ -1,11 +1,11 @@ --- -id: get-bookmark-collections -title: "Get bookmark collections" -description: "Get all collections that a bookmark belongs to by bookmark details." -sidebar_label: "Get bookmark collections" +id: auth-get-v-1-bookmarks-bookmark +title: "Get bookmark" +description: "Get a bookmark by details" +sidebar_label: "Get bookmark" hide_title: true hide_table_of_contents: true -api: {"description":"Get all collections that a bookmark belongs to by bookmark details.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"key","schema":{"type":"number","format":"float","description":"Surah, Juz or page number."},"required":true,"description":"Surah, Juz or page number."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"required":false,"description":"The bookmark type."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"required":false,"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"required":false,"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"required":false,"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"required":false,"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav113800077e21b8bfgkgs"},"updatedAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"name":{"type":"string","example":"Woman in Quran"}},"required":["id","updatedAt","name"],"additionalProperties":false,"title":"Collection"}}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/bookmarks/collections","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get bookmark collections","description":{"content":"Get all collections that a bookmark belongs to by bookmark details.","type":"text/plain"},"url":{"path":["v1","bookmarks","collections"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Surah, Juz or page number.","type":"text/plain"},"key":"key","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get a bookmark by details","tags":["Bookmarks"],"parameters":[{"in":"query","name":"verseNumber","schema":{"type":"integer","description":"The Ayah number of the bookmark"},"description":"The Ayah number of the bookmark"},{"in":"query","name":"isReading","schema":{"type":"boolean","description":"Whether to fetch the reading bookmark"},"description":"Whether to fetch the reading bookmark"},{"in":"query","name":"key","schema":{"type":"integer","oneOf":[{},{"x-required":true}],"description":"Surah, Juz or page number.","example":2},"description":"Surah, Juz or page number."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"oneOf":[{},{"x-required":true}],"description":"The bookmark type.","default":"ayah"},"description":"The bookmark type."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.","example":4},"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name."},{"in":"query","name":"mushaf","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.","example":4},"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqim00057z3fe30y0b3e"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"group":{"type":"string","example":"verses_6236"},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false},"collectionsCount":{"type":"integer","description":"Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.","example":1}},"required":["id","createdAt","type","key","group","isInDefaultCollection","isReading"],"additionalProperties":false,"title":"Bookmark"}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1BookmarksBookmark","method":"get","path":"/v1/bookmarks/bookmark","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get bookmark","description":{"content":"Get a bookmark by details","type":"text/plain"},"url":{"path":["v1","bookmarks","bookmark"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The Ayah number of the bookmark","type":"text/plain"},"key":"verseNumber","value":""},{"disabled":false,"description":{"content":"Whether to fetch the reading bookmark","type":"text/plain"},"key":"isReading","value":""},{"disabled":false,"description":{"content":"Surah, Juz or page number.","type":"text/plain"},"key":"key","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.","type":"text/plain"},"key":"mushafId","value":""},{"disabled":false,"description":{"content":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.","type":"text/plain"},"key":"mushaf","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -21,17 +21,17 @@ import SchemaTabs from "@theme/SchemaTabs"; import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import TabItem from "@theme/TabItem"; -## Get bookmark collections +## Get bookmark -Get all collections that a bookmark belongs to by bookmark details. +Get a bookmark by details -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    +
    Schema
      data object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-all-collection-items.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks-collections.api.mdx similarity index 64% rename from docs/user_related_apis_versioned/1.0.0/get-all-collection-items.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks-collections.api.mdx index a354c95c..f35a307c 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-all-collection-items.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks-collections.api.mdx @@ -1,11 +1,11 @@ --- -id: get-all-collection-items -title: "Get all collection items" -description: "Get all existing collections along with resources that belong to them." -sidebar_label: "Get all collection items" +id: auth-get-v-1-bookmarks-collections +title: "Get bookmark collections" +description: "Get named collection IDs for a bookmark by bookmark details. Pass `includeDefault=true` to also append `__default__` when the bookmark belongs to Favorites." +sidebar_label: "Get bookmark collections" hide_title: true hide_table_of_contents: true -api: {"description":"Get all existing collections along with resources that belong to them.","tags":["Collections"],"parameters":[{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyAdded","verseKey"],"description":"Sort the collection items either by the time they were added at descendingly or alphabetically."},"description":"Sort the collection items either by the time they were added at descendingly or alphabetically."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"description":"The bookmark type."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav10y500057e21hjilhplh"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5},"group":{"type":"string"},"isInDefaultCollection":{"type":"boolean","example":true}},"required":["id","createdAt","type","key","isInDefaultCollection"],"additionalProperties":false,"title":"Bookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/collections/all","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all collection items","description":{"content":"Get all existing collections along with resources that belong to them.","type":"text/plain"},"url":{"path":["v1","collections","all"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort the collection items either by the time they were added at descendingly or alphabetically.","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get named collection IDs for a bookmark by bookmark details. Pass `includeDefault=true` to also append `__default__` when the bookmark belongs to Favorites.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"key","schema":{"type":"number","format":"float","description":"Surah, Juz or page number."},"required":true,"description":"Surah, Juz or page number."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"required":false,"description":"The bookmark type."},{"in":"query","name":"includeDefault","schema":{"type":"boolean","description":"When `true`, append `__default__` if the bookmark belongs to the virtual Favorites collection."},"required":false,"description":"When `true`, append `__default__` if the bookmark belongs to the virtual Favorites collection."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"required":false,"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"required":false,"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"required":false,"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"required":false,"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"string","description":"Collection ID. When `includeDefault=true`, this array may also include `__default__`.","example":"cmnkcpmvc000814v9f5jtbsxf"}}},"additionalProperties":false},"example":{"success":true,"data":["cmnkcpmvc000814v9f5jtbsxf"]}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1BookmarksCollections","method":"get","path":"/v1/bookmarks/collections","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get bookmark collections","description":{"content":"Get named collection IDs for a bookmark by bookmark details. Pass `includeDefault=true` to also append `__default__` when the bookmark belongs to Favorites.","type":"text/plain"},"url":{"path":["v1","bookmarks","collections"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Surah, Juz or page number.","type":"text/plain"},"key":"key","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"When `true`, append `__default__` if the bookmark belongs to the virtual Favorites collection.","type":"text/plain"},"key":"includeDefault","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -21,17 +21,17 @@ import SchemaTabs from "@theme/SchemaTabs"; import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import TabItem from "@theme/TabItem"; -## Get all collection items +## Get bookmark collections -Get all existing collections along with resources that belong to them. +Get named collection IDs for a bookmark by bookmark details. Pass `includeDefault=true` to also append `__default__` when the bookmark belongs to Favorites. -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    +
    Schema
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-user-bookmarks.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks.api.mdx similarity index 63% rename from docs/user_related_apis_versioned/1.0.0/get-user-bookmarks.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks.api.mdx index 170d3624..f687e816 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-user-bookmarks.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks.api.mdx @@ -1,11 +1,11 @@ --- -id: get-user-bookmarks +id: auth-get-v-1-bookmarks title: "Get user bookmarks" description: "Get all bookmarks. This includes bookmarks belonging to a collection." sidebar_label: "Get user bookmarks" hide_title: true hide_table_of_contents: true -api: {"description":"Get all bookmarks. This includes bookmarks belonging to a collection.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"required":false,"description":"The bookmark type."},{"in":"query","name":"isReading","schema":{"type":"boolean","description":"Whether to fetch only the reading bookmark"},"required":false,"description":"Whether to fetch only the reading bookmark"},{"in":"query","name":"key","schema":{"type":"integer","description":"Filter by key (surah/juz/page number)"},"required":false,"description":"Filter by key (surah/juz/page number)"},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"required":false,"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"required":false,"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"required":false,"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"required":false,"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav10y500057e21hjilhplh"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5},"group":{"type":"string"},"isInDefaultCollection":{"type":"boolean","example":true}},"required":["id","createdAt","type","key","isInDefaultCollection"],"additionalProperties":false,"title":"Bookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user bookmarks","description":{"content":"Get all bookmarks. This includes bookmarks belonging to a collection.","type":"text/plain"},"url":{"path":["v1","bookmarks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"Whether to fetch only the reading bookmark","type":"text/plain"},"key":"isReading","value":""},{"disabled":false,"description":{"content":"Filter by key (surah/juz/page number)","type":"text/plain"},"key":"key","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get all bookmarks. This includes bookmarks belonging to a collection.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"required":false,"description":"The bookmark type."},{"in":"query","name":"isReading","schema":{"type":"boolean","description":"Whether to fetch only the reading bookmark"},"required":false,"description":"Whether to fetch only the reading bookmark"},{"in":"query","name":"key","schema":{"type":"integer","description":"Filter by key (surah/juz/page number)"},"required":false,"description":"Filter by key (surah/juz/page number)"},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"required":false,"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"required":false,"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"required":false,"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"required":false,"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqim00057z3fe30y0b3e"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"group":{"type":"string","example":"verses_6236"},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false},"collectionsCount":{"type":"integer","description":"Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.","example":1}},"required":["id","createdAt","type","key","group","isInDefaultCollection","isReading","collectionsCount"],"additionalProperties":false,"title":"BookmarkWithCollectionsCount"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Bookmarks","method":"get","path":"/v1/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user bookmarks","description":{"content":"Get all bookmarks. This includes bookmarks belonging to a collection.","type":"text/plain"},"url":{"path":["v1","bookmarks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"Whether to fetch only the reading bookmark","type":"text/plain"},"key":"isReading","value":""},{"disabled":false,"description":{"content":"Filter by key (surah/juz/page number)","type":"text/plain"},"key":"key","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; Get all bookmarks. This includes bookmarks belonging to a collection. -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    +
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-collections-all.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-collections-all.api.mdx new file mode 100644 index 00000000..1cda4a2d --- /dev/null +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-collections-all.api.mdx @@ -0,0 +1,74 @@ +--- +id: auth-get-v-1-collections-all +title: "Get all collection items" +description: "Get all existing collections along with resources that belong to them." +sidebar_label: "Get all collection items" +hide_title: true +hide_table_of_contents: true +api: {"description":"Get all existing collections along with resources that belong to them.","tags":["Collections"],"parameters":[{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyAdded","verseKey"],"description":"Sort the collection items either by the time they were added at descendingly or alphabetically."},"description":"Sort the collection items either by the time they were added at descendingly or alphabetically."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"description":"The bookmark type."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqim00057z3fe30y0b3e"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"group":{"type":"string","example":"verses_6236"},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false},"collectionsCount":{"type":"integer","description":"Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.","example":1}},"required":["id","createdAt","type","key","group","isInDefaultCollection","isReading"],"additionalProperties":false,"title":"Bookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1CollectionsAll","method":"get","path":"/v1/collections/all","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all collection items","description":{"content":"Get all existing collections along with resources that belong to them.","type":"text/plain"},"url":{"path":["v1","collections","all"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort the collection items either by the time they were added at descendingly or alphabetically.","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +sidebar_class_name: "get api-method" +info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsVersionedSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Get all collection items + + + +Get all existing collections along with resources that belong to them. + +
    Query Parameters
    + +Request has been handled successfully. + +
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    diff --git a/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-collections-by-collection-id.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-collections-by-collection-id.api.mdx new file mode 100644 index 00000000..9f873df7 --- /dev/null +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-collections-by-collection-id.api.mdx @@ -0,0 +1,74 @@ +--- +id: auth-get-v-1-collections-by-collection-id +title: "Get collection items by id" +description: "Get all resources that belong to an existing collection by collection id. Use `__default__` to fetch the virtual Favorites collection." +sidebar_label: "Get collection items by id" +hide_title: true +hide_table_of_contents: true +api: {"description":"Get all resources that belong to an existing collection by collection id. Use `__default__` to fetch the virtual Favorites collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"Collection ID. Use `__default__` for the virtual Favorites collection.","example":"cmoa3wr17000d7z3f7ssph68y"},"description":"Collection ID. Use `__default__` for the virtual Favorites collection."},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyAdded","verseKey"],"description":"Sort the collection items either by the time they were added at descendingly or by Ayah key."},"description":"Sort the collection items either by the time they were added at descendingly or by Ayah key."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"collection":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqsk00087z3f5hp42h08"},"name":{"type":"string","example":"Woman in Quran"},"slug":{"type":"string","nullable":true,"example":"woman-in-quran"},"isPrivate":{"type":"boolean","example":false},"isDefault":{"type":"boolean","example":false},"updatedAt":{"type":"string","format":"date-time","nullable":true,"example":"2023-01-21T07:28:13.023Z"},"url":{"type":"string","nullable":true,"example":"cmnkcpmvc000814v9f5jtbsxf"},"bookmarksCount":{"type":"integer","example":1},"resourcesCount":{"type":"integer","example":1},"count":{"type":"integer","example":1}},"required":["id","name","slug","isPrivate","isDefault","updatedAt"],"additionalProperties":false,"title":"Collection"},"bookmarks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqim00057z3fe30y0b3e"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"group":{"type":"string","example":"verses_6236"},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false},"collectionsCount":{"type":"integer","description":"Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.","example":1}},"required":["id","createdAt","type","key","group","isInDefaultCollection","isReading","collectionsCount"],"additionalProperties":false,"title":"BookmarkWithCollectionsCount"}}},"additionalProperties":false},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"collection":{"id":"cmoa3wqsk00087z3f5hp42h08","name":"Woman in Quran","slug":"woman-in-quran","isPrivate":false,"isDefault":false,"updatedAt":"2023-01-21T07:28:13.023Z","url":"cmnkcpmvc000814v9f5jtbsxf","bookmarksCount":1,"resourcesCount":1,"count":1},"bookmarks":[{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}]},"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1CollectionsByCollectionId","method":"get","path":"/v1/collections/{collectionId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get collection items by id","description":{"content":"Get all resources that belong to an existing collection by collection id. Use `__default__` to fetch the virtual Favorites collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort the collection items either by the time they were added at descendingly or by Ayah key.","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[{"disabled":false,"description":{"content":"Collection ID. Use `__default__` for the virtual Favorites collection.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +sidebar_class_name: "get api-method" +info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsVersionedSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Get collection items by id + + + +Get all resources that belong to an existing collection by collection id. Use `__default__` to fetch the virtual Favorites collection. + +
    Path Parameters
    Query Parameters
    + +Request has been handled successfully. + +
    Schema
      data object
      collection object
      bookmarks object[]
    • Array [
    • ]
    • pagination object
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    diff --git a/docs/user_related_apis_versioned/1.0.0/get-all-collections.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-collections.api.mdx similarity index 60% rename from docs/user_related_apis_versioned/1.0.0/get-all-collections.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-collections.api.mdx index 0f127384..40e89312 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-all-collections.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-collections.api.mdx @@ -1,11 +1,11 @@ --- -id: get-all-collections +id: auth-get-v-1-collections title: "Get all collections" description: "List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination)" sidebar_label: "Get all collections" hide_title: true hide_table_of_contents: true -api: {"tags":["Collections"],"description":"List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination)","parameters":[{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyUpdated","alphabetical"],"description":"Sort the collections list either by the time they were updated at descendingly or alphabetically.","example":"recentlyUpdated"},"description":"Sort the collections list either by the time they were updated at descendingly or alphabetically."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"description":"The bookmark type."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav113800077e21b8bfgkgs"},"updatedAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"name":{"type":"string","example":"Woman in Quran"}},"required":["id","updatedAt","name"],"additionalProperties":false,"title":"Collection"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/collections","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all collections","description":{"content":"List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination)","type":"text/plain"},"url":{"path":["v1","collections"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort the collections list either by the time they were updated at descendingly or alphabetically.","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Collections"],"description":"List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination)","parameters":[{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyUpdated","alphabetical"],"description":"Sort the collections list either by the time they were updated at descendingly or alphabetically.","example":"recentlyUpdated"},"description":"Sort the collections list either by the time they were updated at descendingly or alphabetically."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"description":"The bookmark type."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqsk00087z3f5hp42h08"},"name":{"type":"string","example":"Woman in Quran"},"slug":{"type":"string","nullable":true,"example":"woman-in-quran"},"isPrivate":{"type":"boolean","example":false},"isDefault":{"type":"boolean","example":false},"updatedAt":{"type":"string","format":"date-time","nullable":true,"example":"2023-01-21T07:28:13.023Z"},"url":{"type":"string","nullable":true,"example":"cmnkcpmvc000814v9f5jtbsxf"},"bookmarksCount":{"type":"integer","example":1},"resourcesCount":{"type":"integer","example":1},"count":{"type":"integer","example":1}},"required":["id","name","slug","isPrivate","isDefault","updatedAt"],"additionalProperties":false,"title":"Collection"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wqsk00087z3f5hp42h08","name":"Woman in Quran","slug":"woman-in-quran","isPrivate":false,"isDefault":false,"updatedAt":"2023-01-21T07:28:13.023Z","url":"cmnkcpmvc000814v9f5jtbsxf","bookmarksCount":1,"resourcesCount":1,"count":1}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Collections","method":"get","path":"/v1/collections","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all collections","description":{"content":"List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination)","type":"text/plain"},"url":{"path":["v1","collections"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort the collections list either by the time they were updated at descendingly or alphabetically.","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination) -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    +
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/generate-timeline-estimation.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-goals-estimate.api.mdx similarity index 74% rename from docs/user_related_apis_versioned/1.0.0/generate-timeline-estimation.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-goals-estimate.api.mdx index f78d33b7..4e8cc177 100644 --- a/docs/user_related_apis_versioned/1.0.0/generate-timeline-estimation.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-goals-estimate.api.mdx @@ -1,11 +1,11 @@ --- -id: generate-timeline-estimation +id: auth-get-v-1-goals-estimate title: "Generate timeline estimation" description: "Generate a timeline up to a week of the minimum daily amount required to meet the goal." sidebar_label: "Generate timeline estimation" hide_title: true hide_table_of_contents: true -api: {"description":"Generate a timeline up to a week of the minimum daily amount required to meet the goal.","tags":["Goals"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"required":true,"description":"The type of the goal."},{"in":"query","name":"amount","schema":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"required":true,"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},{"in":"query","name":"duration","schema":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"required":false,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"week":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date-time","description":"The date of the estimated day","example":"2023-01-21T07:28:13.023Z"},"amount":{"oneOf":[{"type":"string","example":"1:5-1:10"},{"type":"integer","minimum":1,"example":600}],"description":"The amount of the day's goal."}},"required":["date","amount"],"additionalProperties":false,"title":"EstimatedGoalTimelineDay"}}},"additionalProperties":false,"title":"EstimatedGoalTimeline"}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/goals/estimate","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Generate timeline estimation","description":{"content":"Generate a timeline up to a week of the minimum daily amount required to meet the goal.","type":"text/plain"},"url":{"path":["v1","goals","estimate"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The type of the goal.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"(Required) The amount of the goal. Depending on the goal type, the amount value and format will be different","type":"text/plain"},"key":"amount","value":""},{"disabled":false,"description":{"content":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based.","type":"text/plain"},"key":"duration","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Generate a timeline up to a week of the minimum daily amount required to meet the goal.","tags":["Goals"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"required":true,"description":"The type of the goal."},{"in":"query","name":"amount","schema":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"required":true,"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},{"in":"query","name":"duration","schema":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"required":false,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"week":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date-time","description":"The date of the estimated day","example":"2023-01-21T07:28:13.023Z"},"amount":{"oneOf":[{"type":"string","example":"1:5-1:10"},{"type":"integer","minimum":1,"example":600}],"description":"The amount of the day's goal."}},"required":["date","amount"],"additionalProperties":false,"title":"EstimatedGoalTimelineDay"}}},"additionalProperties":false,"title":"EstimatedGoalTimeline"}},"additionalProperties":false},"example":{"success":true,"data":{"week":[{"date":"2023-01-21T07:28:13.023Z","amount":"1:5-1:10"}]}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1GoalsEstimate","method":"get","path":"/v1/goals/estimate","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Generate timeline estimation","description":{"content":"Generate a timeline up to a week of the minimum daily amount required to meet the goal.","type":"text/plain"},"url":{"path":["v1","goals","estimate"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The type of the goal.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"(Required) The amount of the goal. Depending on the goal type, the amount value and format will be different","type":"text/plain"},"key":"amount","value":""},{"disabled":false,"description":{"content":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based.","type":"text/plain"},"key":"duration","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -43,7 +43,7 @@ The amount of the day's goal. The amount of the day's goal. -
  • ]
  • +
  • ]
  • The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-todays-goal-plan.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-goals-get-todays-plan.api.mdx similarity index 73% rename from docs/user_related_apis_versioned/1.0.0/get-todays-goal-plan.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-goals-get-todays-plan.api.mdx index a681ad70..c3f081b1 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-todays-goal-plan.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-goals-get-todays-plan.api.mdx @@ -1,11 +1,11 @@ --- -id: get-todays-goal-plan +id: auth-get-v-1-goals-get-todays-plan title: "Get today's goal plan" description: "Get today's goal plan." sidebar_label: "Get today's goal plan" hide_title: true hide_table_of_contents: true -api: {"description":"Get today's goal plan.","tags":["Goals"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"required":true,"description":"The type of the goal."},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"hasGoal":{"type":"boolean","description":"User has a goal.","example":false}},"required":["hasGoal"],"additionalProperties":false,"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"The id of the activity day.","example":"cmmav10hr00047e21267o9efb"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day.","example":"2023-09-31"},"progress":{"type":"number","format":"float","minimum":0,"maximum":1,"description":"The progress of the reading goal of that activity day (if the user has a reading goal on that day).","example":0.695},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"ranges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The ranges read on that day (will be included only when the type is QURAN)","example":["1:1-1:2"]},"pagesRead":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages read on that day (will be included only when the type is QURAN)","example":1.637041020126048},"secondsRead":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading on that day (will be included only when the type is QURAN)","example":417},"versesRead":{"oneOf":[{"type":"integer"}],"description":"The number of Ayahs read on that day (will be included only when the type is QURAN)","example":24},"manuallyAddedSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading that was manually input by the user and not auto-tracked (will be included only when the type is QURAN)","example":24},"dailyTargetPages":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":1.637041020126048},"dailyTargetSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":5},"dailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"remainingDailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4}},"required":["id","date","progress","type","mushafId"],"additionalProperties":false,"description":"The Mushaf used to read on that day (will be included only when the type is QURAN) \n\nThe id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","title":"When user has a goal"}]}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/goals/get-todays-plan","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get today's goal plan","description":{"content":"Get today's goal plan.","type":"text/plain"},"url":{"path":["v1","goals","get-todays-plan"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The type of the goal.","type":"text/plain"},"key":"type","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get today's goal plan.","tags":["Goals"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"required":true,"description":"The type of the goal."},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"hasGoal":{"type":"boolean","description":"User has a goal.","example":false}},"required":["hasGoal"],"additionalProperties":false,"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"The id of the activity day.","example":"cmoa3wq2b00047z3fbl4c6ew0"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day.","example":"2023-09-31"},"progress":{"type":"number","format":"float","minimum":0,"maximum":1,"description":"The progress of the reading goal of that activity day (if the user has a reading goal on that day).","example":0.695},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"ranges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The ranges read on that day (will be included only when the type is QURAN)","example":["1:1-1:2"]},"pagesRead":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages read on that day (will be included only when the type is QURAN)","example":1.637041020126048},"secondsRead":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading on that day (will be included only when the type is QURAN)","example":417},"versesRead":{"oneOf":[{"type":"integer"}],"description":"The number of Ayahs read on that day (will be included only when the type is QURAN)","example":24},"manuallyAddedSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading that was manually input by the user and not auto-tracked (will be included only when the type is QURAN)","example":24},"dailyTargetPages":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":1.637041020126048},"dailyTargetSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":5},"dailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"remainingDailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4}},"required":["id","date","progress","type","mushafId"],"additionalProperties":false,"description":"The Mushaf used to read on that day (will be included only when the type is QURAN) \n\nThe id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","title":"When user has a goal"}]}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wq2b00047z3fbl4c6ew0","date":"2023-09-31","progress":0.695,"type":"QURAN","ranges":["1:1-1:2"],"pagesRead":1.637041020126048,"secondsRead":417,"versesRead":24,"manuallyAddedSeconds":24,"dailyTargetPages":1.637041020126048,"dailyTargetSeconds":5,"dailyTargetRanges":["1:1-1:2"],"remainingDailyTargetRanges":["1:1-1:2"],"mushafId":4}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1GoalsGetTodaysPlan","method":"get","path":"/v1/goals/get-todays-plan","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get today's goal plan","description":{"content":"Get today's goal plan.","type":"text/plain"},"url":{"path":["v1","goals","get-todays-plan"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The type of the goal.","type":"text/plain"},"key":"type","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Get today's goal plan. Request has been handled successfully. -
    Schema
      data object
      oneOf

      object

    +
    Schema
      data object
      oneOf

      object

    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-notes-by-attached-entity.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-attached-entity.api.mdx similarity index 75% rename from docs/user_related_apis_versioned/1.0.0/get-notes-by-attached-entity.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-attached-entity.api.mdx index 67fb71c8..1c62a58b 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-notes-by-attached-entity.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-attached-entity.api.mdx @@ -1,11 +1,11 @@ --- -id: get-notes-by-attached-entity +id: auth-get-v-1-notes-by-attached-entity title: "Get notes by attached entity" description: "Retrieve notes by attached entity." sidebar_label: "Get notes by attached entity" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Retrieve notes by attached entity.","parameters":[{"in":"query","name":"entityId","schema":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"required":true,"description":"The unique identifier for the attached entity."},{"in":"query","name":"entityType","schema":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"required":true,"description":"The type of the attached entity, must be one of the predefined NoteEntityType values."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/notes/by-attached-entity","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes by attached entity","description":{"content":"Retrieve notes by attached entity.","type":"text/plain"},"url":{"path":["v1","notes","by-attached-entity"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The unique identifier for the attached entity.","type":"text/plain"},"key":"entityId","value":""},{"disabled":false,"description":{"content":"(Required) The type of the attached entity, must be one of the predefined NoteEntityType values.","type":"text/plain"},"key":"entityType","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Notes"],"description":"Retrieve notes by attached entity.","parameters":[{"in":"query","name":"entityId","schema":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"required":true,"description":"The unique identifier for the attached entity."},{"in":"query","name":"entityType","schema":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"required":true,"description":"The type of the attached entity, must be one of the predefined NoteEntityType values."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}]}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesByAttachedEntity","method":"get","path":"/v1/notes/by-attached-entity","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes by attached entity","description":{"content":"Retrieve notes by attached entity.","type":"text/plain"},"url":{"path":["v1","notes","by-attached-entity"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The unique identifier for the attached entity.","type":"text/plain"},"key":"entityId","value":""},{"disabled":false,"description":{"content":"(Required) The type of the attached entity, must be one of the predefined NoteEntityType values.","type":"text/plain"},"key":"entityType","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ An array of attached entities associated with the note. Additional metadata for the attached entity. -
  • ]
  • ]
  • +
  • ]
  • ]
  • The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-note-by-id.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-note-id.api.mdx similarity index 74% rename from docs/user_related_apis_versioned/1.0.0/get-note-by-id.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-note-id.api.mdx index e98e79e4..7c30c3d8 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-note-by-id.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-note-id.api.mdx @@ -1,11 +1,11 @@ --- -id: get-note-by-id +id: auth-get-v-1-notes-by-note-id title: "Get note by ID" description: "Retrieve a note by its ID." sidebar_label: "Get note by ID" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Retrieve a note by its ID.","parameters":[{"in":"query","name":"withAttachedEntities","schema":{"type":"boolean","description":"Specifies whether to include attached entities in the response, defaults to true.","example":true,"default":true},"description":"Specifies whether to include attached entities in the response, defaults to true."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/notes/:noteId","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"}} +api: {"tags":["Notes"],"description":"Retrieve a note by its ID.","parameters":[{"in":"query","name":"withAttachedEntities","schema":{"type":"boolean","description":"Specifies whether to include attached entities in the response, defaults to true.","example":true,"default":true},"description":"Specifies whether to include attached entities in the response, defaults to true."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesByNoteId","method":"get","path":"/v1/notes/{noteId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get note by ID","description":{"content":"Retrieve a note by its ID.","type":"text/plain"},"url":{"path":["v1","notes",":noteId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Specifies whether to include attached entities in the response, defaults to true.","type":"text/plain"},"key":"withAttachedEntities","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ An array of attached entities associated with the note. Additional metadata for the attached entity. -
  • ]
  • +
  • ]
  • The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-notes-by-verse-range.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-range.api.mdx similarity index 75% rename from docs/user_related_apis_versioned/1.0.0/get-notes-by-verse-range.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-range.api.mdx index 8ee316af..d23508ef 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-notes-by-verse-range.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-range.api.mdx @@ -1,11 +1,11 @@ --- -id: get-notes-by-verse-range +id: auth-get-v-1-notes-by-range title: "Get notes by verse range" description: "Retrieve notes by a range of verses." sidebar_label: "Get notes by verse range" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Retrieve notes by a range of verses.","parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The starting verse key of the range.","example":"2:12"},"required":true,"description":"The starting verse key of the range."},{"in":"query","name":"to","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The ending verse key of the range.","example":"2:18"},"required":true,"description":"The ending verse key of the range."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/notes/by-range","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes by verse range","description":{"content":"Retrieve notes by a range of verses.","type":"text/plain"},"url":{"path":["v1","notes","by-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The starting verse key of the range.","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"(Required) The ending verse key of the range.","type":"text/plain"},"key":"to","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Notes"],"description":"Retrieve notes by a range of verses.","parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The starting verse key of the range.","example":"2:12"},"required":true,"description":"The starting verse key of the range."},{"in":"query","name":"to","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The ending verse key of the range.","example":"2:18"},"required":true,"description":"The ending verse key of the range."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}]}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesByRange","method":"get","path":"/v1/notes/by-range","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes by verse range","description":{"content":"Retrieve notes by a range of verses.","type":"text/plain"},"url":{"path":["v1","notes","by-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The starting verse key of the range.","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"(Required) The ending verse key of the range.","type":"text/plain"},"key":"to","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ An array of attached entities associated with the note. Additional metadata for the attached entity. -
  • ]
  • ]
  • +
  • ]
  • ]
  • The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-notes-by-verse.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-verse-by-verse-key.api.mdx similarity index 73% rename from docs/user_related_apis_versioned/1.0.0/get-notes-by-verse.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-verse-by-verse-key.api.mdx index e2478601..91df775d 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-notes-by-verse.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-verse-by-verse-key.api.mdx @@ -1,11 +1,11 @@ --- -id: get-notes-by-verse +id: auth-get-v-1-notes-by-verse-by-verse-key title: "Get notes by verse" description: "Retrieve notes by a specific verse." sidebar_label: "Get notes by verse" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Retrieve notes by a specific verse.","parameters":[{"in":"query","name":"verseKey","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The verse key for which notes are being requested.","example":"2:255"},"required":true,"description":"The verse key for which notes are being requested."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/notes/by-verse/:verseKey","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"}} +api: {"tags":["Notes"],"description":"Retrieve notes by a specific verse.","parameters":[{"in":"query","name":"verseKey","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The verse key for which notes are being requested.","example":"2:255"},"required":true,"description":"The verse key for which notes are being requested."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesByVerseByVerseKey","method":"get","path":"/v1/notes/by-verse/{verseKey}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes by verse","description":{"content":"Retrieve notes by a specific verse.","type":"text/plain"},"url":{"path":["v1","notes","by-verse",":verseKey"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The verse key for which notes are being requested.","type":"text/plain"},"key":"verseKey","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ An array of attached entities associated with the note. Additional metadata for the attached entity. -
  • ]
  • ]
  • pagination object
    +
  • ]
  • ]
  • pagination object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-notes-count-within-verse-range.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-count-within-range.api.mdx similarity index 72% rename from docs/user_related_apis_versioned/1.0.0/get-notes-count-within-verse-range.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-count-within-range.api.mdx index db6e53a5..35c1f8cf 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-notes-count-within-verse-range.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes-count-within-range.api.mdx @@ -1,11 +1,11 @@ --- -id: get-notes-count-within-verse-range +id: auth-get-v-1-notes-count-within-range title: "Get notes count within verse range" description: "Get the count of notes within a range of verses." sidebar_label: "Get notes count within verse range" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Get the count of notes within a range of verses.","parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The starting verse key of the range.","example":"2:12"},"required":true,"description":"The starting verse key of the range."},{"in":"query","name":"to","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The ending verse key of the range.","example":"2:18"},"required":true,"description":"The ending verse key of the range."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{},"additionalProperties":{"type":"integer","minimum":1},"description":"A map of verse keys to note counts, where each key is a verse key and each value is an integer count of notes.","example":{"1:2":5,"1:3":1,"1:4":1}}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/notes/count-within-range","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes count within verse range","description":{"content":"Get the count of notes within a range of verses.","type":"text/plain"},"url":{"path":["v1","notes","count-within-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The starting verse key of the range.","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"(Required) The ending verse key of the range.","type":"text/plain"},"key":"to","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Notes"],"description":"Get the count of notes within a range of verses.","parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The starting verse key of the range.","example":"2:12"},"required":true,"description":"The starting verse key of the range."},{"in":"query","name":"to","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The ending verse key of the range.","example":"2:18"},"required":true,"description":"The ending verse key of the range."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{},"additionalProperties":{"type":"integer","minimum":1},"description":"A map of verse keys to note counts, where each key is a verse key and each value is an integer count of notes.","example":{"1:2":5,"1:3":1,"1:4":1}}},"additionalProperties":false},"example":{"success":true,"data":{"1:2":5,"1:3":1,"1:4":1}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesCountWithinRange","method":"get","path":"/v1/notes/count-within-range","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes count within verse range","description":{"content":"Get the count of notes within a range of verses.","type":"text/plain"},"url":{"path":["v1","notes","count-within-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The starting verse key of the range.","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"(Required) The ending verse key of the range.","type":"text/plain"},"key":"to","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Request has been handled successfully. A map of verse keys to note counts, where each key is a verse key and each value is an integer count of notes. -
    +
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-all-notes.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes.api.mdx similarity index 77% rename from docs/user_related_apis_versioned/1.0.0/get-all-notes.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes.api.mdx index b1d1d696..9dd91ca1 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-all-notes.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-notes.api.mdx @@ -1,11 +1,11 @@ --- -id: get-all-notes +id: auth-get-v-1-notes title: "Get all notes" description: "List notes owned by the user. This API contains pagination. Read more about [pagination](/#pagination)" sidebar_label: "Get all notes" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"List notes owned by the user. This API contains pagination. Read more about [pagination](/#pagination)","parameters":[{"in":"query","name":"cursor","schema":{"type":"string","description":"A cursor for pagination, used to fetch the next set of results.","example":"cursor123"},"description":"A cursor for pagination, used to fetch the next set of results."},{"in":"query","name":"limit","schema":{"type":"number","format":"float","minimum":1,"maximum":50,"description":"The maximum number of notes to return, defaults to 20.","example":20,"default":20},"description":"The maximum number of notes to return, defaults to 20."},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["newest","oldest"],"description":"The sorting order of the notes, defaults to newest first.","example":"newest","default":"newest"},"description":"The sorting order of the notes, defaults to newest first."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/notes","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all notes","description":{"content":"List notes owned by the user. This API contains pagination. Read more about [pagination](/#pagination)","type":"text/plain"},"url":{"path":["v1","notes"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"A cursor for pagination, used to fetch the next set of results.","type":"text/plain"},"key":"cursor","value":""},{"disabled":false,"description":{"content":"The maximum number of notes to return, defaults to 20.","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"The sorting order of the notes, defaults to newest first.","type":"text/plain"},"key":"sortBy","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Notes"],"description":"List notes owned by the user. This API contains pagination. Read more about [pagination](/#pagination)","parameters":[{"in":"query","name":"cursor","schema":{"type":"string","description":"A cursor for pagination, used to fetch the next set of results.","example":"cursor123"},"description":"A cursor for pagination, used to fetch the next set of results."},{"in":"query","name":"limit","schema":{"type":"number","format":"float","minimum":1,"maximum":50,"description":"The maximum number of notes to return, defaults to 20.","example":20,"default":20},"description":"The maximum number of notes to return, defaults to 20."},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["newest","oldest"],"description":"The sorting order of the notes, defaults to newest first.","example":"newest","default":"newest"},"description":"The sorting order of the notes, defaults to newest first."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Notes","method":"get","path":"/v1/notes","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all notes","description":{"content":"List notes owned by the user. This API contains pagination. Read more about [pagination](/#pagination)","type":"text/plain"},"url":{"path":["v1","notes"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"A cursor for pagination, used to fetch the next set of results.","type":"text/plain"},"key":"cursor","value":""},{"disabled":false,"description":{"content":"The maximum number of notes to return, defaults to 20.","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"The sorting order of the notes, defaults to newest first.","type":"text/plain"},"key":"sortBy","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ An array of attached entities associated with the note. Additional metadata for the attached entity. -
  • ]
  • ]
  • pagination object
    +
  • ]
  • ]
  • pagination object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-user-preferences.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-preferences.api.mdx similarity index 77% rename from docs/user_related_apis_versioned/1.0.0/get-user-preferences.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-preferences.api.mdx index a3578c16..a1c3b60e 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-user-preferences.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-preferences.api.mdx @@ -1,11 +1,11 @@ --- -id: get-user-preferences +id: auth-get-v-1-preferences title: "Get user preferences" description: "Get all user preferences like theme, favorite reciter, default language etc." sidebar_label: "Get user preferences" hide_title: true hide_table_of_contents: true -api: {"description":"Get all user preferences like theme, favorite reciter, default language etc.","tags":["Preferences"],"parameters":[],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"theme":{"type":"object","properties":{"type":{"type":"string","enum":["auto","light","sepia","dark"],"example":"auto"}},"additionalProperties":false},"reading":{"type":"object","properties":{"readingPreference":{"type":"string","enum":["translation","reading","readingTranslation"],"example":"translation"},"selectedWordByWordLocale":{"type":"string","enum":["en","ur","id","bn","tr","fa","ru","hi","de","ta","inh","fr","sq","dv","zh","sd","ml"],"example":"en"},"wordClickFunctionality":{"type":"string","enum":["play-audio","no-audio"],"example":"play-audio"},"isReadingByRevelationOrder":{"type":"boolean","example":true},"wordByWordContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordDisplay":{"type":"array","items":{"type":"string","enum":["tooltip","inline"]},"example":["tooltip"]},"wordByWordTooltipContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordInlineContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":[]},"selectedReadingTranslation":{"type":"string","minLength":1,"maxLength":255,"example":"131"},"selectedReflectionLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1},"selectedLessonLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}},"required":["readingPreference","selectedWordByWordLocale","wordClickFunctionality","selectedReadingTranslation"],"additionalProperties":false},"quranReaderStyles":{"type":"object","properties":{"tafsirFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranTextFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"translationFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"wordByWordFontScale":{"type":"integer","minimum":1,"maximum":6,"example":3},"reflectionFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"qnaFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"lessonFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"surahInfoFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"hadithFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"layersFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranFont":{"type":"string","enum":["code_v1","code_v2","text_uthmani","text_indopak","qpc_uthmani_hafs","tajweed","tajweed_v4"],"example":"code_v1"},"mushafLines":{"type":"string","enum":["15_lines","16_lines"],"example":"16_lines"},"showTajweedRules":{"type":"boolean","example":true}},"required":["tafsirFontScale","quranTextFontScale","translationFontScale","wordByWordFontScale","reflectionFontScale","qnaFontScale","lessonFontScale","surahInfoFontScale","hadithFontScale","layersFontScale"],"additionalProperties":false},"translations":{"type":"object","properties":{"selectedTranslations":{"type":"array","items":{"type":"integer","example":131}}},"additionalProperties":false},"tafsirs":{"type":"object","properties":{"selectedTafsirs":{"type":"array","items":{"type":"string","example":"en-tafisr-ibn-kathir"}}},"additionalProperties":false},"audio":{"type":"object","properties":{"reciter":{"type":"integer","example":7},"playbackRate":{"type":"integer","enum":[0.25,0.5,0.75,1,1.25,1.5,1.75,2],"example":1},"showTooltipWhenPlayingAudio":{"type":"boolean","example":true},"enableAutoScrolling":{"type":"boolean","example":true}},"required":["reciter"],"additionalProperties":false},"language":{"type":"object","properties":{"language":{"type":"string","enum":["en","ar","bn","fa","fr","id","it","nl","pt","ru","sq","th","tr","ur","zh","ms","es","sw","vi"]}},"additionalProperties":false},"userHasCustomised":{"type":"object","properties":{"userHasCustomised":{"type":"boolean","example":false}},"required":["userHasCustomised"],"additionalProperties":false}},"additionalProperties":false,"title":"Preference"}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/preferences","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user preferences","description":{"content":"Get all user preferences like theme, favorite reciter, default language etc.","type":"text/plain"},"url":{"path":["v1","preferences"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get all user preferences like theme, favorite reciter, default language etc.","tags":["Preferences"],"parameters":[],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"theme":{"type":"object","properties":{"type":{"type":"string","enum":["auto","light","sepia","dark"],"example":"auto"}},"additionalProperties":false},"reading":{"type":"object","properties":{"readingPreference":{"type":"string","enum":["translation","reading","readingTranslation"],"example":"translation"},"selectedWordByWordLocale":{"type":"string","enum":["en","ur","id","bn","tr","fa","ru","hi","de","ta","inh","fr","sq","dv","zh","sd","ml"],"example":"en"},"wordClickFunctionality":{"type":"string","enum":["play-audio","no-audio"],"example":"play-audio"},"isReadingByRevelationOrder":{"type":"boolean","example":true},"wordByWordContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordDisplay":{"type":"array","items":{"type":"string","enum":["tooltip","inline"]},"example":["tooltip"]},"wordByWordTooltipContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordInlineContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":[]},"selectedReadingTranslation":{"type":"string","minLength":1,"maxLength":255,"example":"131"},"selectedReflectionLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1},"selectedLessonLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}},"required":["readingPreference","selectedWordByWordLocale","wordClickFunctionality","selectedReadingTranslation"],"additionalProperties":false},"quranReaderStyles":{"type":"object","properties":{"tafsirFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranTextFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"translationFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"wordByWordFontScale":{"type":"integer","minimum":1,"maximum":6,"example":3},"reflectionFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"qnaFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"lessonFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"surahInfoFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"hadithFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"layersFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranFont":{"type":"string","enum":["code_v1","code_v2","text_uthmani","text_indopak","qpc_uthmani_hafs","tajweed","tajweed_v4"],"example":"code_v1"},"mushafLines":{"type":"string","enum":["15_lines","16_lines"],"example":"16_lines"},"showTajweedRules":{"type":"boolean","example":true}},"required":["tafsirFontScale","quranTextFontScale","translationFontScale","wordByWordFontScale","reflectionFontScale","qnaFontScale","lessonFontScale","surahInfoFontScale","hadithFontScale","layersFontScale"],"additionalProperties":false},"translations":{"type":"object","properties":{"selectedTranslations":{"type":"array","items":{"type":"integer","example":131}}},"additionalProperties":false},"tafsirs":{"type":"object","properties":{"selectedTafsirs":{"type":"array","items":{"type":"string","example":"en-tafisr-ibn-kathir"}}},"additionalProperties":false},"audio":{"type":"object","properties":{"reciter":{"type":"integer","example":7},"playbackRate":{"type":"integer","enum":[0.25,0.5,0.75,1,1.25,1.5,1.75,2],"example":1},"showTooltipWhenPlayingAudio":{"type":"boolean","example":true},"enableAutoScrolling":{"type":"boolean","example":true}},"required":["reciter"],"additionalProperties":false},"language":{"type":"object","properties":{"language":{"type":"string","enum":["en","ar","bn","fa","fr","id","it","nl","pt","ru","sq","th","tr","ur","zh","ms","es","sw","vi"]}},"additionalProperties":false},"userHasCustomised":{"type":"object","properties":{"userHasCustomised":{"type":"boolean","example":false}},"required":["userHasCustomised"],"additionalProperties":false}},"additionalProperties":false,"title":"Preference"}},"additionalProperties":false},"example":{"success":true,"data":{"theme":{"type":"auto"},"reading":{"readingPreference":"translation","selectedWordByWordLocale":"en","wordClickFunctionality":"play-audio","isReadingByRevelationOrder":true,"wordByWordContentType":["translation"],"wordByWordDisplay":["tooltip"],"wordByWordTooltipContentType":["translation"],"wordByWordInlineContentType":[],"selectedReadingTranslation":"131","selectedReflectionLanguages":["string"],"selectedLessonLanguages":["string"]},"quranReaderStyles":{"tafsirFontScale":3,"quranTextFontScale":3,"translationFontScale":3,"wordByWordFontScale":3,"reflectionFontScale":3,"qnaFontScale":3,"lessonFontScale":3,"surahInfoFontScale":3,"hadithFontScale":3,"layersFontScale":3,"quranFont":"code_v1","mushafLines":"16_lines","showTajweedRules":true},"translations":{"selectedTranslations":[131]},"tafsirs":{"selectedTafsirs":["en-tafisr-ibn-kathir"]},"audio":{"reciter":7,"playbackRate":1,"showTooltipWhenPlayingAudio":true,"enableAutoScrolling":true},"language":{"language":"en"},"userHasCustomised":{"userHasCustomised":false}}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Preferences","method":"get","path":"/v1/preferences","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user preferences","description":{"content":"Get all user preferences like theme, favorite reciter, default language etc.","type":"text/plain"},"url":{"path":["v1","preferences"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Get all user preferences like theme, favorite reciter, default language etc. Request has been handled successfully. -
    Schema
      data object
      theme object
      reading object
      = 1`"} schema={{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}}>= 1`"} schema={{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}}>
      quranReaderStyles object
      = 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 6`"} schema={{"type":"integer","minimum":1,"maximum":6,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>
      translations object
      tafsirs object
      audio object
      language object
      userHasCustomised object
    +
    Schema
      data object
      theme object
      reading object
      = 1`"} schema={{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}}>= 1`"} schema={{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}}>
      quranReaderStyles object
      = 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 6`"} schema={{"type":"integer","minimum":1,"maximum":6,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>
      translations object
      tafsirs object
      audio object
      language object
      userHasCustomised object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-user-reading-sessions.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-reading-sessions.api.mdx similarity index 69% rename from docs/user_related_apis_versioned/1.0.0/get-user-reading-sessions.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-reading-sessions.api.mdx index fddd1a9d..3858bec4 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-user-reading-sessions.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-reading-sessions.api.mdx @@ -1,11 +1,11 @@ --- -id: get-user-reading-sessions +id: auth-get-v-1-reading-sessions title: "Get user reading sessions" description: "Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for 'Continue reading' / 'Recently read'. For streaks, goals, and calendar-style progress tracking, use Activity Days." sidebar_label: "Get user reading sessions" hide_title: true hide_table_of_contents: true -api: {"description":"Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for \"Continue reading\" / \"Recently read\". For streaks, goals, and calendar-style progress tracking, use Activity Days.","tags":["Reading Sessions"],"parameters":[{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav126k000e7e21h96r5yb0"},"updatedAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"chapterNumber":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5}},"required":["id","updatedAt"],"additionalProperties":false,"title":"ReadingSession"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/reading-sessions","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user reading sessions","description":{"content":"Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for \"Continue reading\" / \"Recently read\". For streaks, goals, and calendar-style progress tracking, use Activity Days.","type":"text/plain"},"url":{"path":["v1","reading-sessions"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for \"Continue reading\" / \"Recently read\". For streaks, goals, and calendar-style progress tracking, use Activity Days.","tags":["Reading Sessions"],"parameters":[{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wrpk000h7z3f2t6a57dg"},"updatedAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"chapterNumber":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5}},"required":["id","updatedAt"],"additionalProperties":false,"title":"ReadingSession"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wrpk000h7z3f2t6a57dg","updatedAt":"2023-01-21T07:28:13.023Z","chapterNumber":1,"verseNumber":5}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1ReadingSessions","method":"get","path":"/v1/reading-sessions","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user reading sessions","description":{"content":"Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for \"Continue reading\" / \"Recently read\". For streaks, goals, and calendar-style progress tracking, use Activity Days.","type":"text/plain"},"url":{"path":["v1","reading-sessions"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for "Continue reading" / "Recently read". For streaks, goals, and calendar-style progress tracking, use Activity Days. -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    +
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/add-user-bookmark.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-streaks-current-streak-days.api.mdx similarity index 70% rename from docs/user_related_apis_versioned/1.0.0/add-user-bookmark.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-streaks-current-streak-days.api.mdx index 33e30742..3e5608d6 100644 --- a/docs/user_related_apis_versioned/1.0.0/add-user-bookmark.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-streaks-current-streak-days.api.mdx @@ -1,12 +1,12 @@ --- -id: add-user-bookmark -title: "Add user bookmark" -description: "Add a bookmark by details." -sidebar_label: "Add user bookmark" +id: auth-get-v-1-streaks-current-streak-days +title: "Get current streak days" +description: "Get current active streak days." +sidebar_label: "Get current streak days" hide_title: true hide_table_of_contents: true -api: {"description":"Add a bookmark by details.","tags":["Bookmarks"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["key","verseNumber","mushaf"],"additionalProperties":false,"title":"Ayah"},{"type":"object","required":["key","mushaf"],"additionalProperties":false,"title":"Surah, Juz, Or page"}]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","example":"cmmav10y500057e21hjilhplh"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5},"group":{"type":"string"},"isInDefaultCollection":{"type":"boolean","example":true}},"required":["id","createdAt","type","key","isInDefaultCollection"],"additionalProperties":false,"title":"Bookmark"}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"key":2,"type":"ayah","verseNumber":3,"isReading":true,"mushaf":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add user bookmark","description":{"content":"Add a bookmark by details.","type":"text/plain"},"url":{"path":["v1","bookmarks"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} -sidebar_class_name: "post api-method" +api: {"description":"Get current active streak days.","tags":["Streaks"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN"],"description":"The type of the streak","example":"QURAN"},"required":true,"description":"The type of the streak"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"days":{"type":"integer","description":"The number of days the current streak is active for.","example":5}},"required":["days"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"days":5}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1StreaksCurrentStreakDays","method":"get","path":"/v1/streaks/current-streak-days","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get current streak days","description":{"content":"Get current active streak days.","type":"text/plain"},"url":{"path":["v1","streaks","current-streak-days"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The type of the streak","type":"text/plain"},"key":"type","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"GET"}} +sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null displayed_sidebar: APIsVersionedSidebar @@ -21,17 +21,17 @@ import SchemaTabs from "@theme/SchemaTabs"; import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import TabItem from "@theme/TabItem"; -## Add user bookmark +## Get current streak days -Add a bookmark by details. +Get current active streak days. -
    Request Body
      anyOf
    +
    Query Parameters
    Header Parameters
    Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-streaks.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-streaks.api.mdx similarity index 72% rename from docs/user_related_apis_versioned/1.0.0/get-streaks.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-get-v-1-streaks.api.mdx index ed899092..2e2a1a02 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-streaks.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-get-v-1-streaks.api.mdx @@ -1,11 +1,11 @@ --- -id: get-streaks +id: auth-get-v-1-streaks title: "Get streaks" description: "Get user streaks." sidebar_label: "Get streaks" hide_title: true hide_table_of_contents: true -api: {"description":"Get user streaks.","tags":["Streaks"],"parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date after which any streaks would be returned (inclusive)","example":"2023-09-01"},"description":"The date after which any streaks would be returned (inclusive)"},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date before which any streaks would be returned (inclusive)","example":"2023-09-31"},"description":"The date before which any streaks would be returned (inclusive)"},{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN"],"description":"The type of the streak","example":"QURAN"},"description":"The type of the streak"},{"in":"query","name":"sortOrder","schema":{"type":"string","enum":["asc","desc"],"description":"The sorting order of `orderBy` field","example":"desc","default":"desc"},"description":"The sorting order of `orderBy` field"},{"in":"query","name":"orderBy","schema":{"type":"string","enum":["startDate","days"],"description":"Which field to order the streaks by","example":"startDate","default":"startDate"},"description":"Which field to order the streaks by"},{"in":"query","name":"status","schema":{"type":"string","enum":["ACTIVE","BROKEN"],"description":"The status of the streak.","example":"ACTIVE"},"description":"The status of the streak."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The id of the streak.","example":"cmmav127k000f7e21hy00bd6f"},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the streak.","example":"2023-09-01"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the streak.","example":"2023-09-31"},"status":{"type":"string","enum":["ACTIVE","BROKEN"],"description":"The status of the streak.","example":"ACTIVE"},"days":{"type":"integer","description":"The number of days the streak is/was active for.","example":5}},"required":["id","startDate","endDate","status","days"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/streaks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get streaks","description":{"content":"Get user streaks.","type":"text/plain"},"url":{"path":["v1","streaks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The date after which any streaks would be returned (inclusive)","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"The date before which any streaks would be returned (inclusive)","type":"text/plain"},"key":"to","value":""},{"disabled":false,"description":{"content":"The type of the streak","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The sorting order of `orderBy` field","type":"text/plain"},"key":"sortOrder","value":""},{"disabled":false,"description":{"content":"Which field to order the streaks by","type":"text/plain"},"key":"orderBy","value":""},{"disabled":false,"description":{"content":"The status of the streak.","type":"text/plain"},"key":"status","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get user streaks.","tags":["Streaks"],"parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date after which any streaks would be returned (inclusive)","example":"2023-09-01"},"description":"The date after which any streaks would be returned (inclusive)"},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date before which any streaks would be returned (inclusive)","example":"2023-09-31"},"description":"The date before which any streaks would be returned (inclusive)"},{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN"],"description":"The type of the streak","example":"QURAN"},"description":"The type of the streak"},{"in":"query","name":"sortOrder","schema":{"type":"string","enum":["asc","desc"],"description":"The sorting order of `orderBy` field","example":"desc","default":"desc"},"description":"The sorting order of `orderBy` field"},{"in":"query","name":"orderBy","schema":{"type":"string","enum":["startDate","days"],"description":"Which field to order the streaks by","example":"startDate","default":"startDate"},"description":"Which field to order the streaks by"},{"in":"query","name":"status","schema":{"type":"string","enum":["ACTIVE","BROKEN"],"description":"The status of the streak.","example":"ACTIVE"},"description":"The status of the streak."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The id of the streak.","example":"cmoa3wrr2000i7z3fe8swbujv"},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the streak.","example":"2023-09-01"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the streak.","example":"2023-09-31"},"status":{"type":"string","enum":["ACTIVE","BROKEN"],"description":"The status of the streak.","example":"ACTIVE"},"days":{"type":"integer","description":"The number of days the streak is/was active for.","example":5}},"required":["id","startDate","endDate","status","days"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wrr2000i7z3fe8swbujv","startDate":"2023-09-01","endDate":"2023-09-31","status":"ACTIVE","days":5}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Streaks","method":"get","path":"/v1/streaks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get streaks","description":{"content":"Get user streaks.","type":"text/plain"},"url":{"path":["v1","streaks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The date after which any streaks would be returned (inclusive)","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"The date before which any streaks would be returned (inclusive)","type":"text/plain"},"key":"to","value":""},{"disabled":false,"description":{"content":"The type of the streak","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The sorting order of `orderBy` field","type":"text/plain"},"key":"sortOrder","value":""},{"disabled":false,"description":{"content":"Which field to order the streaks by","type":"text/plain"},"key":"orderBy","value":""},{"disabled":false,"description":{"content":"The status of the streak.","type":"text/plain"},"key":"status","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; Get user streaks. -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    +
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/update-note-by-id.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-patch-v-1-notes-by-note-id.api.mdx similarity index 51% rename from docs/user_related_apis_versioned/1.0.0/update-note-by-id.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-patch-v-1-notes-by-note-id.api.mdx index bb678958..56c371c6 100644 --- a/docs/user_related_apis_versioned/1.0.0/update-note-by-id.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-patch-v-1-notes-by-note-id.api.mdx @@ -1,11 +1,11 @@ --- -id: update-note-by-id +id: auth-patch-v-1-notes-by-note-id title: "Update note by ID" description: "Update a note by its ID." sidebar_label: "Update note by ID" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Update a note by its ID.","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The unique identifier of the note to be retrieved or manipulated.","example":"asda12312312"},"required":true,"description":"The unique identifier of the note to be retrieved or manipulated."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"saveToQR":{"type":"boolean","description":"Indicates whether the updated note should be saved to the QuranReflect, defaults to false.","example":false,"default":false}},"required":["body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"patch","path":"/v1/notes/:noteId","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"body":"This is a sample note body.","saveToQR":false},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"}} +api: {"tags":["Notes"],"description":"Update a note by its ID.","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The unique identifier of the note to be retrieved or manipulated.","example":"asda12312312"},"required":true,"description":"The unique identifier of the note to be retrieved or manipulated."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"saveToQR":{"type":"boolean","description":"Indicates whether the updated note should be saved to the QuranReflect, defaults to false.","example":false,"default":false}},"required":["body"],"additionalProperties":false},"example":{"body":"This is a sample note body.","saveToQR":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPatchV1NotesByNoteId","method":"patch","path":"/v1/notes/{noteId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"body":"This is a sample note body.","saveToQR":false},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update note by ID","description":{"content":"Update a note by its ID.","type":"text/plain"},"url":{"path":["v1","notes",":noteId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The unique identifier of the note to be retrieved or manipulated.","type":"text/plain"},"type":"any","value":"","key":"noteId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "patch api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -27,11 +27,15 @@ import TabItem from "@theme/TabItem"; Update a note by its ID. -
    Path Parameters
    Request Body
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
    +
    Path Parameters
    Query Parameters
    Request Body
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
    Request has been handled successfully. -
    Schema
      data object
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
      attachedEntities object[]
      +
      Response Headers
      • X-Mutation-At string
        + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
      Schema
        data object
        = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
        attachedEntities object[]
        An array of attached entities associated with the note. @@ -39,7 +43,7 @@ An array of attached entities associated with the note. Additional metadata for the attached entity. -
      • ]
    +
  • ]
  • The request is missing required parameters or is invalid. @@ -55,7 +59,11 @@ Forbidden error. Can either be due to access token not being passed, having been Not Found. The resource being accessed does not exist. -
    Schema
    +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    Validation Error. The request includes one or more invalid params. Please check the request params and try again. diff --git a/docs/user_related_apis_versioned/1.0.0/add-update-activity-day.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-activity-days.api.mdx similarity index 73% rename from docs/user_related_apis_versioned/1.0.0/add-update-activity-day.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-post-v-1-activity-days.api.mdx index ed42d082..07a6205d 100644 --- a/docs/user_related_apis_versioned/1.0.0/add-update-activity-day.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-activity-days.api.mdx @@ -1,11 +1,11 @@ --- -id: add-update-activity-day +id: auth-post-v-1-activity-days title: "Add/update activity day" description: "Create or update a daily activity record (one per date per type). Activity Days power streaks, goals, and calendar-style progress." sidebar_label: "Add/update activity day" hide_title: true hide_table_of_contents: true -api: {"description":"Create or update a daily activity record (one per date per type). Activity Days power streaks, goals, and calendar-style progress.\n\nFor `type=QURAN`, provide `seconds`, `ranges`, and `mushafId`. You can optionally pass `date` (YYYY-MM-DD) to backfill activity for a past day (for example when the user manually adds time). This endpoint enqueues progress updates and uses the `x-timezone` header to interpret day boundaries and calculate streaks accurately.","tags":["Activity Days"],"parameters":[{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day, can be today or a past date. If not passed, default to today","example":"2023-09-01"},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"}},"required":["type"],"additionalProperties":false,"oneOf":[{"type":"object","required":["seconds","ranges","mushafId"],"additionalProperties":false,"title":"QURAN"}]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/activity-days","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"date":"2023-09-01","type":"QURAN","seconds":5,"ranges":["1:5-1:10"],"mushafId":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add/update activity day","description":{"content":"Create or update a daily activity record (one per date per type). Activity Days power streaks, goals, and calendar-style progress.\n\nFor `type=QURAN`, provide `seconds`, `ranges`, and `mushafId`. You can optionally pass `date` (YYYY-MM-DD) to backfill activity for a past day (for example when the user manually adds time). This endpoint enqueues progress updates and uses the `x-timezone` header to interpret day boundaries and calculate streaks accurately.","type":"text/plain"},"url":{"path":["v1","activity-days"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Create or update a daily activity record (one per date per type). Activity Days power streaks, goals, and calendar-style progress.\n\nFor `type=QURAN`, provide `seconds`, `ranges`, and `mushafId`. You can optionally pass `date` (YYYY-MM-DD) to backfill activity for a past day (for example when the user manually adds time). This endpoint enqueues progress updates and uses the `x-timezone` header to interpret day boundaries and calculate streaks accurately.","tags":["Activity Days"],"parameters":[{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day, can be today or a past date. If not passed, default to today","example":"2023-09-01"},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"}},"required":["type"],"additionalProperties":false,"oneOf":[{"type":"object","required":["seconds","ranges","mushafId"],"additionalProperties":false,"title":"QURAN"}]},"example":{"seconds":5,"ranges":["1:5-1:10"],"mushafId":4}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"}},"additionalProperties":false},"example":{"success":true,"data":{}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1ActivityDays","method":"post","path":"/v1/activity-days","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"date":"2023-09-01","type":"QURAN","seconds":5,"ranges":["1:5-1:10"],"mushafId":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add/update activity day","description":{"content":"Create or update a daily activity record (one per date per type). Activity Days power streaks, goals, and calendar-style progress.\n\nFor `type=QURAN`, provide `seconds`, `ranges`, and `mushafId`. You can optionally pass `date` (YYYY-MM-DD) to backfill activity for a past day (for example when the user manually adds time). This endpoint enqueues progress updates and uses the `x-timezone` header to interpret day boundaries and calculate streaks accurately.","type":"text/plain"},"url":{"path":["v1","activity-days"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -33,7 +33,7 @@ For `type=QURAN`, provide `seconds`, `ranges`, and `mushafId`. You can optionall Request has been handled successfully. -
    Schema
    +
    Schema
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-bookmarks.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-bookmarks.api.mdx new file mode 100644 index 00000000..bda0f6cb --- /dev/null +++ b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-bookmarks.api.mdx @@ -0,0 +1,82 @@ +--- +id: auth-post-v-1-bookmarks +title: "Add user bookmark" +description: "Add or update a bookmark by details. Omit `isReading` to create or update a regular standalone bookmark. Set `isReading=true` to set the user's singleton reading bookmark. Set `isReading=false` to unset the current reading bookmark; in that case the response `data` can be `null` if no reading bookmark was set. For Quran.com-style saved or favorite ayah bookmarks, use `POST /v1/collections/__default__/bookmarks`." +sidebar_label: "Add user bookmark" +hide_title: true +hide_table_of_contents: true +api: {"description":"Add or update a bookmark by details. Omit `isReading` to create or update a regular standalone bookmark. Set `isReading=true` to set the user's singleton reading bookmark. Set `isReading=false` to unset the current reading bookmark; in that case the response `data` can be `null` if no reading bookmark was set. For Quran.com-style saved or favorite ayah bookmarks, use `POST /v1/collections/__default__/bookmarks`.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["key","type","verseNumber"],"additionalProperties":false,"title":"Ayah"},{"type":"object","required":["key","type"],"additionalProperties":false,"title":"Surah, Juz, Or page"}]},"example":{"key":2,"type":"ayah","verseNumber":3,"isReading":true,"mushafId":4,"mushaf":4}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqim00057z3fe30y0b3e"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"group":{"type":"string","example":"verses_6236"},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false},"collectionsCount":{"type":"integer","description":"Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.","example":1}},"required":["id","createdAt","type","key","group","isInDefaultCollection","isReading"],"additionalProperties":false,"nullable":true,"title":"NullableBookmark"}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Bookmarks","method":"post","path":"/v1/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"key":2,"type":"ayah","verseNumber":3,"isReading":true,"mushafId":4,"mushaf":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add user bookmark","description":{"content":"Add or update a bookmark by details. Omit `isReading` to create or update a regular standalone bookmark. Set `isReading=true` to set the user's singleton reading bookmark. Set `isReading=false` to unset the current reading bookmark; in that case the response `data` can be `null` if no reading bookmark was set. For Quran.com-style saved or favorite ayah bookmarks, use `POST /v1/collections/__default__/bookmarks`.","type":"text/plain"},"url":{"path":["v1","bookmarks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "post api-method" +info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsVersionedSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Add user bookmark + + + +Add or update a bookmark by details. Omit `isReading` to create or update a regular standalone bookmark. Set `isReading=true` to set the user's singleton reading bookmark. Set `isReading=false` to unset the current reading bookmark; in that case the response `data` can be `null` if no reading bookmark was set. For Quran.com-style saved or favorite ayah bookmarks, use `POST /v1/collections/__default__/bookmarks`. + +
    Query Parameters
    Request Body
      oneOf
    + +Request has been handled successfully. + +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object nullable
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    diff --git a/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-collections-by-collection-id-bookmarks.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-collections-by-collection-id-bookmarks.api.mdx new file mode 100644 index 00000000..9ce43f60 --- /dev/null +++ b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-collections-by-collection-id-bookmarks.api.mdx @@ -0,0 +1,83 @@ +--- +id: auth-post-v-1-collections-by-collection-id-bookmarks +title: "Add collection Bookmark" +description: "Add a bookmark to a collection. Use `collectionId='__default__'` to add an ayah bookmark to the virtual Favorites collection used by Quran.com." +sidebar_label: "Add collection Bookmark" +hide_title: true +hide_table_of_contents: true +api: {"description":"Add a bookmark to a collection. Use `collectionId=\"__default__\"` to add an ayah bookmark to the virtual Favorites collection used by Quran.com.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The collection ID. Use `__default__` to add an ayah bookmark to the virtual Favorites collection used by Quran.com.","example":"cmoa3wqvw00097z3f9tk87gga"},"required":true,"description":"The collection ID. Use `__default__` to add an ayah bookmark to the virtual Favorites collection used by Quran.com."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["key","verseNumber"],"additionalProperties":false,"title":"Ayah"},{"type":"object","required":["key"],"additionalProperties":false,"title":"Surah, Juz, Or Page"}]},"example":{"key":2,"type":"ayah","verseNumber":3,"mushafId":4,"mushaf":4}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection bookmark added"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"collection bookmark added"}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1CollectionsByCollectionIdBookmarks","method":"post","path":"/v1/collections/{collectionId}/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"key":2,"type":"ayah","verseNumber":3,"mushafId":4,"mushaf":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add collection Bookmark","description":{"content":"Add a bookmark to a collection. Use `collectionId=\"__default__\"` to add an ayah bookmark to the virtual Favorites collection used by Quran.com.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId","bookmarks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The collection ID. Use `__default__` to add an ayah bookmark to the virtual Favorites collection used by Quran.com.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "post api-method" +info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsVersionedSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Add collection Bookmark + + + +Add a bookmark to a collection. Use `collectionId="__default__"` to add an ayah bookmark to the virtual Favorites collection used by Quran.com. + +
    Path Parameters
    Query Parameters
    Request Body
      oneOf
    + +Request has been handled successfully. + +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    + \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/update-collection.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-collections-by-collection-id.api.mdx similarity index 53% rename from docs/user_related_apis_versioned/1.0.0/update-collection.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-post-v-1-collections-by-collection-id.api.mdx index 100970fc..1db58771 100644 --- a/docs/user_related_apis_versioned/1.0.0/update-collection.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-collections-by-collection-id.api.mdx @@ -1,11 +1,11 @@ --- -id: update-collection +id: auth-post-v-1-collections-by-collection-id title: "Update collection" description: "Update an existing collection." sidebar_label: "Update collection" hide_title: true hide_table_of_contents: true -api: {"description":"Update an existing collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be updated."},"required":true,"description":"The Id of the collection to be updated."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the collection to be updated."}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection renamed"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/collections/{collectionId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"string"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update collection","description":{"content":"Update an existing collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The Id of the collection to be updated.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Update an existing collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be updated."},"required":true,"description":"The Id of the collection to be updated."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the collection to be updated."}},"required":["name"],"additionalProperties":false},"example":{"name":"string"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection renamed"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"collection renamed"}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1CollectionsByCollectionId","method":"post","path":"/v1/collections/{collectionId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"string"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update collection","description":{"content":"Update an existing collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The Id of the collection to be updated.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -27,11 +27,15 @@ import TabItem from "@theme/TabItem"; Update an existing collection. -
    Path Parameters
    Request Body
    +
    Path Parameters
    Query Parameters
    Request Body
    Request has been handled successfully. -
    Schema
      data object
    +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -47,7 +51,11 @@ Forbidden error. Can either be due to access token not being passed, having been Not Found. The resource being accessed does not exist. -
    Schema
    +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    Validation Error. The request includes one or more invalid params. Please check the request params and try again. diff --git a/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-collections.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-collections.api.mdx new file mode 100644 index 00000000..01566e4b --- /dev/null +++ b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-collections.api.mdx @@ -0,0 +1,83 @@ +--- +id: auth-post-v-1-collections +title: "Add collection" +description: "Create a new collection under user's account." +sidebar_label: "Add collection" +hide_title: true +hide_table_of_contents: true +api: {"description":"Create a new collection under user's account.","tags":["Collections"],"parameters":[{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the new collection to be created.","example":"Woman in Quran"}},"required":["name"],"additionalProperties":false},"example":{"name":"Woman in Quran"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqsk00087z3f5hp42h08"},"name":{"type":"string","example":"Woman in Quran"},"slug":{"type":"string","nullable":true,"example":"woman-in-quran"},"isPrivate":{"type":"boolean","example":false},"isDefault":{"type":"boolean","example":false},"updatedAt":{"type":"string","format":"date-time","nullable":true,"example":"2023-01-21T07:28:13.023Z"},"url":{"type":"string","nullable":true,"example":"cmnkcpmvc000814v9f5jtbsxf"},"bookmarksCount":{"type":"integer","example":1},"resourcesCount":{"type":"integer","example":1},"count":{"type":"integer","example":1}},"required":["id","name","slug","isPrivate","isDefault","updatedAt"],"additionalProperties":false,"title":"Collection"}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wqsk00087z3f5hp42h08","name":"Woman in Quran","slug":"woman-in-quran","isPrivate":false,"isDefault":false,"updatedAt":"2023-01-21T07:28:13.023Z","url":"cmnkcpmvc000814v9f5jtbsxf","bookmarksCount":1,"resourcesCount":1,"count":1}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Collections","method":"post","path":"/v1/collections","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"Woman in Quran"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add collection","description":{"content":"Create a new collection under user's account.","type":"text/plain"},"url":{"path":["v1","collections"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "post api-method" +info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsVersionedSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Add collection + + + +Create a new collection under user's account. + +
    Query Parameters
    Request Body
    + +Request has been handled successfully. + +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    + \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/create-a-goal.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-goals.api.mdx similarity index 72% rename from docs/user_related_apis_versioned/1.0.0/create-a-goal.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-post-v-1-goals.api.mdx index a36aac24..81d89fac 100644 --- a/docs/user_related_apis_versioned/1.0.0/create-a-goal.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-goals.api.mdx @@ -1,11 +1,11 @@ --- -id: create-a-goal +id: auth-post-v-1-goals title: "Create a goal" description: "Create a goal" sidebar_label: "Create a goal" hide_title: true hide_table_of_contents: true -api: {"description":"Create a goal","tags":["Goals"],"parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"amount":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"duration":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"category":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"}},"required":["type","amount","category"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The id of the goal.","example":"cmmav11g9000d7e219d05gas2"}},"required":["id"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/goals","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":0,"category":"QURAN"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a goal","description":{"content":"Create a goal","type":"text/plain"},"url":{"path":["v1","goals"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Create a goal","tags":["Goals"],"parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"amount":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"duration":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"category":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"}},"required":["type","amount","category"],"additionalProperties":false},"example":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":1,"category":"QURAN"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The id of the goal.","example":"cmoa3wr5c000g7z3fgv0y0rvo"}},"required":["id"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wr5c000g7z3fgv0y0rvo"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Goals","method":"post","path":"/v1/goals","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":0,"category":"QURAN"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a goal","description":{"content":"Create a goal","type":"text/plain"},"url":{"path":["v1","goals"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -43,7 +43,7 @@ The amount of the goal. Depending on the goal type, the amount value and format Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/get-bookmark.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-notes-by-note-id-publish.api.mdx similarity index 55% rename from docs/user_related_apis_versioned/1.0.0/get-bookmark.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-post-v-1-notes-by-note-id-publish.api.mdx index d0cdb5cc..fd4b5ef0 100644 --- a/docs/user_related_apis_versioned/1.0.0/get-bookmark.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-notes-by-note-id-publish.api.mdx @@ -1,12 +1,12 @@ --- -id: get-bookmark -title: "Get bookmark" -description: "Get a bookmark by details" -sidebar_label: "Get bookmark" +id: auth-post-v-1-notes-by-note-id-publish +title: "Publish note" +description: "Publish a note to QR." +sidebar_label: "Publish note" hide_title: true hide_table_of_contents: true -api: {"description":"Get a bookmark by details","tags":["Bookmarks"],"parameters":[{"in":"query","name":"verseNumber","schema":{"type":"integer","description":"The Ayah number of the bookmark"},"required":false,"description":"The Ayah number of the bookmark"},{"in":"query","name":"isReading","schema":{"type":"boolean","description":"Whether to fetch the reading bookmark"},"required":false,"description":"Whether to fetch the reading bookmark"},{"in":"query","name":"key","schema":{"type":"integer","oneOf":[{},{"x-required":true}],"description":"Surah, Juz or page number.","example":2},"required":false,"description":"Surah, Juz or page number."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"oneOf":[{},{"x-required":true}],"description":"The bookmark type.","default":"ayah"},"required":false,"description":"The bookmark type."},{"in":"query","name":"mushaf","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","example":"cmmav10y500057e21hjilhplh"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5},"group":{"type":"string"},"isInDefaultCollection":{"type":"boolean","example":true}},"required":["id","createdAt","type","key","isInDefaultCollection"],"additionalProperties":false,"title":"Bookmark"}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/bookmarks/bookmark","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get bookmark","description":{"content":"Get a bookmark by details","type":"text/plain"},"url":{"path":["v1","bookmarks","bookmark"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The Ayah number of the bookmark","type":"text/plain"},"key":"verseNumber","value":""},{"disabled":false,"description":{"content":"Whether to fetch the reading bookmark","type":"text/plain"},"key":"isReading","value":""},{"disabled":false,"description":{"content":"Surah, Juz or page number.","type":"text/plain"},"key":"key","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushaf","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} -sidebar_class_name: "get api-method" +api: {"tags":["Notes"],"description":"Publish a note to QR.","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The unique identifier of the note to be retrieved or manipulated.","example":"asda12312312"},"required":true,"description":"The unique identifier of the note to be retrieved or manipulated."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:112-2:115"]}},"required":["body"],"additionalProperties":false},"example":{"body":"This is a sample note body.","ranges":["2:112-2:115"]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"success":{"type":"boolean"},"postId":{"type":"number","format":"float"}},"required":["success"],"additionalProperties":false,"description":"Response object indicating the success of the note publishing operation and the optional post ID if successful.","example":{"success":true,"postId":123}}},"additionalProperties":false},"example":{"success":true,"data":{"success":true,"postId":123}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1NotesByNoteIdPublish","method":"post","path":"/v1/notes/{noteId}/publish","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"body":"This is a sample note body.","ranges":["2:112-2:115"]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Publish note","description":{"content":"Publish a note to QR.","type":"text/plain"},"url":{"path":["v1","notes",":noteId","publish"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The unique identifier of the note to be retrieved or manipulated.","type":"text/plain"},"type":"any","value":"","key":"noteId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null displayed_sidebar: APIsVersionedSidebar @@ -21,17 +21,25 @@ import SchemaTabs from "@theme/SchemaTabs"; import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import TabItem from "@theme/TabItem"; -## Get bookmark +## Publish note -Get a bookmark by details +Publish a note to QR. -
    Query Parameters
    +
    Path Parameters
    Query Parameters
    Request Body
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
    Request has been handled successfully. -
    Schema
      data object
    +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
      + +Response object indicating the success of the note publishing operation and the optional post ID if successful. + +
    The request is missing required parameters or is invalid. @@ -47,7 +55,11 @@ Forbidden error. Can either be due to access token not being passed, having been Not Found. The resource being accessed does not exist. -
    Schema
    +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    Validation Error. The request includes one or more invalid params. Please check the request params and try again. diff --git a/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-notes.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-notes.api.mdx new file mode 100644 index 00000000..d96c84d1 --- /dev/null +++ b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-notes.api.mdx @@ -0,0 +1,95 @@ +--- +id: auth-post-v-1-notes +title: "Add note" +description: "Add a new note." +sidebar_label: "Add note" +hide_title: true +hide_table_of_contents: true +api: {"tags":["Notes"],"description":"Add a new note.","parameters":[{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"saveToQR":{"type":"boolean","description":"Indicates whether the note should be saved to the QuranReflect.","example":true},"attachedEntity":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["body","saveToQR"],"additionalProperties":false},"example":{"body":"This is a sample note body.","saveToQR":true,"attachedEntity":{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}},"ranges":["2:255-2:257"]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Notes","method":"post","path":"/v1/notes","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"body":"This is a sample note body.","saveToQR":true,"attachedEntity":{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}},"ranges":["2:255-2:257"]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add note","description":{"content":"Add a new note.","type":"text/plain"},"url":{"path":["v1","notes"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "post api-method" +info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsVersionedSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Add note + + + +Add a new note. + +
    Query Parameters
    Request Body
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
      attachedEntity object
      entityMetadata object
      + +Additional metadata for the attached entity. + +
    + +Request has been handled successfully. + +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
      attachedEntities object[]
      + +An array of attached entities associated with the note. + +
    • Array [
    • entityMetadata object
      + +Additional metadata for the attached entity. + +
    • ]
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    + \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/bulk-add-or-update-preferences.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-preferences-bulk.api.mdx similarity index 77% rename from docs/user_related_apis_versioned/1.0.0/bulk-add-or-update-preferences.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-post-v-1-preferences-bulk.api.mdx index af89f550..91aa573c 100644 --- a/docs/user_related_apis_versioned/1.0.0/bulk-add-or-update-preferences.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-preferences-bulk.api.mdx @@ -1,11 +1,11 @@ --- -id: bulk-add-or-update-preferences +id: auth-post-v-1-preferences-bulk title: "Bulk add or update preferences" description: "Add or update one or more user preferences groups like favorite Tafsirs and translations." sidebar_label: "Bulk add or update preferences" hide_title: true hide_table_of_contents: true -api: {"description":"Add or update one or more user preferences groups like favorite Tafsirs and translations.","tags":["Preferences"],"parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"theme":{"type":"object","properties":{"type":{"type":"string","enum":["auto","light","sepia","dark"],"example":"auto"}},"additionalProperties":false},"reading":{"type":"object","properties":{"readingPreference":{"type":"string","enum":["translation","reading","readingTranslation"],"example":"translation"},"selectedWordByWordLocale":{"type":"string","enum":["en","ur","id","bn","tr","fa","ru","hi","de","ta","inh","fr","sq","dv","zh","sd","ml"],"example":"en"},"wordClickFunctionality":{"type":"string","enum":["play-audio","no-audio"],"example":"play-audio"},"isReadingByRevelationOrder":{"type":"boolean","example":true},"wordByWordContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordDisplay":{"type":"array","items":{"type":"string","enum":["tooltip","inline"]},"example":["tooltip"]},"wordByWordTooltipContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordInlineContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":[]},"selectedReadingTranslation":{"type":"string","minLength":1,"maxLength":255,"example":"131"},"selectedReflectionLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1},"selectedLessonLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}},"required":["readingPreference","selectedWordByWordLocale","wordClickFunctionality","selectedReadingTranslation"],"additionalProperties":false},"quranReaderStyles":{"type":"object","properties":{"tafsirFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranTextFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"translationFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"wordByWordFontScale":{"type":"integer","minimum":1,"maximum":6,"example":3},"reflectionFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"qnaFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"lessonFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"surahInfoFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"hadithFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"layersFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranFont":{"type":"string","enum":["code_v1","code_v2","text_uthmani","text_indopak","qpc_uthmani_hafs","tajweed","tajweed_v4"],"example":"code_v1"},"mushafLines":{"type":"string","enum":["15_lines","16_lines"],"example":"16_lines"},"showTajweedRules":{"type":"boolean","example":true}},"required":["tafsirFontScale","quranTextFontScale","translationFontScale","wordByWordFontScale","reflectionFontScale","qnaFontScale","lessonFontScale","surahInfoFontScale","hadithFontScale","layersFontScale"],"additionalProperties":false},"translations":{"type":"object","properties":{"selectedTranslations":{"type":"array","items":{"type":"integer","example":131}}},"additionalProperties":false},"tafsirs":{"type":"object","properties":{"selectedTafsirs":{"type":"array","items":{"type":"string","example":"en-tafisr-ibn-kathir"}}},"additionalProperties":false},"audio":{"type":"object","properties":{"reciter":{"type":"integer","example":7},"playbackRate":{"type":"integer","enum":[0.25,0.5,0.75,1,1.25,1.5,1.75,2],"example":1},"showTooltipWhenPlayingAudio":{"type":"boolean","example":true},"enableAutoScrolling":{"type":"boolean","example":true}},"required":["reciter"],"additionalProperties":false},"language":{"type":"object","properties":{"language":{"type":"string","enum":["en","ar","bn","fa","fr","id","it","nl","pt","ru","sq","th","tr","ur","zh","ms","es","sw","vi"]}},"additionalProperties":false},"userHasCustomised":{"type":"object","properties":{"userHasCustomised":{"type":"boolean","example":false}},"required":["userHasCustomised"],"additionalProperties":false}},"additionalProperties":false,"title":"Preference"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["preferences updated"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/preferences/bulk","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"theme":{"type":"auto"},"reading":{"readingPreference":"translation","selectedWordByWordLocale":"en","wordClickFunctionality":"play-audio","isReadingByRevelationOrder":true,"wordByWordContentType":["translation"],"wordByWordDisplay":["tooltip"],"wordByWordTooltipContentType":["translation"],"wordByWordInlineContentType":[],"selectedReadingTranslation":"131","selectedReflectionLanguages":["string"],"selectedLessonLanguages":["string"]},"quranReaderStyles":{"tafsirFontScale":3,"quranTextFontScale":3,"translationFontScale":3,"wordByWordFontScale":3,"reflectionFontScale":3,"qnaFontScale":3,"lessonFontScale":3,"surahInfoFontScale":3,"hadithFontScale":3,"layersFontScale":3,"quranFont":"code_v1","mushafLines":"16_lines","showTajweedRules":true},"translations":{"selectedTranslations":[131]},"tafsirs":{"selectedTafsirs":["en-tafisr-ibn-kathir"]},"audio":{"reciter":7,"playbackRate":1,"showTooltipWhenPlayingAudio":true,"enableAutoScrolling":true},"language":{"language":"en"},"userHasCustomised":{"userHasCustomised":false}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Bulk add or update preferences","description":{"content":"Add or update one or more user preferences groups like favorite Tafsirs and translations.","type":"text/plain"},"url":{"path":["v1","preferences","bulk"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Add or update one or more user preferences groups like favorite Tafsirs and translations.","tags":["Preferences"],"parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"theme":{"type":"object","properties":{"type":{"type":"string","enum":["auto","light","sepia","dark"],"example":"auto"}},"additionalProperties":false},"reading":{"type":"object","properties":{"readingPreference":{"type":"string","enum":["translation","reading","readingTranslation"],"example":"translation"},"selectedWordByWordLocale":{"type":"string","enum":["en","ur","id","bn","tr","fa","ru","hi","de","ta","inh","fr","sq","dv","zh","sd","ml"],"example":"en"},"wordClickFunctionality":{"type":"string","enum":["play-audio","no-audio"],"example":"play-audio"},"isReadingByRevelationOrder":{"type":"boolean","example":true},"wordByWordContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordDisplay":{"type":"array","items":{"type":"string","enum":["tooltip","inline"]},"example":["tooltip"]},"wordByWordTooltipContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordInlineContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":[]},"selectedReadingTranslation":{"type":"string","minLength":1,"maxLength":255,"example":"131"},"selectedReflectionLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1},"selectedLessonLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}},"required":["readingPreference","selectedWordByWordLocale","wordClickFunctionality","selectedReadingTranslation"],"additionalProperties":false},"quranReaderStyles":{"type":"object","properties":{"tafsirFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranTextFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"translationFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"wordByWordFontScale":{"type":"integer","minimum":1,"maximum":6,"example":3},"reflectionFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"qnaFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"lessonFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"surahInfoFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"hadithFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"layersFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranFont":{"type":"string","enum":["code_v1","code_v2","text_uthmani","text_indopak","qpc_uthmani_hafs","tajweed","tajweed_v4"],"example":"code_v1"},"mushafLines":{"type":"string","enum":["15_lines","16_lines"],"example":"16_lines"},"showTajweedRules":{"type":"boolean","example":true}},"required":["tafsirFontScale","quranTextFontScale","translationFontScale","wordByWordFontScale","reflectionFontScale","qnaFontScale","lessonFontScale","surahInfoFontScale","hadithFontScale","layersFontScale"],"additionalProperties":false},"translations":{"type":"object","properties":{"selectedTranslations":{"type":"array","items":{"type":"integer","example":131}}},"additionalProperties":false},"tafsirs":{"type":"object","properties":{"selectedTafsirs":{"type":"array","items":{"type":"string","example":"en-tafisr-ibn-kathir"}}},"additionalProperties":false},"audio":{"type":"object","properties":{"reciter":{"type":"integer","example":7},"playbackRate":{"type":"integer","enum":[0.25,0.5,0.75,1,1.25,1.5,1.75,2],"example":1},"showTooltipWhenPlayingAudio":{"type":"boolean","example":true},"enableAutoScrolling":{"type":"boolean","example":true}},"required":["reciter"],"additionalProperties":false},"language":{"type":"object","properties":{"language":{"type":"string","enum":["en","ar","bn","fa","fr","id","it","nl","pt","ru","sq","th","tr","ur","zh","ms","es","sw","vi"]}},"additionalProperties":false},"userHasCustomised":{"type":"object","properties":{"userHasCustomised":{"type":"boolean","example":false}},"required":["userHasCustomised"],"additionalProperties":false}},"additionalProperties":false,"title":"Preference"},"example":{"theme":{"type":"auto"},"reading":{"readingPreference":"translation","selectedWordByWordLocale":"en","wordClickFunctionality":"play-audio","isReadingByRevelationOrder":true,"wordByWordContentType":["translation"],"wordByWordDisplay":["tooltip"],"wordByWordTooltipContentType":["translation"],"wordByWordInlineContentType":[],"selectedReadingTranslation":"131","selectedReflectionLanguages":["string"],"selectedLessonLanguages":["string"]},"quranReaderStyles":{"tafsirFontScale":3,"quranTextFontScale":3,"translationFontScale":3,"wordByWordFontScale":3,"reflectionFontScale":3,"qnaFontScale":3,"lessonFontScale":3,"surahInfoFontScale":3,"hadithFontScale":3,"layersFontScale":3,"quranFont":"code_v1","mushafLines":"16_lines","showTajweedRules":true},"translations":{"selectedTranslations":[131]},"tafsirs":{"selectedTafsirs":["en-tafisr-ibn-kathir"]},"audio":{"reciter":7,"playbackRate":1,"showTooltipWhenPlayingAudio":true,"enableAutoScrolling":true},"language":{"language":"en"},"userHasCustomised":{"userHasCustomised":false}}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["preferences updated"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"preferences updated"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1PreferencesBulk","method":"post","path":"/v1/preferences/bulk","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"theme":{"type":"auto"},"reading":{"readingPreference":"translation","selectedWordByWordLocale":"en","wordClickFunctionality":"play-audio","isReadingByRevelationOrder":true,"wordByWordContentType":["translation"],"wordByWordDisplay":["tooltip"],"wordByWordTooltipContentType":["translation"],"wordByWordInlineContentType":[],"selectedReadingTranslation":"131","selectedReflectionLanguages":["string"],"selectedLessonLanguages":["string"]},"quranReaderStyles":{"tafsirFontScale":3,"quranTextFontScale":3,"translationFontScale":3,"wordByWordFontScale":3,"reflectionFontScale":3,"qnaFontScale":3,"lessonFontScale":3,"surahInfoFontScale":3,"hadithFontScale":3,"layersFontScale":3,"quranFont":"code_v1","mushafLines":"16_lines","showTajweedRules":true},"translations":{"selectedTranslations":[131]},"tafsirs":{"selectedTafsirs":["en-tafisr-ibn-kathir"]},"audio":{"reciter":7,"playbackRate":1,"showTooltipWhenPlayingAudio":true,"enableAutoScrolling":true},"language":{"language":"en"},"userHasCustomised":{"userHasCustomised":false}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Bulk add or update preferences","description":{"content":"Add or update one or more user preferences groups like favorite Tafsirs and translations.","type":"text/plain"},"url":{"path":["v1","preferences","bulk"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Add or update one or more user preferences groups like favorite Tafsirs and tran Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/add-or-update-preference.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-preferences.api.mdx similarity index 79% rename from docs/user_related_apis_versioned/1.0.0/add-or-update-preference.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-post-v-1-preferences.api.mdx index b908c137..94622e1b 100644 --- a/docs/user_related_apis_versioned/1.0.0/add-or-update-preference.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-preferences.api.mdx @@ -1,11 +1,11 @@ --- -id: add-or-update-preference +id: auth-post-v-1-preferences title: "Add or update preference" description: "Add or update one user preferences group like favorite Tafsirs or translations." sidebar_label: "Add or update preference" hide_title: true hide_table_of_contents: true -api: {"description":"Add or update one user preferences group like favorite Tafsirs or translations.","tags":["Preferences"],"parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"group":{"type":"string","enum":["tafsirs","translations","audio","theme","quranReaderStyles","reading","language","userHasCustomised"],"description":"The preference group to be added or updated.","example":"tafsirs"},"key":{"type":"string","description":"The preference key to be added or updated.","example":"selectedTafsirs"},"value":{"description":"The preference value to be added or updated.","example":"[\"en-tafisr-ibn-kathir\"]"}},"required":["group","key","value"],"additionalProperties":false,"anyOf":[{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["key"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["preference updated"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/preferences","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"group":"tafsirs","key":"selectedTafsirs","value":"[\"en-tafisr-ibn-kathir\"]"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add or update preference","description":{"content":"Add or update one user preferences group like favorite Tafsirs or translations.","type":"text/plain"},"url":{"path":["v1","preferences"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Add or update one user preferences group like favorite Tafsirs or translations.","tags":["Preferences"],"parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"group":{"type":"string","enum":["tafsirs","translations","audio","theme","quranReaderStyles","reading","language","userHasCustomised"],"description":"The preference group to be added or updated.","example":"tafsirs"},"key":{"type":"string","description":"The preference key to be added or updated.","example":"selectedTafsirs"},"value":{"description":"The preference value to be added or updated.","example":"[\"en-tafisr-ibn-kathir\"]"}},"required":["group","key","value"],"additionalProperties":false,"oneOf":[{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["key"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false}]},"example":{"key":"type"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["preference updated"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"preference updated"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Preferences","method":"post","path":"/v1/preferences","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"group":"tafsirs","key":"selectedTafsirs","value":"[\"en-tafisr-ibn-kathir\"]"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add or update preference","description":{"content":"Add or update one user preferences group like favorite Tafsirs or translations.","type":"text/plain"},"url":{"path":["v1","preferences"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; Add or update one user preferences group like favorite Tafsirs or translations. -
    Query Parameters
    Request Body
      anyOf= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 6`"} schema={{"type":"integer","minimum":1,"maximum":6,"example":3}}>= 1`"} schema={{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}}>
    +
    Query Parameters
    Request Body
      oneOf= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 6`"} schema={{"type":"integer","minimum":1,"maximum":6,"example":3}}>= 1`"} schema={{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}}>
    Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/add-or-update-user-reading-session.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-reading-sessions.api.mdx similarity index 67% rename from docs/user_related_apis_versioned/1.0.0/add-or-update-user-reading-session.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-post-v-1-reading-sessions.api.mdx index 1f7ed151..2ccde9d0 100644 --- a/docs/user_related_apis_versioned/1.0.0/add-or-update-user-reading-session.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-post-v-1-reading-sessions.api.mdx @@ -1,11 +1,11 @@ --- -id: add-or-update-user-reading-session +id: auth-post-v-1-reading-sessions title: "Add or update user reading session" description: "Track the user's most recent reading location (Surah/Ayah) for 'Continue reading' / 'Recently read' UX." sidebar_label: "Add or update user reading session" hide_title: true hide_table_of_contents: true -api: {"description":"Track the user's most recent reading location (Surah/Ayah) for \"Continue reading\" / \"Recently read\" UX.\n\nA new reading session will be created if the user does not have an existing one in the past 20 minutes; otherwise, the existing reading session will be updated with the latest read Ayah.\n\nFor streaks, goals, and calendar-style progress tracking, use [Activity Days](/docs/user_related_apis_versioned/add-update-activity-day) instead.","tags":["Reading Sessions"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"chapterNumber":{"type":"integer","minimum":1,"description":"The Surah number to be added to reading session.","example":1},"verseNumber":{"type":"integer","minimum":1,"description":"The Ayah number to be added to reading session.","example":1}},"required":["chapterNumber","verseNumber"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"type":"string","enum":["reading session created","reading session updated"],"example":"reading session created"}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/reading-sessions","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"chapterNumber":1,"verseNumber":1},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add or update user reading session","description":{"content":"Track the user's most recent reading location (Surah/Ayah) for \"Continue reading\" / \"Recently read\" UX.\n\nA new reading session will be created if the user does not have an existing one in the past 20 minutes; otherwise, the existing reading session will be updated with the latest read Ayah.\n\nFor streaks, goals, and calendar-style progress tracking, use [Activity Days](/docs/user_related_apis_versioned/add-update-activity-day) instead.","type":"text/plain"},"url":{"path":["v1","reading-sessions"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Track the user's most recent reading location (Surah/Ayah) for \"Continue reading\" / \"Recently read\" UX.\n\nA new reading session will be created if the user does not have an existing one in the past 20 minutes; otherwise, the existing reading session will be updated with the latest read Ayah.\n\nFor streaks, goals, and calendar-style progress tracking, see [Reading Sessions vs Activity Days](/docs/user-related-apis/reading-sessions-vs-activity-days).","tags":["Reading Sessions"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"chapterNumber":{"type":"integer","minimum":1,"description":"The Surah number to be added to reading session.","example":1},"verseNumber":{"type":"integer","minimum":1,"description":"The Ayah number to be added to reading session.","example":1}},"required":["chapterNumber","verseNumber"],"additionalProperties":false},"example":{"chapterNumber":1,"verseNumber":1}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"type":"string","enum":["reading session created","reading session updated"],"example":"reading session created"}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"reading session created"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1ReadingSessions","method":"post","path":"/v1/reading-sessions","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"chapterNumber":1,"verseNumber":1},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add or update user reading session","description":{"content":"Track the user's most recent reading location (Surah/Ayah) for \"Continue reading\" / \"Recently read\" UX.\n\nA new reading session will be created if the user does not have an existing one in the past 20 minutes; otherwise, the existing reading session will be updated with the latest read Ayah.\n\nFor streaks, goals, and calendar-style progress tracking, see [Reading Sessions vs Activity Days](/docs/user-related-apis/reading-sessions-vs-activity-days).","type":"text/plain"},"url":{"path":["v1","reading-sessions"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -29,13 +29,13 @@ Track the user's most recent reading location (Surah/Ayah) for "Continue reading A new reading session will be created if the user does not have an existing one in the past 20 minutes; otherwise, the existing reading session will be updated with the latest read Ayah. -For streaks, goals, and calendar-style progress tracking, use [Activity Days](/docs/user_related_apis_versioned/add-update-activity-day) instead. +For streaks, goals, and calendar-style progress tracking, see [Reading Sessions vs Activity Days](/docs/user-related-apis/reading-sessions-vs-activity-days).
    Request Body
      = 1`"} schema={{"type":"integer","minimum":1,"description":"The Surah number to be added to reading session.","example":1}}>= 1`"} schema={{"type":"integer","minimum":1,"description":"The Ayah number to be added to reading session.","example":1}}>
    Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -76,4 +76,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/update-a-goal.api.mdx b/docs/user_related_apis_versioned/1.0.0/auth-put-v-1-goals-by-id.api.mdx similarity index 73% rename from docs/user_related_apis_versioned/1.0.0/update-a-goal.api.mdx rename to docs/user_related_apis_versioned/1.0.0/auth-put-v-1-goals-by-id.api.mdx index ab33dfc7..c635e516 100644 --- a/docs/user_related_apis_versioned/1.0.0/update-a-goal.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/auth-put-v-1-goals-by-id.api.mdx @@ -1,11 +1,11 @@ --- -id: update-a-goal +id: auth-put-v-1-goals-by-id title: "Update a goal" description: "Update a goal" sidebar_label: "Update a goal" hide_title: true hide_table_of_contents: true -api: {"description":"Update a goal","tags":["Goals"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The id of the goal.","example":"cmmav11g9000d7e219d05gas2"},"required":true,"description":"The id of the goal."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"amount":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"duration":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"category":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"put","path":"/v1/goals/{id}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":0,"category":"QURAN"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update a goal","description":{"content":"Update a goal","type":"text/plain"},"url":{"path":["v1","goals",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The id of the goal.","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PUT","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Update a goal","tags":["Goals"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The id of the goal.","example":"cmoa3wr5c000g7z3fgv0y0rvo"},"required":true,"description":"The id of the goal."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"amount":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"duration":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"category":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"}},"additionalProperties":false},"example":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":1,"category":"QURAN"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPutV1GoalsById","method":"put","path":"/v1/goals/{id}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":0,"category":"QURAN"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update a goal","description":{"content":"Update a goal","type":"text/plain"},"url":{"path":["v1","goals",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The id of the goal.","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PUT","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "put api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -27,7 +27,7 @@ import TabItem from "@theme/TabItem"; Update a goal -
    Path Parameters
    Query Parameters
    Header Parameters
    Request Body
      amount object
      +
      Path Parameters
      Query Parameters
      Header Parameters
      Request Body
        amount object
        The amount of the goal. Depending on the goal type, the amount value and format will be different @@ -43,7 +43,7 @@ The amount of the goal. Depending on the goal type, the amount value and format Request has been handled successfully. -
        Schema
          data object
        +
        Schema
          data object
        The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/1.0.0/comments-controller-create.api.mdx b/docs/user_related_apis_versioned/1.0.0/comments-controller-create.api.mdx index 2b26187c..0ca5b7c3 100644 --- a/docs/user_related_apis_versioned/1.0.0/comments-controller-create.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/comments-controller-create.api.mdx @@ -5,7 +5,7 @@ description: "Add a comment to a post or reply to an existing comment. Supports sidebar_label: "Create a new comment" hide_title: true hide_table_of_contents: true -api: {"operationId":"CommentsController_create","description":"Add a comment to a post or reply to an existing comment. Supports mentions and notifies the post author.","parameters":[],"requestBody":{"required":true,"description":"Comment with postId and optional parentId","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"description":"Comment details for creation","allOf":[{"type":"object","properties":{"body":{"type":"string","description":"Comment body text","example":"This is a thoughtful comment about the post","maxLength":8000},"postId":{"type":"number","description":"ID of the post this comment belongs to","example":123},"isPrivate":{"type":"boolean","default":false,"description":"Whether the comment is private","example":false},"parentId":{"type":"number","description":"ID of the parent comment (for replies)","example":456},"mentions":{"description":"User mentions in the comment","type":"array","items":{"type":"object","properties":{"marker":{"type":"string","pattern":"/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/","example":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}"},"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["marker","userId","displayName"],"title":"UserMentionAttributes"}}},"required":["body","postId","isPrivate"],"title":"CreateCommentDto"}]}},"required":["comment"],"title":"CreateCommentBody"}}}},"responses":{"201":{"description":"Comment created","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"},"success":{"type":"boolean"}},"required":["comment","success"],"title":"CreateCommentResponse"}}}},"400":{"description":"Invalid comment - empty body or invalid postId"},"401":{"description":"User not authenticated"},"404":{"description":"Post or parent comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/comments","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"comment":{"body":"This is a thoughtful comment about the post","postId":123,"isPrivate":false,"parentId":456,"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}]}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a new comment","description":{"content":"Add a comment to a post or reply to an existing comment. Supports mentions and notifies the post author.","type":"text/plain"},"url":{"path":["v1","comments"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"CommentsController_create","description":"Add a comment to a post or reply to an existing comment. Supports mentions and notifies the post author.","parameters":[],"requestBody":{"required":true,"description":"Comment with postId and optional parentId","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"description":"Comment details for creation","allOf":[{"type":"object","properties":{"body":{"type":"string","description":"Comment body text","example":"This is a thoughtful comment about the post","maxLength":8000},"postId":{"type":"number","description":"ID of the post this comment belongs to","example":123},"isPrivate":{"type":"boolean","default":false,"description":"Whether the comment is private","example":false},"parentId":{"type":"number","description":"ID of the parent comment (for replies)","example":456},"mentions":{"description":"User mentions in the comment","type":"array","items":{"type":"object","properties":{"marker":{"type":"string","pattern":"/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/","example":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}"},"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["marker","userId","displayName"],"title":"UserMentionAttributes"}}},"required":["body","postId","isPrivate"],"title":"CreateCommentDto"}]}},"required":["comment"],"title":"CreateCommentBody"},"example":{"comment":{"body":"This is a thoughtful comment about the post","postId":123,"isPrivate":false,"parentId":456,"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}]}}}}},"responses":{"201":{"description":"Comment created","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"},"success":{"type":"boolean"}},"required":["comment","success"],"title":"CreateCommentResponse"},"example":{"comment":{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]},"success":true}}}},"400":{"description":"Invalid comment - empty body or invalid postId"},"401":{"description":"User not authenticated"},"404":{"description":"Post or parent comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/comments","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"comment":{"body":"This is a thoughtful comment about the post","postId":123,"isPrivate":false,"parentId":456,"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}]}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a new comment","description":{"content":"Add a comment to a post or reply to an existing comment. Supports mentions and notifies the post author.","type":"text/plain"},"url":{"path":["v1","comments"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ User mentions in the comment Comment created -
        Schema
          comment object required
          author object
          avatarUrls object required
          mentions object[]
        • Array [
        • avatarUrls object required
        • ]
        • tags object[]
        • Array [
        • ]
        +
        Schema
          comment object required
          author object
          avatarUrls object required
          mentions object[]
        • Array [
        • avatarUrls object required
        • ]
        • tags object[]
        • Array [
        • ]
        Invalid comment - empty body or invalid postId diff --git a/docs/user_related_apis_versioned/1.0.0/comments-controller-delete-comment.api.mdx b/docs/user_related_apis_versioned/1.0.0/comments-controller-delete-comment.api.mdx index 07011f9d..e922ba82 100644 --- a/docs/user_related_apis_versioned/1.0.0/comments-controller-delete-comment.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/comments-controller-delete-comment.api.mdx @@ -5,7 +5,7 @@ description: "Soft-delete a comment and its direct replies. Only the comment own sidebar_label: "Delete a comment" hide_title: true hide_table_of_contents: true -api: {"operationId":"CommentsController_deleteComment","description":"Soft-delete a comment and its direct replies. Only the comment owner, post owner, or admins can delete.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric comment ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Comment deleted","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean","example":true}}}}}},"400":{"description":"User not authorized to delete this comment"},"401":{"description":"User not authenticated"},"404":{"description":"The comment has already been deleted"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/comments/{id}/delete","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete a comment","description":{"content":"Soft-delete a comment and its direct replies. Only the comment owner, post owner, or admins can delete.","type":"text/plain"},"url":{"path":["v1","comments",":id","delete"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric comment ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"CommentsController_deleteComment","description":"Soft-delete a comment and its direct replies. Only the comment owner, post owner, or admins can delete.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric comment ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Comment deleted","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean","example":true}}},"example":{"removed":true}}}},"400":{"description":"User not authorized to delete this comment"},"401":{"description":"User not authenticated"},"404":{"description":"The comment has already been deleted"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/comments/{id}/delete","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete a comment","description":{"content":"Soft-delete a comment and its direct replies. Only the comment owner, post owner, or admins can delete.","type":"text/plain"},"url":{"path":["v1","comments",":id","delete"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric comment ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Soft-delete a comment and its direct replies. Only the comment owner, post owner Comment deleted -
        Schema
        +
        Schema
        User not authorized to delete this comment diff --git a/docs/user_related_apis_versioned/1.0.0/comments-controller-get.api.mdx b/docs/user_related_apis_versioned/1.0.0/comments-controller-get.api.mdx index a22b5734..9850aec0 100644 --- a/docs/user_related_apis_versioned/1.0.0/comments-controller-get.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/comments-controller-get.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve paginated replies (nested comments) for a parent comment sidebar_label: "Get replies to a comment" hide_title: true hide_table_of_contents: true -api: {"operationId":"CommentsController_get","description":"Retrieve paginated replies (nested comments) for a parent comment with author info.","parameters":[{"name":"id","required":true,"in":"path","description":"Parent comment ID","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"Comment replies with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}},"comment":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}},"required":["total","currentPage","limit","pages","replies","comment"],"title":"CommentRepliesResponse"}}}},"404":{"description":"Parent comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/comments/{id}/replies","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get replies to a comment","description":{"content":"Retrieve paginated replies (nested comments) for a parent comment with author info.","type":"text/plain"},"url":{"path":["v1","comments",":id","replies"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Number of results to return","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Parent comment ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"CommentsController_get","description":"Retrieve paginated replies (nested comments) for a parent comment with author info.","parameters":[{"name":"id","required":true,"in":"path","description":"Parent comment ID","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"Comment replies with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}},"comment":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}},"required":["total","currentPage","limit","pages","replies","comment"],"title":"CommentRepliesResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"replies":[{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]}],"comment":{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]}}}}},"404":{"description":"Parent comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/comments/{id}/replies","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get replies to a comment","description":{"content":"Retrieve paginated replies (nested comments) for a parent comment with author info.","type":"text/plain"},"url":{"path":["v1","comments",":id","replies"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Number of results to return","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Parent comment ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve paginated replies (nested comments) for a parent comment with author in Comment replies with pagination -
        Schema
          replies object[] required
        • Array [
        • author object
          avatarUrls object required
          mentions object[]
        • Array [
        • avatarUrls object required
        • ]
        • tags object[]
        • Array [
        • ]
        • ]
        • comment object required
          author object
          avatarUrls object required
          mentions object[]
        • Array [
        • avatarUrls object required
        • ]
        • tags object[]
        • Array [
        • ]
        +
        Schema
          replies object[] required
        • Array [
        • author object
          avatarUrls object required
          mentions object[]
        • Array [
        • avatarUrls object required
        • ]
        • tags object[]
        • Array [
        • ]
        • ]
        • comment object required
          author object
          avatarUrls object required
          mentions object[]
        • Array [
        • avatarUrls object required
        • ]
        • tags object[]
        • Array [
        • ]
        Parent comment not found diff --git a/docs/user_related_apis_versioned/1.0.0/comments-controller-toggle-like.api.mdx b/docs/user_related_apis_versioned/1.0.0/comments-controller-toggle-like.api.mdx index 4977cc60..c23c6753 100644 --- a/docs/user_related_apis_versioned/1.0.0/comments-controller-toggle-like.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/comments-controller-toggle-like.api.mdx @@ -5,7 +5,7 @@ description: "Toggle like status. If liked, removes like. Notifies comment autho sidebar_label: "Toggle like/unlike a comment" hide_title: true hide_table_of_contents: true -api: {"operationId":"CommentsController_toggleLike","description":"Toggle like status. If liked, removes like. Notifies comment author on new likes.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric comment ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Like toggled","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true if liked, false if unliked"}}}}}},"401":{"description":"User not authenticated"},"404":{"description":"Comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/comments/{id}/toggle-like","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle like/unlike a comment","description":{"content":"Toggle like status. If liked, removes like. Notifies comment author on new likes.","type":"text/plain"},"url":{"path":["v1","comments",":id","toggle-like"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric comment ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"CommentsController_toggleLike","description":"Toggle like status. If liked, removes like. Notifies comment author on new likes.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric comment ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Like toggled","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true if liked, false if unliked"}}},"example":{"liked":true}}}},"401":{"description":"User not authenticated"},"404":{"description":"Comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/comments/{id}/toggle-like","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle like/unlike a comment","description":{"content":"Toggle like status. If liked, removes like. Notifies comment author on new likes.","type":"text/plain"},"url":{"path":["v1","comments",":id","toggle-like"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric comment ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Toggle like status. If liked, removes like. Notifies comment author on new likes Like toggled -
        Schema
        +
        Schema
        User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/delete-note-by-id.api.mdx b/docs/user_related_apis_versioned/1.0.0/delete-note-by-id.api.mdx deleted file mode 100644 index be7c2a46..00000000 --- a/docs/user_related_apis_versioned/1.0.0/delete-note-by-id.api.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: delete-note-by-id -title: "Delete note by ID" -description: "Delete a note by its ID." -sidebar_label: "Delete note by ID" -hide_title: true -hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Delete a note by its ID.","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The ID of the note to delete."},"required":true,"description":"The ID of the note to delete."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"success":{"type":"boolean"}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"delete","path":"/v1/notes/:noteId","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"}} -sidebar_class_name: "delete api-method" -info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsVersionedSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Delete note by ID - - - -Delete a note by its ID. - -
        Path Parameters
        - -Request has been handled successfully. - -
        Schema
          data object
        - -The request is missing required parameters or is invalid. - -
        Schema
        - -The request is unauthorized. - -
        Schema
        - -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
        - -Not Found. The resource being accessed does not exist. - -
        Schema
        - -Validation Error. The request includes one or more invalid params. Please check the request params and try again. - -
        Schema
        - -Too many requests, please try again later. - -
        Schema
        - -Server Error. Something went wrong, try again later. - -
        Schema
        - -Invalid response from the upstream server - -
        Schema
        - -The server is currently unable to handle the request due to a temporary overload or scheduled maintenance - -
        Schema
        - -The server did not receive a timely response from the upstream server. - -
        Schema
        - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/get-collection-items-by-id.api.mdx b/docs/user_related_apis_versioned/1.0.0/get-collection-items-by-id.api.mdx deleted file mode 100644 index 6d98e29a..00000000 --- a/docs/user_related_apis_versioned/1.0.0/get-collection-items-by-id.api.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: get-collection-items-by-id -title: "Get collection items by id" -description: "Get all resources that belong to an existing collection by collection id." -sidebar_label: "Get collection items by id" -hide_title: true -hide_table_of_contents: true -api: {"description":"Get all resources that belong to an existing collection by collection id.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","example":"cmmav11d8000c7e211dux16dq"}},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyAdded","verseKey"],"description":"Sort the collection items either by the time they were added at descendingly or by Ayah key."},"description":"Sort the collection items either by the time they were added at descendingly or by Ayah key."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"collection":{"type":"object","properties":{"id":{"type":"string","example":"cmmav113800077e21b8bfgkgs"},"updatedAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"name":{"type":"string","example":"Woman in Quran"}},"required":["id","updatedAt","name"],"additionalProperties":false,"title":"Collection"},"bookmarks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav10y500057e21hjilhplh"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5},"group":{"type":"string"},"isInDefaultCollection":{"type":"boolean","example":true}},"required":["id","createdAt","type","key","isInDefaultCollection"],"additionalProperties":false,"title":"Bookmark"}}},"additionalProperties":false},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/collections/{collectionId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get collection items by id","description":{"content":"Get all resources that belong to an existing collection by collection id.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort the collection items either by the time they were added at descendingly or by Ayah key.","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[{"disabled":false,"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} -sidebar_class_name: "get api-method" -info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsVersionedSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Get collection items by id - - - -Get all resources that belong to an existing collection by collection id. - -
        Path Parameters
        Query Parameters
        - -Request has been handled successfully. - -
        Schema
          data object
          collection object
          bookmarks object[]
        • Array [
        • ]
        • pagination object
        - -The request is missing required parameters or is invalid. - -
        Schema
        - -The request is unauthorized. - -
        Schema
        - -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
        - -Not Found. The resource being accessed does not exist. - -
        Schema
        - -Validation Error. The request includes one or more invalid params. Please check the request params and try again. - -
        Schema
        - -Too many requests, please try again later. - -
        Schema
        - -Server Error. Something went wrong, try again later. - -
        Schema
        - -Invalid response from the upstream server - -
        Schema
        - -The server is currently unable to handle the request due to a temporary overload or scheduled maintenance - -
        Schema
        - -The server did not receive a timely response from the upstream server. - -
        Schema
        - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/get-current-streak-days.api.mdx b/docs/user_related_apis_versioned/1.0.0/get-current-streak-days.api.mdx deleted file mode 100644 index 01f8c6b8..00000000 --- a/docs/user_related_apis_versioned/1.0.0/get-current-streak-days.api.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: get-current-streak-days -title: "Get current streak days" -description: "Get current active streak days." -sidebar_label: "Get current streak days" -hide_title: true -hide_table_of_contents: true -api: {"description":"Get current active streak days.","tags":["Streaks"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN"],"description":"The type of the streak","example":"QURAN"},"required":true,"description":"The type of the streak"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"days":{"type":"integer","description":"The number of days the current streak is active for.","example":5}},"required":["days"],"additionalProperties":false}}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/streaks/current-streak-days","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get current streak days","description":{"content":"Get current active streak days.","type":"text/plain"},"url":{"path":["v1","streaks","current-streak-days"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The type of the streak","type":"text/plain"},"key":"type","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"GET"}} -sidebar_class_name: "get api-method" -info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsVersionedSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Get current streak days - - - -Get current active streak days. - -
        Query Parameters
        Header Parameters
        - -Request has been handled successfully. - -
        Schema
          data object[]
        • Array [
        • ]
        - -The request is missing required parameters or is invalid. - -
        Schema
        - -The request is unauthorized. - -
        Schema
        - -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
        - -Not Found. The resource being accessed does not exist. - -
        Schema
        - -Validation Error. The request includes one or more invalid params. Please check the request params and try again. - -
        Schema
        - -Too many requests, please try again later. - -
        Schema
        - -Server Error. Something went wrong, try again later. - -
        Schema
        - -Invalid response from the upstream server - -
        Schema
        - -The server is currently unable to handle the request due to a temporary overload or scheduled maintenance - -
        Schema
        - -The server did not receive a timely response from the upstream server. - -
        Schema
        - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/get-mutations.api.mdx b/docs/user_related_apis_versioned/1.0.0/get-mutations.api.mdx new file mode 100644 index 00000000..e9a98c1b --- /dev/null +++ b/docs/user_related_apis_versioned/1.0.0/get-mutations.api.mdx @@ -0,0 +1,95 @@ +--- +id: get-mutations +title: "Get mutations" +description: "Get list of mutations that were applied to resources after a certain point in time." +sidebar_label: "Get mutations" +hide_title: true +hide_table_of_contents: true +api: {"description":"Get list of mutations that were applied to resources after a certain point in time.","tags":["Sync"],"parameters":[{"in":"query","name":"mutationsSince","schema":{"type":"number","format":"float","description":"The timestamp to get mutations since.","example":1731636500303},"required":true,"description":"The timestamp to get mutations since."},{"in":"query","name":"resources","schema":{"type":"string","description":"Comma-separated list of resources to filter mutations by (e.g. \"BOOKMARK,COLLECTION,COLLECTION_BOOKMARK,NOTE\"). If not provided, all accessible resources will be returned.","example":"BOOKMARK,COLLECTION,COLLECTION_BOOKMARK"},"required":false,"description":"Comma-separated list of resources to filter mutations by (e.g. \"BOOKMARK,COLLECTION,COLLECTION_BOOKMARK,NOTE\"). If not provided, all accessible resources will be returned."},{"in":"query","name":"metadataOnly","schema":{"type":"boolean","description":"When true, returns only the lastMutationAt timestamp without fetching actual mutations. This is significantly faster (single DB query vs multiple joins) and ideal for: 1) Checking if new data exists before performing a full sync, 2) Implementing periodic background polling to detect changes, 3) Recovering the current lastMutationAt if the client missed the X-Mutation-At header from a previous successful mutation response. Response will only contain { lastMutationAt: number }.","example":true,"default":false},"required":false,"description":"When true, returns only the lastMutationAt timestamp without fetching actual mutations. This is significantly faster (single DB query vs multiple joins) and ideal for: 1) Checking if new data exists before performing a full sync, 2) Implementing periodic background polling to detect changes, 3) Recovering the current lastMutationAt if the client missed the X-Mutation-At header from a previous successful mutation response. Response will only contain { lastMutationAt: number }."},{"in":"query","name":"limit","schema":{"type":"number","format":"float","minimum":1,"maximum":1000,"description":"Maximum number of mutations to return per page (1-1000).","example":100,"default":100},"required":false,"description":"Maximum number of mutations to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"number","format":"float","minimum":1,"description":"Page number (1-based).","example":1,"default":1},"required":false,"description":"Page number (1-based)."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"mutations":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CREATE","UPDATE","DELETE"],"description":"The type of the mutation","example":"CREATE"},"resource":{"type":"string","enum":["BOOKMARK","COLLECTION","COLLECTION_BOOKMARK","NOTE"],"description":"The resource the mutation was applied to.","example":"BOOKMARK"},"resourceId":{"type":"string","description":"The id of the resource the mutation was applied to. Will not be present for resources that use composite keys (e.g. COLLECTION_BOOKMARK uses data.collection and data.bookmark instead).","example":"lqc794i0qnxq4pdlfanfbd2r"},"data":{"type":"object","properties":{},"description":"The latest version of the data of the resource that was mutated. Will be empty when the mutation is a delete.","example":{"bookmarkType":"ayah","bookmarkGroup":"verses_6236","key":6,"verseNumber":3}},"timestamp":{"type":"number","format":"float","description":"Unix timestamp when the latest mutation of the resource occurred","example":1731636500303}},"required":["type","resource","timestamp"],"additionalProperties":false,"description":"Represents a single mutation/change to a resource"},"description":"Array of mutations that occurred after lastMutationAt. Will be omitted when metadataOnly is set to true.","example":[{"type":"CREATE","resource":"BOOKMARK","resourceId":"u54maufl0ftmarp73ei0hg64","data":{"bookmarkType":"ayah","bookmarkGroup":"verses_6236","key":6,"verseNumber":3},"timestamp":1769340915572},{"type":"UPDATE","resource":"COLLECTION","resourceId":"na6orcv0pbcomiphmkv0yhma","data":{"name":"New collection!","slug":"new-collection","isPrivate":true},"timestamp":1769340915572},{"type":"CREATE","resource":"COLLECTION_BOOKMARK","data":{"collection":"na6orcv0pbcomiphmkv0yhma","bookmark":"u54maufl0ftmarp73ei0hg64"},"timestamp":1769340915575},{"type":"DELETE","resource":"NOTE","resourceId":"his2lubkxxr3l102nqptmnur","data":{},"timestamp":1769341113173}]},"page":{"type":"number","format":"float","description":"Current page number","example":1},"limit":{"type":"number","format":"float","description":"Items per page","example":100},"total":{"type":"number","format":"float","description":"Total number of mutations","example":150},"hasMore":{"type":"boolean","description":"Whether more pages exist","example":true},"lastMutationAt":{"type":"number","format":"float","description":"Timestamp of the latest mutation. This should be used for subsequent sync requests. If metadataOnly is true, this will be the only field returned.","example":1731636500303}},"required":["lastMutationAt"],"additionalProperties":false,"description":"Response schema for get mutations endpoint"}},"additionalProperties":false}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/sync","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get mutations","description":{"content":"Get list of mutations that were applied to resources after a certain point in time.","type":"text/plain"},"url":{"path":["v1","sync"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp to get mutations since.","type":"text/plain"},"key":"mutationsSince","value":""},{"disabled":false,"description":{"content":"Comma-separated list of resources to filter mutations by (e.g. \"BOOKMARK,COLLECTION,COLLECTION_BOOKMARK,NOTE\"). If not provided, all accessible resources will be returned.","type":"text/plain"},"key":"resources","value":""},{"disabled":false,"description":{"content":"When true, returns only the lastMutationAt timestamp without fetching actual mutations. This is significantly faster (single DB query vs multiple joins) and ideal for: 1) Checking if new data exists before performing a full sync, 2) Implementing periodic background polling to detect changes, 3) Recovering the current lastMutationAt if the client missed the X-Mutation-At header from a previous successful mutation response. Response will only contain { lastMutationAt: number }.","type":"text/plain"},"key":"metadataOnly","value":""},{"disabled":false,"description":{"content":"Maximum number of mutations to return per page (1-1000).","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (1-based).","type":"text/plain"},"key":"page","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +sidebar_class_name: "get api-method" +info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsVersionedSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Get mutations + + + +Get list of mutations that were applied to resources after a certain point in time. + +
        Query Parameters
        + +Request has been handled successfully. + +
        Response Headers
        • X-Mutation-At string
          + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
        Schema
          data object
          + +Response schema for get mutations endpoint + +
          mutations object[]
          + +Array of mutations that occurred after lastMutationAt. Will be omitted when metadataOnly is set to true. + +
        • Array [
        • data object
          + +The latest version of the data of the resource that was mutated. Will be empty when the mutation is a delete. + +
        • ]
        + +The request is missing required parameters or is invalid. + +
        Schema
        + +The request is unauthorized. + +
        Schema
        + +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
        + +Not Found. The resource being accessed does not exist. + +
        Schema
        + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
        Schema
          error object
        + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
        Schema
        + +Too many requests, please try again later. + +
        Schema
        + +Server Error. Something went wrong, try again later. + +
        Schema
        + +Invalid response from the upstream server + +
        Schema
        + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
        Schema
        + +The server did not receive a timely response from the upstream server. + +
        Schema
        + \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-create.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-create.api.mdx index ff954a42..1ebc455d 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-create.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-create.api.mdx @@ -5,7 +5,7 @@ description: "Create a new post (reflection) with Quran references. Posts can be sidebar_label: "Create post" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_create","description":"Create a new post (reflection) with Quran references. Posts can be public, drafts, or associated with a room (group/page). Supports user mentions and multiple Quran verse references. Minimum body length is 6 characters.","parameters":[],"requestBody":{"required":true,"description":"Post creation payload containing the post object with body, references, mentions, and visibility settings","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"roomPostStatus":{"enum":[0,1,2],"type":"number","description":"The room post status, defaults to publicly: 1. As Room: 0, Publicly: 1, Only Members: 2"},"body":{"type":"string","minLength":6},"draft":{"type":"boolean"},"references":{"type":"array","items":{"type":"object","properties":{"chapterId":{"type":"number","minimum":1},"from":{"type":"number","default":0},"to":{"type":"number","default":0}},"required":["chapterId","from","to"],"title":"ReferenceAttributes"}},"mentions":{"type":"array","items":{"type":"object","properties":{"marker":{"type":"string","pattern":"/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/","example":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}"},"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["marker","userId","displayName"],"title":"UserMentionAttributes"}},"roomId":{"type":"number"},"postAsAuthorId":{"type":"string"},"publishedAt":{"format":"date-time","type":"string"}},"required":["roomPostStatus","body","draft","references","mentions","roomId","postAsAuthorId","publishedAt"],"title":"CreatePostDto"}},"required":["post"],"title":"CreatePostBodyDto"}}}},"responses":{"201":{"description":"Post created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"},"success":{"type":"boolean"}},"required":["post","success"],"title":"PostCreatedResponse"}}}},"400":{"description":"Invalid post data - body too short, invalid references, or invalid room post status"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"post":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":0,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":0,"postAsAuthorId":"string","publishedAt":"2026-03-29T20:06:51.526Z"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create post","description":{"content":"Create a new post (reflection) with Quran references. Posts can be public, drafts, or associated with a room (group/page). Supports user mentions and multiple Quran verse references. Minimum body length is 6 characters.","type":"text/plain"},"url":{"path":["v1","posts"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"PostsController_create","description":"Create a new post (reflection) with Quran references. Posts can be public, drafts, or associated with a room (group/page). Supports user mentions and multiple Quran verse references. Minimum body length is 6 characters.","parameters":[],"requestBody":{"required":true,"description":"Post creation payload containing the post object with body, references, mentions, and visibility settings","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"roomPostStatus":{"enum":[0,1,2],"type":"number","description":"The room post status, defaults to publicly: 1. As Room: 0, Publicly: 1, Only Members: 2"},"body":{"type":"string","minLength":6},"draft":{"type":"boolean"},"references":{"type":"array","items":{"type":"object","properties":{"chapterId":{"type":"number","minimum":1},"from":{"type":"number","default":0},"to":{"type":"number","default":0}},"required":["chapterId","from","to"],"title":"ReferenceAttributes"}},"mentions":{"type":"array","items":{"type":"object","properties":{"marker":{"type":"string","pattern":"/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/","example":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}"},"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["marker","userId","displayName"],"title":"UserMentionAttributes"}},"roomId":{"type":"number"},"postAsAuthorId":{"type":"string"},"publishedAt":{"format":"date-time","type":"string"}},"required":["roomPostStatus","body","draft","references","mentions","roomId","postAsAuthorId","publishedAt"],"title":"CreatePostDto"}},"required":["post"],"title":"CreatePostBodyDto"},"example":{"post":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":1,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":1,"postAsAuthorId":"string","publishedAt":"2026-04-02T00:00:00.000Z"}}}}},"responses":{"201":{"description":"Post created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"},"success":{"type":"boolean"}},"required":["data","success"],"title":"PostCreatedResponse"},"example":{"data":{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"},"success":true}}}},"400":{"description":"Invalid post data - body too short, invalid references, or invalid room post status"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"post":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":0,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":0,"postAsAuthorId":"string","publishedAt":"2026-04-23T07:01:56.569Z"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create post","description":{"content":"Create a new post (reflection) with Quran references. Posts can be public, drafts, or associated with a room (group/page). Supports user mentions and multiple Quran verse references. Minimum body length is 6 characters.","type":"text/plain"},"url":{"path":["v1","posts"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Post creation payload containing the post object with body, references, mentions Post created successfully -
        Schema
          post object required
          tags object[]
        • Array [
        • ]
        • references object[]
        • Array [
        • ]
        • recentComment object
          author object required
          avatarUrls object required
          room object nullable
          mentions object[]
        • Array [
        • avatarUrls object required
        • ]
        +
        Schema
          data object required
          tags object[]
        • Array [
        • ]
        • references object[]
        • Array [
        • ]
        • recentComment object
          author object required
          avatarUrls object required
          room object nullable
          mentions object[]
        • Array [
        • avatarUrls object required
        • ]
        Invalid post data - body too short, invalid references, or invalid room post status diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-delete.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-delete.api.mdx index a24470ed..91c85164 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-delete.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-delete.api.mdx @@ -5,7 +5,7 @@ description: "Soft-delete a post by marking it as removed. Only the post author sidebar_label: "Delete post" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_delete","description":"Soft-delete a post by marking it as removed. Only the post author or admins can delete posts. Related engagement counts (likes, comments, saves) update asynchronously via background jobs, so metrics may briefly lag.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to delete","schema":{"type":"number"}}],"responses":{"200":{"description":"Post deletion accepted and queued for processing","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to delete this post"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"delete","path":"/v1/posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete post","description":{"content":"Soft-delete a post by marking it as removed. Only the post author or admins can delete posts. Related engagement counts (likes, comments, saves) update asynchronously via background jobs, so metrics may briefly lag.","type":"text/plain"},"url":{"path":["v1","posts",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to delete","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +api: {"operationId":"PostsController_delete","description":"Soft-delete a post by marking it as removed. Only the post author or admins can delete posts. Related engagement counts (likes, comments, saves) update asynchronously via background jobs, so metrics may briefly lag.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to delete","schema":{"type":"number"}}],"responses":{"200":{"description":"Post deletion accepted and queued for processing","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}},"example":{"success":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to delete this post"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"delete","path":"/v1/posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete post","description":{"content":"Soft-delete a post by marking it as removed. Only the post author or admins can delete posts. Related engagement counts (likes, comments, saves) update asynchronously via background jobs, so metrics may briefly lag.","type":"text/plain"},"url":{"path":["v1","posts",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to delete","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Soft-delete a post by marking it as removed. Only the post author or admins can Post deletion accepted and queued for processing -
        Schema
        +
        Schema
        User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-edit.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-edit.api.mdx index 71ca6818..977e315d 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-edit.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-edit.api.mdx @@ -5,7 +5,7 @@ description: "Update an existing post. Only the post author or admins can edit. sidebar_label: "Edit post" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_edit","description":"Update an existing post. Only the post author or admins can edit. Supports updating body, references, mentions, draft status, and room visibility settings.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to update","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Partial post data to update - only include fields to change","content":{"application/json":{"schema":{"type":"object","properties":{"roomPostStatus":{"enum":[0,1,2],"type":"number","description":"The room post status, defaults to publicly: 1. As Room: 0, Publicly: 1, Only Members: 2"},"body":{"type":"string","minLength":6},"draft":{"type":"boolean"},"references":{"type":"array","items":{"type":"object","properties":{"chapterId":{"type":"number","minimum":1},"from":{"type":"number","default":0},"to":{"type":"number","default":0}},"required":["chapterId","from","to"],"title":"ReferenceAttributes"}},"mentions":{"type":"array","items":{"type":"object","properties":{"marker":{"type":"string","pattern":"/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/","example":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}"},"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["marker","userId","displayName"],"title":"UserMentionAttributes"}},"roomId":{"type":"number"},"postAsAuthorId":{"type":"string"},"publishedAt":{"format":"date-time","type":"string"}},"title":"UpdatePostDto"}}}},"responses":{"200":{"description":"Post updated successfully with the updated post data","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"},"success":{"type":"boolean"}},"required":["post","success"],"title":"PostCreatedResponse"}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to edit this post"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":0,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":0,"postAsAuthorId":"string","publishedAt":"2026-03-29T20:06:51.526Z"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Edit post","description":{"content":"Update an existing post. Only the post author or admins can edit. Supports updating body, references, mentions, draft status, and room visibility settings.","type":"text/plain"},"url":{"path":["v1","posts",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to update","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"PostsController_edit","description":"Update an existing post. Only the post author or admins can edit. Supports updating body, references, mentions, draft status, and room visibility settings.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to update","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Partial post data to update - only include fields to change","content":{"application/json":{"schema":{"type":"object","properties":{"roomPostStatus":{"enum":[0,1,2],"type":"number","description":"The room post status, defaults to publicly: 1. As Room: 0, Publicly: 1, Only Members: 2"},"body":{"type":"string","minLength":6},"draft":{"type":"boolean"},"references":{"type":"array","items":{"type":"object","properties":{"chapterId":{"type":"number","minimum":1},"from":{"type":"number","default":0},"to":{"type":"number","default":0}},"required":["chapterId","from","to"],"title":"ReferenceAttributes"}},"mentions":{"type":"array","items":{"type":"object","properties":{"marker":{"type":"string","pattern":"/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/","example":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}"},"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["marker","userId","displayName"],"title":"UserMentionAttributes"}},"roomId":{"type":"number"},"postAsAuthorId":{"type":"string"},"publishedAt":{"format":"date-time","type":"string"}},"title":"UpdatePostDto"},"example":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":1,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":1,"postAsAuthorId":"string","publishedAt":"2026-04-02T00:00:00.000Z"}}}},"responses":{"200":{"description":"Post updated successfully with the updated post data","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"},"success":{"type":"boolean"}},"required":["data","success"],"title":"PostCreatedResponse"},"example":{"data":{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"},"success":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to edit this post"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":0,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":0,"postAsAuthorId":"string","publishedAt":"2026-04-23T07:01:56.569Z"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Edit post","description":{"content":"Update an existing post. Only the post author or admins can edit. Supports updating body, references, mentions, draft status, and room visibility settings.","type":"text/plain"},"url":{"path":["v1","posts",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to update","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "patch api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Partial post data to update - only include fields to change Post updated successfully with the updated post data -
        Schema
          post object required
          tags object[]
        • Array [
        • ]
        • references object[]
        • Array [
        • ]
        • recentComment object
          author object required
          avatarUrls object required
          room object nullable
          mentions object[]
        • Array [
        • avatarUrls object required
        • ]
        +
        Schema
          data object required
          tags object[]
        • Array [
        • ]
        • references object[]
        • Array [
        • ]
        • recentComment object
          author object required
          avatarUrls object required
          room object nullable
          mentions object[]
        • Array [
        • avatarUrls object required
        • ]
        User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-export-multiple-posts.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-export-multiple-posts.api.mdx index 5af1e92f..33725617 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-export-multiple-posts.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-export-multiple-posts.api.mdx @@ -5,7 +5,7 @@ description: "Generate a downloadable PDF document containing selected posts wit sidebar_label: "Export posts as PDF" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_exportMultiplePosts","description":"Generate a downloadable PDF document containing selected posts with their full content, Quran references, and author information. Ayah translations are rendered according to user language preferences.","parameters":[],"requestBody":{"required":true,"description":"Array of post IDs to include in the PDF export (minimum 1)","content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"description":"Array of post IDs to export","example":[1,2,3],"minItems":1,"type":"array","items":{"type":"number"}}},"required":["ids"],"title":"ExportPostsDto"}}}},"responses":{"200":{"description":"PDF file generated and returned as binary attachment","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request - empty or invalid post IDs array"},"401":{"description":"User not authenticated"},"404":{"description":"No accessible posts found for the given IDs"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/export/pdf","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"ids":[1,2,3]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Export posts as PDF","description":{"content":"Generate a downloadable PDF document containing selected posts with their full content, Quran references, and author information. Ayah translations are rendered according to user language preferences.","type":"text/plain"},"url":{"path":["v1","posts","export","pdf"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/pdf"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"PostsController_exportMultiplePosts","description":"Generate a downloadable PDF document containing selected posts with their full content, Quran references, and author information. Ayah translations are rendered according to user language preferences.","parameters":[],"requestBody":{"required":true,"description":"Array of post IDs to include in the PDF export (minimum 1)","content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"description":"Array of post IDs to export","example":[1,2,3],"minItems":1,"type":"array","items":{"type":"number"}}},"required":["ids"],"title":"ExportPostsDto"},"example":{"ids":[1,2,3]}}}},"responses":{"200":{"description":"PDF file generated and returned as binary attachment","content":{"application/pdf":{"schema":{"type":"string","format":"binary"},"example":"string"}}},"400":{"description":"Invalid request - empty or invalid post IDs array"},"401":{"description":"User not authenticated"},"404":{"description":"No accessible posts found for the given IDs"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/export/pdf","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"ids":[1,2,3]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Export posts as PDF","description":{"content":"Generate a downloadable PDF document containing selected posts with their full content, Quran references, and author information. Ayah translations are rendered according to user language preferences.","type":"text/plain"},"url":{"path":["v1","posts","export","pdf"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/pdf"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ PDF file generated and returned as binary attachment string -
      +
    Invalid request - empty or invalid post IDs array diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-feed.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-feed.api.mdx index 168b5184..565042e6 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-feed.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-feed.api.mdx @@ -1,11 +1,11 @@ --- id: posts-controller-feed title: "Get posts feed" -description: "Retrieve a paginated feed of posts (reflections). Supports filtering by authors, tags, Quran references, groups, pages, and post types. Results can be filtered by language preferences from user settings or query parameters." +description: "Retrieve a paginated feed of Quran Reflect posts, including reflections and lessons. Supports filtering by authors, tags, Quran references, groups, pages, and post types. Response items include engagement metadata such as `likesCount`, `commentsCount`, and `recentComment` when available. Use the dedicated comment endpoints to retrieve comment objects and totals. For ayah-by-ayah reads, use `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`, and use `filter[postTypeIds]=1` for reflections or `filter[postTypeIds]=2` for lessons." sidebar_label: "Get posts feed" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_feed","description":"Retrieve a paginated feed of posts (reflections). Supports filtering by authors, tags, Quran references, groups, pages, and post types. Results can be filtered by language preferences from user settings or query parameters.","parameters":[{"name":"tab","required":false,"in":"query","description":"Feed tab type. feed shows personalized content, trending shows explore, following shows posts from followed users.","schema":{"enum":["newest","latest","following","draft","favorite","most_popular","only_room_members","public","feed","trending","popular"],"type":"string"}},{"name":"languages","required":false,"in":"query","description":"Array of language IDs to filter posts by reflection language","schema":{"type":"array","items":{"type":"number"}}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20)","schema":{"minimum":1,"default":20,"type":"number"}},{"required":false,"name":"authors","in":"query","schema":{"type":"array","items":{"type":"string"}}},{"required":false,"name":"tags","in":"query","schema":{"type":"array","items":{"type":"string"}}},{"required":false,"name":"references","in":"query","schema":{"type":"array","items":{"type":"object","properties":{"chapterId":{"type":"number","minimum":1},"from":{"type":"number","default":0},"to":{"type":"number","default":0}},"required":["chapterId","from","to"],"title":"ReferenceAttributes"}}},{"required":false,"name":"groups","in":"query","schema":{"type":"array","items":{"type":"string"}}},{"required":false,"name":"pages","in":"query","schema":{"type":"array","items":{"type":"string"}}},{"required":false,"name":"postTypeIds","in":"query","schema":{"type":"array","items":{"type":"number"}}},{"required":false,"name":"tagsOperator","in":"query","schema":{"enum":["OR","AND"],"type":"string"}},{"required":false,"name":"referencesOperator","in":"query","schema":{"enum":["OR","AND"],"type":"string"}},{"required":false,"name":"verifiedOnly","in":"query","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"description":"Feed retrieved successfully with paginated posts","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/feed","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get posts feed","description":{"content":"Retrieve a paginated feed of posts (reflections). Supports filtering by authors, tags, Quran references, groups, pages, and post types. Results can be filtered by language preferences from user settings or query parameters.","type":"text/plain"},"url":{"path":["v1","posts","feed"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Feed tab type. feed shows personalized content, trending shows explore, following shows posts from followed users.","type":"text/plain"},"key":"tab","value":""},{"disabled":false,"description":{"content":"Array of language IDs to filter posts by reflection language","type":"text/plain"},"key":"languages","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Number of posts per page (default: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"key":"authors","value":""},{"disabled":false,"key":"tags","value":""},{"disabled":false,"key":"references","value":""},{"disabled":false,"key":"groups","value":""},{"disabled":false,"key":"pages","value":""},{"disabled":false,"key":"postTypeIds","value":""},{"disabled":false,"key":"tagsOperator","value":""},{"disabled":false,"key":"referencesOperator","value":""},{"disabled":false,"key":"verifiedOnly","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_feed","description":"Retrieve a paginated feed of Quran Reflect posts, including reflections and lessons. Supports filtering by authors, tags, Quran references, groups, pages, and post types. Response items include engagement metadata such as `likesCount`, `commentsCount`, and `recentComment` when available. Use the dedicated comment endpoints to retrieve comment objects and totals. For ayah-by-ayah reads, use `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`, and use `filter[postTypeIds]=1` for reflections or `filter[postTypeIds]=2` for lessons.","parameters":[{"name":"tab","required":false,"in":"query","description":"Feed tab type. `feed` shows personalized content, `trending` shows explore, and `following` shows posts from followed users.","schema":{"type":"string","enum":["newest","latest","following","draft","favorite","most_popular","only_room_members","public","feed","trending","popular"]}},{"name":"languages","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of language IDs to filter posts by reflection language, for example `languages=1,2`.","schema":{"type":"array","items":{"type":"number"},"example":[1,2]}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1).","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20).","schema":{"minimum":1,"default":20,"type":"number"}},{"name":"filter[verifiedOnly]","required":false,"in":"query","description":"Whether to limit the feed to verified contributors. Public ayah-by-ayah reads typically combine this with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.","schema":{"type":"boolean","default":false,"example":true}},{"name":"filter[referencesOperator]","required":false,"in":"query","description":"Operator applied to multiple Quran reference filters.","schema":{"type":"string","enum":["OR","AND"]}},{"name":"filter[tagsOperator]","required":false,"in":"query","description":"Operator applied to multiple tag filters.","schema":{"type":"string","enum":["OR","AND"]}},{"name":"filter[postTypeIds]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated Quran Reflect post type IDs. Use `1` for reflections and `2` for lessons.","schema":{"type":"array","items":{"type":"number"},"example":[1,2]}},{"name":"filter[pages]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of page subdomains to include.","schema":{"type":"array","items":{"type":"string"},"example":["quran-reflections","khutbahapp"]}},{"name":"filter[groups]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of group URLs to include.","schema":{"type":"array","items":{"type":"string"},"example":["my-group","ramadan-circle"]}},{"name":"filter[references][0][to]","required":false,"in":"query","description":"Ending ayah number for reference filter index `0`. For a single ayah, use the same value as `from`.","schema":{"type":"number","minimum":1,"example":255}},{"name":"filter[references][0][from]","required":false,"in":"query","description":"Starting ayah number for reference filter index `0`. Pair with the matching `chapterId` and `to` values.","schema":{"type":"number","minimum":1,"example":255}},{"name":"filter[references][0][chapterId]","required":false,"in":"query","description":"Reference filter example for index `0`. Use additional indices such as `filter[references][1][chapterId]` for more references.","schema":{"type":"number","minimum":1,"example":2}},{"name":"filter[tags]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of tag values to include.","schema":{"type":"array","items":{"type":"string"},"example":["ramadan","patience"]}},{"name":"filter[authors]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of author identifiers to include.","schema":{"type":"array","items":{"type":"string"},"example":["user-1","user-2"]}}],"responses":{"200":{"description":"Feed retrieved successfully with paginated posts","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/feed","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get posts feed","description":{"content":"Retrieve a paginated feed of Quran Reflect posts, including reflections and lessons. Supports filtering by authors, tags, Quran references, groups, pages, and post types. Response items include engagement metadata such as `likesCount`, `commentsCount`, and `recentComment` when available. Use the dedicated comment endpoints to retrieve comment objects and totals. For ayah-by-ayah reads, use `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`, and use `filter[postTypeIds]=1` for reflections or `filter[postTypeIds]=2` for lessons.","type":"text/plain"},"url":{"path":["v1","posts","feed"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Feed tab type. `feed` shows personalized content, `trending` shows explore, and `following` shows posts from followed users.","type":"text/plain"},"key":"tab","value":""},{"disabled":false,"description":{"content":"Comma-separated list of language IDs to filter posts by reflection language, for example `languages=1,2`.","type":"text/plain"},"key":"languages","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1).","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Number of posts per page (default: 20).","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Whether to limit the feed to verified contributors. Public ayah-by-ayah reads typically combine this with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.","type":"text/plain"},"key":"filter[verifiedOnly]","value":""},{"disabled":false,"description":{"content":"Operator applied to multiple Quran reference filters.","type":"text/plain"},"key":"filter[referencesOperator]","value":""},{"disabled":false,"description":{"content":"Operator applied to multiple tag filters.","type":"text/plain"},"key":"filter[tagsOperator]","value":""},{"disabled":false,"description":{"content":"Comma-separated Quran Reflect post type IDs. Use `1` for reflections and `2` for lessons.","type":"text/plain"},"key":"filter[postTypeIds]","value":""},{"disabled":false,"description":{"content":"Comma-separated list of page subdomains to include.","type":"text/plain"},"key":"filter[pages]","value":""},{"disabled":false,"description":{"content":"Comma-separated list of group URLs to include.","type":"text/plain"},"key":"filter[groups]","value":""},{"disabled":false,"description":{"content":"Ending ayah number for reference filter index `0`. For a single ayah, use the same value as `from`.","type":"text/plain"},"key":"filter[references][0][to]","value":""},{"disabled":false,"description":{"content":"Starting ayah number for reference filter index `0`. Pair with the matching `chapterId` and `to` values.","type":"text/plain"},"key":"filter[references][0][from]","value":""},{"disabled":false,"description":{"content":"Reference filter example for index `0`. Use additional indices such as `filter[references][1][chapterId]` for more references.","type":"text/plain"},"key":"filter[references][0][chapterId]","value":""},{"disabled":false,"description":{"content":"Comma-separated list of tag values to include.","type":"text/plain"},"key":"filter[tags]","value":""},{"disabled":false,"description":{"content":"Comma-separated list of author identifiers to include.","type":"text/plain"},"key":"filter[authors]","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -25,11 +25,11 @@ import TabItem from "@theme/TabItem"; -Retrieve a paginated feed of posts (reflections). Supports filtering by authors, tags, Quran references, groups, pages, and post types. Results can be filtered by language preferences from user settings or query parameters. +Retrieve a paginated feed of Quran Reflect posts, including reflections and lessons. Supports filtering by authors, tags, Quran references, groups, pages, and post types. Response items include engagement metadata such as `likesCount`, `commentsCount`, and `recentComment` when available. Use the dedicated comment endpoints to retrieve comment objects and totals. For ayah-by-ayah reads, use `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`, and use `filter[postTypeIds]=1` for reflections or `filter[postTypeIds]=2` for lessons. -
    Query Parameters
    +
    Query Parameters
    Feed retrieved successfully with paginated posts -
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    +
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-find-one.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-find-one.api.mdx index 355ec704..251e6ba7 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-find-one.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-find-one.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve a specific post by its unique numeric ID. Returns the ful sidebar_label: "Get post by ID" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_findOne","description":"Retrieve a specific post by its unique numeric ID. Returns the full post with author details, tags, references, room information, and engagement metrics. Admins can view additional moderation details.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Post found and returned with all associated data","content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}}},"404":{"description":"Post not found or has been deleted"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get post by ID","description":{"content":"Retrieve a specific post by its unique numeric ID. Returns the full post with author details, tags, references, room information, and engagement metrics. Admins can view additional moderation details.","type":"text/plain"},"url":{"path":["v1","posts",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_findOne","description":"Retrieve a specific post by its unique numeric ID. Returns the full post with author details, tags, references, room information, and engagement metrics. Admins can view additional moderation details.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Post found and returned with all associated data","content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"},"example":{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}}}},"404":{"description":"Post not found or has been deleted"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get post by ID","description":{"content":"Retrieve a specific post by its unique numeric ID. Returns the full post with author details, tags, references, room information, and engagement metrics. Admins can view additional moderation details.","type":"text/plain"},"url":{"path":["v1","posts",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve a specific post by its unique numeric ID. Returns the full post with au Post found and returned with all associated data -
    Schema
      tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    +
    Schema
      tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    Post not found or has been deleted diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-all-comment.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-all-comment.api.mdx index 5ec232ef..4ee45404 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-all-comment.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-all-comment.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve all comments for a post in a single request without pagin sidebar_label: "Get all post comments" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getAllComment","description":"Retrieve all comments for a post in a single request without pagination. Useful for displaying full comment threads or export scenarios.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"All comments returned with total count","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}},"total":{"type":"number","example":"10 // works also with swagger setup"}},"required":["comments","total"],"title":"PostAllCommentsResponse"}}}},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}/all-comments","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all post comments","description":{"content":"Retrieve all comments for a post in a single request without pagination. Useful for displaying full comment threads or export scenarios.","type":"text/plain"},"url":{"path":["v1","posts",":id","all-comments"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getAllComment","description":"Retrieve all comments for a post in a single request without pagination. Useful for displaying full comment threads or export scenarios.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"All comments returned with total count","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}},"total":{"type":"number","example":"10 // works also with swagger setup"}},"required":["comments","total"],"title":"PostAllCommentsResponse"},"example":{"comments":[{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]}],"total":"10 // works also with swagger setup"}}}},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}/all-comments","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all post comments","description":{"content":"Retrieve all comments for a post in a single request without pagination. Useful for displaying full comment threads or export scenarios.","type":"text/plain"},"url":{"path":["v1","posts",":id","all-comments"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve all comments for a post in a single request without pagination. Useful All comments returned with total count -
    Schema
      comments object[] required
    • Array [
    • author object
      avatarUrls object required
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • tags object[]
    • Array [
    • ]
    • ]
    +
    Schema
      comments object[] required
    • Array [
    • author object
      avatarUrls object required
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • tags object[]
    • Array [
    • ]
    • ]
    Post not found diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-comments.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-comments.api.mdx index 034d970b..7aac00c7 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-comments.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-comments.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve paginated top-level comments for a post. Use the replies sidebar_label: "Get post comments" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getComments","description":"Retrieve paginated top-level comments for a post. Use the replies endpoint to get nested replies for specific comments.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"Comments retrieved with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}}},"required":["total","currentPage","limit","pages","comments"],"title":"PostCommentsResponse"}}}},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}/comments","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get post comments","description":{"content":"Retrieve paginated top-level comments for a post. Use the replies endpoint to get nested replies for specific comments.","type":"text/plain"},"url":{"path":["v1","posts",":id","comments"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Number of results to return","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getComments","description":"Retrieve paginated top-level comments for a post. Use the replies endpoint to get nested replies for specific comments.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"Comments retrieved with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}}},"required":["total","currentPage","limit","pages","comments"],"title":"PostCommentsResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"comments":[{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]}]}}}},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}/comments","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get post comments","description":{"content":"Retrieve paginated top-level comments for a post. Use the replies endpoint to get nested replies for specific comments.","type":"text/plain"},"url":{"path":["v1","posts",":id","comments"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Number of results to return","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve paginated top-level comments for a post. Use the replies endpoint to ge Comments retrieved with pagination metadata -
    Schema
      comments object[] required
    • Array [
    • author object
      avatarUrls object required
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • tags object[]
    • Array [
    • ]
    • ]
    +
    Schema
      comments object[] required
    • Array [
    • author object
      avatarUrls object required
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • tags object[]
    • Array [
    • ]
    • ]
    Post not found diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-liked-state.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-liked-state.api.mdx index 2d2056c1..5185d68d 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-liked-state.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-liked-state.api.mdx @@ -5,7 +5,7 @@ description: "Returns whether the authenticated user currently likes the post. T sidebar_label: "Get post liked state" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getLikedState","description":"Returns whether the authenticated user currently likes the post. This lightweight endpoint avoids loading the full post payload for simple like-state checks.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to check liked state for","schema":{"type":"number"}}],"responses":{"200":{"description":"Like state retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true when the post is liked by the current user"}}}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}/liked","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get post liked state","description":{"content":"Returns whether the authenticated user currently likes the post. This lightweight endpoint avoids loading the full post payload for simple like-state checks.","type":"text/plain"},"url":{"path":["v1","posts",":id","liked"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to check liked state for","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getLikedState","description":"Returns whether the authenticated user currently likes the post. This lightweight endpoint avoids loading the full post payload for simple like-state checks.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to check liked state for","schema":{"type":"number"}}],"responses":{"200":{"description":"Like state retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true when the post is liked by the current user"}}},"example":{"liked":true}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}/liked","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get post liked state","description":{"content":"Returns whether the authenticated user currently likes the post. This lightweight endpoint avoids loading the full post payload for simple like-state checks.","type":"text/plain"},"url":{"path":["v1","posts",":id","liked"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to check liked state for","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Returns whether the authenticated user currently likes the post. This lightweigh Like state retrieved successfully -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-loggedin-user-posts.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-loggedin-user-posts.api.mdx index 4ef7719a..c13bd167 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-loggedin-user-posts.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-loggedin-user-posts.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve posts created by the currently authenticated user. Suppor sidebar_label: "Get current user posts" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getLoggedinUserPosts","description":"Retrieve posts created by the currently authenticated user. Supports filtering by tab (MY_REFLECTIONS, SAVED, DRAFTS), sorting options, and post type filtering.","parameters":[{"name":"tab","required":false,"in":"query","description":"Profile tab filter (default: my_reflections)","schema":{"enum":["my_reflections","saved","notes","mentions"],"type":"string"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order for posts (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20, max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"postTypeIds","required":false,"in":"query","description":"Array of post type IDs to filter by","schema":{"type":"array","items":{"type":"number"}}}],"responses":{"200":{"description":"User posts retrieved successfully with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"}}}},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/my-posts","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get current user posts","description":{"content":"Retrieve posts created by the currently authenticated user. Supports filtering by tab (MY_REFLECTIONS, SAVED, DRAFTS), sorting options, and post type filtering.","type":"text/plain"},"url":{"path":["v1","posts","my-posts"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Profile tab filter (default: my_reflections)","type":"text/plain"},"key":"tab","value":""},{"disabled":false,"description":{"content":"Sort order for posts (default: latest)","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"Number of posts per page (default: 20, max: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Array of post type IDs to filter by","type":"text/plain"},"key":"postTypeIds","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getLoggedinUserPosts","description":"Retrieve posts created by the currently authenticated user. Supports filtering by tab (MY_REFLECTIONS, SAVED, DRAFTS), sorting options, and post type filtering.","parameters":[{"name":"tab","required":false,"in":"query","description":"Profile tab filter (default: my_reflections)","schema":{"enum":["my_reflections","saved","notes","mentions"],"type":"string"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order for posts (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20, max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"postTypeIds","required":false,"in":"query","description":"Array of post type IDs to filter by","schema":{"type":"array","items":{"type":"number"}}}],"responses":{"200":{"description":"User posts retrieved successfully with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/my-posts","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get current user posts","description":{"content":"Retrieve posts created by the currently authenticated user. Supports filtering by tab (MY_REFLECTIONS, SAVED, DRAFTS), sorting options, and post type filtering.","type":"text/plain"},"url":{"path":["v1","posts","my-posts"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Profile tab filter (default: my_reflections)","type":"text/plain"},"key":"tab","value":""},{"disabled":false,"description":{"content":"Sort order for posts (default: latest)","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"Number of posts per page (default: 20, max: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Array of post type IDs to filter by","type":"text/plain"},"key":"postTypeIds","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve posts created by the currently authenticated user. Supports filtering b User posts retrieved successfully with pagination metadata -
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    +
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-my-posts-by-verse.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-my-posts-by-verse.api.mdx index 653295d2..fba36760 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-my-posts-by-verse.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-my-posts-by-verse.api.mdx @@ -1,11 +1,11 @@ --- id: posts-controller-get-my-posts-by-verse title: "Get posts by verse" -description: "Retrieve all posts written by the current user for a specific Quran verse. Returns posts referencing the exact verse key." +description: "Retrieve all posts written by the current user for a specific Quran verse. This endpoint requires a user-bound token and returns only the authenticated user's own posts. It is not part of the public `client_credentials`-compatible read subset; for public ayah-by-ayah reads, use `GET /v1/posts/feed` with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`." sidebar_label: "Get posts by verse" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getMyPostsByVerse","description":"Retrieve all posts written by the current user for a specific Quran verse. Returns posts referencing the exact verse key.","parameters":[{"name":"verseKey","required":true,"in":"path","description":"Verse key in format chapter:verse","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:255","type":"string"}}],"responses":{"200":{"description":"User posts for the specified verse","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"}}}},"400":{"description":"Invalid verse key format"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/by-verse/{verseKey}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get posts by verse","description":{"content":"Retrieve all posts written by the current user for a specific Quran verse. Returns posts referencing the exact verse key.","type":"text/plain"},"url":{"path":["v1","posts","by-verse",":verseKey"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Verse key in format chapter:verse","type":"text/plain"},"type":"any","value":"","key":"verseKey"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getMyPostsByVerse","description":"Retrieve all posts written by the current user for a specific Quran verse. This endpoint requires a user-bound token and returns only the authenticated user's own posts. It is not part of the public `client_credentials`-compatible read subset; for public ayah-by-ayah reads, use `GET /v1/posts/feed` with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.","parameters":[{"name":"verseKey","required":true,"in":"path","description":"Verse key in format chapter:verse","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:255","type":"string"}}],"responses":{"200":{"description":"User posts for the specified verse","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}},"400":{"description":"Invalid verse key format"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/by-verse/{verseKey}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get posts by verse","description":{"content":"Retrieve all posts written by the current user for a specific Quran verse. This endpoint requires a user-bound token and returns only the authenticated user's own posts. It is not part of the public `client_credentials`-compatible read subset; for public ayah-by-ayah reads, use `GET /v1/posts/feed` with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.","type":"text/plain"},"url":{"path":["v1","posts","by-verse",":verseKey"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Verse key in format chapter:verse","type":"text/plain"},"type":"any","value":"","key":"verseKey"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -25,13 +25,13 @@ import TabItem from "@theme/TabItem"; -Retrieve all posts written by the current user for a specific Quran verse. Returns posts referencing the exact verse key. +Retrieve all posts written by the current user for a specific Quran verse. This endpoint requires a user-bound token and returns only the authenticated user's own posts. It is not part of the public `client_credentials`-compatible read subset; for public ayah-by-ayah reads, use `GET /v1/posts/feed` with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.
    Path Parameters
    User posts for the specified verse -
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    +
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    Invalid verse key format diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-my-posts-count-within-range.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-my-posts-count-within-range.api.mdx index 5abe0f0b..4c260d28 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-my-posts-count-within-range.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-my-posts-count-within-range.api.mdx @@ -5,7 +5,7 @@ description: "Count how many posts the current user has written for verses withi sidebar_label: "Get posts count within range" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getMyPostsCountWithinRange","description":"Count how many posts the current user has written for verses within a specified Quran verse range. Useful for reading goals and progress tracking.","parameters":[{"name":"from","required":true,"in":"query","description":"Start verse key in format chapter:verse (e.g., \"2:1\")","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:1","type":"string"}},{"name":"to","required":true,"in":"query","description":"End verse key in format chapter:verse (e.g., \"2:286\")","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:286","type":"string"}}],"responses":{"200":{"description":"Count of posts within the specified verse range","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number","example":5}}}}}},"400":{"description":"Invalid verse range - malformed keys or from > to"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/count-within-range","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get posts count within range","description":{"content":"Count how many posts the current user has written for verses within a specified Quran verse range. Useful for reading goals and progress tracking.","type":"text/plain"},"url":{"path":["v1","posts","count-within-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Start verse key in format chapter:verse (e.g., \"2:1\")","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"(Required) End verse key in format chapter:verse (e.g., \"2:286\")","type":"text/plain"},"key":"to","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getMyPostsCountWithinRange","description":"Count how many posts the current user has written for verses within a specified Quran verse range. Useful for reading goals and progress tracking.","parameters":[{"name":"from","required":true,"in":"query","description":"Start verse key in format chapter:verse (e.g., \"2:1\")","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:1","type":"string"}},{"name":"to","required":true,"in":"query","description":"End verse key in format chapter:verse (e.g., \"2:286\")","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:286","type":"string"}}],"responses":{"200":{"description":"Count of posts within the specified verse range","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number","example":5}}},"example":{"count":5}}}},"400":{"description":"Invalid verse range - malformed keys or from > to"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/count-within-range","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get posts count within range","description":{"content":"Count how many posts the current user has written for verses within a specified Quran verse range. Useful for reading goals and progress tracking.","type":"text/plain"},"url":{"path":["v1","posts","count-within-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Start verse key in format chapter:verse (e.g., \"2:1\")","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"(Required) End verse key in format chapter:verse (e.g., \"2:286\")","type":"text/plain"},"key":"to","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Count how many posts the current user has written for verses within a specified Count of posts within the specified verse range -
    Schema
    +
    Schema
    Invalid verse range - malformed keys or from > to diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-related-posts.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-related-posts.api.mdx index bbb5c48c..1392a9e9 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-related-posts.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-related-posts.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve posts related to a given post by matching its Quran refer sidebar_label: "Get related posts" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getRelatedPosts","description":"Retrieve posts related to a given post by matching its Quran references with OR logic. Results are filtered by language preferences and ordered by popularity, excluding the source post.","parameters":[{"name":"postId","required":true,"in":"path","description":"Source post ID used for related-post matching","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 8, max: 8)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Related posts retrieved successfully with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"}}}},"404":{"description":"Source post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{postId}/related","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get related posts","description":{"content":"Retrieve posts related to a given post by matching its Quran references with OR logic. Results are filtered by language preferences and ordered by popularity, excluding the source post.","type":"text/plain"},"url":{"path":["v1","posts",":postId","related"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Number of posts per page (default: 8, max: 8)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Source post ID used for related-post matching","type":"text/plain"},"type":"any","value":"","key":"postId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getRelatedPosts","description":"Retrieve posts related to a given post by matching its Quran references with OR logic. Results are filtered by language preferences and ordered by popularity, excluding the source post.","parameters":[{"name":"postId","required":true,"in":"path","description":"Source post ID used for related-post matching","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 8, max: 8)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Related posts retrieved successfully with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}},"404":{"description":"Source post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{postId}/related","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get related posts","description":{"content":"Retrieve posts related to a given post by matching its Quran references with OR logic. Results are filtered by language preferences and ordered by popularity, excluding the source post.","type":"text/plain"},"url":{"path":["v1","posts",":postId","related"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Number of posts per page (default: 8, max: 8)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Source post ID used for related-post matching","type":"text/plain"},"type":"any","value":"","key":"postId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,9 +31,8 @@ Retrieve posts related to a given post by matching its Quran references with OR Related posts retrieved successfully with pagination metadata -
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    +
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    Source post not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-user-post.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-user-post.api.mdx index d3989ae8..6fdb812d 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-get-user-post.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-get-user-post.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve public posts created by a specific user. If viewing own p sidebar_label: "Get user posts" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getUserPost","description":"Retrieve public posts created by a specific user. If viewing own posts while authenticated, returns all posts including drafts. Supports sorting and filtering by post type.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user whose posts to retrieve","schema":{"type":"string"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order for posts (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20, max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"postTypeIds","required":false,"in":"query","description":"Array of post type IDs to filter by","schema":{"type":"array","items":{"type":"number"}}}],"responses":{"200":{"description":"User posts retrieved with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/user-posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user posts","description":{"content":"Retrieve public posts created by a specific user. If viewing own posts while authenticated, returns all posts including drafts. Supports sorting and filtering by post type.","type":"text/plain"},"url":{"path":["v1","posts","user-posts",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort order for posts (default: latest)","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"Number of posts per page (default: 20, max: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Array of post type IDs to filter by","type":"text/plain"},"key":"postTypeIds","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user whose posts to retrieve","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getUserPost","description":"Retrieve public posts created by a specific user. If viewing own posts while authenticated, returns all posts including drafts. Supports sorting and filtering by post type.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user whose posts to retrieve","schema":{"type":"string"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order for posts (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20, max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"postTypeIds","required":false,"in":"query","description":"Array of post type IDs to filter by","schema":{"type":"array","items":{"type":"number"}}}],"responses":{"200":{"description":"User posts retrieved with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/user-posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user posts","description":{"content":"Retrieve public posts created by a specific user. If viewing own posts while authenticated, returns all posts including drafts. Supports sorting and filtering by post type.","type":"text/plain"},"url":{"path":["v1","posts","user-posts",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort order for posts (default: latest)","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"Number of posts per page (default: 20, max: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Array of post type IDs to filter by","type":"text/plain"},"key":"postTypeIds","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user whose posts to retrieve","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,5 +31,5 @@ Retrieve public posts created by a specific user. If viewing own posts while aut User posts retrieved with pagination metadata -
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    +
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-report-abuse.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-report-abuse.api.mdx index 6917df5d..824b6eed 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-report-abuse.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-report-abuse.api.mdx @@ -5,7 +5,7 @@ description: "Report a post for moderation review. Provide a reason for the repo sidebar_label: "Report post abuse" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_reportAbuse","description":"Report a post for moderation review. Provide a reason for the report to help moderators evaluate the content. Multiple reports on the same post may trigger automatic review.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to report","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Report details including reason for flagging the content","content":{"application/json":{"schema":{"type":"object","properties":{"report":{"type":"object","properties":{"abuse":{"type":"string"},"comments":{"type":"string","default":""}},"required":["abuse","comments"],"title":"ReportAbuseDto"}},"required":["report"],"title":"ReportAbuseBodyDto"}}}},"responses":{"200":{"description":"Report submitted successfully for moderation review","content":{"application/json":{"schema":{"type":"object","properties":{"reported":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/{id}/report","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"report":{"abuse":"string","comments":"string"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Report post abuse","description":{"content":"Report a post for moderation review. Provide a reason for the report to help moderators evaluate the content. Multiple reports on the same post may trigger automatic review.","type":"text/plain"},"url":{"path":["v1","posts",":id","report"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to report","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"PostsController_reportAbuse","description":"Report a post for moderation review. Provide a reason for the report to help moderators evaluate the content. Multiple reports on the same post may trigger automatic review.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to report","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Report details including reason for flagging the content","content":{"application/json":{"schema":{"type":"object","properties":{"report":{"type":"object","properties":{"abuse":{"type":"string"},"comments":{"type":"string","default":""}},"required":["abuse","comments"],"title":"ReportAbuseDto"}},"required":["report"],"title":"ReportAbuseBodyDto"},"example":{"report":{"abuse":"string","comments":""}}}}},"responses":{"200":{"description":"Report submitted successfully for moderation review","content":{"application/json":{"schema":{"type":"object","properties":{"reported":{"type":"boolean","example":true}}},"example":{"reported":true}}}},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/{id}/report","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"report":{"abuse":"string","comments":"string"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Report post abuse","description":{"content":"Report a post for moderation review. Provide a reason for the report to help moderators evaluate the content. Multiple reports on the same post may trigger automatic review.","type":"text/plain"},"url":{"path":["v1","posts",":id","report"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to report","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Report details including reason for flagging the content Report submitted successfully for moderation review -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-toggle-like.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-toggle-like.api.mdx index 9ec5a98b..f04ac1e1 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-toggle-like.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-toggle-like.api.mdx @@ -5,7 +5,7 @@ description: "Toggle like status for a post. If already liked, removes the like. sidebar_label: "Toggle post like" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_toggleLike","description":"Toggle like status for a post. If already liked, removes the like. If not liked, adds a like. Updates the post like count and triggers notifications.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to like/unlike","schema":{"type":"number"}}],"responses":{"200":{"description":"Like status toggled - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true if now liked, false if now unliked"}}}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/{id}/toggle-like","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle post like","description":{"content":"Toggle like status for a post. If already liked, removes the like. If not liked, adds a like. Updates the post like count and triggers notifications.","type":"text/plain"},"url":{"path":["v1","posts",":id","toggle-like"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to like/unlike","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"PostsController_toggleLike","description":"Toggle like status for a post. If already liked, removes the like. If not liked, adds a like. Updates the post like count and triggers notifications.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to like/unlike","schema":{"type":"number"}}],"responses":{"200":{"description":"Like status toggled - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true if now liked, false if now unliked"}}},"example":{"liked":true}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/{id}/toggle-like","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle post like","description":{"content":"Toggle like status for a post. If already liked, removes the like. If not liked, adds a like. Updates the post like count and triggers notifications.","type":"text/plain"},"url":{"path":["v1","posts",":id","toggle-like"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to like/unlike","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Toggle like status for a post. If already liked, removes the like. If not liked, Like status toggled - returns new state -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-toggle-save.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-toggle-save.api.mdx index 5b9584e2..4bc9e879 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-toggle-save.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-toggle-save.api.mdx @@ -5,7 +5,7 @@ description: "Toggle save/bookmark status for a post. Saved posts appear in the sidebar_label: "Toggle post save" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_toggleSave","description":"Toggle save/bookmark status for a post. Saved posts appear in the SAVED tab of the user profile for easy access later.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to save/unsave","schema":{"type":"number"}}],"responses":{"200":{"description":"Save status toggled - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"saved":{"type":"boolean","description":"true if now saved, false if now unsaved"}}}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/{id}/toggle-save","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle post save","description":{"content":"Toggle save/bookmark status for a post. Saved posts appear in the SAVED tab of the user profile for easy access later.","type":"text/plain"},"url":{"path":["v1","posts",":id","toggle-save"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to save/unsave","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"PostsController_toggleSave","description":"Toggle save/bookmark status for a post. Saved posts appear in the SAVED tab of the user profile for easy access later.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to save/unsave","schema":{"type":"number"}}],"responses":{"200":{"description":"Save status toggled - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"saved":{"type":"boolean","description":"true if now saved, false if now unsaved"}}},"example":{"saved":true}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/{id}/toggle-save","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle post save","description":{"content":"Toggle save/bookmark status for a post. Saved posts appear in the SAVED tab of the user profile for easy access later.","type":"text/plain"},"url":{"path":["v1","posts",":id","toggle-save"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to save/unsave","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Toggle save/bookmark status for a post. Saved posts appear in the SAVED tab of t Save status toggled - returns new state -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/posts-controller-view-tracking.api.mdx b/docs/user_related_apis_versioned/1.0.0/posts-controller-view-tracking.api.mdx index fdbaca0a..3e271a25 100644 --- a/docs/user_related_apis_versioned/1.0.0/posts-controller-view-tracking.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/posts-controller-view-tracking.api.mdx @@ -5,7 +5,7 @@ description: "Record that a post has been viewed by the current user (if authent sidebar_label: "Track post view" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_viewTracking","description":"Record that a post has been viewed by the current user (if authenticated). Used for analytics and engagement tracking. Does not require authentication but will track user-specific views when logged in.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"View tracked successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/viewed/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Track post view","description":{"content":"Record that a post has been viewed by the current user (if authenticated). Used for analytics and engagement tracking. Does not require authentication but will track user-specific views when logged in.","type":"text/plain"},"url":{"path":["v1","posts","viewed",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_viewTracking","description":"Record that a post has been viewed by the current user (if authenticated). Used for analytics and engagement tracking. Does not require authentication but will track user-specific views when logged in.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"View tracked successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}},"example":{"success":true}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/viewed/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Track post view","description":{"content":"Record that a post has been viewed by the current user (if authenticated). Used for analytics and engagement tracking. Does not require authentication but will track user-specific views when logged in.","type":"text/plain"},"url":{"path":["v1","posts","viewed",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,5 +31,5 @@ Record that a post has been viewed by the current user (if authenticated). Used View tracked successfully -
    Schema
    +
    Schema
    \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/publish-note.api.mdx b/docs/user_related_apis_versioned/1.0.0/publish-note.api.mdx deleted file mode 100644 index ff7a79bc..00000000 --- a/docs/user_related_apis_versioned/1.0.0/publish-note.api.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -id: publish-note -title: "Publish note" -description: "Publish a note to QR." -sidebar_label: "Publish note" -hide_title: true -hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Publish a note to QR.","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The unique identifier of the note to be retrieved or manipulated.","example":"asda12312312"},"required":true,"description":"The unique identifier of the note to be retrieved or manipulated."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:112-2:115"]}},"required":["body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"success":{"type":"boolean"},"postId":{"type":"number","format":"float"}},"required":["success"],"additionalProperties":false,"description":"Response object indicating the success of the note publishing operation and the optional post ID if successful.","example":{"success":true,"postId":123}}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/notes/:noteId/publish","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"body":"This is a sample note body.","ranges":["2:112-2:115"]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"}} -sidebar_class_name: "post api-method" -info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsVersionedSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Publish note - - - -Publish a note to QR. - -
    Path Parameters
    Request Body
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
    - -Request has been handled successfully. - -
    Schema
      data object
      - -Response object indicating the success of the note publishing operation and the optional post ID if successful. - -
    - -The request is missing required parameters or is invalid. - -
    Schema
    - -The request is unauthorized. - -
    Schema
    - -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
    - -Not Found. The resource being accessed does not exist. - -
    Schema
    - -Validation Error. The request includes one or more invalid params. Please check the request params and try again. - -
    Schema
    - -Too many requests, please try again later. - -
    Schema
    - -Server Error. Something went wrong, try again later. - -
    Schema
    - -Invalid response from the upstream server - -
    Schema
    - -The server is currently unable to handle the request due to a temporary overload or scheduled maintenance - -
    Schema
    - -The server did not receive a timely response from the upstream server. - -
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-accept-by-private-token.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-accept-by-private-token.api.mdx index 393e705b..bce46c59 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-accept-by-private-token.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-accept-by-private-token.api.mdx @@ -5,7 +5,7 @@ description: "Accept an invitation using a private room URL with embedded token. sidebar_label: "Accept room invite by private token" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_acceptByPrivateToken","description":"Accept an invitation using a private room URL with embedded token. Alternative to the /accept-invite endpoint for direct link access.","parameters":[{"name":"url","required":false,"in":"path","description":"Group URL identifier","schema":{"type":"string"}},{"name":"subdomain","required":false,"in":"path","description":"Page subdomain identifier","schema":{"type":"string"}},{"name":"token","required":true,"in":"path","description":"Private invitation token","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation accepted - user added to room"},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/group/{url}/accept/{token}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Accept room invite by private token","description":{"content":"Accept an invitation using a private room URL with embedded token. Alternative to the /accept-invite endpoint for direct link access.","type":"text/plain"},"url":{"path":["v1","rooms","group",":url","accept",":token"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"Group URL identifier","type":"text/plain"},"type":"any","value":"","key":"url"},{"disabled":false,"description":{"content":"Page subdomain identifier","type":"text/plain"},"type":"any","value":"","key":"subdomain"},{"disabled":false,"description":{"content":"(Required) Private invitation token","type":"text/plain"},"type":"any","value":"","key":"token"}]},"method":"GET"}} +api: {"operationId":"RoomsController_acceptByPrivateToken","description":"Accept an invitation using a private room URL with embedded token. Alternative to the /accept-invite endpoint for direct link access.","parameters":[{"name":"url","required":false,"in":"path","description":"Group URL identifier","schema":{"type":"string"}},{"name":"subdomain","required":false,"in":"path","description":"Page subdomain identifier","schema":{"type":"string"}},{"name":"token","required":true,"in":"path","description":"Private invitation token","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation accepted - user added to room","content":{"application/json":{"schema":{"type":"object","properties":{"roomId":{"type":"number","example":42},"success":{"type":"boolean","example":true},"isNewMember":{"type":"boolean","example":true}},"required":["roomId","success","isNewMember"],"title":"RoomAcceptByPrivateTokenResponseDto"},"example":{"roomId":42,"success":true,"isNewMember":true}}}},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/group/{url}/accept/{token}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Accept room invite by private token","description":{"content":"Accept an invitation using a private room URL with embedded token. Alternative to the /accept-invite endpoint for direct link access.","type":"text/plain"},"url":{"path":["v1","rooms","group",":url","accept",":token"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"Group URL identifier","type":"text/plain"},"type":"any","value":"","key":"url"},{"disabled":false,"description":{"content":"Page subdomain identifier","type":"text/plain"},"type":"any","value":"","key":"subdomain"},{"disabled":false,"description":{"content":"(Required) Private invitation token","type":"text/plain"},"type":"any","value":"","key":"token"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Accept an invitation using a private room URL with embedded token. Alternative t Invitation accepted - user added to room -
    +
    Schema
    Invalid or expired token diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-accept-invite.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-accept-invite.api.mdx index 76c058e0..d84ad99b 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-accept-invite.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-accept-invite.api.mdx @@ -5,7 +5,7 @@ description: "Accept an invitation to join a room using the token from the invit sidebar_label: "Accept room invite" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_acceptInvite","description":"Accept an invitation to join a room using the token from the invite link. Adds user as member.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"token","required":true,"in":"query","description":"Invitation token from invite link","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation accepted - user is now a member"},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/accept-invite","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Accept room invite","description":{"content":"Accept an invitation to join a room using the token from the invite link. Adds user as member.","type":"text/plain"},"url":{"path":["v1","rooms",":id","accept-invite"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Invitation token from invite link","type":"text/plain"},"key":"token","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"RoomsController_acceptInvite","description":"Accept an invitation to join a room using the token from the invite link. Adds user as member.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"token","required":true,"in":"query","description":"Invitation token from invite link","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation accepted - user is now a member","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean","example":true}},"required":["accepted"],"title":"RoomInviteAcceptedResponseDto"},"example":{"accepted":true}}}},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/accept-invite","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Accept room invite","description":{"content":"Accept an invitation to join a room using the token from the invite link. Adds user as member.","type":"text/plain"},"url":{"path":["v1","rooms",":id","accept-invite"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Invitation token from invite link","type":"text/plain"},"key":"token","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Accept an invitation to join a room using the token from the invite link. Adds u Invitation accepted - user is now a member -
    +
    Schema
    Invalid or expired token diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-admins-access.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-admins-access.api.mdx index 9c49ec99..2958f55b 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-admins-access.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-admins-access.api.mdx @@ -5,7 +5,7 @@ description: "Grant or revoke admin privileges for a user in a room. Only room o sidebar_label: "Update room admin access" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_adminsAccess","description":"Grant or revoke admin privileges for a user in a room. Only room owners or existing admins can modify admin access.","parameters":[],"requestBody":{"required":true,"description":"Contains roomId, userId, and admin boolean to grant/revoke access","content":{"application/json":{"schema":{"type":"object","properties":{"roomId":{"type":"number"},"userId":{"type":"string"},"admin":{"type":"boolean"}},"required":["roomId","userId","admin"],"title":"RoomAdminUpdateDto"}}}},"responses":{"200":{"description":"Admin access updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to modify admin access"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/admins-access","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"roomId":0,"userId":"string","admin":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update room admin access","description":{"content":"Grant or revoke admin privileges for a user in a room. Only room owners or existing admins can modify admin access.","type":"text/plain"},"url":{"path":["v1","rooms","admins-access"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_adminsAccess","description":"Grant or revoke admin privileges for a user in a room. Only room owners or existing admins can modify admin access.","parameters":[],"requestBody":{"required":true,"description":"Contains roomId, userId, and admin boolean to grant/revoke access","content":{"application/json":{"schema":{"type":"object","properties":{"roomId":{"type":"number"},"userId":{"type":"string"},"admin":{"type":"boolean"}},"required":["roomId","userId","admin"],"title":"RoomAdminUpdateDto"},"example":{"roomId":1,"userId":"string","admin":true}}}},"responses":{"200":{"description":"Admin access updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}},"example":{"success":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to modify admin access"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/admins-access","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"roomId":0,"userId":"string","admin":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update room admin access","description":{"content":"Grant or revoke admin privileges for a user in a room. Only room owners or existing admins can modify admin access.","type":"text/plain"},"url":{"path":["v1","rooms","admins-access"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Contains roomId, userId, and admin boolean to grant/revoke access Admin access updated successfully -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-create-new-group.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-create-new-group.api.mdx index b705ce9e..0e254886 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-create-new-group.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-create-new-group.api.mdx @@ -5,7 +5,7 @@ description: "Create a new community group for sharing reflections. Groups can b sidebar_label: "Create a new group" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_createNewGroup","description":"Create a new community group for sharing reflections. Groups can be public or private, and the creator becomes the owner.","parameters":[],"requestBody":{"required":true,"description":"Group creation details including name, description, URL, and visibility","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","maxLength":200},"url":{"type":"string","minLength":1,"maxLength":50},"public":{"type":"boolean"}},"required":["name","url"],"title":"CreateGroupDto"}}}},"responses":{"201":{"description":"Group created successfully"},"400":{"description":"Invalid group data or URL already taken"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/groups","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"string","description":"string","url":"string","public":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a new group","description":{"content":"Create a new community group for sharing reflections. Groups can be public or private, and the creator becomes the owner.","type":"text/plain"},"url":{"path":["v1","rooms","groups"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_createNewGroup","description":"Create a new community group for sharing reflections. Groups can be public or private, and the creator becomes the owner.","parameters":[],"requestBody":{"required":true,"description":"Group creation details including name, description, URL, and visibility","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","maxLength":200},"url":{"type":"string","minLength":1,"maxLength":50},"public":{"type":"boolean"}},"required":["name","url"],"title":"CreateGroupDto"},"example":{"name":"string","description":"string","url":"string","public":true}}}},"responses":{"201":{"description":"Group created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"roomType":{"type":"string"},"isActive":{"type":"boolean"},"isVerified":{"type":"boolean"},"isPublic":{"type":"boolean"},"isOwner":{"type":"boolean"},"isAdmin":{"type":"boolean"},"ownerId":{"type":"string"},"postsCount":{"type":"number"},"membersCount":{"type":"number"},"url":{"type":"string"},"avatarUrls":{"type":"object","properties":{"thumb":{"required":true,"type":"string"},"original":{"required":true,"type":"string"}}},"createdAt":{"format":"date-time","type":"string"},"isMember":{"type":"boolean"},"subdomain":{"type":"string"},"country":{"type":"string"}},"required":["id","name","description","roomType","isActive","isVerified","isPublic","isOwner","isAdmin","ownerId","postsCount","membersCount","avatarUrls"],"title":"RoomListItemDto"}},"required":["success","data"],"title":"RoomCreatedResponseDto"},"example":{"success":true,"data":{"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}}}}},"400":{"description":"Invalid group data or URL already taken"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/groups","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"string","description":"string","url":"string","public":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a new group","description":{"content":"Create a new community group for sharing reflections. Groups can be public or private, and the creator becomes the owner.","type":"text/plain"},"url":{"path":["v1","rooms","groups"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Group creation details including name, description, URL, and visibility Group created successfully -
    +
    Schema
      data object required
      avatarUrls object required
    Invalid group data or URL already taken diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-create-new-page.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-create-new-page.api.mdx index 7d3d8a00..ce20a0b4 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-create-new-page.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-create-new-page.api.mdx @@ -5,7 +5,7 @@ description: "Submit a request to create a new organizational page. Pages requir sidebar_label: "Create a new page" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_createNewPage","description":"Submit a request to create a new organizational page. Pages require admin approval and include organization details, contact info, and purpose statement.","parameters":[],"requestBody":{"required":true,"description":"Page creation details including name, description, URL, organization info, and purpose","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"jobTitle":{"type":"string"},"contactNumber":{"type":"string"},"organizationName":{"type":"string"},"organizationWebsite":{"type":"string"},"purpose":{"type":"string"},"additionalDetails":{"type":"string"},"country":{"type":"string"},"url":{"type":"string"},"public":{"type":"boolean"}},"required":["name","jobTitle","contactNumber","organizationName","purpose","url"],"title":"CreatePageDto"}}}},"responses":{"201":{"description":"Page request submitted for admin review","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"},"message":{"type":"string"}}}}}},"400":{"description":"Invalid page data or URL already taken"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/pages","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"string","description":"string","jobTitle":"string","contactNumber":"string","organizationName":"string","organizationWebsite":"string","purpose":"string","additionalDetails":"string","country":"string","url":"string","public":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a new page","description":{"content":"Submit a request to create a new organizational page. Pages require admin approval and include organization details, contact info, and purpose statement.","type":"text/plain"},"url":{"path":["v1","rooms","pages"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_createNewPage","description":"Submit a request to create a new organizational page. Pages require admin approval and include organization details, contact info, and purpose statement.","parameters":[],"requestBody":{"required":true,"description":"Page creation details including name, description, URL, organization info, and purpose","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"jobTitle":{"type":"string"},"contactNumber":{"type":"string"},"organizationName":{"type":"string"},"organizationWebsite":{"type":"string"},"purpose":{"type":"string"},"additionalDetails":{"type":"string"},"country":{"type":"string"},"url":{"type":"string"},"public":{"type":"boolean"}},"required":["name","jobTitle","contactNumber","organizationName","purpose","url"],"title":"CreatePageDto"},"example":{"name":"string","description":"string","jobTitle":"string","contactNumber":"string","organizationName":"string","organizationWebsite":"string","purpose":"string","additionalDetails":"string","country":"string","url":"string","public":true}}}},"responses":{"201":{"description":"Page request submitted for admin review","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"},"message":{"type":"string"}}},"example":{"success":true,"data":{},"message":"string"}}}},"400":{"description":"Invalid page data or URL already taken"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/pages","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"string","description":"string","jobTitle":"string","contactNumber":"string","organizationName":"string","organizationWebsite":"string","purpose":"string","additionalDetails":"string","country":"string","url":"string","public":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a new page","description":{"content":"Submit a request to create a new organizational page. Pages require admin approval and include organization details, contact info, and purpose statement.","type":"text/plain"},"url":{"path":["v1","rooms","pages"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Page creation details including name, description, URL, organization info, and p Page request submitted for admin review -
    Schema
    +
    Schema
    Invalid page data or URL already taken diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-follow-page.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-follow-page.api.mdx index b9f2786e..c841c764 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-follow-page.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-follow-page.api.mdx @@ -5,7 +5,7 @@ description: "Follow an organizational page to see their posts in your feed. Pag sidebar_label: "Follow a page" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_followPage","description":"Follow an organizational page to see their posts in your feed. Pages represent verified organizations or scholars.","parameters":[{"name":"pageId","required":true,"in":"path","description":"Unique numeric page ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully followed the page","content":{"application/json":{"schema":{"type":"object","properties":{"followed":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{pageId}/follow","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Follow a page","description":{"content":"Follow an organizational page to see their posts in your feed. Pages represent verified organizations or scholars.","type":"text/plain"},"url":{"path":["v1","rooms",":pageId","follow"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric page ID","type":"text/plain"},"type":"any","value":"","key":"pageId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"RoomsController_followPage","description":"Follow an organizational page to see their posts in your feed. Pages represent verified organizations or scholars.","parameters":[{"name":"pageId","required":true,"in":"path","description":"Unique numeric page ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully followed the page","content":{"application/json":{"schema":{"type":"object","properties":{"followed":{"type":"boolean","example":true}}},"example":{"followed":true}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{pageId}/follow","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Follow a page","description":{"content":"Follow an organizational page to see their posts in your feed. Pages represent verified organizations or scholars.","type":"text/plain"},"url":{"path":["v1","rooms",":pageId","follow"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric page ID","type":"text/plain"},"type":"any","value":"","key":"pageId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Follow an organizational page to see their posts in your feed. Pages represent v Successfully followed the page -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-members.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-members.api.mdx index 3da087b0..988dc198 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-members.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-members.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve paginated list of members in a room (group or page). Retu sidebar_label: "Get room members" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_getRoomMembers","description":"Retrieve paginated list of members in a room (group or page). Returns user profiles with their roles.","parameters":[{"name":"limit","required":false,"in":"query","description":"Members per page (default: 10)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Room members retrieved with pagination"},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/members","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room members","description":{"content":"Retrieve paginated list of members in a room (group or page). Returns user profiles with their roles.","type":"text/plain"},"url":{"path":["v1","rooms",":id","members"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Members per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"RoomsController_getRoomMembers","description":"Retrieve paginated list of members in a room (group or page). Returns user profiles with their roles.","parameters":[{"name":"limit","required":false,"in":"query","description":"Members per page (default: 10)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Room members retrieved with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"user-1"},"username":{"type":"string","example":"member.username"},"firstName":{"type":"string","example":"Member"},"lastName":{"type":"string","example":"User"},"verified":{"type":"boolean","example":true},"avatarUrls":{"type":"object","example":{"small":"https://avatars.quran.foundation/users/user-1/small.png","medium":"https://avatars.quran.foundation/users/user-1/medium.png","large":"https://avatars.quran.foundation/users/user-1/large.png"}},"isAdmin":{"type":"boolean","example":false},"isOwner":{"type":"boolean","example":false},"isFollowed":{"type":"boolean","example":true},"isActive":{"type":"boolean","example":true},"followersCount":{"type":"number","example":42}},"required":["id","username","firstName","lastName","verified","avatarUrls","isAdmin","isOwner","isFollowed","isActive","followersCount"],"title":"MemberSerializedDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"RoomMembersResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"id":"user-1","username":"member.username","firstName":"Member","lastName":"User","verified":true,"avatarUrls":{"small":"https://avatars.quran.foundation/users/user-1/small.png","medium":"https://avatars.quran.foundation/users/user-1/medium.png","large":"https://avatars.quran.foundation/users/user-1/large.png"},"isAdmin":false,"isOwner":false,"isFollowed":true,"isActive":true,"followersCount":42}]}}}},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/members","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room members","description":{"content":"Retrieve paginated list of members in a room (group or page). Returns user profiles with their roles.","type":"text/plain"},"url":{"path":["v1","rooms",":id","members"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Members per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve paginated list of members in a room (group or page). Returns user profi Room members retrieved with pagination -
    +
    Schema
      data object[] required
    • Array [
    • ]
    Room not found diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-posts.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-posts.api.mdx index ad5b8153..8577a3a8 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-posts.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-posts.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve paginated posts shared within a room. Supports filtering sidebar_label: "Get room posts" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_getRoomPosts","description":"Retrieve paginated posts shared within a room. Supports filtering by tab (REFLECTIONS, DISCUSSIONS) and sorting (LATEST, POPULAR).","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Posts per page (max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"tab","required":false,"in":"query","description":"Filter posts by content type","schema":{"enum":["reflections","saved","public","members_only"],"type":"string"}}],"responses":{"200":{"description":"Room posts with pagination"},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/posts","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room posts","description":{"content":"Retrieve paginated posts shared within a room. Supports filtering by tab (REFLECTIONS, DISCUSSIONS) and sorting (LATEST, POPULAR).","type":"text/plain"},"url":{"path":["v1","rooms",":id","posts"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort order (default: latest)","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"Posts per page (max: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Filter posts by content type","type":"text/plain"},"key":"tab","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"RoomsController_getRoomPosts","description":"Retrieve paginated posts shared within a room. Supports filtering by tab (REFLECTIONS, DISCUSSIONS) and sorting (LATEST, POPULAR).","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Posts per page (max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"tab","required":false,"in":"query","description":"Filter posts by content type","schema":{"enum":["reflections","saved","public","members_only"],"type":"string"}}],"responses":{"200":{"description":"Room posts with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/posts","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room posts","description":{"content":"Retrieve paginated posts shared within a room. Supports filtering by tab (REFLECTIONS, DISCUSSIONS) and sorting (LATEST, POPULAR).","type":"text/plain"},"url":{"path":["v1","rooms",":id","posts"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort order (default: latest)","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"Posts per page (max: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Filter posts by content type","type":"text/plain"},"key":"tab","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve paginated posts shared within a room. Supports filtering by tab (REFLEC Room posts with pagination -
    +
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    Room not found diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-profile-by-id.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-profile-by-id.api.mdx index 333e65bb..1e0cdb5b 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-profile-by-id.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-profile-by-id.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve a room profile by its unique numeric ID. Returns room det sidebar_label: "Get room profile by ID" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_getRoomProfileById","description":"Retrieve a room profile by its unique numeric ID. Returns room details, member counts, and relationship status for the current user.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Room profile retrieved successfully"},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room profile by ID","description":{"content":"Retrieve a room profile by its unique numeric ID. Returns room details, member counts, and relationship status for the current user.","type":"text/plain"},"url":{"path":["v1","rooms",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"RoomsController_getRoomProfileById","description":"Retrieve a room profile by its unique numeric ID. Returns room details, member counts, and relationship status for the current user.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Room profile retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"privateToken":{"type":"string","example":"private-room-token"},"mutualFollowers":{"type":"array","items":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"}},"mutualFollowersCount":{"type":"number","example":2},"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"roomType":{"type":"string"},"isActive":{"type":"boolean"},"isVerified":{"type":"boolean"},"isPublic":{"type":"boolean"},"isOwner":{"type":"boolean"},"isAdmin":{"type":"boolean"},"ownerId":{"type":"string"},"postsCount":{"type":"number"},"membersCount":{"type":"number"},"url":{"type":"string"},"avatarUrls":{"type":"object","properties":{"thumb":{"required":true,"type":"string"},"original":{"required":true,"type":"string"}}},"createdAt":{"format":"date-time","type":"string"},"isMember":{"type":"boolean"},"subdomain":{"type":"string"},"country":{"type":"string"}},"required":["id","name","description","roomType","isActive","isVerified","isPublic","isOwner","isAdmin","ownerId","postsCount","membersCount","avatarUrls"],"title":"RoomProfileResponseDto"},"example":{"privateToken":"private-room-token","mutualFollowers":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}],"mutualFollowersCount":2,"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}}}},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room profile by ID","description":{"content":"Retrieve a room profile by its unique numeric ID. Returns room details, member counts, and relationship status for the current user.","type":"text/plain"},"url":{"path":["v1","rooms",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve a room profile by its unique numeric ID. Returns room details, member c Room profile retrieved successfully -
    +
    Schema
      mutualFollowers object[]
    • Array [
    • settings object required
    • ]
    • avatarUrls object required
    Room not found diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-profile.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-profile.api.mdx index 9008dc09..a8fa3e3a 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-profile.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-room-profile.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve a room profile by its unique URL (for groups) or subdomai sidebar_label: "Get room profile by URL or subdomain" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_getRoomProfile","description":"Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Returns room details, member counts, and relationship status.","parameters":[{"name":"url","required":false,"in":"path","description":"Group URL identifier (lowercase)","schema":{"type":"string"}},{"name":"subdomain","required":false,"in":"path","description":"Page subdomain identifier (lowercase)","schema":{"type":"string"}}],"responses":{"200":{"description":"Room profile with details and membership info"},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/group/{url}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room profile by URL or subdomain","description":{"content":"Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Returns room details, member counts, and relationship status.","type":"text/plain"},"url":{"path":["v1","rooms","group",":url"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"Group URL identifier (lowercase)","type":"text/plain"},"type":"any","value":"","key":"url"},{"disabled":false,"description":{"content":"Page subdomain identifier (lowercase)","type":"text/plain"},"type":"any","value":"","key":"subdomain"}]},"method":"GET"}} +api: {"operationId":"RoomsController_getRoomProfile","description":"Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Returns room details, member counts, and relationship status.","parameters":[{"name":"url","required":false,"in":"path","description":"Group URL identifier (lowercase)","schema":{"type":"string"}},{"name":"subdomain","required":false,"in":"path","description":"Page subdomain identifier (lowercase)","schema":{"type":"string"}}],"responses":{"200":{"description":"Room profile with details and membership info","content":{"application/json":{"schema":{"type":"object","properties":{"privateToken":{"type":"string","example":"private-room-token"},"mutualFollowers":{"type":"array","items":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"}},"mutualFollowersCount":{"type":"number","example":2},"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"roomType":{"type":"string"},"isActive":{"type":"boolean"},"isVerified":{"type":"boolean"},"isPublic":{"type":"boolean"},"isOwner":{"type":"boolean"},"isAdmin":{"type":"boolean"},"ownerId":{"type":"string"},"postsCount":{"type":"number"},"membersCount":{"type":"number"},"url":{"type":"string"},"avatarUrls":{"type":"object","properties":{"thumb":{"required":true,"type":"string"},"original":{"required":true,"type":"string"}}},"createdAt":{"format":"date-time","type":"string"},"isMember":{"type":"boolean"},"subdomain":{"type":"string"},"country":{"type":"string"}},"required":["id","name","description","roomType","isActive","isVerified","isPublic","isOwner","isAdmin","ownerId","postsCount","membersCount","avatarUrls"],"title":"RoomProfileResponseDto"},"example":{"privateToken":"private-room-token","mutualFollowers":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}],"mutualFollowersCount":2,"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}}}},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/group/{url}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room profile by URL or subdomain","description":{"content":"Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Returns room details, member counts, and relationship status.","type":"text/plain"},"url":{"path":["v1","rooms","group",":url"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"Group URL identifier (lowercase)","type":"text/plain"},"type":"any","value":"","key":"url"},{"disabled":false,"description":{"content":"Page subdomain identifier (lowercase)","type":"text/plain"},"type":"any","value":"","key":"subdomain"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Room profile with details and membership info -
    +
    Schema
      mutualFollowers object[]
    • Array [
    • settings object required
    • ]
    • avatarUrls object required
    Room not found diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-rooms.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-rooms.api.mdx index e9d5899c..d25f2031 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-rooms.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-get-rooms.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve rooms the user has joined (joined-rooms) or manages as ad sidebar_label: "Get joined or managed rooms" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_getRooms","description":"Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-rooms). Supports search and pagination.","parameters":[{"name":"query","required":false,"in":"query","description":"Search query for room names","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Rooms per page (default: 5)","schema":{"minimum":1,"maximum":5,"default":5,"type":"number"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order (default: NAME_ASC)","schema":{"enum":["NAME_ASC","NAME_DESC","LATEST_ACTIVITY"],"type":"string"}}],"responses":{"200":{"description":"Rooms retrieved with pagination"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/joined-rooms","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get joined or managed rooms","description":{"content":"Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-rooms). Supports search and pagination.","type":"text/plain"},"url":{"path":["v1","rooms","joined-rooms"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search query for room names","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Rooms per page (default: 5)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Sort order (default: NAME_ASC)","type":"text/plain"},"key":"sortBy","value":""}],"variable":[]},"method":"GET"}} +api: {"operationId":"RoomsController_getRooms","description":"Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-rooms). Supports search and pagination.","parameters":[{"name":"query","required":false,"in":"query","description":"Search query for room names","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Rooms per page (default: 5)","schema":{"minimum":1,"maximum":5,"default":5,"type":"number"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order (default: NAME_ASC)","schema":{"enum":["NAME_ASC","NAME_DESC","LATEST_ACTIVITY"],"type":"string"}}],"responses":{"200":{"description":"Rooms retrieved with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"roomType":{"type":"string"},"isActive":{"type":"boolean"},"isVerified":{"type":"boolean"},"isPublic":{"type":"boolean"},"isOwner":{"type":"boolean"},"isAdmin":{"type":"boolean"},"ownerId":{"type":"string"},"postsCount":{"type":"number"},"membersCount":{"type":"number"},"url":{"type":"string"},"avatarUrls":{"type":"object","properties":{"thumb":{"required":true,"type":"string"},"original":{"required":true,"type":"string"}}},"createdAt":{"format":"date-time","type":"string"},"isMember":{"type":"boolean"},"subdomain":{"type":"string"},"country":{"type":"string"}},"required":["id","name","description","roomType","isActive","isVerified","isPublic","isOwner","isAdmin","ownerId","postsCount","membersCount","avatarUrls"],"title":"RoomListItemDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"PaginatedRoomsResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}]}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/joined-rooms","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get joined or managed rooms","description":{"content":"Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-rooms). Supports search and pagination.","type":"text/plain"},"url":{"path":["v1","rooms","joined-rooms"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search query for room names","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Rooms per page (default: 5)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Sort order (default: NAME_ASC)","type":"text/plain"},"key":"sortBy","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-r Rooms retrieved with pagination -
    +
    Schema
      data object[] required
    • Array [
    • avatarUrls object required
    • ]
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-invite-user-to-room.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-invite-user-to-room.api.mdx index e569bd08..bdbb6f27 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-invite-user-to-room.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-invite-user-to-room.api.mdx @@ -5,7 +5,7 @@ description: "Send an invitation to a user to join the room. User will receive a sidebar_label: "Invite user to room" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_inviteUserToRoom","description":"Send an invitation to a user to join the room. User will receive a notification/email with an invite link. Only admins can invite.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"User identification for invitation (email or userId)","content":{"application/json":{"schema":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}}},"required":["userIds","emails"],"title":"InviteUserDto"}}}},"responses":{"200":{"description":"Invitation sent successfully"},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to invite members"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{id}/invite","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"userIds":["string"],"emails":["string"]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Invite user to room","description":{"content":"Send an invitation to a user to join the room. User will receive a notification/email with an invite link. Only admins can invite.","type":"text/plain"},"url":{"path":["v1","rooms",":id","invite"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Content-Type","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_inviteUserToRoom","description":"Send an invitation to a user to join the room. User will receive a notification/email with an invite link. Only admins can invite.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"User identification for invitation (email or userId)","content":{"application/json":{"schema":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}}},"required":["userIds","emails"],"title":"InviteUserDto"},"example":{"userIds":["string"],"emails":["string"]}}}},"responses":{"200":{"description":"Invitation sent successfully","content":{"application/json":{"schema":{"type":"object","properties":{"invited":{"type":"boolean","example":true},"inviteStatus":{"type":"object","additionalProperties":{"oneOf":[{"type":"boolean"},{"type":"string"}]},"example":{"user-123":true,"user-456":"already_a_member"}}},"required":["invited","inviteStatus"],"title":"RoomInviteUserResponseDto"},"example":{"invited":true,"inviteStatus":{"user-123":true,"user-456":"already_a_member"}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to invite members"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{id}/invite","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"userIds":["string"],"emails":["string"]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Invite user to room","description":{"content":"Send an invitation to a user to join the room. User will receive a notification/email with an invite link. Only admins can invite.","type":"text/plain"},"url":{"path":["v1","rooms",":id","invite"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ User identification for invitation (email or userId) Invitation sent successfully -
    +
    Schema
      inviteStatus object required
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-join-room.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-join-room.api.mdx index 4f5047e2..d91b219f 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-join-room.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-join-room.api.mdx @@ -5,7 +5,7 @@ description: "Join a public group as a member. For private groups, an invitation sidebar_label: "Join a group" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_joinRoom","description":"Join a public group as a member. For private groups, an invitation is required. Returns whether the join was successful.","parameters":[{"name":"groupId","required":true,"in":"path","description":"Unique numeric group ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully joined the group","content":{"application/json":{"schema":{"type":"object","properties":{"joined":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"Group is private - invitation required"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{groupId}/join","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Join a group","description":{"content":"Join a public group as a member. For private groups, an invitation is required. Returns whether the join was successful.","type":"text/plain"},"url":{"path":["v1","rooms",":groupId","join"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric group ID","type":"text/plain"},"type":"any","value":"","key":"groupId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"RoomsController_joinRoom","description":"Join a public group as a member. For private groups, an invitation is required. Returns whether the join was successful.","parameters":[{"name":"groupId","required":true,"in":"path","description":"Unique numeric group ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully joined the group","content":{"application/json":{"schema":{"type":"object","properties":{"joined":{"type":"boolean","example":true}}},"example":{"joined":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"Group is private - invitation required"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{groupId}/join","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Join a group","description":{"content":"Join a public group as a member. For private groups, an invitation is required. Returns whether the join was successful.","type":"text/plain"},"url":{"path":["v1","rooms",":groupId","join"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric group ID","type":"text/plain"},"type":"any","value":"","key":"groupId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Join a public group as a member. For private groups, an invitation is required. Successfully joined the group -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-leave-group.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-leave-group.api.mdx index 527d87a8..9f144f1a 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-leave-group.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-leave-group.api.mdx @@ -5,7 +5,7 @@ description: "Leave a group the user is currently a member of. Owners cannot lea sidebar_label: "Leave a group" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_leaveGroup","description":"Leave a group the user is currently a member of. Owners cannot leave - they must transfer ownership first.","parameters":[{"name":"groupId","required":true,"in":"path","description":"Unique numeric group ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully left the group","content":{"application/json":{"schema":{"type":"object","properties":{"left":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"Owner cannot leave - transfer ownership first"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{groupId}/leave","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Leave a group","description":{"content":"Leave a group the user is currently a member of. Owners cannot leave - they must transfer ownership first.","type":"text/plain"},"url":{"path":["v1","rooms",":groupId","leave"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric group ID","type":"text/plain"},"type":"any","value":"","key":"groupId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"RoomsController_leaveGroup","description":"Leave a group the user is currently a member of. Owners cannot leave - they must transfer ownership first.","parameters":[{"name":"groupId","required":true,"in":"path","description":"Unique numeric group ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully left the group","content":{"application/json":{"schema":{"type":"object","properties":{"left":{"type":"boolean","example":true}}},"example":{"left":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"Owner cannot leave - transfer ownership first"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{groupId}/leave","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Leave a group","description":{"content":"Leave a group the user is currently a member of. Owners cannot leave - they must transfer ownership first.","type":"text/plain"},"url":{"path":["v1","rooms",":groupId","leave"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric group ID","type":"text/plain"},"type":"any","value":"","key":"groupId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Leave a group the user is currently a member of. Owners cannot leave - they must Successfully left the group -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-reject-invite.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-reject-invite.api.mdx index 6361ffc7..ea198cab 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-reject-invite.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-reject-invite.api.mdx @@ -5,7 +5,7 @@ description: "Decline an invitation to join a room. Invalidates the invite token sidebar_label: "Reject room invite" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_rejectInvite","description":"Decline an invitation to join a room. Invalidates the invite token.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"token","required":true,"in":"query","description":"Invitation token from invite link","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation rejected"},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/reject-invite","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Reject room invite","description":{"content":"Decline an invitation to join a room. Invalidates the invite token.","type":"text/plain"},"url":{"path":["v1","rooms",":id","reject-invite"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Invitation token from invite link","type":"text/plain"},"key":"token","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"RoomsController_rejectInvite","description":"Decline an invitation to join a room. Invalidates the invite token.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"token","required":true,"in":"query","description":"Invitation token from invite link","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation rejected","content":{"application/json":{"schema":{"type":"object","properties":{"rejected":{"type":"boolean","example":true}},"required":["rejected"],"title":"RoomInviteRejectedResponseDto"},"example":{"rejected":true}}}},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/reject-invite","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Reject room invite","description":{"content":"Decline an invitation to join a room. Invalidates the invite token.","type":"text/plain"},"url":{"path":["v1","rooms",":id","reject-invite"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Invitation token from invite link","type":"text/plain"},"key":"token","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Decline an invitation to join a room. Invalidates the invite token. Invitation rejected -
    +
    Schema
    Invalid or expired token diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-remove-member.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-remove-member.api.mdx index ab88acf7..10805a31 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-remove-member.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-remove-member.api.mdx @@ -5,7 +5,7 @@ description: "Remove a user from a room (group or page). Only admins can remove sidebar_label: "Remove member from room" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_removeMember","description":"Remove a user from a room (group or page). Only admins can remove other members. Users can remove themselves.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"userId","required":true,"in":"path","description":"UUID of the user to remove","schema":{"type":"string"}}],"responses":{"200":{"description":"Member removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to remove this member"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"delete","path":"/v1/rooms/{id}/members/{userId}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Remove member from room","description":{"content":"Remove a user from a room (group or page). Only admins can remove other members. Users can remove themselves.","type":"text/plain"},"url":{"path":["v1","rooms",":id","members",":userId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"},{"disabled":false,"description":{"content":"(Required) UUID of the user to remove","type":"text/plain"},"type":"any","value":"","key":"userId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +api: {"operationId":"RoomsController_removeMember","description":"Remove a user from a room (group or page). Only admins can remove other members. Users can remove themselves.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"userId","required":true,"in":"path","description":"UUID of the user to remove","schema":{"type":"string"}}],"responses":{"200":{"description":"Member removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}},"example":{"success":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to remove this member"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"delete","path":"/v1/rooms/{id}/members/{userId}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Remove member from room","description":{"content":"Remove a user from a room (group or page). Only admins can remove other members. Users can remove themselves.","type":"text/plain"},"url":{"path":["v1","rooms",":id","members",":userId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"},{"disabled":false,"description":{"content":"(Required) UUID of the user to remove","type":"text/plain"},"type":"any","value":"","key":"userId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Remove a user from a room (group or page). Only admins can remove other members. Member removed successfully -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-search-rooms.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-search-rooms.api.mdx index a15d61fc..1a3d200f 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-search-rooms.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-search-rooms.api.mdx @@ -5,7 +5,7 @@ description: "Search for public groups and pages by name or description. Results sidebar_label: "Search rooms" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_searchRooms","description":"Search for public groups and pages by name or description. Results can be filtered by room type.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term for room name/description","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"type":"number"}},{"name":"roomType","required":false,"in":"query","description":"Filter by room type: GROUP or PAGE","schema":{"type":"string"}}],"responses":{"200":{"description":"Matching rooms with pagination"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/search","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Search rooms","description":{"content":"Search for public groups and pages by name or description. Results can be filtered by room type.","type":"text/plain"},"url":{"path":["v1","rooms","search"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search term for room name/description","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Filter by room type: GROUP or PAGE","type":"text/plain"},"key":"roomType","value":""}],"variable":[]},"method":"GET"}} +api: {"operationId":"RoomsController_searchRooms","description":"Search for public groups and pages by name or description. Results can be filtered by room type.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term for room name/description","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"type":"number"}},{"name":"roomType","required":false,"in":"query","description":"Filter by room type: GROUP or PAGE","schema":{"type":"string"}}],"responses":{"200":{"description":"Matching rooms with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"roomType":{"type":"string"},"isActive":{"type":"boolean"},"isVerified":{"type":"boolean"},"isPublic":{"type":"boolean"},"isOwner":{"type":"boolean"},"isAdmin":{"type":"boolean"},"ownerId":{"type":"string"},"postsCount":{"type":"number"},"membersCount":{"type":"number"},"url":{"type":"string"},"avatarUrls":{"type":"object","properties":{"thumb":{"required":true,"type":"string"},"original":{"required":true,"type":"string"}}},"createdAt":{"format":"date-time","type":"string"},"isMember":{"type":"boolean"},"subdomain":{"type":"string"},"country":{"type":"string"}},"required":["id","name","description","roomType","isActive","isVerified","isPublic","isOwner","isAdmin","ownerId","postsCount","membersCount","avatarUrls"],"title":"RoomListItemDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"PaginatedRoomsResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}]}}}}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/search","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Search rooms","description":{"content":"Search for public groups and pages by name or description. Results can be filtered by room type.","type":"text/plain"},"url":{"path":["v1","rooms","search"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search term for room name/description","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Filter by room type: GROUP or PAGE","type":"text/plain"},"key":"roomType","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,5 +31,5 @@ Search for public groups and pages by name or description. Results can be filter Matching rooms with pagination -
    +
    Schema
      data object[] required
    • Array [
    • avatarUrls object required
    • ]
    \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-unfollow-page.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-unfollow-page.api.mdx index 36417dee..1bd42e36 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-unfollow-page.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-unfollow-page.api.mdx @@ -5,7 +5,7 @@ description: "Stop following a page. Their posts will no longer appear in your p sidebar_label: "Unfollow a page" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_unfollowPage","description":"Stop following a page. Their posts will no longer appear in your personalized feed.","parameters":[{"name":"pageId","required":true,"in":"path","description":"Unique numeric page ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully unfollowed the page","content":{"application/json":{"schema":{"type":"object","properties":{"unfollowed":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{pageId}/unfollow","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Unfollow a page","description":{"content":"Stop following a page. Their posts will no longer appear in your personalized feed.","type":"text/plain"},"url":{"path":["v1","rooms",":pageId","unfollow"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric page ID","type":"text/plain"},"type":"any","value":"","key":"pageId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"RoomsController_unfollowPage","description":"Stop following a page. Their posts will no longer appear in your personalized feed.","parameters":[{"name":"pageId","required":true,"in":"path","description":"Unique numeric page ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully unfollowed the page","content":{"application/json":{"schema":{"type":"object","properties":{"unfollowed":{"type":"boolean","example":true}}},"example":{"unfollowed":true}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{pageId}/unfollow","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Unfollow a page","description":{"content":"Stop following a page. Their posts will no longer appear in your personalized feed.","type":"text/plain"},"url":{"path":["v1","rooms",":pageId","unfollow"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric page ID","type":"text/plain"},"type":"any","value":"","key":"pageId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Stop following a page. Their posts will no longer appear in your personalized fe Successfully unfollowed the page -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-update-group.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-update-group.api.mdx index 8af3cb16..cf40a387 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-update-group.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-update-group.api.mdx @@ -5,7 +5,7 @@ description: "Update group properties like name, description, URL, avatar, count sidebar_label: "Update a group" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_updateGroup","description":"Update group properties like name, description, URL, avatar, country, or public visibility. Only group admins/owners can update.","parameters":[],"requestBody":{"required":true,"description":"Group fields to update - all fields optional except id","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","maxLength":200},"url":{"type":"string","minLength":1,"maxLength":50},"removeAvatar":{"type":"boolean"},"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"country":{"type":"string","nullable":true},"public":{"type":"boolean","nullable":true,"default":null}},"required":["id"],"title":"UpdateGroupDto"}}}},"responses":{"200":{"description":"Group updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"room":{"type":"object"}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to update this group"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/rooms/groups","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"id":0,"name":"string","description":"string","url":"string","removeAvatar":true,"avatar":"string","country":"string","public":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update a group","description":{"content":"Update group properties like name, description, URL, avatar, country, or public visibility. Only group admins/owners can update.","type":"text/plain"},"url":{"path":["v1","rooms","groups"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_updateGroup","description":"Update group properties like name, description, URL, avatar, country, or public visibility. Only group admins/owners can update.","parameters":[],"requestBody":{"required":true,"description":"Group fields to update - all fields optional except id","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","maxLength":200},"url":{"type":"string","minLength":1,"maxLength":50},"removeAvatar":{"type":"boolean"},"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"country":{"type":"string","nullable":true},"public":{"type":"boolean","nullable":true,"default":null}},"required":["id"],"title":"UpdateGroupDto"},"example":{"id":1,"name":"string","description":"string","url":"string","removeAvatar":true,"avatar":"string","country":"string","public":null}}}},"responses":{"200":{"description":"Group updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"room":{"type":"object"}}},"example":{"success":true,"room":{}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to update this group"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/rooms/groups","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"id":0,"name":"string","description":"string","url":"string","removeAvatar":true,"avatar":"string","country":"string","public":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update a group","description":{"content":"Update group properties like name, description, URL, avatar, country, or public visibility. Only group admins/owners can update.","type":"text/plain"},"url":{"path":["v1","rooms","groups"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "patch api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Group fields to update - all fields optional except id Group updated successfully -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-update-page.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-update-page.api.mdx index 88299fda..6c72f051 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-update-page.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-update-page.api.mdx @@ -5,7 +5,7 @@ description: "Update page properties like name, description, contact info, organ sidebar_label: "Update a page" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_updatePage","description":"Update page properties like name, description, contact info, organization details, or visibility. Only page admins/owners can update.","parameters":[],"requestBody":{"required":true,"description":"Page fields to update - all fields optional except id","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"removeAvatar":{"type":"boolean"},"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"public":{"type":"boolean","nullable":true,"default":null},"name":{"type":"string"},"description":{"type":"string"},"organizationWebsite":{"type":"string"},"country":{"type":"string"},"url":{"type":"string"}},"required":["id"],"title":"UpdatePageDto"}}}},"responses":{"200":{"description":"Page updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"room":{"type":"object"}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to update this page"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/rooms/pages","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"id":0,"removeAvatar":true,"avatar":"string","public":true,"name":"string","description":"string","organizationWebsite":"string","country":"string","url":"string"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update a page","description":{"content":"Update page properties like name, description, contact info, organization details, or visibility. Only page admins/owners can update.","type":"text/plain"},"url":{"path":["v1","rooms","pages"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_updatePage","description":"Update page properties like name, description, contact info, organization details, or visibility. Only page admins/owners can update.","parameters":[],"requestBody":{"required":true,"description":"Page fields to update - all fields optional except id","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"removeAvatar":{"type":"boolean"},"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"public":{"type":"boolean","nullable":true,"default":null},"name":{"type":"string"},"description":{"type":"string"},"organizationWebsite":{"type":"string"},"country":{"type":"string"},"url":{"type":"string"}},"required":["id"],"title":"UpdatePageDto"},"example":{"id":1,"removeAvatar":true,"avatar":"string","public":null,"name":"string","description":"string","organizationWebsite":"string","country":"string","url":"string"}}}},"responses":{"200":{"description":"Page updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"room":{"type":"object"}}},"example":{"success":true,"room":{}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to update this page"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/rooms/pages","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"id":0,"removeAvatar":true,"avatar":"string","public":true,"name":"string","description":"string","organizationWebsite":"string","country":"string","url":"string"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update a page","description":{"content":"Update page properties like name, description, contact info, organization details, or visibility. Only page admins/owners can update.","type":"text/plain"},"url":{"path":["v1","rooms","pages"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "patch api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Page fields to update - all fields optional except id Page updated successfully -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/rooms-controller-update-post-privacy.api.mdx b/docs/user_related_apis_versioned/1.0.0/rooms-controller-update-post-privacy.api.mdx index fafca506..10ffb1e1 100644 --- a/docs/user_related_apis_versioned/1.0.0/rooms-controller-update-post-privacy.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/rooms-controller-update-post-privacy.api.mdx @@ -5,7 +5,7 @@ description: "Change the visibility of a post within a room. Toggle between publ sidebar_label: "Update post privacy in room" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_updatePostPrivacy","description":"Change the visibility of a post within a room. Toggle between public (visible outside room) and private (members only). Only admins can modify.","parameters":[{"name":"roomId","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"postId","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Privacy setting with isPublic boolean","content":{"application/json":{"schema":{"type":"object","properties":{"isPublic":{"type":"boolean"}},"required":["isPublic"],"title":"RoomPostUpdatePrivacyDto"}}}},"responses":{"200":{"description":"Post privacy updated successfully"},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to modify post privacy"},"404":{"description":"Room or post not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/rooms/{roomId}/posts/{postId}/privacy","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"isPublic":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update post privacy in room","description":{"content":"Change the visibility of a post within a room. Toggle between public (visible outside room) and private (members only). Only admins can modify.","type":"text/plain"},"url":{"path":["v1","rooms",":roomId","posts",":postId","privacy"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"roomId"},{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"postId"}]},"header":[{"key":"Content-Type","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_updatePostPrivacy","description":"Change the visibility of a post within a room. Toggle between public (visible outside room) and private (members only). Only admins can modify.","parameters":[{"name":"roomId","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"postId","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Privacy setting with isPublic boolean","content":{"application/json":{"schema":{"type":"object","properties":{"isPublic":{"type":"boolean"}},"required":["isPublic"],"title":"RoomPostUpdatePrivacyDto"},"example":{"isPublic":true}}}},"responses":{"200":{"description":"Post privacy updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"},"example":{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to modify post privacy"},"404":{"description":"Room or post not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/rooms/{roomId}/posts/{postId}/privacy","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"isPublic":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update post privacy in room","description":{"content":"Change the visibility of a post within a room. Toggle between public (visible outside room) and private (members only). Only admins can modify.","type":"text/plain"},"url":{"path":["v1","rooms",":roomId","posts",":postId","privacy"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"roomId"},{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"postId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "patch api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Privacy setting with isPublic boolean Post privacy updated successfully -
    +
    Schema
      tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/sidebar.js b/docs/user_related_apis_versioned/1.0.0/sidebar.js index 591f8c78..1709bdea 100644 --- a/docs/user_related_apis_versioned/1.0.0/sidebar.js +++ b/docs/user_related_apis_versioned/1.0.0/sidebar.js @@ -1 +1 @@ -module.exports = [{"type":"doc","id":"user_related_apis_versioned/1.0.0/user-related-apis"},{"type":"category","label":"Collections","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/add-collection","label":"Add collection","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-all-collections","label":"Get all collections","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/add-collection-bookmark","label":"Add collection Bookmark","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/delete-collection","label":"Delete collection","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-collection-items-by-id","label":"Get collection items by id","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/update-collection","label":"Update collection","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/delete-collection-bookmark-by-id","label":"Delete collection bookmark by id","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-all-collection-items","label":"Get all collection items","className":"api-method get"}]},{"type":"category","label":"Bookmarks","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/add-user-bookmark","label":"Add user bookmark","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-user-bookmarks","label":"Get user bookmarks","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/delete-bookmark","label":"Delete Bookmark","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-bookmarks-within-a-range-of-ayahs","label":"Get bookmarks within a range of Ayahs","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-bookmark","label":"Get bookmark","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-bookmark-collections","label":"Get bookmark collections","className":"api-method get"}]},{"type":"category","label":"Preferences","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/add-or-update-preference","label":"Add or update preference","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-user-preferences","label":"Get user preferences","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/bulk-add-or-update-preferences","label":"Bulk add or update preferences","className":"api-method post"}]},{"type":"category","label":"Reading Sessions","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/add-or-update-user-reading-session","label":"Add or update user reading session","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-user-reading-sessions","label":"Get user reading sessions","className":"api-method get"}]},{"type":"category","label":"Goals","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-todays-goal-plan","label":"Get today's goal plan","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/update-a-goal","label":"Update a goal","className":"api-method put"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/delete-a-goal","label":"Delete a goal","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/create-a-goal","label":"Create a goal","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/generate-timeline-estimation","label":"Generate timeline estimation","className":"api-method get"}]},{"type":"category","label":"Streaks","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-streaks","label":"Get streaks","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-current-streak-days","label":"Get current streak days","className":"api-method get"}]},{"type":"category","label":"Activity Days","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/add-update-activity-day","label":"Add/update activity day","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-activity-days","label":"Get activity days","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/estimate-reading-time","label":"Estimate reading time","className":"api-method get"}]},{"type":"category","label":"Users","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-edit-profile","label":"Edit user profile","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-profile","label":"Get user profile","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-update-profile","label":"Update user profile","className":"api-method put"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-rooms","label":"Get logged-in user rooms","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-search","label":"Search for users","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-toggle-follow","label":"Toggle follow/unfollow a user","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-remove-follower","label":"Remove a follower","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-get-featured-users","label":"Get featured users for follow recommendation","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-follow-featured-users","label":"Follow all featured users","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-get-user-profile","label":"Get user profile by id or username","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-get-user-followers","label":"Get user followers","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-get-user-following","label":"Get users followed by user","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-delete-account","label":"Delete user account permanently","className":"api-method delete"}]},{"type":"category","label":"Notes","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-all-notes","label":"Get all notes","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/add-note","label":"Add note","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-notes-by-verse","label":"Get notes by verse","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-notes-by-attached-entity","label":"Get notes by attached entity","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-notes-count-within-verse-range","label":"Get notes count within verse range","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-notes-by-verse-range","label":"Get notes by verse range","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-note-by-id","label":"Get note by ID","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/update-note-by-id","label":"Update note by ID","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/delete-note-by-id","label":"Delete note by ID","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/publish-note","label":"Publish note","className":"api-method post"}]},{"type":"category","label":"Rooms","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-admins-access","label":"Update room admin access","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-update-group","label":"Update a group","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-create-new-group","label":"Create a new group","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-update-page","label":"Update a page","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-create-new-page","label":"Create a new page","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-get-room-members","label":"Get room members","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-invite-user-to-room","label":"Invite user to room","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-accept-invite","label":"Accept room invite","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-reject-invite","label":"Reject room invite","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-remove-member","label":"Remove member from room","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-get-rooms","label":"Get joined or managed rooms","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-search-rooms","label":"Search rooms","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-get-room-profile","label":"Get room profile by URL or subdomain","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-accept-by-private-token","label":"Accept room invite by private token","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-get-room-profile-by-id","label":"Get room profile by ID","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-get-room-posts","label":"Get room posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-join-room","label":"Join a group","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-leave-group","label":"Leave a group","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-follow-page","label":"Follow a page","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-unfollow-page","label":"Unfollow a page","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-update-post-privacy","label":"Update post privacy in room","className":"api-method patch"}]},{"type":"category","label":"Posts","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-feed","label":"Get posts feed","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-related-posts","label":"Get related posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-loggedin-user-posts","label":"Get current user posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-find-one","label":"Get post by ID","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-delete","label":"Delete post","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-edit","label":"Edit post","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-view-tracking","label":"Track post view","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-create","label":"Create post","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-report-abuse","label":"Report post abuse","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-user-post","label":"Get user posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-toggle-like","label":"Toggle post like","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-toggle-save","label":"Toggle post save","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-comments","label":"Get post comments","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-all-comment","label":"Get all post comments","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-export-multiple-posts","label":"Export posts as PDF","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-my-posts-count-within-range","label":"Get posts count within range","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-my-posts-by-verse","label":"Get posts by verse","className":"api-method get"}]},{"type":"category","label":"Tags","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/tags-controller-find","label":"Search and retrieve tags","className":"api-method get"}]},{"type":"category","label":"Comments","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/comments-controller-create","label":"Create a new comment","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/comments-controller-delete-comment","label":"Delete a comment","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/comments-controller-toggle-like","label":"Toggle like/unlike a comment","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/comments-controller-get","label":"Get replies to a comment","className":"api-method get"}]}]; \ No newline at end of file +module.exports = [{"type":"doc","id":"user_related_apis_versioned/1.0.0/user-related-apis"},{"type":"category","label":"Collections","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-post-v-1-collections","label":"Add collection","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-collections","label":"Get all collections","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-post-v-1-collections-by-collection-id-bookmarks","label":"Add collection Bookmark","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-delete-v-1-collections-by-collection-id-bookmarks","label":"Delete collection bookmark by details","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-delete-v-1-collections-by-collection-id","label":"Delete collection","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-collections-by-collection-id","label":"Get collection items by id","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-post-v-1-collections-by-collection-id","label":"Update collection","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-delete-v-1-collections-by-collection-id-bookmarks-by-bookmark-id","label":"Delete collection bookmark by id","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-collections-all","label":"Get all collection items","className":"api-method get"}]},{"type":"category","label":"Bookmarks","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-post-v-1-bookmarks","label":"Add user bookmark","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks","label":"Get user bookmarks","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-delete-v-1-bookmarks-by-bookmark-id","label":"Delete Bookmark","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks-ayahs-range","label":"Get bookmarks within a range of Ayahs","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks-bookmark","label":"Get bookmark","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-bookmarks-collections","label":"Get bookmark collections","className":"api-method get"}]},{"type":"category","label":"Preferences","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-post-v-1-preferences","label":"Add or update preference","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-preferences","label":"Get user preferences","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-post-v-1-preferences-bulk","label":"Bulk add or update preferences","className":"api-method post"}]},{"type":"category","label":"Reading Sessions","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-post-v-1-reading-sessions","label":"Add or update user reading session","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-reading-sessions","label":"Get user reading sessions","className":"api-method get"}]},{"type":"category","label":"Goals","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-goals-get-todays-plan","label":"Get today's goal plan","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-put-v-1-goals-by-id","label":"Update a goal","className":"api-method put"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-delete-v-1-goals-by-id","label":"Delete a goal","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-post-v-1-goals","label":"Create a goal","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-goals-estimate","label":"Generate timeline estimation","className":"api-method get"}]},{"type":"category","label":"Streaks","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-streaks","label":"Get streaks","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-streaks-current-streak-days","label":"Get current streak days","className":"api-method get"}]},{"type":"category","label":"Activity Days","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-post-v-1-activity-days","label":"Add/update activity day","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-activity-days","label":"Get activity days","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-activity-days-estimate-reading-time","label":"Estimate reading time","className":"api-method get"}]},{"type":"category","label":"Users","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-edit-profile","label":"Edit user profile","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-profile","label":"Get user profile","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-update-profile","label":"Update user profile","className":"api-method put"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-rooms","label":"Get logged-in user rooms","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-search","label":"Search for users","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-toggle-follow","label":"Toggle follow/unfollow a user","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-remove-follower","label":"Remove a follower","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-get-user-profile","label":"Get user profile by id or username","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-get-user-followers","label":"Get user followers","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-get-user-following","label":"Get users followed by user","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/users-controller-delete-account","label":"Delete user account permanently","className":"api-method delete"}]},{"type":"category","label":"Notes","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-notes","label":"Get all notes","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-post-v-1-notes","label":"Add note","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-verse-by-verse-key","label":"Get notes by verse","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-attached-entity","label":"Get notes by attached entity","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-notes-count-within-range","label":"Get notes count within verse range","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-range","label":"Get notes by verse range","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-get-v-1-notes-by-note-id","label":"Get note by ID","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-patch-v-1-notes-by-note-id","label":"Update note by ID","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-delete-v-1-notes-by-note-id","label":"Delete note by ID","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/auth-post-v-1-notes-by-note-id-publish","label":"Publish note","className":"api-method post"}]},{"type":"category","label":"Rooms","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-admins-access","label":"Update room admin access","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-update-group","label":"Update a group","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-create-new-group","label":"Create a new group","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-update-page","label":"Update a page","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-create-new-page","label":"Create a new page","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-get-room-members","label":"Get room members","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-invite-user-to-room","label":"Invite user to room","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-accept-invite","label":"Accept room invite","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-reject-invite","label":"Reject room invite","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-remove-member","label":"Remove member from room","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-get-rooms","label":"Get joined or managed rooms","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-search-rooms","label":"Search rooms","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-get-room-profile","label":"Get room profile by URL or subdomain","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-accept-by-private-token","label":"Accept room invite by private token","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-get-room-profile-by-id","label":"Get room profile by ID","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-get-room-posts","label":"Get room posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-join-room","label":"Join a group","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-leave-group","label":"Leave a group","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-follow-page","label":"Follow a page","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-unfollow-page","label":"Unfollow a page","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/rooms-controller-update-post-privacy","label":"Update post privacy in room","className":"api-method patch"}]},{"type":"category","label":"Posts","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-feed","label":"Get posts feed","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-related-posts","label":"Get related posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-loggedin-user-posts","label":"Get current user posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-liked-state","label":"Get post liked state","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-find-one","label":"Get post by ID","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-delete","label":"Delete post","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-edit","label":"Edit post","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-view-tracking","label":"Track post view","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-create","label":"Create post","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-report-abuse","label":"Report post abuse","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-user-post","label":"Get user posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-toggle-like","label":"Toggle post like","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-toggle-save","label":"Toggle post save","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-comments","label":"Get post comments","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-all-comment","label":"Get all post comments","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-export-multiple-posts","label":"Export posts as PDF","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-my-posts-count-within-range","label":"Get posts count within range","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/posts-controller-get-my-posts-by-verse","label":"Get posts by verse","className":"api-method get"}]},{"type":"category","label":"Tags","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/tags-controller-find","label":"Search and retrieve tags","className":"api-method get"}]},{"type":"category","label":"Comments","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/comments-controller-create","label":"Create a new comment","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/comments-controller-delete-comment","label":"Delete a comment","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/comments-controller-toggle-like","label":"Toggle like/unlike a comment","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/comments-controller-get","label":"Get replies to a comment","className":"api-method get"}]},{"type":"category","label":"Sync","items":[{"type":"doc","id":"user_related_apis_versioned/1.0.0/get-mutations","label":"Get mutations","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/1.0.0/sync-local-mutations","label":"Sync local mutations","className":"api-method post"}]}]; \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/sync-local-mutations.api.mdx b/docs/user_related_apis_versioned/1.0.0/sync-local-mutations.api.mdx new file mode 100644 index 00000000..e7e6edde --- /dev/null +++ b/docs/user_related_apis_versioned/1.0.0/sync-local-mutations.api.mdx @@ -0,0 +1,99 @@ +--- +id: sync-local-mutations +title: "Sync local mutations" +description: "An endpoint to sync local mutations to the server." +sidebar_label: "Sync local mutations" +hide_title: true +hide_table_of_contents: true +api: {"description":"An endpoint to sync local mutations to the server.","tags":["Sync"],"parameters":[{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. The value needs to match the latest value from get mutations endpoint, otherwise, the request will be rejected.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. The value needs to match the latest value from get mutations endpoint, otherwise, the request will be rejected."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mutations":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CREATE","UPDATE","DELETE"],"description":"The type of the mutation","example":"CREATE"},"resource":{"type":"string","enum":["BOOKMARK","COLLECTION","COLLECTION_BOOKMARK","NOTE"],"description":"Resource the mutation applies to.","example":"BOOKMARK"},"resourceId":{"type":"string","description":"Server's ID for finding the resource during update/delete operations.","example":"lqc794i0qnxq4pdlfanfbd2r"},"data":{"type":"object","properties":{},"description":"Resource data. Format depends on resource type.","example":{"bookmarkType":"ayah","bookmarkGroup":"verses_6236","key":6,"verseNumber":3}}},"required":["type","resource"],"additionalProperties":false,"description":"Represents a single mutation/change to a resource"}}},"required":["mutations"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"mutations":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CREATE","UPDATE","DELETE"],"description":"The type of the mutation","example":"CREATE"},"resource":{"type":"string","enum":["BOOKMARK","COLLECTION","COLLECTION_BOOKMARK","NOTE"],"description":"The resource the mutation was applied to.","example":"BOOKMARK"},"resourceId":{"type":"string","description":"The id of the resource the mutation was applied to. Will not be present for resources that use composite keys (e.g. COLLECTION_BOOKMARK uses data.collection and data.bookmark instead).","example":"lqc794i0qnxq4pdlfanfbd2r"},"data":{"type":"object","properties":{},"description":"The latest version of the data of the resource that was mutated. Will be empty when the mutation is a delete.","example":{"bookmarkType":"ayah","bookmarkGroup":"verses_6236","key":6,"verseNumber":3}},"timestamp":{"type":"number","format":"float","description":"Unix timestamp when the latest mutation of the resource occurred","example":1731636500303}},"required":["type","resource","timestamp"],"additionalProperties":false,"description":"Represents a single mutation/change to a resource"},"description":"Array of mutations that were successfully applied on the server.","example":[{"type":"CREATE","resource":"BOOKMARK","resourceId":"u54maufl0ftmarp73ei0hg64","data":{"bookmarkType":"ayah","bookmarkGroup":"verses_6236","key":6,"verseNumber":3},"timestamp":1769340915572},{"type":"UPDATE","resource":"COLLECTION","resourceId":"na6orcv0pbcomiphmkv0yhma","data":{"name":"New collection!","slug":"new-collection","isPrivate":true},"timestamp":1769340915572},{"type":"CREATE","resource":"COLLECTION_BOOKMARK","data":{"collection":"na6orcv0pbcomiphmkv0yhma","bookmark":"u54maufl0ftmarp73ei0hg64"},"timestamp":1769340915575},{"type":"DELETE","resource":"NOTE","resourceId":"his2lubkxxr3l102nqptmnur","data":{},"timestamp":1769341113173}]},"page":{"type":"number","format":"float","description":"Current page number","example":1},"limit":{"type":"number","format":"float","description":"Items per page","example":100},"total":{"type":"number","format":"float","description":"Total number of mutations","example":150},"hasMore":{"type":"boolean","description":"Whether more pages exist","example":true},"lastMutationAt":{"type":"number","format":"float","description":"Timestamp of the latest mutation that was applied on the server. This should be used for subsequent sync requests.","example":1731636500303}},"required":["lastMutationAt"],"additionalProperties":false,"description":"Response schema for post mutations endpoint"}},"additionalProperties":false}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"ValidationError"},"message":{"type":"string","example":"Invalid mutations"}}}}},"examples":{"Invalid mutations format":{"value":{"success":false,"error":{"code":"ValidationError","message":"Invalid mutations"}}},"Too many mutations":{"value":{"success":false,"error":{"code":"ValidationError","message":"Mutations must not exceed 100"}}},"Missing resource":{"value":{"success":false,"error":{"code":"ValidationError","message":"Missing resource at mutation[0]"}}},"Invalid resource":{"value":{"success":false,"error":{"code":"ValidationError","message":"Invalid resource: \"invalidResource\" at mutation[0]"}}},"Missing mutation type":{"value":{"success":false,"error":{"code":"ValidationError","message":"Missing mutation type at mutation[0]"}}},"Invalid mutation type":{"value":{"success":false,"error":{"code":"ValidationError","message":"Invalid mutation type: \"invalidType\" at mutation[0]"}}},"Missing resourceId":{"value":{"success":false,"error":{"code":"ValidationError","message":"Missing resourceId at mutation[0]"}}},"Invalid resourceId type":{"value":{"success":false,"error":{"code":"ValidationError","message":"Invalid resourceId at mutation[0]"}}},"Missing data":{"value":{"success":false,"error":{"code":"ValidationError","message":"Missing data at mutation[0]"}}}}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/sync","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"mutations":[{"type":"CREATE","resource":"BOOKMARK","resourceId":"lqc794i0qnxq4pdlfanfbd2r","data":{"bookmarkType":"ayah","bookmarkGroup":"verses_6236","key":6,"verseNumber":3}}]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Sync local mutations","description":{"content":"An endpoint to sync local mutations to the server.","type":"text/plain"},"url":{"path":["v1","sync"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. The value needs to match the latest value from get mutations endpoint, otherwise, the request will be rejected.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "post api-method" +info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsVersionedSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Sync local mutations + + + +An endpoint to sync local mutations to the server. + +
    Query Parameters
    Request Body
      mutations object[] required
    • Array [
    • data object
      + +Resource data. Format depends on resource type. + +
    • ]
    + +Request has been handled successfully. + +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
      + +Response schema for post mutations endpoint + +
      mutations object[]
      + +Array of mutations that were successfully applied on the server. + +
    • Array [
    • data object
      + +The latest version of the data of the resource that was mutated. Will be empty when the mutation is a delete. + +
    • ]
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    + +Validation Error. The request includes one or more invalid params. + +
    Schema
      error object
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    + \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/tags-controller-find.api.mdx b/docs/user_related_apis_versioned/1.0.0/tags-controller-find.api.mdx index 1df433b1..d3b2f415 100644 --- a/docs/user_related_apis_versioned/1.0.0/tags-controller-find.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/tags-controller-find.api.mdx @@ -5,7 +5,7 @@ description: "Search for tags by query string. Returns paginated results matchin sidebar_label: "Search and retrieve tags" hide_title: true hide_table_of_contents: true -api: {"operationId":"TagsController_find","description":"Search for tags by query string. Returns paginated results matching the search term. Useful for tag autocomplete and discovery features.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"type":"number"}}],"responses":{"200":{"description":"Tags matching search query with pagination","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"rank":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"postsCount":{"type":"number"},"commentsCount":{"type":"number"}},"required":["id","createdAt","updatedAt"],"title":"Tag"}}}}}},"tags":["Tags"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/tags","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Search and retrieve tags","description":{"content":"Search for tags by query string. Returns paginated results matching the search term. Useful for tag autocomplete and discovery features.","type":"text/plain"},"url":{"path":["v1","tags"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search term","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Number of results to return","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number","type":"text/plain"},"key":"page","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"TagsController_find","description":"Search for tags by query string. Returns paginated results matching the search term. Useful for tag autocomplete and discovery features.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"type":"number"}}],"responses":{"200":{"description":"Tags matching search query with pagination","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"rank":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"postsCount":{"type":"number"},"commentsCount":{"type":"number"}},"required":["id","createdAt","updatedAt"],"title":"Tag"}},"example":[{"id":1,"name":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","rank":0,"languageId":1,"languageName":"string","postsCount":1,"commentsCount":1}]}}}},"tags":["Tags"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/tags","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Search and retrieve tags","description":{"content":"Search for tags by query string. Returns paginated results matching the search term. Useful for tag autocomplete and discovery features.","type":"text/plain"},"url":{"path":["v1","tags"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search term","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Number of results to return","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number","type":"text/plain"},"key":"page","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,5 +31,5 @@ Search for tags by query string. Returns paginated results matching the search t Tags matching search query with pagination -
    Schema
    • Array [
    • ]
    +
    Schema
    • Array [
    • ]
    \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/user-related-apis.info.mdx b/docs/user_related_apis_versioned/1.0.0/user-related-apis.info.mdx index 69417523..9e2906f5 100644 --- a/docs/user_related_apis_versioned/1.0.0/user-related-apis.info.mdx +++ b/docs/user_related_apis_versioned/1.0.0/user-related-apis.info.mdx @@ -26,6 +26,8 @@ Quran.Foundation user-related APIs enable your app to seamlessly integrate with We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). + For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs. + ## Pagination We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. diff --git a/docs/user_related_apis_versioned/1.0.0/users-controller-delete-account.api.mdx b/docs/user_related_apis_versioned/1.0.0/users-controller-delete-account.api.mdx index 22724dad..8853e5b7 100644 --- a/docs/user_related_apis_versioned/1.0.0/users-controller-delete-account.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/users-controller-delete-account.api.mdx @@ -5,7 +5,7 @@ description: "Permanently delete the authenticated user account and all associat sidebar_label: "Delete user account permanently" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_deleteAccount","description":"Permanently delete the authenticated user account and all associated data from QuranReflect and Quran.com. This action is irreversible. The user is immediately banned to prevent further actions, then all data is deleted in the background. All posts, comments, likes, preferences, and memberships will be removed. If the user owns rooms, posts by other members will be converted to global posts.","parameters":[],"responses":{"200":{"description":"Account deletion initiated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Account deletion initiated successfully"}}}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"delete","path":"/v1/users","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete user account permanently","description":{"content":"Permanently delete the authenticated user account and all associated data from QuranReflect and Quran.com. This action is irreversible. The user is immediately banned to prevent further actions, then all data is deleted in the background. All posts, comments, likes, preferences, and memberships will be removed. If the user owns rooms, posts by other members will be converted to global posts.","type":"text/plain"},"url":{"path":["v1","users"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +api: {"operationId":"UsersController_deleteAccount","description":"Permanently delete the authenticated user account and all associated data from QuranReflect and Quran.com. This action is irreversible. The user is immediately banned to prevent further actions, then all data is deleted in the background. All posts, comments, likes, preferences, and memberships will be removed. If the user owns rooms, posts by other members will be converted to global posts.","parameters":[],"responses":{"200":{"description":"Account deletion initiated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Account deletion initiated successfully"}}}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"delete","path":"/v1/users","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete user account permanently","description":{"content":"Permanently delete the authenticated user account and all associated data from QuranReflect and Quran.com. This action is irreversible. The user is immediately banned to prevent further actions, then all data is deleted in the background. All posts, comments, likes, preferences, and memberships will be removed. If the user owns rooms, posts by other members will be converted to global posts.","type":"text/plain"},"url":{"path":["v1","users"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null diff --git a/docs/user_related_apis_versioned/1.0.0/users-controller-edit-profile.api.mdx b/docs/user_related_apis_versioned/1.0.0/users-controller-edit-profile.api.mdx index 29852c35..10514fd6 100644 --- a/docs/user_related_apis_versioned/1.0.0/users-controller-edit-profile.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/users-controller-edit-profile.api.mdx @@ -5,7 +5,7 @@ description: "Partially update the authenticated user settings and preferences l sidebar_label: "Edit user profile" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_editProfile","description":"Partially update the authenticated user settings and preferences like notification settings, privacy options, and display preferences.","parameters":[],"requestBody":{"required":true,"description":"Settings fields to update - only include fields you want to change","content":{"application/json":{"schema":{"type":"object","properties":{"languageId":{"type":"number"},"reflectionLanguages":{"type":"array","items":{"type":"string"}},"ayahLanguages":{"type":"array","items":{"type":"string"}},"customized":{"type":"boolean"},"hideFollowSuggestion":{"type":"boolean","description":"Hide follow suggestion popup after liking a post"},"showFollowFeaturedSuggestion":{"type":"boolean","description":"Show featured follow suggestion popup on QR onboarding"}},"title":"EditProfileDto"}}}},"responses":{"200":{"description":"Settings updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}}}}},"400":{"description":"Invalid settings data"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/users/profile","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"languageId":0,"reflectionLanguages":["string"],"ayahLanguages":["string"],"customized":true,"hideFollowSuggestion":true,"showFollowFeaturedSuggestion":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Edit user profile","description":{"content":"Partially update the authenticated user settings and preferences like notification settings, privacy options, and display preferences.","type":"text/plain"},"url":{"path":["v1","users","profile"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"UsersController_editProfile","description":"Partially update the authenticated user settings and preferences like notification settings, privacy options, and display preferences.","parameters":[],"requestBody":{"required":true,"description":"Settings fields to update - only include fields you want to change","content":{"application/json":{"schema":{"type":"object","properties":{"languageId":{"type":"number"},"reflectionLanguages":{"type":"array","items":{"type":"string"}},"ayahLanguages":{"type":"array","items":{"type":"string"}},"customized":{"type":"boolean"},"hideFollowSuggestion":{"type":"boolean","description":"Hide follow suggestion popup after liking a post"},"showFollowFeaturedSuggestion":{"type":"boolean","description":"Show featured follow suggestion popup on QR onboarding"}},"title":"EditProfileDto"},"example":{"languageId":1,"reflectionLanguages":["string"],"ayahLanguages":["string"],"customized":true,"hideFollowSuggestion":true,"showFollowFeaturedSuggestion":true}}}},"responses":{"200":{"description":"Settings updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}},"example":{"success":true}}}},"400":{"description":"Invalid settings data"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/users/profile","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"languageId":0,"reflectionLanguages":["string"],"ayahLanguages":["string"],"customized":true,"hideFollowSuggestion":true,"showFollowFeaturedSuggestion":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Edit user profile","description":{"content":"Partially update the authenticated user settings and preferences like notification settings, privacy options, and display preferences.","type":"text/plain"},"url":{"path":["v1","users","profile"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "patch api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Settings fields to update - only include fields you want to change Settings updated successfully -
    Schema
    +
    Schema
    Invalid settings data diff --git a/docs/user_related_apis_versioned/1.0.0/users-controller-follow-featured-users.api.mdx b/docs/user_related_apis_versioned/1.0.0/users-controller-follow-featured-users.api.mdx deleted file mode 100644 index 74660048..00000000 --- a/docs/user_related_apis_versioned/1.0.0/users-controller-follow-featured-users.api.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -id: users-controller-follow-featured-users -title: "Follow all featured users" -description: "Follows all eligible featured user recommendations in one action." -sidebar_label: "Follow all featured users" -hide_title: true -hide_table_of_contents: true -api: {"operationId":"UsersController_followFeaturedUsers","description":"Follows all eligible featured user recommendations in one action.","parameters":[],"responses":{"200":{"description":"Summary of follow-all operation","content":{"application/json":{"schema":{"type":"object","properties":{"requested":{"type":"number","example":9},"followed":{"type":"number","example":7},"skipped":{"type":"number","example":1},"failed":{"type":"number","example":1},"complete":{"type":"boolean","example":true},"failedItems":{"type":"array","items":{"type":"object","properties":{"followeeId":{"type":"string","example":"user-id-123"},"reason":{"type":"string","example":"FOLLOW_FAILED"}},"required":["followeeId","reason"],"title":"FailedFeaturedFollowItemDto"}}},"required":["requested","followed","skipped","failed","complete"],"title":"FollowFeaturedUsersResponseDto"}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/users/featured/follow-all","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Follow all featured users","description":{"content":"Follows all eligible featured user recommendations in one action.","type":"text/plain"},"url":{"path":["v1","users","featured","follow-all"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} -sidebar_class_name: "post api-method" -info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsVersionedSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Follow all featured users - - - -Follows all eligible featured user recommendations in one action. - -
    - -Summary of follow-all operation - -
    Schema
      failedItems object[]
    • Array [
    • ]
    - -User not authenticated - -
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/users-controller-get-featured-users.api.mdx b/docs/user_related_apis_versioned/1.0.0/users-controller-get-featured-users.api.mdx deleted file mode 100644 index 3a7e2ba3..00000000 --- a/docs/user_related_apis_versioned/1.0.0/users-controller-get-featured-users.api.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -id: users-controller-get-featured-users -title: "Get featured users for follow recommendation" -description: "Returns a sorted list of feature-enabled users excluding banned, dangerous, and followed accounts." -sidebar_label: "Get featured users for follow recommendation" -hide_title: true -hide_table_of_contents: true -api: {"operationId":"UsersController_getFeaturedUsers","description":"Returns a sorted list of feature-enabled users excluding banned, dangerous, and followed accounts.","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (default/max: 9)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Featured users result","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"1f8d6f3f-2f57-4c3e-b7b5-5f6a9d7f7a55"},"username":{"type":"string","example":"example.user"},"verified":{"type":"boolean","example":true},"firstName":{"type":"string","example":"Example"},"lastName":{"type":"string","example":"User"},"fullName":{"type":"string","example":"Example User"},"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"followersCount":{"type":"number","example":1200},"bio":{"type":"string","example":"I write reflections on the Quran."}},"required":["id","username","verified","firstName","lastName","fullName","avatarUrls","followersCount"],"title":"FeaturedUserDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeaturedUsersResponseDto"}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/featured","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get featured users for follow recommendation","description":{"content":"Returns a sorted list of feature-enabled users excluding banned, dangerous, and followed accounts.","type":"text/plain"},"url":{"path":["v1","users","featured"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Page size (default/max: 9)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} -sidebar_class_name: "get api-method" -info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsVersionedSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Get featured users for follow recommendation - - - -Returns a sorted list of feature-enabled users excluding banned, dangerous, and followed accounts. - -
    Query Parameters
    - -Featured users result - -
    Schema
      data object[] required
    • Array [
    • ]
    - -User not authenticated - -
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/users-controller-get-user-followers.api.mdx b/docs/user_related_apis_versioned/1.0.0/users-controller-get-user-followers.api.mdx index 5ed1b740..53a3621b 100644 --- a/docs/user_related_apis_versioned/1.0.0/users-controller-get-user-followers.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/users-controller-get-user-followers.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve a paginated list of users who follow the specified user. sidebar_label: "Get user followers" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_getUserFollowers","description":"Retrieve a paginated list of users who follow the specified user. Includes follow relationship to the viewer if authenticated.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"List of followers with pagination"},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/{id}/followers","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user followers","description":{"content":"Retrieve a paginated list of users who follow the specified user. Includes follow relationship to the viewer if authenticated.","type":"text/plain"},"url":{"path":["v1","users",":id","followers"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"UsersController_getUserFollowers","description":"Retrieve a paginated list of users who follow the specified user. Includes follow relationship to the viewer if authenticated.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"List of followers with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"isFollowed":{"type":"boolean","example":false},"followed":{"type":"boolean","example":false},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSearchDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"UsersSearchResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"isFollowed":false,"followed":false,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string"}]}}}},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/{id}/followers","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user followers","description":{"content":"Retrieve a paginated list of users who follow the specified user. Includes follow relationship to the viewer if authenticated.","type":"text/plain"},"url":{"path":["v1","users",":id","followers"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve a paginated list of users who follow the specified user. Includes follo List of followers with pagination -
    +
    Schema
      data object[] required
    • Array [
    • settings object required
    • ]
    User not found diff --git a/docs/user_related_apis_versioned/1.0.0/users-controller-get-user-following.api.mdx b/docs/user_related_apis_versioned/1.0.0/users-controller-get-user-following.api.mdx index 6f957fd1..8f42d1cd 100644 --- a/docs/user_related_apis_versioned/1.0.0/users-controller-get-user-following.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/users-controller-get-user-following.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve a paginated list of users that the specified user follows sidebar_label: "Get users followed by user" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_getUserFollowing","description":"Retrieve a paginated list of users that the specified user follows. Includes follow relationship to the viewer if authenticated.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"List of followed users with pagination"},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/{id}/following","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get users followed by user","description":{"content":"Retrieve a paginated list of users that the specified user follows. Includes follow relationship to the viewer if authenticated.","type":"text/plain"},"url":{"path":["v1","users",":id","following"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"UsersController_getUserFollowing","description":"Retrieve a paginated list of users that the specified user follows. Includes follow relationship to the viewer if authenticated.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"List of followed users with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"isFollowed":{"type":"boolean","example":false},"followed":{"type":"boolean","example":false},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSearchDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"UsersSearchResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"isFollowed":false,"followed":false,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string"}]}}}},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/{id}/following","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get users followed by user","description":{"content":"Retrieve a paginated list of users that the specified user follows. Includes follow relationship to the viewer if authenticated.","type":"text/plain"},"url":{"path":["v1","users",":id","following"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve a paginated list of users that the specified user follows. Includes fol List of followed users with pagination -
    +
    Schema
      data object[] required
    • Array [
    • settings object required
    • ]
    User not found diff --git a/docs/user_related_apis_versioned/1.0.0/users-controller-get-user-profile.api.mdx b/docs/user_related_apis_versioned/1.0.0/users-controller-get-user-profile.api.mdx index 271f1363..2d61d7e7 100644 --- a/docs/user_related_apis_versioned/1.0.0/users-controller-get-user-profile.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/users-controller-get-user-profile.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve a user profile by either UUID or username. If viewing you sidebar_label: "Get user profile by id or username" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_getUserProfile","description":"Retrieve a user profile by either UUID or username. If viewing your own profile, returns full data; otherwise returns public profile with follow relationship status.","parameters":[{"name":"id","required":false,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"username","required":false,"in":"path","description":"Username of the user (case-insensitive)","schema":{"type":"string"}},{"name":"qdc","required":false,"in":"query","description":"Include Quran.com connected account data","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Own profile with full data including settings","content":{"application/json":{"schema":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"}}}},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user profile by id or username","description":{"content":"Retrieve a user profile by either UUID or username. If viewing your own profile, returns full data; otherwise returns public profile with follow relationship status.","type":"text/plain"},"url":{"path":["v1","users",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Include Quran.com connected account data","type":"text/plain"},"key":"qdc","value":""}],"variable":[{"disabled":false,"description":{"content":"UUID of the user","type":"text/plain"},"type":"any","value":"","key":"id"},{"disabled":false,"description":{"content":"Username of the user (case-insensitive)","type":"text/plain"},"type":"any","value":"","key":"username"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"UsersController_getUserProfile","description":"Retrieve a user profile by either UUID or username. If viewing your own profile, returns full data; otherwise returns public profile with follow relationship status.","parameters":[{"name":"id","required":false,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"username","required":false,"in":"path","description":"Username of the user (case-insensitive)","schema":{"type":"string"}},{"name":"qdc","required":false,"in":"query","description":"Include Quran.com connected account data","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Own profile with full data including settings","content":{"application/json":{"schema":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"},"example":{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}}}},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user profile by id or username","description":{"content":"Retrieve a user profile by either UUID or username. If viewing your own profile, returns full data; otherwise returns public profile with follow relationship status.","type":"text/plain"},"url":{"path":["v1","users",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Include Quran.com connected account data","type":"text/plain"},"key":"qdc","value":""}],"variable":[{"disabled":false,"description":{"content":"UUID of the user","type":"text/plain"},"type":"any","value":"","key":"id"},{"disabled":false,"description":{"content":"Username of the user (case-insensitive)","type":"text/plain"},"type":"any","value":"","key":"username"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve a user profile by either UUID or username. If viewing your own profile, Own profile with full data including settings -
    Schema
      settings object required
    +
    Schema
      settings object required
    User not found diff --git a/docs/user_related_apis_versioned/1.0.0/users-controller-profile.api.mdx b/docs/user_related_apis_versioned/1.0.0/users-controller-profile.api.mdx index 4d49256f..3fe3ba17 100644 --- a/docs/user_related_apis_versioned/1.0.0/users-controller-profile.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/users-controller-profile.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve the complete profile of the authenticated user including sidebar_label: "Get user profile" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_profile","description":"Retrieve the complete profile of the authenticated user including personal info, settings, statistics, and connected accounts.","parameters":[{"name":"qdc","required":false,"in":"query","description":"Include Quran.com (QDC) connected account data","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Full user profile with all data","content":{"application/json":{"schema":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/profile","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user profile","description":{"content":"Retrieve the complete profile of the authenticated user including personal info, settings, statistics, and connected accounts.","type":"text/plain"},"url":{"path":["v1","users","profile"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Include Quran.com (QDC) connected account data","type":"text/plain"},"key":"qdc","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"UsersController_profile","description":"Retrieve the complete profile of the authenticated user including personal info, settings, statistics, and connected accounts.","parameters":[{"name":"qdc","required":false,"in":"query","description":"Include Quran.com (QDC) connected account data","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Full user profile with all data","content":{"application/json":{"schema":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"},"example":{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/profile","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user profile","description":{"content":"Retrieve the complete profile of the authenticated user including personal info, settings, statistics, and connected accounts.","type":"text/plain"},"url":{"path":["v1","users","profile"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Include Quran.com (QDC) connected account data","type":"text/plain"},"key":"qdc","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve the complete profile of the authenticated user including personal info, Full user profile with all data -
    Schema
      settings object required
    +
    Schema
      settings object required
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/users-controller-remove-follower.api.mdx b/docs/user_related_apis_versioned/1.0.0/users-controller-remove-follower.api.mdx index 89ba69a4..fc692d11 100644 --- a/docs/user_related_apis_versioned/1.0.0/users-controller-remove-follower.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/users-controller-remove-follower.api.mdx @@ -5,7 +5,7 @@ description: "Remove a user from your followers list. They will no longer see yo sidebar_label: "Remove a follower" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_removeFollower","description":"Remove a user from your followers list. They will no longer see you as followed and won't receive notifications about your activity.","parameters":[{"name":"followerId","required":true,"in":"path","description":"UUID of the follower to remove","schema":{"type":"string"}}],"responses":{"200":{"description":"Follower removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean","example":true}}}}}},"400":{"description":"Invalid follower id or follower relationship doesn't exist"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/users/{followerId}/remove-follower","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Remove a follower","description":{"content":"Remove a user from your followers list. They will no longer see you as followed and won't receive notifications about your activity.","type":"text/plain"},"url":{"path":["v1","users",":followerId","remove-follower"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the follower to remove","type":"text/plain"},"type":"any","value":"","key":"followerId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"UsersController_removeFollower","description":"Remove a user from your followers list. They will no longer see you as followed and won't receive notifications about your activity.","parameters":[{"name":"followerId","required":true,"in":"path","description":"UUID of the follower to remove","schema":{"type":"string"}}],"responses":{"200":{"description":"Follower removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean","example":true}}},"example":{"removed":true}}}},"400":{"description":"Invalid follower id or follower relationship doesn't exist"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/users/{followerId}/remove-follower","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Remove a follower","description":{"content":"Remove a user from your followers list. They will no longer see you as followed and won't receive notifications about your activity.","type":"text/plain"},"url":{"path":["v1","users",":followerId","remove-follower"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the follower to remove","type":"text/plain"},"type":"any","value":"","key":"followerId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Remove a user from your followers list. They will no longer see you as followed Follower removed successfully -
    Schema
    +
    Schema
    Invalid follower id or follower relationship doesn't exist diff --git a/docs/user_related_apis_versioned/1.0.0/users-controller-rooms.api.mdx b/docs/user_related_apis_versioned/1.0.0/users-controller-rooms.api.mdx index 18296f6e..dc2e79d7 100644 --- a/docs/user_related_apis_versioned/1.0.0/users-controller-rooms.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/users-controller-rooms.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve all rooms (groups and pages) the authenticated user is a sidebar_label: "Get logged-in user rooms" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_rooms","description":"Retrieve all rooms (groups and pages) the authenticated user is a member of. Supports filtering by name and pagination.","parameters":[{"name":"name","required":false,"in":"query","description":"Filter rooms by name","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Rooms per page (default: 10)","schema":{"type":"number"}}],"responses":{"200":{"description":"User rooms with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"group":{"type":"string"},"public":{"type":"boolean"},"roomType":{"type":"string"},"verified":{"type":"boolean"},"subdomain":{"type":"string"},"description":{"type":"string"},"membersCount":{"type":"number"},"avatarUrl":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}}},"required":["id","name","group","public","roomType","verified","subdomain","description","membersCount","avatarUrl"],"title":"UserRoomDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"UserRoomsResponse"}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/my-rooms","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get logged-in user rooms","description":{"content":"Retrieve all rooms (groups and pages) the authenticated user is a member of. Supports filtering by name and pagination.","type":"text/plain"},"url":{"path":["v1","users","my-rooms"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Filter rooms by name","type":"text/plain"},"key":"name","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Rooms per page (default: 10)","type":"text/plain"},"key":"limit","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"UsersController_rooms","description":"Retrieve all rooms (groups and pages) the authenticated user is a member of. Supports filtering by name and pagination.","parameters":[{"name":"name","required":false,"in":"query","description":"Filter rooms by name","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Rooms per page (default: 10)","schema":{"type":"number"}}],"responses":{"200":{"description":"User rooms with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"group":{"type":"string"},"public":{"type":"boolean"},"roomType":{"type":"string"},"verified":{"type":"boolean"},"subdomain":{"type":"string"},"description":{"type":"string"},"membersCount":{"type":"number"},"avatarUrl":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}}},"required":["id","name","group","public","roomType","verified","subdomain","description","membersCount","avatarUrl"],"title":"UserRoomDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"UserRoomsResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"id":1,"name":"string","group":"string","public":true,"roomType":"string","verified":true,"subdomain":"string","description":"string","membersCount":1,"avatarUrl":{"small":"string","medium":"string","large":"string"}}]}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/my-rooms","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get logged-in user rooms","description":{"content":"Retrieve all rooms (groups and pages) the authenticated user is a member of. Supports filtering by name and pagination.","type":"text/plain"},"url":{"path":["v1","users","my-rooms"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Filter rooms by name","type":"text/plain"},"key":"name","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Rooms per page (default: 10)","type":"text/plain"},"key":"limit","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve all rooms (groups and pages) the authenticated user is a member of. Sup User rooms with pagination metadata -
    Schema
      data object[] required
    • Array [
    • avatarUrl object required
    • ]
    +
    Schema
      data object[] required
    • Array [
    • avatarUrl object required
    • ]
    User not authenticated diff --git a/docs/user_related_apis_versioned/1.0.0/users-controller-search.api.mdx b/docs/user_related_apis_versioned/1.0.0/users-controller-search.api.mdx index 033c8f47..a27d2297 100644 --- a/docs/user_related_apis_versioned/1.0.0/users-controller-search.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/users-controller-search.api.mdx @@ -5,7 +5,7 @@ description: "Search users by name or username. Supports mentioning in posts, fi sidebar_label: "Search for users" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_search","description":"Search users by name or username. Supports mentioning in posts, finding users for room invites, and general discovery. Results can be scoped to specific contexts.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term for name/username","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"all","required":false,"in":"query","description":"Search all users (not just followed)","schema":{"type":"boolean"}},{"name":"postingAs","required":false,"in":"query","description":"Filter for posting-as feature","schema":{"type":"boolean"}},{"name":"postingAsUserId","required":false,"in":"query","description":"User ID for posting-as context","schema":{"type":"string"}},{"name":"roomId","required":false,"in":"query","description":"Room ID for scoped search","schema":{"type":"number"}}],"responses":{"200":{"description":"Matching users with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"UsersSearchResponse"}}}}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/search","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Search for users","description":{"content":"Search users by name or username. Supports mentioning in posts, finding users for room invites, and general discovery. Results can be scoped to specific contexts.","type":"text/plain"},"url":{"path":["v1","users","search"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search term for name/username","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Search all users (not just followed)","type":"text/plain"},"key":"all","value":""},{"disabled":false,"description":{"content":"Filter for posting-as feature","type":"text/plain"},"key":"postingAs","value":""},{"disabled":false,"description":{"content":"User ID for posting-as context","type":"text/plain"},"key":"postingAsUserId","value":""},{"disabled":false,"description":{"content":"Room ID for scoped search","type":"text/plain"},"key":"roomId","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"UsersController_search","description":"Search users by name or username. Supports mentioning in posts, finding users for room invites, and general discovery. Results can be scoped to specific contexts.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term for name/username","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"all","required":false,"in":"query","description":"Search all users (not just followed)","schema":{"type":"boolean"}},{"name":"postingAs","required":false,"in":"query","description":"Filter for posting-as feature","schema":{"type":"boolean"}},{"name":"postingAsUserId","required":false,"in":"query","description":"User ID for posting-as context","schema":{"type":"string"}},{"name":"roomId","required":false,"in":"query","description":"Room ID for scoped search","schema":{"type":"number"}}],"responses":{"200":{"description":"Matching users with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"isFollowed":{"type":"boolean","example":false},"followed":{"type":"boolean","example":false},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSearchDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"UsersSearchResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"isFollowed":false,"followed":false,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string"}]}}}}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/search","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Search for users","description":{"content":"Search users by name or username. Supports mentioning in posts, finding users for room invites, and general discovery. Results can be scoped to specific contexts.","type":"text/plain"},"url":{"path":["v1","users","search"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search term for name/username","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Search all users (not just followed)","type":"text/plain"},"key":"all","value":""},{"disabled":false,"description":{"content":"Filter for posting-as feature","type":"text/plain"},"key":"postingAs","value":""},{"disabled":false,"description":{"content":"User ID for posting-as context","type":"text/plain"},"key":"postingAsUserId","value":""},{"disabled":false,"description":{"content":"Room ID for scoped search","type":"text/plain"},"key":"roomId","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -31,5 +31,5 @@ Search users by name or username. Supports mentioning in posts, finding users fo Matching users with pagination -
    Schema
      data object[] required
    • Array [
    • settings object required
    • ]
    +
    Schema
      data object[] required
    • Array [
    • settings object required
    • ]
    \ No newline at end of file diff --git a/docs/user_related_apis_versioned/1.0.0/users-controller-toggle-follow.api.mdx b/docs/user_related_apis_versioned/1.0.0/users-controller-toggle-follow.api.mdx index 0b35b2a1..11262853 100644 --- a/docs/user_related_apis_versioned/1.0.0/users-controller-toggle-follow.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/users-controller-toggle-follow.api.mdx @@ -5,7 +5,7 @@ description: "Follow or unfollow another user. When following, their posts will sidebar_label: "Toggle follow/unfollow a user" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_toggleFollow","description":"Follow or unfollow another user. When following, their posts will appear in your FOLLOWING feed. Can optionally specify action to force follow/unfollow.","parameters":[{"name":"followeeId","required":true,"in":"path","description":"UUID of the user to follow/unfollow","schema":{"type":"string"}}],"requestBody":{"required":false,"description":"Optional: specify \"follow\" or \"unfollow\" action explicitly","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"enum":["follow","unfollow"],"type":"string","description":"The intended action: follow or unfollow","example":"follow"}},"title":"ToggleFollowDto"}}}},"responses":{"200":{"description":"Follow status changed - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"followed":{"type":"boolean","description":"true if now following"}}}}}},"400":{"description":"Cannot follow yourself or action already in desired state"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/users/{followeeId}/toggle-follow","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"action":"follow"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle follow/unfollow a user","description":{"content":"Follow or unfollow another user. When following, their posts will appear in your FOLLOWING feed. Can optionally specify action to force follow/unfollow.","type":"text/plain"},"url":{"path":["v1","users",":followeeId","toggle-follow"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user to follow/unfollow","type":"text/plain"},"type":"any","value":"","key":"followeeId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"UsersController_toggleFollow","description":"Follow or unfollow another user. When following, their posts will appear in your FOLLOWING feed. Can optionally specify action to force follow/unfollow.","parameters":[{"name":"followeeId","required":true,"in":"path","description":"UUID of the user to follow/unfollow","schema":{"type":"string"}}],"requestBody":{"required":false,"description":"Optional: specify \"follow\" or \"unfollow\" action explicitly","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"enum":["follow","unfollow"],"type":"string","description":"The intended action: follow or unfollow","example":"follow"}},"title":"ToggleFollowDto"},"example":{"action":"follow"}}}},"responses":{"200":{"description":"Follow status changed - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"followed":{"type":"boolean","description":"true if now following"}}},"example":{"followed":true}}}},"400":{"description":"Cannot follow yourself or action already in desired state"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/users/{followeeId}/toggle-follow","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"action":"follow"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle follow/unfollow a user","description":{"content":"Follow or unfollow another user. When following, their posts will appear in your FOLLOWING feed. Can optionally specify action to force follow/unfollow.","type":"text/plain"},"url":{"path":["v1","users",":followeeId","toggle-follow"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user to follow/unfollow","type":"text/plain"},"type":"any","value":"","key":"followeeId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Optional: specify "follow" or "unfollow" action explicitly Follow status changed - returns new state -
    Schema
    +
    Schema
    Cannot follow yourself or action already in desired state diff --git a/docs/user_related_apis_versioned/1.0.0/users-controller-update-profile.api.mdx b/docs/user_related_apis_versioned/1.0.0/users-controller-update-profile.api.mdx index 8f56b065..d9d23d5c 100644 --- a/docs/user_related_apis_versioned/1.0.0/users-controller-update-profile.api.mdx +++ b/docs/user_related_apis_versioned/1.0.0/users-controller-update-profile.api.mdx @@ -5,7 +5,7 @@ description: "Update user profile information including name, bio, username, ava sidebar_label: "Update user profile" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_updateProfile","description":"Update user profile information including name, bio, username, avatar, and social links. Validates username uniqueness.","parameters":[],"requestBody":{"required":true,"description":"Profile fields to update wrapped in a user object","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"removeAvatar":{"type":"boolean"}},"title":"UpdateProfileDto"}},"required":["user"],"title":"UpdateProfileBodyDto"}}}},"responses":{"200":{"description":"Profile updated and returned with new values","content":{"application/json":{"schema":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"}}}},"400":{"description":"Invalid profile data or username taken"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"put","path":"/v1/users/profile","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"user":{"avatar":"string","firstName":"string","lastName":"string","bio":"string","country":"string","removeAvatar":true}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update user profile","description":{"content":"Update user profile information including name, bio, username, avatar, and social links. Validates username uniqueness.","type":"text/plain"},"url":{"path":["v1","users","profile"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PUT","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"UsersController_updateProfile","description":"Update user profile information including name, bio, username, avatar, and social links. Validates username uniqueness.","parameters":[],"requestBody":{"required":true,"description":"Profile fields to update wrapped in a user object","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"removeAvatar":{"type":"boolean"}},"title":"UpdateProfileDto"}},"required":["user"],"title":"UpdateProfileBodyDto"},"example":{"user":{"avatar":"string","firstName":"string","lastName":"string","bio":"string","country":"string","removeAvatar":true}}}}},"responses":{"200":{"description":"Profile updated and returned with new values","content":{"application/json":{"schema":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"},"example":{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}}}},"400":{"description":"Invalid profile data or username taken"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"put","path":"/v1/users/profile","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"user":{"avatar":"string","firstName":"string","lastName":"string","bio":"string","country":"string","removeAvatar":true}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update user profile","description":{"content":"Update user profile information including name, bio, username, avatar, and social links. Validates username uniqueness.","type":"text/plain"},"url":{"path":["v1","users","profile"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PUT","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "put api-method" info_path: docs/user_related_apis_versioned/1.0.0/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Profile fields to update wrapped in a user object Profile updated and returned with new values -
    Schema
      settings object required
    +
    Schema
      settings object required
    Invalid profile data or username taken diff --git a/docs/user_related_apis_versioned/add-collection.api.mdx b/docs/user_related_apis_versioned/add-collection.api.mdx deleted file mode 100644 index a8203ded..00000000 --- a/docs/user_related_apis_versioned/add-collection.api.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: add-collection -title: "Add collection" -description: "Create a new collection under user's account." -sidebar_label: "Add collection" -hide_title: true -hide_table_of_contents: true -api: {"description":"Create a new collection under user's account.","tags":["Collections"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the new collection to be created.","example":"Woman in Quran"}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","example":"cmmav113800077e21b8bfgkgs"},"updatedAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"name":{"type":"string","example":"Woman in Quran"}},"required":["id","updatedAt","name"],"additionalProperties":false,"title":"Collection"}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/collections","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"Woman in Quran"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add collection","description":{"content":"Create a new collection under user's account.","type":"text/plain"},"url":{"path":["v1","collections"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} -sidebar_class_name: "post api-method" -info_path: docs/user_related_apis_versioned/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Add collection - - - -Create a new collection under user's account. - -
    Request Body
    - -Request has been handled successfully. - -
    Schema
      data object
    - -The request is missing required parameters or is invalid. - -
    Schema
    - -The request is unauthorized. - -
    Schema
    - -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
    - -Not Found. The resource being accessed does not exist. - -
    Schema
    - -Validation Error. The request includes one or more invalid params. Please check the request params and try again. - -
    Schema
    - -Too many requests, please try again later. - -
    Schema
    - -Server Error. Something went wrong, try again later. - -
    Schema
    - -Invalid response from the upstream server - -
    Schema
    - -The server is currently unable to handle the request due to a temporary overload or scheduled maintenance - -
    Schema
    - -The server did not receive a timely response from the upstream server. - -
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/add-note.api.mdx b/docs/user_related_apis_versioned/add-note.api.mdx deleted file mode 100644 index 7a3eeec3..00000000 --- a/docs/user_related_apis_versioned/add-note.api.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -id: add-note -title: "Add note" -description: "Add a new note." -sidebar_label: "Add note" -hide_title: true -hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Add a new note.","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"saveToQR":{"type":"boolean","description":"Indicates whether the note should be saved to the QuranReflect.","example":true},"attachedEntity":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["body","saveToQR"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/notes","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"body":"This is a sample note body.","saveToQR":true,"attachedEntity":{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}},"ranges":["2:255-2:257"]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add note","description":{"content":"Add a new note.","type":"text/plain"},"url":{"path":["v1","notes"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} -sidebar_class_name: "post api-method" -info_path: docs/user_related_apis_versioned/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Add note - - - -Add a new note. - -
    Request Body
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
      attachedEntity object
      entityMetadata object
      - -Additional metadata for the attached entity. - -
    - -Request has been handled successfully. - -
    Schema
      data object
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
      attachedEntities object[]
      - -An array of attached entities associated with the note. - -
    • Array [
    • entityMetadata object
      - -Additional metadata for the attached entity. - -
    • ]
    - -The request is missing required parameters or is invalid. - -
    Schema
    - -The request is unauthorized. - -
    Schema
    - -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
    - -Not Found. The resource being accessed does not exist. - -
    Schema
    - -Validation Error. The request includes one or more invalid params. Please check the request params and try again. - -
    Schema
    - -Too many requests, please try again later. - -
    Schema
    - -Server Error. Something went wrong, try again later. - -
    Schema
    - -Invalid response from the upstream server - -
    Schema
    - -The server is currently unable to handle the request due to a temporary overload or scheduled maintenance - -
    Schema
    - -The server did not receive a timely response from the upstream server. - -
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/delete-bookmark.api.mdx b/docs/user_related_apis_versioned/auth-delete-v-1-bookmarks-by-bookmark-id.api.mdx similarity index 50% rename from docs/user_related_apis_versioned/delete-bookmark.api.mdx rename to docs/user_related_apis_versioned/auth-delete-v-1-bookmarks-by-bookmark-id.api.mdx index 226b7efe..c5465cd3 100644 --- a/docs/user_related_apis_versioned/delete-bookmark.api.mdx +++ b/docs/user_related_apis_versioned/auth-delete-v-1-bookmarks-by-bookmark-id.api.mdx @@ -1,11 +1,11 @@ --- -id: delete-bookmark +id: auth-delete-v-1-bookmarks-by-bookmark-id title: "Delete Bookmark" -description: "Delete a bookmark by id." +description: "Delete a standalone bookmark by id. This endpoint fully removes orphan bookmarks only. If the bookmark belongs to the virtual Favorites collection or any custom collection, it is not removed; this endpoint only sets `isReading` to `false` and leaves the bookmark attached to those collections. To remove it from Favorites or a custom collection, use the corresponding collection delete endpoint instead." sidebar_label: "Delete Bookmark" hide_title: true hide_table_of_contents: true -api: {"description":"Delete a bookmark by id.","tags":["Bookmarks"],"parameters":[{"in":"path","name":"bookmarkId","schema":{"type":"string","description":"The id of the bookmark to be deleted.","example":"cmmav10zi00067e215f09bzz7"},"required":true,"description":"The id of the bookmark to be deleted."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["bookmark deleted"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"delete","path":"/v1/bookmarks/{bookmarkId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete Bookmark","description":{"content":"Delete a bookmark by id.","type":"text/plain"},"url":{"path":["v1","bookmarks",":bookmarkId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The id of the bookmark to be deleted.","type":"text/plain"},"type":"any","value":"","key":"bookmarkId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +api: {"description":"Delete a standalone bookmark by id. This endpoint fully removes orphan bookmarks only. If the bookmark belongs to the virtual Favorites collection or any custom collection, it is not removed; this endpoint only sets `isReading` to `false` and leaves the bookmark attached to those collections. To remove it from Favorites or a custom collection, use the corresponding collection delete endpoint instead.","tags":["Bookmarks"],"parameters":[{"in":"path","name":"bookmarkId","schema":{"type":"string","description":"The id of the bookmark to be deleted.","example":"cmoa3wqk500077z3f018r4rzn"},"required":true,"description":"The id of the bookmark to be deleted."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["bookmark deleted"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"bookmark deleted"}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1BookmarksByBookmarkId","method":"delete","path":"/v1/bookmarks/{bookmarkId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete Bookmark","description":{"content":"Delete a standalone bookmark by id. This endpoint fully removes orphan bookmarks only. If the bookmark belongs to the virtual Favorites collection or any custom collection, it is not removed; this endpoint only sets `isReading` to `false` and leaves the bookmark attached to those collections. To remove it from Favorites or a custom collection, use the corresponding collection delete endpoint instead.","type":"text/plain"},"url":{"path":["v1","bookmarks",":bookmarkId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The id of the bookmark to be deleted.","type":"text/plain"},"type":"any","value":"","key":"bookmarkId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -25,13 +25,17 @@ import TabItem from "@theme/TabItem"; -Delete a bookmark by id. +Delete a standalone bookmark by id. This endpoint fully removes orphan bookmarks only. If the bookmark belongs to the virtual Favorites collection or any custom collection, it is not removed; this endpoint only sets `isReading` to `false` and leaves the bookmark attached to those collections. To remove it from Favorites or a custom collection, use the corresponding collection delete endpoint instead. -
    Path Parameters
    +
    Path Parameters
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object
    +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -47,7 +51,11 @@ Forbidden error. Can either be due to access token not being passed, having been Not Found. The resource being accessed does not exist. -
    Schema
    +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    Validation Error. The request includes one or more invalid params. Please check the request params and try again. diff --git a/docs/user_related_apis_versioned/auth-delete-v-1-collections-by-collection-id-bookmarks-by-bookmark-id.api.mdx b/docs/user_related_apis_versioned/auth-delete-v-1-collections-by-collection-id-bookmarks-by-bookmark-id.api.mdx new file mode 100644 index 00000000..24b4e79d --- /dev/null +++ b/docs/user_related_apis_versioned/auth-delete-v-1-collections-by-collection-id-bookmarks-by-bookmark-id.api.mdx @@ -0,0 +1,83 @@ +--- +id: auth-delete-v-1-collections-by-collection-id-bookmarks-by-bookmark-id +title: "Delete collection bookmark by id" +description: "Delete a bookmark from a collection by bookmark ID. Use `collectionId='__default__'` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan." +sidebar_label: "Delete collection bookmark by id" +hide_title: true +hide_table_of_contents: true +api: {"description":"Delete a bookmark from a collection by bookmark ID. Use `collectionId=\"__default__\"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection.","example":"cmoa3wqxe000b7z3f6d6ia4ih"},"required":true,"description":"The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection."},{"in":"path","name":"bookmarkId","schema":{"type":"string","description":"The Id of the bookmark to be deleted.","example":"cmoa3wqxe000c7z3f61siesdm"},"required":true,"description":"The Id of the bookmark to be deleted."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection bookmark deleted"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"collection bookmark deleted"}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1CollectionsByCollectionIdBookmarksByBookmarkId","method":"delete","path":"/v1/collections/{collectionId}/bookmarks/{bookmarkId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete collection bookmark by id","description":{"content":"Delete a bookmark from a collection by bookmark ID. Use `collectionId=\"__default__\"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId","bookmarks",":bookmarkId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection.","type":"text/plain"},"type":"any","value":"","key":"collectionId"},{"disabled":false,"description":{"content":"(Required) The Id of the bookmark to be deleted.","type":"text/plain"},"type":"any","value":"","key":"bookmarkId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +sidebar_class_name: "delete api-method" +info_path: docs/user_related_apis_versioned/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Delete collection bookmark by id + + + +Delete a bookmark from a collection by bookmark ID. Use `collectionId="__default__"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan. + +
    Path Parameters
    Query Parameters
    + +Request has been handled successfully. + +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    + \ No newline at end of file diff --git a/docs/user_related_apis_versioned/auth-delete-v-1-collections-by-collection-id-bookmarks.api.mdx b/docs/user_related_apis_versioned/auth-delete-v-1-collections-by-collection-id-bookmarks.api.mdx new file mode 100644 index 00000000..0a8eb6f1 --- /dev/null +++ b/docs/user_related_apis_versioned/auth-delete-v-1-collections-by-collection-id-bookmarks.api.mdx @@ -0,0 +1,75 @@ +--- +id: auth-delete-v-1-collections-by-collection-id-bookmarks +title: "Delete collection bookmark by details" +description: "Delete a bookmark from a collection by bookmark details. Use `collectionId='__default__'` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan." +sidebar_label: "Delete collection bookmark by details" +hide_title: true +hide_table_of_contents: true +api: {"description":"Delete a bookmark from a collection by bookmark details. Use `collectionId=\"__default__\"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection.","example":"cmoa3wr2h000f7z3ffr5fc0z1"},"required":true,"description":"The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"}},"additionalProperties":false},"example":{"success":true,"data":{}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["key","verseNumber"],"additionalProperties":false,"title":"Ayah"},{"type":"object","required":["key"],"additionalProperties":false,"title":"Surah, Juz, Or Page"},{"type":"object","required":["bookmarkId"],"additionalProperties":false,"title":"Bookmark ID"}],"title":"input"},"example":{"key":2,"type":"ayah","verseNumber":3,"mushafId":4,"mushaf":4}}}},"operationId":"authDeleteV1CollectionsByCollectionIdBookmarks","method":"delete","path":"/v1/collections/{collectionId}/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"key":2,"type":"ayah","verseNumber":3,"mushafId":4,"mushaf":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete collection bookmark by details","description":{"content":"Delete a bookmark from a collection by bookmark details. Use `collectionId=\"__default__\"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId","bookmarks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"DELETE","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "delete api-method" +info_path: docs/user_related_apis_versioned/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Delete collection bookmark by details + + + +Delete a bookmark from a collection by bookmark details. Use `collectionId="__default__"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan. + +
    Path Parameters
    Query Parameters
    Request Body
      oneOf
    + +Request has been handled successfully. + +
    Schema
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    + \ No newline at end of file diff --git a/docs/user_related_apis_versioned/delete-collection.api.mdx b/docs/user_related_apis_versioned/auth-delete-v-1-collections-by-collection-id.api.mdx similarity index 54% rename from docs/user_related_apis_versioned/delete-collection.api.mdx rename to docs/user_related_apis_versioned/auth-delete-v-1-collections-by-collection-id.api.mdx index 9d0ea71d..a2fa92f8 100644 --- a/docs/user_related_apis_versioned/delete-collection.api.mdx +++ b/docs/user_related_apis_versioned/auth-delete-v-1-collections-by-collection-id.api.mdx @@ -1,11 +1,11 @@ --- -id: delete-collection +id: auth-delete-v-1-collections-by-collection-id title: "Delete collection" description: "Delete a an existing collection." sidebar_label: "Delete collection" hide_title: true hide_table_of_contents: true -api: {"description":"Delete a an existing collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be deleted.","example":"cmmav11ac00097e211kmcdj4z"},"required":true,"description":"The Id of the collection to be deleted."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection deleted"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"delete","path":"/v1/collections/{collectionId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete collection","description":{"content":"Delete a an existing collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The Id of the collection to be deleted.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +api: {"description":"Delete a an existing collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be deleted.","example":"cmoa3wqwh000a7z3f0d6y5mte"},"required":true,"description":"The Id of the collection to be deleted."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection deleted"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"collection deleted"}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1CollectionsByCollectionId","method":"delete","path":"/v1/collections/{collectionId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete collection","description":{"content":"Delete a an existing collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The Id of the collection to be deleted.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -27,11 +27,15 @@ import TabItem from "@theme/TabItem"; Delete a an existing collection. -
    Path Parameters
    +
    Path Parameters
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object
    +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -47,7 +51,11 @@ Forbidden error. Can either be due to access token not being passed, having been Not Found. The resource being accessed does not exist. -
    Schema
    +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    Validation Error. The request includes one or more invalid params. Please check the request params and try again. diff --git a/docs/user_related_apis_versioned/delete-a-goal.api.mdx b/docs/user_related_apis_versioned/auth-delete-v-1-goals-by-id.api.mdx similarity index 71% rename from docs/user_related_apis_versioned/delete-a-goal.api.mdx rename to docs/user_related_apis_versioned/auth-delete-v-1-goals-by-id.api.mdx index 8848822e..15a499a0 100644 --- a/docs/user_related_apis_versioned/delete-a-goal.api.mdx +++ b/docs/user_related_apis_versioned/auth-delete-v-1-goals-by-id.api.mdx @@ -1,11 +1,11 @@ --- -id: delete-a-goal +id: auth-delete-v-1-goals-by-id title: "Delete a goal" description: "Delete a goal by id." sidebar_label: "Delete a goal" hide_title: true hide_table_of_contents: true -api: {"description":"Delete a goal by id.","tags":["Goals"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The id of the goal.","example":"cmmav11g9000d7e219d05gas2"},"required":true,"description":"The id of the goal."},{"in":"query","name":"category","schema":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"},"required":true,"description":"The category of the goal"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["goal deleted"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"delete","path":"/v1/goals/{id}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete a goal","description":{"content":"Delete a goal by id.","type":"text/plain"},"url":{"path":["v1","goals",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The category of the goal","type":"text/plain"},"key":"category","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The id of the goal.","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +api: {"description":"Delete a goal by id.","tags":["Goals"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The id of the goal.","example":"cmoa3wr5c000g7z3fgv0y0rvo"},"required":true,"description":"The id of the goal."},{"in":"query","name":"category","schema":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"},"required":true,"description":"The category of the goal"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["goal deleted"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"goal deleted"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1GoalsById","method":"delete","path":"/v1/goals/{id}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete a goal","description":{"content":"Delete a goal by id.","type":"text/plain"},"url":{"path":["v1","goals",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The category of the goal","type":"text/plain"},"key":"category","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The id of the goal.","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"DELETE"}} sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; Delete a goal by id. -
    Path Parameters
    Query Parameters
    Header Parameters
    +
    Path Parameters
    Query Parameters
    Header Parameters
    Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -72,4 +72,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/add-collection-bookmark.api.mdx b/docs/user_related_apis_versioned/auth-delete-v-1-notes-by-note-id.api.mdx similarity index 55% rename from docs/user_related_apis_versioned/add-collection-bookmark.api.mdx rename to docs/user_related_apis_versioned/auth-delete-v-1-notes-by-note-id.api.mdx index 5711f1c5..25e897ed 100644 --- a/docs/user_related_apis_versioned/add-collection-bookmark.api.mdx +++ b/docs/user_related_apis_versioned/auth-delete-v-1-notes-by-note-id.api.mdx @@ -1,12 +1,12 @@ --- -id: add-collection-bookmark -title: "Add collection Bookmark" -description: "Add a bookmark to an existing collection." -sidebar_label: "Add collection Bookmark" +id: auth-delete-v-1-notes-by-note-id +title: "Delete note by ID" +description: "Delete a note by its ID." +sidebar_label: "Delete note by ID" hide_title: true hide_table_of_contents: true -api: {"description":"Add a bookmark to an existing collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be added.","example":"cmmav119z00087e21czrofw1s"},"required":true,"description":"The Id of the collection to be added."}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["key","verseNumber","mushaf"],"additionalProperties":false,"title":"Ayah"},{"type":"object","required":["key","mushaf"],"additionalProperties":false,"title":"Surah, Juz, Or Page"}]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection bookmark added"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/collections/{collectionId}/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"key":2,"type":"ayah","verseNumber":3,"mushaf":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add collection Bookmark","description":{"content":"Add a bookmark to an existing collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId","bookmarks"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The Id of the collection to be added.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} -sidebar_class_name: "post api-method" +api: {"tags":["Notes"],"description":"Delete a note by its ID.","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The ID of the note to delete."},"required":true,"description":"The ID of the note to delete."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"success":{"type":"boolean"}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"success":true}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1NotesByNoteId","method":"delete","path":"/v1/notes/{noteId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete note by ID","description":{"content":"Delete a note by its ID.","type":"text/plain"},"url":{"path":["v1","notes",":noteId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The ID of the note to delete.","type":"text/plain"},"type":"any","value":"","key":"noteId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null displayed_sidebar: APIsSidebar @@ -21,17 +21,21 @@ import SchemaTabs from "@theme/SchemaTabs"; import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import TabItem from "@theme/TabItem"; -## Add collection Bookmark +## Delete note by ID -Add a bookmark to an existing collection. +Delete a note by its ID. -
    Path Parameters
    Request Body
      anyOf
    +
    Path Parameters
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object
    +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -47,7 +51,11 @@ Forbidden error. Can either be due to access token not being passed, having been Not Found. The resource being accessed does not exist. -
    Schema
    +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    Validation Error. The request includes one or more invalid params. Please check the request params and try again. diff --git a/docs/user_related_apis_versioned/estimate-reading-time.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-activity-days-estimate-reading-time.api.mdx similarity index 71% rename from docs/user_related_apis_versioned/estimate-reading-time.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-activity-days-estimate-reading-time.api.mdx index 3877d3dd..dd7db1d7 100644 --- a/docs/user_related_apis_versioned/estimate-reading-time.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-activity-days-estimate-reading-time.api.mdx @@ -1,11 +1,11 @@ --- -id: estimate-reading-time +id: auth-get-v-1-activity-days-estimate-reading-time title: "Estimate reading time" description: "Estimate the number of seconds it would take to read a range. We estimate it based on the average reading speed we have collected on quran.com." sidebar_label: "Estimate reading time" hide_title: true hide_table_of_contents: true -api: {"description":"Estimate the number of seconds it would take to read a range. We estimate it based on the average reading speed we have collected on quran.com.","tags":["Activity Days"],"parameters":[{"in":"query","name":"ranges","schema":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"},"required":true,"description":"a comma separated string of Ayah ranges e.g. 1:1-1:2"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"seconds":{"type":"integer","description":"The number of seconds it would take on average to read the range of Ayahs.","example":66.8}},"required":["seconds"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/activity-days/estimate-reading-time","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Estimate reading time","description":{"content":"Estimate the number of seconds it would take to read a range. We estimate it based on the average reading speed we have collected on quran.com.","type":"text/plain"},"url":{"path":["v1","activity-days","estimate-reading-time"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) a comma separated string of Ayah ranges e.g. 1:1-1:2","type":"text/plain"},"key":"ranges","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Estimate the number of seconds it would take to read a range. We estimate it based on the average reading speed we have collected on quran.com.","tags":["Activity Days"],"parameters":[{"in":"query","name":"ranges","schema":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"},"required":true,"description":"a comma separated string of Ayah ranges e.g. 1:1-1:2"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"seconds":{"type":"integer","description":"The number of seconds it would take on average to read the range of Ayahs.","example":66.8}},"required":["seconds"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"seconds":66.8}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1ActivityDaysEstimateReadingTime","method":"get","path":"/v1/activity-days/estimate-reading-time","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Estimate reading time","description":{"content":"Estimate the number of seconds it would take to read a range. We estimate it based on the average reading speed we have collected on quran.com.","type":"text/plain"},"url":{"path":["v1","activity-days","estimate-reading-time"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) a comma separated string of Ayah ranges e.g. 1:1-1:2","type":"text/plain"},"key":"ranges","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Estimate the number of seconds it would take to read a range. We estimate it bas Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -72,4 +72,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-activity-days.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-activity-days.api.mdx similarity index 77% rename from docs/user_related_apis_versioned/get-activity-days.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-activity-days.api.mdx index e1a5de68..f97b5a0e 100644 --- a/docs/user_related_apis_versioned/get-activity-days.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-activity-days.api.mdx @@ -1,11 +1,11 @@ --- -id: get-activity-days +id: auth-get-v-1-activity-days title: "Get activity days" description: "Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type." sidebar_label: "Get activity days" hide_title: true hide_table_of_contents: true -api: {"description":"Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type.","tags":["Activity Days"],"parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The start date of the activity days","example":"2023-09-01"},"description":"The start date of the activity days"},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The last date of the activity days","example":"2023-09-31"},"description":"The last date of the activity days"},{"in":"query","name":"dateOrderBy","schema":{"type":"string","enum":["asc","desc"],"description":"Order by activity day's date","example":"desc","default":"desc"},"description":"Order by activity day's date"},{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"description":"The type of the activity day"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The id of the activity day.","example":"cmmav10hr00047e21267o9efb"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day.","example":"2023-09-31"},"progress":{"type":"number","format":"float","minimum":0,"maximum":1,"description":"The progress of the reading goal of that activity day (if the user has a reading goal on that day).","example":0.695},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"ranges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The ranges read on that day (will be included only when the type is QURAN)","example":["1:1-1:2"]},"pagesRead":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages read on that day (will be included only when the type is QURAN)","example":1.637041020126048},"secondsRead":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading on that day (will be included only when the type is QURAN)","example":417},"versesRead":{"oneOf":[{"type":"integer"}],"description":"The number of Ayahs read on that day (will be included only when the type is QURAN)","example":24},"manuallyAddedSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading that was manually input by the user and not auto-tracked (will be included only when the type is QURAN)","example":24},"dailyTargetPages":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":1.637041020126048},"dailyTargetSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":5},"dailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"remainingDailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4}},"required":["id","date","progress","type","mushafId"],"additionalProperties":false,"description":"The Mushaf used to read on that day (will be included only when the type is QURAN) \n\nThe id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/activity-days","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get activity days","description":{"content":"Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type.","type":"text/plain"},"url":{"path":["v1","activity-days"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The start date of the activity days","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"The last date of the activity days","type":"text/plain"},"key":"to","value":""},{"disabled":false,"description":{"content":"Order by activity day's date","type":"text/plain"},"key":"dateOrderBy","value":""},{"disabled":false,"description":{"content":"The type of the activity day","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type.","tags":["Activity Days"],"parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The start date of the activity days","example":"2023-09-01"},"description":"The start date of the activity days"},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The last date of the activity days","example":"2023-09-31"},"description":"The last date of the activity days"},{"in":"query","name":"dateOrderBy","schema":{"type":"string","enum":["asc","desc"],"description":"Order by activity day's date","example":"desc","default":"desc"},"description":"Order by activity day's date"},{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"description":"The type of the activity day"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The id of the activity day.","example":"cmoa3wq2b00047z3fbl4c6ew0"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day.","example":"2023-09-31"},"progress":{"type":"number","format":"float","minimum":0,"maximum":1,"description":"The progress of the reading goal of that activity day (if the user has a reading goal on that day).","example":0.695},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"ranges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The ranges read on that day (will be included only when the type is QURAN)","example":["1:1-1:2"]},"pagesRead":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages read on that day (will be included only when the type is QURAN)","example":1.637041020126048},"secondsRead":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading on that day (will be included only when the type is QURAN)","example":417},"versesRead":{"oneOf":[{"type":"integer"}],"description":"The number of Ayahs read on that day (will be included only when the type is QURAN)","example":24},"manuallyAddedSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading that was manually input by the user and not auto-tracked (will be included only when the type is QURAN)","example":24},"dailyTargetPages":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":1.637041020126048},"dailyTargetSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":5},"dailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"remainingDailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4}},"required":["id","date","progress","type","mushafId"],"additionalProperties":false,"description":"The Mushaf used to read on that day (will be included only when the type is QURAN) \n\nThe id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wq2b00047z3fbl4c6ew0","date":"2023-09-31","progress":0.695,"type":"QURAN","ranges":["1:1-1:2"],"pagesRead":1.637041020126048,"secondsRead":417,"versesRead":24,"manuallyAddedSeconds":24,"dailyTargetPages":1.637041020126048,"dailyTargetSeconds":5,"dailyTargetRanges":["1:1-1:2"],"remainingDailyTargetRanges":["1:1-1:2"],"mushafId":4}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1ActivityDays","method":"get","path":"/v1/activity-days","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get activity days","description":{"content":"Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type.","type":"text/plain"},"url":{"path":["v1","activity-days"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The start date of the activity days","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"The last date of the activity days","type":"text/plain"},"key":"to","value":""},{"disabled":false,"description":{"content":"Order by activity day's date","type":"text/plain"},"key":"dateOrderBy","value":""},{"disabled":false,"description":{"content":"The type of the activity day","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type. -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ranges object
      +
      Schema
        data object[]
      • Array [
      • ranges object
        The ranges read on that day (will be included only when the type is QURAN) @@ -103,7 +103,7 @@ The remaining range of Ayahs user should read on that day to meet their goal's t The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN) -
      • ]
      • pagination object
      +
    • ]
    • pagination object
    The request is missing required parameters or is invalid. @@ -144,4 +144,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-bookmarks-within-a-range-of-ayahs.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-bookmarks-ayahs-range.api.mdx similarity index 64% rename from docs/user_related_apis_versioned/get-bookmarks-within-a-range-of-ayahs.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-bookmarks-ayahs-range.api.mdx index 576fad40..572377a4 100644 --- a/docs/user_related_apis_versioned/get-bookmarks-within-a-range-of-ayahs.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-bookmarks-ayahs-range.api.mdx @@ -1,11 +1,11 @@ --- -id: get-bookmarks-within-a-range-of-ayahs +id: auth-get-v-1-bookmarks-ayahs-range title: "Get bookmarks within a range of Ayahs" description: "Get all bookmarks within a specific Ayahs range." sidebar_label: "Get bookmarks within a range of Ayahs" hide_title: true hide_table_of_contents: true -api: {"description":"Get all bookmarks within a specific Ayahs range.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"chapterNumber","schema":{"type":"integer","description":"The number of the Surah that the Ayahs range belong to."},"required":true,"description":"The number of the Surah that the Ayahs range belong to."},{"in":"query","name":"rangeStartAyahNumber","schema":{"type":"integer","description":"The Ayah number at which the range starts."},"required":true,"description":"The Ayah number at which the range starts."},{"in":"query","name":"rangeEndAyahNumber","schema":{"type":"integer","description":"The Ayah number at which the range ends."},"required":true,"description":"The Ayah number at which the range ends."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav10y500057e21hjilhplh"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5},"group":{"type":"string"},"isInDefaultCollection":{"type":"boolean","example":true}},"required":["id","createdAt","type","key","isInDefaultCollection"],"additionalProperties":false,"title":"Bookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/bookmarks/ayahs-range","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get bookmarks within a range of Ayahs","description":{"content":"Get all bookmarks within a specific Ayahs range.","type":"text/plain"},"url":{"path":["v1","bookmarks","ayahs-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The number of the Surah that the Ayahs range belong to.","type":"text/plain"},"key":"chapterNumber","value":""},{"disabled":false,"description":{"content":"(Required) The Ayah number at which the range starts.","type":"text/plain"},"key":"rangeStartAyahNumber","value":""},{"disabled":false,"description":{"content":"(Required) The Ayah number at which the range ends.","type":"text/plain"},"key":"rangeEndAyahNumber","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get all bookmarks within a specific Ayahs range.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"chapterNumber","schema":{"type":"integer","description":"The number of the Surah that the Ayahs range belong to."},"required":true,"description":"The number of the Surah that the Ayahs range belong to."},{"in":"query","name":"rangeStartAyahNumber","schema":{"type":"integer","description":"The Ayah number at which the range starts."},"required":true,"description":"The Ayah number at which the range starts."},{"in":"query","name":"rangeEndAyahNumber","schema":{"type":"integer","description":"The Ayah number at which the range ends."},"required":true,"description":"The Ayah number at which the range ends."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqiu00067z3fh6oieeiq"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"bookmarkType":{"oneOf":[{"type":"string","example":"ayah"},{"type":"object","properties":{"type":{"type":"string","example":"ayah"}},"required":["type"]}]},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"bookmarkGroup":{"oneOf":[{"type":"string","example":"verses_6236"},{"type":"object","properties":{"name":{"type":"string","example":"verses_6236"}},"required":["name"]}]},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false}},"required":["id","createdAt","bookmarkType","key","bookmarkGroup","isInDefaultCollection","isReading"],"title":"RawBookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wqiu00067z3fh6oieeiq","createdAt":"2023-01-21T07:28:13.023Z","bookmarkType":"ayah","key":1,"verseNumber":5,"bookmarkGroup":"verses_6236","isInDefaultCollection":true,"isReading":false}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1BookmarksAyahsRange","method":"get","path":"/v1/bookmarks/ayahs-range","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get bookmarks within a range of Ayahs","description":{"content":"Get all bookmarks within a specific Ayahs range.","type":"text/plain"},"url":{"path":["v1","bookmarks","ayahs-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The number of the Surah that the Ayahs range belong to.","type":"text/plain"},"key":"chapterNumber","value":""},{"disabled":false,"description":{"content":"(Required) The Ayah number at which the range starts.","type":"text/plain"},"key":"rangeStartAyahNumber","value":""},{"disabled":false,"description":{"content":"(Required) The Ayah number at which the range ends.","type":"text/plain"},"key":"rangeEndAyahNumber","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Get all bookmarks within a specific Ayahs range. Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    +
    Schema
      data object[]
    • Array [
    • bookmarkType object required
      oneOf

      string

      object

      bookmarkGroup object required
      oneOf

      string

      object

    • ]
    • pagination object
    The request is missing required parameters or is invalid. @@ -72,4 +72,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-bookmark-collections.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-bookmarks-bookmark.api.mdx similarity index 61% rename from docs/user_related_apis_versioned/get-bookmark-collections.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-bookmarks-bookmark.api.mdx index 5290073f..040edeb7 100644 --- a/docs/user_related_apis_versioned/get-bookmark-collections.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-bookmarks-bookmark.api.mdx @@ -1,11 +1,11 @@ --- -id: get-bookmark-collections -title: "Get bookmark collections" -description: "Get all collections that a bookmark belongs to by bookmark details." -sidebar_label: "Get bookmark collections" +id: auth-get-v-1-bookmarks-bookmark +title: "Get bookmark" +description: "Get a bookmark by details" +sidebar_label: "Get bookmark" hide_title: true hide_table_of_contents: true -api: {"description":"Get all collections that a bookmark belongs to by bookmark details.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"key","schema":{"type":"number","format":"float","description":"Surah, Juz or page number."},"required":true,"description":"Surah, Juz or page number."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"required":false,"description":"The bookmark type."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"required":false,"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"required":false,"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"required":false,"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"required":false,"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav113800077e21b8bfgkgs"},"updatedAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"name":{"type":"string","example":"Woman in Quran"}},"required":["id","updatedAt","name"],"additionalProperties":false,"title":"Collection"}}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/bookmarks/collections","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get bookmark collections","description":{"content":"Get all collections that a bookmark belongs to by bookmark details.","type":"text/plain"},"url":{"path":["v1","bookmarks","collections"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Surah, Juz or page number.","type":"text/plain"},"key":"key","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get a bookmark by details","tags":["Bookmarks"],"parameters":[{"in":"query","name":"verseNumber","schema":{"type":"integer","description":"The Ayah number of the bookmark"},"description":"The Ayah number of the bookmark"},{"in":"query","name":"isReading","schema":{"type":"boolean","description":"Whether to fetch the reading bookmark"},"description":"Whether to fetch the reading bookmark"},{"in":"query","name":"key","schema":{"type":"integer","oneOf":[{},{"x-required":true}],"description":"Surah, Juz or page number.","example":2},"description":"Surah, Juz or page number."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"oneOf":[{},{"x-required":true}],"description":"The bookmark type.","default":"ayah"},"description":"The bookmark type."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.","example":4},"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name."},{"in":"query","name":"mushaf","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.","example":4},"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqim00057z3fe30y0b3e"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"group":{"type":"string","example":"verses_6236"},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false},"collectionsCount":{"type":"integer","description":"Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.","example":1}},"required":["id","createdAt","type","key","group","isInDefaultCollection","isReading"],"additionalProperties":false,"title":"Bookmark"}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1BookmarksBookmark","method":"get","path":"/v1/bookmarks/bookmark","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get bookmark","description":{"content":"Get a bookmark by details","type":"text/plain"},"url":{"path":["v1","bookmarks","bookmark"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The Ayah number of the bookmark","type":"text/plain"},"key":"verseNumber","value":""},{"disabled":false,"description":{"content":"Whether to fetch the reading bookmark","type":"text/plain"},"key":"isReading","value":""},{"disabled":false,"description":{"content":"Surah, Juz or page number.","type":"text/plain"},"key":"key","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.","type":"text/plain"},"key":"mushafId","value":""},{"disabled":false,"description":{"content":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.","type":"text/plain"},"key":"mushaf","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -21,17 +21,17 @@ import SchemaTabs from "@theme/SchemaTabs"; import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import TabItem from "@theme/TabItem"; -## Get bookmark collections +## Get bookmark -Get all collections that a bookmark belongs to by bookmark details. +Get a bookmark by details -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -72,4 +72,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-all-collection-items.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-bookmarks-collections.api.mdx similarity index 64% rename from docs/user_related_apis_versioned/get-all-collection-items.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-bookmarks-collections.api.mdx index 2c47f3c4..af1c6534 100644 --- a/docs/user_related_apis_versioned/get-all-collection-items.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-bookmarks-collections.api.mdx @@ -1,11 +1,11 @@ --- -id: get-all-collection-items -title: "Get all collection items" -description: "Get all existing collections along with resources that belong to them." -sidebar_label: "Get all collection items" +id: auth-get-v-1-bookmarks-collections +title: "Get bookmark collections" +description: "Get named collection IDs for a bookmark by bookmark details. Pass `includeDefault=true` to also append `__default__` when the bookmark belongs to Favorites." +sidebar_label: "Get bookmark collections" hide_title: true hide_table_of_contents: true -api: {"description":"Get all existing collections along with resources that belong to them.","tags":["Collections"],"parameters":[{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyAdded","verseKey"],"description":"Sort the collection items either by the time they were added at descendingly or alphabetically."},"description":"Sort the collection items either by the time they were added at descendingly or alphabetically."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"description":"The bookmark type."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav10y500057e21hjilhplh"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5},"group":{"type":"string"},"isInDefaultCollection":{"type":"boolean","example":true}},"required":["id","createdAt","type","key","isInDefaultCollection"],"additionalProperties":false,"title":"Bookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/collections/all","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all collection items","description":{"content":"Get all existing collections along with resources that belong to them.","type":"text/plain"},"url":{"path":["v1","collections","all"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort the collection items either by the time they were added at descendingly or alphabetically.","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get named collection IDs for a bookmark by bookmark details. Pass `includeDefault=true` to also append `__default__` when the bookmark belongs to Favorites.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"key","schema":{"type":"number","format":"float","description":"Surah, Juz or page number."},"required":true,"description":"Surah, Juz or page number."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"required":false,"description":"The bookmark type."},{"in":"query","name":"includeDefault","schema":{"type":"boolean","description":"When `true`, append `__default__` if the bookmark belongs to the virtual Favorites collection."},"required":false,"description":"When `true`, append `__default__` if the bookmark belongs to the virtual Favorites collection."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"required":false,"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"required":false,"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"required":false,"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"required":false,"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"string","description":"Collection ID. When `includeDefault=true`, this array may also include `__default__`.","example":"cmnkcpmvc000814v9f5jtbsxf"}}},"additionalProperties":false},"example":{"success":true,"data":["cmnkcpmvc000814v9f5jtbsxf"]}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1BookmarksCollections","method":"get","path":"/v1/bookmarks/collections","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get bookmark collections","description":{"content":"Get named collection IDs for a bookmark by bookmark details. Pass `includeDefault=true` to also append `__default__` when the bookmark belongs to Favorites.","type":"text/plain"},"url":{"path":["v1","bookmarks","collections"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Surah, Juz or page number.","type":"text/plain"},"key":"key","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"When `true`, append `__default__` if the bookmark belongs to the virtual Favorites collection.","type":"text/plain"},"key":"includeDefault","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -21,17 +21,17 @@ import SchemaTabs from "@theme/SchemaTabs"; import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import TabItem from "@theme/TabItem"; -## Get all collection items +## Get bookmark collections -Get all existing collections along with resources that belong to them. +Get named collection IDs for a bookmark by bookmark details. Pass `includeDefault=true` to also append `__default__` when the bookmark belongs to Favorites. -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    +
    Schema
    The request is missing required parameters or is invalid. @@ -72,4 +72,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-user-bookmarks.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-bookmarks.api.mdx similarity index 63% rename from docs/user_related_apis_versioned/get-user-bookmarks.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-bookmarks.api.mdx index e9c13d45..d9d282ce 100644 --- a/docs/user_related_apis_versioned/get-user-bookmarks.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-bookmarks.api.mdx @@ -1,11 +1,11 @@ --- -id: get-user-bookmarks +id: auth-get-v-1-bookmarks title: "Get user bookmarks" description: "Get all bookmarks. This includes bookmarks belonging to a collection." sidebar_label: "Get user bookmarks" hide_title: true hide_table_of_contents: true -api: {"description":"Get all bookmarks. This includes bookmarks belonging to a collection.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"required":false,"description":"The bookmark type."},{"in":"query","name":"isReading","schema":{"type":"boolean","description":"Whether to fetch only the reading bookmark"},"required":false,"description":"Whether to fetch only the reading bookmark"},{"in":"query","name":"key","schema":{"type":"integer","description":"Filter by key (surah/juz/page number)"},"required":false,"description":"Filter by key (surah/juz/page number)"},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"required":false,"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"required":false,"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"required":false,"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"required":false,"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav10y500057e21hjilhplh"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5},"group":{"type":"string"},"isInDefaultCollection":{"type":"boolean","example":true}},"required":["id","createdAt","type","key","isInDefaultCollection"],"additionalProperties":false,"title":"Bookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user bookmarks","description":{"content":"Get all bookmarks. This includes bookmarks belonging to a collection.","type":"text/plain"},"url":{"path":["v1","bookmarks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"Whether to fetch only the reading bookmark","type":"text/plain"},"key":"isReading","value":""},{"disabled":false,"description":{"content":"Filter by key (surah/juz/page number)","type":"text/plain"},"key":"key","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get all bookmarks. This includes bookmarks belonging to a collection.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"required":false,"description":"The bookmark type."},{"in":"query","name":"isReading","schema":{"type":"boolean","description":"Whether to fetch only the reading bookmark"},"required":false,"description":"Whether to fetch only the reading bookmark"},{"in":"query","name":"key","schema":{"type":"integer","description":"Filter by key (surah/juz/page number)"},"required":false,"description":"Filter by key (surah/juz/page number)"},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"required":false,"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"required":false,"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"required":false,"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"required":false,"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqim00057z3fe30y0b3e"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"group":{"type":"string","example":"verses_6236"},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false},"collectionsCount":{"type":"integer","description":"Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.","example":1}},"required":["id","createdAt","type","key","group","isInDefaultCollection","isReading","collectionsCount"],"additionalProperties":false,"title":"BookmarkWithCollectionsCount"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Bookmarks","method":"get","path":"/v1/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user bookmarks","description":{"content":"Get all bookmarks. This includes bookmarks belonging to a collection.","type":"text/plain"},"url":{"path":["v1","bookmarks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"Whether to fetch only the reading bookmark","type":"text/plain"},"key":"isReading","value":""},{"disabled":false,"description":{"content":"Filter by key (surah/juz/page number)","type":"text/plain"},"key":"key","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; Get all bookmarks. This includes bookmarks belonging to a collection. -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    +
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    The request is missing required parameters or is invalid. @@ -72,4 +72,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/auth-get-v-1-collections-all.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-collections-all.api.mdx new file mode 100644 index 00000000..bc8196cb --- /dev/null +++ b/docs/user_related_apis_versioned/auth-get-v-1-collections-all.api.mdx @@ -0,0 +1,74 @@ +--- +id: auth-get-v-1-collections-all +title: "Get all collection items" +description: "Get all existing collections along with resources that belong to them." +sidebar_label: "Get all collection items" +hide_title: true +hide_table_of_contents: true +api: {"description":"Get all existing collections along with resources that belong to them.","tags":["Collections"],"parameters":[{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyAdded","verseKey"],"description":"Sort the collection items either by the time they were added at descendingly or alphabetically."},"description":"Sort the collection items either by the time they were added at descendingly or alphabetically."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"description":"The bookmark type."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqim00057z3fe30y0b3e"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"group":{"type":"string","example":"verses_6236"},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false},"collectionsCount":{"type":"integer","description":"Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.","example":1}},"required":["id","createdAt","type","key","group","isInDefaultCollection","isReading"],"additionalProperties":false,"title":"Bookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1CollectionsAll","method":"get","path":"/v1/collections/all","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all collection items","description":{"content":"Get all existing collections along with resources that belong to them.","type":"text/plain"},"url":{"path":["v1","collections","all"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort the collection items either by the time they were added at descendingly or alphabetically.","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +sidebar_class_name: "get api-method" +info_path: docs/user_related_apis_versioned/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Get all collection items + + + +Get all existing collections along with resources that belong to them. + +
    Query Parameters
    + +Request has been handled successfully. + +
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    diff --git a/docs/user_related_apis_versioned/auth-get-v-1-collections-by-collection-id.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-collections-by-collection-id.api.mdx new file mode 100644 index 00000000..b50e5c81 --- /dev/null +++ b/docs/user_related_apis_versioned/auth-get-v-1-collections-by-collection-id.api.mdx @@ -0,0 +1,74 @@ +--- +id: auth-get-v-1-collections-by-collection-id +title: "Get collection items by id" +description: "Get all resources that belong to an existing collection by collection id. Use `__default__` to fetch the virtual Favorites collection." +sidebar_label: "Get collection items by id" +hide_title: true +hide_table_of_contents: true +api: {"description":"Get all resources that belong to an existing collection by collection id. Use `__default__` to fetch the virtual Favorites collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"Collection ID. Use `__default__` for the virtual Favorites collection.","example":"cmoa3wr17000d7z3f7ssph68y"},"description":"Collection ID. Use `__default__` for the virtual Favorites collection."},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyAdded","verseKey"],"description":"Sort the collection items either by the time they were added at descendingly or by Ayah key."},"description":"Sort the collection items either by the time they were added at descendingly or by Ayah key."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"collection":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqsk00087z3f5hp42h08"},"name":{"type":"string","example":"Woman in Quran"},"slug":{"type":"string","nullable":true,"example":"woman-in-quran"},"isPrivate":{"type":"boolean","example":false},"isDefault":{"type":"boolean","example":false},"updatedAt":{"type":"string","format":"date-time","nullable":true,"example":"2023-01-21T07:28:13.023Z"},"url":{"type":"string","nullable":true,"example":"cmnkcpmvc000814v9f5jtbsxf"},"bookmarksCount":{"type":"integer","example":1},"resourcesCount":{"type":"integer","example":1},"count":{"type":"integer","example":1}},"required":["id","name","slug","isPrivate","isDefault","updatedAt"],"additionalProperties":false,"title":"Collection"},"bookmarks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqim00057z3fe30y0b3e"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"group":{"type":"string","example":"verses_6236"},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false},"collectionsCount":{"type":"integer","description":"Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.","example":1}},"required":["id","createdAt","type","key","group","isInDefaultCollection","isReading","collectionsCount"],"additionalProperties":false,"title":"BookmarkWithCollectionsCount"}}},"additionalProperties":false},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"collection":{"id":"cmoa3wqsk00087z3f5hp42h08","name":"Woman in Quran","slug":"woman-in-quran","isPrivate":false,"isDefault":false,"updatedAt":"2023-01-21T07:28:13.023Z","url":"cmnkcpmvc000814v9f5jtbsxf","bookmarksCount":1,"resourcesCount":1,"count":1},"bookmarks":[{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}]},"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1CollectionsByCollectionId","method":"get","path":"/v1/collections/{collectionId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get collection items by id","description":{"content":"Get all resources that belong to an existing collection by collection id. Use `__default__` to fetch the virtual Favorites collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort the collection items either by the time they were added at descendingly or by Ayah key.","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[{"disabled":false,"description":{"content":"Collection ID. Use `__default__` for the virtual Favorites collection.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +sidebar_class_name: "get api-method" +info_path: docs/user_related_apis_versioned/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Get collection items by id + + + +Get all resources that belong to an existing collection by collection id. Use `__default__` to fetch the virtual Favorites collection. + +
    Path Parameters
    Query Parameters
    + +Request has been handled successfully. + +
    Schema
      data object
      collection object
      bookmarks object[]
    • Array [
    • ]
    • pagination object
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    diff --git a/docs/user_related_apis_versioned/get-all-collections.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-collections.api.mdx similarity index 60% rename from docs/user_related_apis_versioned/get-all-collections.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-collections.api.mdx index 808d2c7e..5ac71952 100644 --- a/docs/user_related_apis_versioned/get-all-collections.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-collections.api.mdx @@ -1,11 +1,11 @@ --- -id: get-all-collections +id: auth-get-v-1-collections title: "Get all collections" description: "List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination)" sidebar_label: "Get all collections" hide_title: true hide_table_of_contents: true -api: {"tags":["Collections"],"description":"List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination)","parameters":[{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyUpdated","alphabetical"],"description":"Sort the collections list either by the time they were updated at descendingly or alphabetically.","example":"recentlyUpdated"},"description":"Sort the collections list either by the time they were updated at descendingly or alphabetically."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"description":"The bookmark type."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav113800077e21b8bfgkgs"},"updatedAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"name":{"type":"string","example":"Woman in Quran"}},"required":["id","updatedAt","name"],"additionalProperties":false,"title":"Collection"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/collections","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all collections","description":{"content":"List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination)","type":"text/plain"},"url":{"path":["v1","collections"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort the collections list either by the time they were updated at descendingly or alphabetically.","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Collections"],"description":"List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination)","parameters":[{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyUpdated","alphabetical"],"description":"Sort the collections list either by the time they were updated at descendingly or alphabetically.","example":"recentlyUpdated"},"description":"Sort the collections list either by the time they were updated at descendingly or alphabetically."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"description":"The bookmark type."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqsk00087z3f5hp42h08"},"name":{"type":"string","example":"Woman in Quran"},"slug":{"type":"string","nullable":true,"example":"woman-in-quran"},"isPrivate":{"type":"boolean","example":false},"isDefault":{"type":"boolean","example":false},"updatedAt":{"type":"string","format":"date-time","nullable":true,"example":"2023-01-21T07:28:13.023Z"},"url":{"type":"string","nullable":true,"example":"cmnkcpmvc000814v9f5jtbsxf"},"bookmarksCount":{"type":"integer","example":1},"resourcesCount":{"type":"integer","example":1},"count":{"type":"integer","example":1}},"required":["id","name","slug","isPrivate","isDefault","updatedAt"],"additionalProperties":false,"title":"Collection"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wqsk00087z3f5hp42h08","name":"Woman in Quran","slug":"woman-in-quran","isPrivate":false,"isDefault":false,"updatedAt":"2023-01-21T07:28:13.023Z","url":"cmnkcpmvc000814v9f5jtbsxf","bookmarksCount":1,"resourcesCount":1,"count":1}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Collections","method":"get","path":"/v1/collections","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all collections","description":{"content":"List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination)","type":"text/plain"},"url":{"path":["v1","collections"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort the collections list either by the time they were updated at descendingly or alphabetically.","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination) -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    +
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    The request is missing required parameters or is invalid. @@ -72,4 +72,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/generate-timeline-estimation.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-goals-estimate.api.mdx similarity index 74% rename from docs/user_related_apis_versioned/generate-timeline-estimation.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-goals-estimate.api.mdx index 9687772a..d3bec3e5 100644 --- a/docs/user_related_apis_versioned/generate-timeline-estimation.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-goals-estimate.api.mdx @@ -1,11 +1,11 @@ --- -id: generate-timeline-estimation +id: auth-get-v-1-goals-estimate title: "Generate timeline estimation" description: "Generate a timeline up to a week of the minimum daily amount required to meet the goal." sidebar_label: "Generate timeline estimation" hide_title: true hide_table_of_contents: true -api: {"description":"Generate a timeline up to a week of the minimum daily amount required to meet the goal.","tags":["Goals"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"required":true,"description":"The type of the goal."},{"in":"query","name":"amount","schema":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"required":true,"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},{"in":"query","name":"duration","schema":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"required":false,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"week":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date-time","description":"The date of the estimated day","example":"2023-01-21T07:28:13.023Z"},"amount":{"oneOf":[{"type":"string","example":"1:5-1:10"},{"type":"integer","minimum":1,"example":600}],"description":"The amount of the day's goal."}},"required":["date","amount"],"additionalProperties":false,"title":"EstimatedGoalTimelineDay"}}},"additionalProperties":false,"title":"EstimatedGoalTimeline"}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/goals/estimate","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Generate timeline estimation","description":{"content":"Generate a timeline up to a week of the minimum daily amount required to meet the goal.","type":"text/plain"},"url":{"path":["v1","goals","estimate"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The type of the goal.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"(Required) The amount of the goal. Depending on the goal type, the amount value and format will be different","type":"text/plain"},"key":"amount","value":""},{"disabled":false,"description":{"content":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based.","type":"text/plain"},"key":"duration","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Generate a timeline up to a week of the minimum daily amount required to meet the goal.","tags":["Goals"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"required":true,"description":"The type of the goal."},{"in":"query","name":"amount","schema":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"required":true,"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},{"in":"query","name":"duration","schema":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"required":false,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"week":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date-time","description":"The date of the estimated day","example":"2023-01-21T07:28:13.023Z"},"amount":{"oneOf":[{"type":"string","example":"1:5-1:10"},{"type":"integer","minimum":1,"example":600}],"description":"The amount of the day's goal."}},"required":["date","amount"],"additionalProperties":false,"title":"EstimatedGoalTimelineDay"}}},"additionalProperties":false,"title":"EstimatedGoalTimeline"}},"additionalProperties":false},"example":{"success":true,"data":{"week":[{"date":"2023-01-21T07:28:13.023Z","amount":"1:5-1:10"}]}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1GoalsEstimate","method":"get","path":"/v1/goals/estimate","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Generate timeline estimation","description":{"content":"Generate a timeline up to a week of the minimum daily amount required to meet the goal.","type":"text/plain"},"url":{"path":["v1","goals","estimate"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The type of the goal.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"(Required) The amount of the goal. Depending on the goal type, the amount value and format will be different","type":"text/plain"},"key":"amount","value":""},{"disabled":false,"description":{"content":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based.","type":"text/plain"},"key":"duration","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -43,7 +43,7 @@ The amount of the day's goal. The amount of the day's goal. -
  • ]
  • +
  • ]
  • The request is missing required parameters or is invalid. @@ -84,4 +84,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-todays-goal-plan.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-goals-get-todays-plan.api.mdx similarity index 73% rename from docs/user_related_apis_versioned/get-todays-goal-plan.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-goals-get-todays-plan.api.mdx index 01a8bf84..a459ba4d 100644 --- a/docs/user_related_apis_versioned/get-todays-goal-plan.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-goals-get-todays-plan.api.mdx @@ -1,11 +1,11 @@ --- -id: get-todays-goal-plan +id: auth-get-v-1-goals-get-todays-plan title: "Get today's goal plan" description: "Get today's goal plan." sidebar_label: "Get today's goal plan" hide_title: true hide_table_of_contents: true -api: {"description":"Get today's goal plan.","tags":["Goals"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"required":true,"description":"The type of the goal."},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"hasGoal":{"type":"boolean","description":"User has a goal.","example":false}},"required":["hasGoal"],"additionalProperties":false,"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"The id of the activity day.","example":"cmmav10hr00047e21267o9efb"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day.","example":"2023-09-31"},"progress":{"type":"number","format":"float","minimum":0,"maximum":1,"description":"The progress of the reading goal of that activity day (if the user has a reading goal on that day).","example":0.695},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"ranges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The ranges read on that day (will be included only when the type is QURAN)","example":["1:1-1:2"]},"pagesRead":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages read on that day (will be included only when the type is QURAN)","example":1.637041020126048},"secondsRead":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading on that day (will be included only when the type is QURAN)","example":417},"versesRead":{"oneOf":[{"type":"integer"}],"description":"The number of Ayahs read on that day (will be included only when the type is QURAN)","example":24},"manuallyAddedSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading that was manually input by the user and not auto-tracked (will be included only when the type is QURAN)","example":24},"dailyTargetPages":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":1.637041020126048},"dailyTargetSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":5},"dailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"remainingDailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4}},"required":["id","date","progress","type","mushafId"],"additionalProperties":false,"description":"The Mushaf used to read on that day (will be included only when the type is QURAN) \n\nThe id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","title":"When user has a goal"}]}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/goals/get-todays-plan","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get today's goal plan","description":{"content":"Get today's goal plan.","type":"text/plain"},"url":{"path":["v1","goals","get-todays-plan"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The type of the goal.","type":"text/plain"},"key":"type","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get today's goal plan.","tags":["Goals"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"required":true,"description":"The type of the goal."},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"hasGoal":{"type":"boolean","description":"User has a goal.","example":false}},"required":["hasGoal"],"additionalProperties":false,"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"The id of the activity day.","example":"cmoa3wq2b00047z3fbl4c6ew0"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day.","example":"2023-09-31"},"progress":{"type":"number","format":"float","minimum":0,"maximum":1,"description":"The progress of the reading goal of that activity day (if the user has a reading goal on that day).","example":0.695},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"ranges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The ranges read on that day (will be included only when the type is QURAN)","example":["1:1-1:2"]},"pagesRead":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages read on that day (will be included only when the type is QURAN)","example":1.637041020126048},"secondsRead":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading on that day (will be included only when the type is QURAN)","example":417},"versesRead":{"oneOf":[{"type":"integer"}],"description":"The number of Ayahs read on that day (will be included only when the type is QURAN)","example":24},"manuallyAddedSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading that was manually input by the user and not auto-tracked (will be included only when the type is QURAN)","example":24},"dailyTargetPages":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":1.637041020126048},"dailyTargetSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":5},"dailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"remainingDailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4}},"required":["id","date","progress","type","mushafId"],"additionalProperties":false,"description":"The Mushaf used to read on that day (will be included only when the type is QURAN) \n\nThe id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","title":"When user has a goal"}]}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wq2b00047z3fbl4c6ew0","date":"2023-09-31","progress":0.695,"type":"QURAN","ranges":["1:1-1:2"],"pagesRead":1.637041020126048,"secondsRead":417,"versesRead":24,"manuallyAddedSeconds":24,"dailyTargetPages":1.637041020126048,"dailyTargetSeconds":5,"dailyTargetRanges":["1:1-1:2"],"remainingDailyTargetRanges":["1:1-1:2"],"mushafId":4}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1GoalsGetTodaysPlan","method":"get","path":"/v1/goals/get-todays-plan","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get today's goal plan","description":{"content":"Get today's goal plan.","type":"text/plain"},"url":{"path":["v1","goals","get-todays-plan"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The type of the goal.","type":"text/plain"},"key":"type","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Get today's goal plan. Request has been handled successfully. -
    Schema
      data object
      oneOf

      object

    +
    Schema
      data object
      oneOf

      object

    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/get-notes-by-attached-entity.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-notes-by-attached-entity.api.mdx similarity index 75% rename from docs/user_related_apis_versioned/get-notes-by-attached-entity.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-notes-by-attached-entity.api.mdx index bff37515..0f5252e2 100644 --- a/docs/user_related_apis_versioned/get-notes-by-attached-entity.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-notes-by-attached-entity.api.mdx @@ -1,11 +1,11 @@ --- -id: get-notes-by-attached-entity +id: auth-get-v-1-notes-by-attached-entity title: "Get notes by attached entity" description: "Retrieve notes by attached entity." sidebar_label: "Get notes by attached entity" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Retrieve notes by attached entity.","parameters":[{"in":"query","name":"entityId","schema":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"required":true,"description":"The unique identifier for the attached entity."},{"in":"query","name":"entityType","schema":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"required":true,"description":"The type of the attached entity, must be one of the predefined NoteEntityType values."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/notes/by-attached-entity","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes by attached entity","description":{"content":"Retrieve notes by attached entity.","type":"text/plain"},"url":{"path":["v1","notes","by-attached-entity"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The unique identifier for the attached entity.","type":"text/plain"},"key":"entityId","value":""},{"disabled":false,"description":{"content":"(Required) The type of the attached entity, must be one of the predefined NoteEntityType values.","type":"text/plain"},"key":"entityType","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Notes"],"description":"Retrieve notes by attached entity.","parameters":[{"in":"query","name":"entityId","schema":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"required":true,"description":"The unique identifier for the attached entity."},{"in":"query","name":"entityType","schema":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"required":true,"description":"The type of the attached entity, must be one of the predefined NoteEntityType values."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}]}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesByAttachedEntity","method":"get","path":"/v1/notes/by-attached-entity","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes by attached entity","description":{"content":"Retrieve notes by attached entity.","type":"text/plain"},"url":{"path":["v1","notes","by-attached-entity"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The unique identifier for the attached entity.","type":"text/plain"},"key":"entityId","value":""},{"disabled":false,"description":{"content":"(Required) The type of the attached entity, must be one of the predefined NoteEntityType values.","type":"text/plain"},"key":"entityType","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ An array of attached entities associated with the note. Additional metadata for the attached entity. -
  • ]
  • ]
  • +
  • ]
  • ]
  • The request is missing required parameters or is invalid. @@ -80,4 +80,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-note-by-id.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-notes-by-note-id.api.mdx similarity index 74% rename from docs/user_related_apis_versioned/get-note-by-id.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-notes-by-note-id.api.mdx index 34b9d521..49135e81 100644 --- a/docs/user_related_apis_versioned/get-note-by-id.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-notes-by-note-id.api.mdx @@ -1,11 +1,11 @@ --- -id: get-note-by-id +id: auth-get-v-1-notes-by-note-id title: "Get note by ID" description: "Retrieve a note by its ID." sidebar_label: "Get note by ID" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Retrieve a note by its ID.","parameters":[{"in":"query","name":"withAttachedEntities","schema":{"type":"boolean","description":"Specifies whether to include attached entities in the response, defaults to true.","example":true,"default":true},"description":"Specifies whether to include attached entities in the response, defaults to true."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/notes/:noteId","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"}} +api: {"tags":["Notes"],"description":"Retrieve a note by its ID.","parameters":[{"in":"query","name":"withAttachedEntities","schema":{"type":"boolean","description":"Specifies whether to include attached entities in the response, defaults to true.","example":true,"default":true},"description":"Specifies whether to include attached entities in the response, defaults to true."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesByNoteId","method":"get","path":"/v1/notes/{noteId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get note by ID","description":{"content":"Retrieve a note by its ID.","type":"text/plain"},"url":{"path":["v1","notes",":noteId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Specifies whether to include attached entities in the response, defaults to true.","type":"text/plain"},"key":"withAttachedEntities","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ An array of attached entities associated with the note. Additional metadata for the attached entity. -
  • ]
  • +
  • ]
  • The request is missing required parameters or is invalid. @@ -80,4 +80,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-notes-by-verse-range.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-notes-by-range.api.mdx similarity index 75% rename from docs/user_related_apis_versioned/get-notes-by-verse-range.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-notes-by-range.api.mdx index c1ab514c..3a45bdcf 100644 --- a/docs/user_related_apis_versioned/get-notes-by-verse-range.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-notes-by-range.api.mdx @@ -1,11 +1,11 @@ --- -id: get-notes-by-verse-range +id: auth-get-v-1-notes-by-range title: "Get notes by verse range" description: "Retrieve notes by a range of verses." sidebar_label: "Get notes by verse range" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Retrieve notes by a range of verses.","parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The starting verse key of the range.","example":"2:12"},"required":true,"description":"The starting verse key of the range."},{"in":"query","name":"to","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The ending verse key of the range.","example":"2:18"},"required":true,"description":"The ending verse key of the range."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/notes/by-range","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes by verse range","description":{"content":"Retrieve notes by a range of verses.","type":"text/plain"},"url":{"path":["v1","notes","by-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The starting verse key of the range.","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"(Required) The ending verse key of the range.","type":"text/plain"},"key":"to","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Notes"],"description":"Retrieve notes by a range of verses.","parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The starting verse key of the range.","example":"2:12"},"required":true,"description":"The starting verse key of the range."},{"in":"query","name":"to","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The ending verse key of the range.","example":"2:18"},"required":true,"description":"The ending verse key of the range."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}]}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesByRange","method":"get","path":"/v1/notes/by-range","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes by verse range","description":{"content":"Retrieve notes by a range of verses.","type":"text/plain"},"url":{"path":["v1","notes","by-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The starting verse key of the range.","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"(Required) The ending verse key of the range.","type":"text/plain"},"key":"to","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ An array of attached entities associated with the note. Additional metadata for the attached entity. -
  • ]
  • ]
  • +
  • ]
  • ]
  • The request is missing required parameters or is invalid. @@ -80,4 +80,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-notes-by-verse.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-notes-by-verse-by-verse-key.api.mdx similarity index 73% rename from docs/user_related_apis_versioned/get-notes-by-verse.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-notes-by-verse-by-verse-key.api.mdx index a39d93aa..0ccb7d87 100644 --- a/docs/user_related_apis_versioned/get-notes-by-verse.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-notes-by-verse-by-verse-key.api.mdx @@ -1,11 +1,11 @@ --- -id: get-notes-by-verse +id: auth-get-v-1-notes-by-verse-by-verse-key title: "Get notes by verse" description: "Retrieve notes by a specific verse." sidebar_label: "Get notes by verse" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Retrieve notes by a specific verse.","parameters":[{"in":"query","name":"verseKey","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The verse key for which notes are being requested.","example":"2:255"},"required":true,"description":"The verse key for which notes are being requested."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/notes/by-verse/:verseKey","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"}} +api: {"tags":["Notes"],"description":"Retrieve notes by a specific verse.","parameters":[{"in":"query","name":"verseKey","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The verse key for which notes are being requested.","example":"2:255"},"required":true,"description":"The verse key for which notes are being requested."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesByVerseByVerseKey","method":"get","path":"/v1/notes/by-verse/{verseKey}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes by verse","description":{"content":"Retrieve notes by a specific verse.","type":"text/plain"},"url":{"path":["v1","notes","by-verse",":verseKey"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The verse key for which notes are being requested.","type":"text/plain"},"key":"verseKey","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ An array of attached entities associated with the note. Additional metadata for the attached entity. -
  • ]
  • ]
  • pagination object
    +
  • ]
  • ]
  • pagination object
    The request is missing required parameters or is invalid. @@ -80,4 +80,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-notes-count-within-verse-range.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-notes-count-within-range.api.mdx similarity index 72% rename from docs/user_related_apis_versioned/get-notes-count-within-verse-range.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-notes-count-within-range.api.mdx index 158d563a..5f4f4868 100644 --- a/docs/user_related_apis_versioned/get-notes-count-within-verse-range.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-notes-count-within-range.api.mdx @@ -1,11 +1,11 @@ --- -id: get-notes-count-within-verse-range +id: auth-get-v-1-notes-count-within-range title: "Get notes count within verse range" description: "Get the count of notes within a range of verses." sidebar_label: "Get notes count within verse range" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Get the count of notes within a range of verses.","parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The starting verse key of the range.","example":"2:12"},"required":true,"description":"The starting verse key of the range."},{"in":"query","name":"to","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The ending verse key of the range.","example":"2:18"},"required":true,"description":"The ending verse key of the range."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{},"additionalProperties":{"type":"integer","minimum":1},"description":"A map of verse keys to note counts, where each key is a verse key and each value is an integer count of notes.","example":{"1:2":5,"1:3":1,"1:4":1}}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/notes/count-within-range","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes count within verse range","description":{"content":"Get the count of notes within a range of verses.","type":"text/plain"},"url":{"path":["v1","notes","count-within-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The starting verse key of the range.","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"(Required) The ending verse key of the range.","type":"text/plain"},"key":"to","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Notes"],"description":"Get the count of notes within a range of verses.","parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The starting verse key of the range.","example":"2:12"},"required":true,"description":"The starting verse key of the range."},{"in":"query","name":"to","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The ending verse key of the range.","example":"2:18"},"required":true,"description":"The ending verse key of the range."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{},"additionalProperties":{"type":"integer","minimum":1},"description":"A map of verse keys to note counts, where each key is a verse key and each value is an integer count of notes.","example":{"1:2":5,"1:3":1,"1:4":1}}},"additionalProperties":false},"example":{"success":true,"data":{"1:2":5,"1:3":1,"1:4":1}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesCountWithinRange","method":"get","path":"/v1/notes/count-within-range","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get notes count within verse range","description":{"content":"Get the count of notes within a range of verses.","type":"text/plain"},"url":{"path":["v1","notes","count-within-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The starting verse key of the range.","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"(Required) The ending verse key of the range.","type":"text/plain"},"key":"to","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Request has been handled successfully. A map of verse keys to note counts, where each key is a verse key and each value is an integer count of notes. -
    +
    The request is missing required parameters or is invalid. diff --git a/docs/user_related_apis_versioned/get-all-notes.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-notes.api.mdx similarity index 77% rename from docs/user_related_apis_versioned/get-all-notes.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-notes.api.mdx index 65b09578..746a183a 100644 --- a/docs/user_related_apis_versioned/get-all-notes.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-notes.api.mdx @@ -1,11 +1,11 @@ --- -id: get-all-notes +id: auth-get-v-1-notes title: "Get all notes" description: "List notes owned by the user. This API contains pagination. Read more about [pagination](/#pagination)" sidebar_label: "Get all notes" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"List notes owned by the user. This API contains pagination. Read more about [pagination](/#pagination)","parameters":[{"in":"query","name":"cursor","schema":{"type":"string","description":"A cursor for pagination, used to fetch the next set of results.","example":"cursor123"},"description":"A cursor for pagination, used to fetch the next set of results."},{"in":"query","name":"limit","schema":{"type":"number","format":"float","minimum":1,"maximum":50,"description":"The maximum number of notes to return, defaults to 20.","example":20,"default":20},"description":"The maximum number of notes to return, defaults to 20."},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["newest","oldest"],"description":"The sorting order of the notes, defaults to newest first.","example":"newest","default":"newest"},"description":"The sorting order of the notes, defaults to newest first."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/notes","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all notes","description":{"content":"List notes owned by the user. This API contains pagination. Read more about [pagination](/#pagination)","type":"text/plain"},"url":{"path":["v1","notes"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"A cursor for pagination, used to fetch the next set of results.","type":"text/plain"},"key":"cursor","value":""},{"disabled":false,"description":{"content":"The maximum number of notes to return, defaults to 20.","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"The sorting order of the notes, defaults to newest first.","type":"text/plain"},"key":"sortBy","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"tags":["Notes"],"description":"List notes owned by the user. This API contains pagination. Read more about [pagination](/#pagination)","parameters":[{"in":"query","name":"cursor","schema":{"type":"string","description":"A cursor for pagination, used to fetch the next set of results.","example":"cursor123"},"description":"A cursor for pagination, used to fetch the next set of results."},{"in":"query","name":"limit","schema":{"type":"number","format":"float","minimum":1,"maximum":50,"description":"The maximum number of notes to return, defaults to 20.","example":20,"default":20},"description":"The maximum number of notes to return, defaults to 20."},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["newest","oldest"],"description":"The sorting order of the notes, defaults to newest first.","example":"newest","default":"newest"},"description":"The sorting order of the notes, defaults to newest first."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Notes","method":"get","path":"/v1/notes","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all notes","description":{"content":"List notes owned by the user. This API contains pagination. Read more about [pagination](/#pagination)","type":"text/plain"},"url":{"path":["v1","notes"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"A cursor for pagination, used to fetch the next set of results.","type":"text/plain"},"key":"cursor","value":""},{"disabled":false,"description":{"content":"The maximum number of notes to return, defaults to 20.","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"The sorting order of the notes, defaults to newest first.","type":"text/plain"},"key":"sortBy","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ An array of attached entities associated with the note. Additional metadata for the attached entity. -
  • ]
  • ]
  • pagination object
    +
  • ]
  • ]
  • pagination object
    The request is missing required parameters or is invalid. @@ -80,4 +80,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-user-preferences.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-preferences.api.mdx similarity index 77% rename from docs/user_related_apis_versioned/get-user-preferences.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-preferences.api.mdx index 668f5cfd..484778ee 100644 --- a/docs/user_related_apis_versioned/get-user-preferences.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-preferences.api.mdx @@ -1,11 +1,11 @@ --- -id: get-user-preferences +id: auth-get-v-1-preferences title: "Get user preferences" description: "Get all user preferences like theme, favorite reciter, default language etc." sidebar_label: "Get user preferences" hide_title: true hide_table_of_contents: true -api: {"description":"Get all user preferences like theme, favorite reciter, default language etc.","tags":["Preferences"],"parameters":[],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"theme":{"type":"object","properties":{"type":{"type":"string","enum":["auto","light","sepia","dark"],"example":"auto"}},"additionalProperties":false},"reading":{"type":"object","properties":{"readingPreference":{"type":"string","enum":["translation","reading","readingTranslation"],"example":"translation"},"selectedWordByWordLocale":{"type":"string","enum":["en","ur","id","bn","tr","fa","ru","hi","de","ta","inh","fr","sq","dv","zh","sd","ml"],"example":"en"},"wordClickFunctionality":{"type":"string","enum":["play-audio","no-audio"],"example":"play-audio"},"isReadingByRevelationOrder":{"type":"boolean","example":true},"wordByWordContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordDisplay":{"type":"array","items":{"type":"string","enum":["tooltip","inline"]},"example":["tooltip"]},"wordByWordTooltipContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordInlineContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":[]},"selectedReadingTranslation":{"type":"string","minLength":1,"maxLength":255,"example":"131"},"selectedReflectionLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1},"selectedLessonLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}},"required":["readingPreference","selectedWordByWordLocale","wordClickFunctionality","selectedReadingTranslation"],"additionalProperties":false},"quranReaderStyles":{"type":"object","properties":{"tafsirFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranTextFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"translationFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"wordByWordFontScale":{"type":"integer","minimum":1,"maximum":6,"example":3},"reflectionFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"qnaFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"lessonFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"surahInfoFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"hadithFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"layersFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranFont":{"type":"string","enum":["code_v1","code_v2","text_uthmani","text_indopak","qpc_uthmani_hafs","tajweed","tajweed_v4"],"example":"code_v1"},"mushafLines":{"type":"string","enum":["15_lines","16_lines"],"example":"16_lines"},"showTajweedRules":{"type":"boolean","example":true}},"required":["tafsirFontScale","quranTextFontScale","translationFontScale","wordByWordFontScale","reflectionFontScale","qnaFontScale","lessonFontScale","surahInfoFontScale","hadithFontScale","layersFontScale"],"additionalProperties":false},"translations":{"type":"object","properties":{"selectedTranslations":{"type":"array","items":{"type":"integer","example":131}}},"additionalProperties":false},"tafsirs":{"type":"object","properties":{"selectedTafsirs":{"type":"array","items":{"type":"string","example":"en-tafisr-ibn-kathir"}}},"additionalProperties":false},"audio":{"type":"object","properties":{"reciter":{"type":"integer","example":7},"playbackRate":{"type":"integer","enum":[0.25,0.5,0.75,1,1.25,1.5,1.75,2],"example":1},"showTooltipWhenPlayingAudio":{"type":"boolean","example":true},"enableAutoScrolling":{"type":"boolean","example":true}},"required":["reciter"],"additionalProperties":false},"language":{"type":"object","properties":{"language":{"type":"string","enum":["en","ar","bn","fa","fr","id","it","nl","pt","ru","sq","th","tr","ur","zh","ms","es","sw","vi"]}},"additionalProperties":false},"userHasCustomised":{"type":"object","properties":{"userHasCustomised":{"type":"boolean","example":false}},"required":["userHasCustomised"],"additionalProperties":false}},"additionalProperties":false,"title":"Preference"}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/preferences","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user preferences","description":{"content":"Get all user preferences like theme, favorite reciter, default language etc.","type":"text/plain"},"url":{"path":["v1","preferences"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get all user preferences like theme, favorite reciter, default language etc.","tags":["Preferences"],"parameters":[],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"theme":{"type":"object","properties":{"type":{"type":"string","enum":["auto","light","sepia","dark"],"example":"auto"}},"additionalProperties":false},"reading":{"type":"object","properties":{"readingPreference":{"type":"string","enum":["translation","reading","readingTranslation"],"example":"translation"},"selectedWordByWordLocale":{"type":"string","enum":["en","ur","id","bn","tr","fa","ru","hi","de","ta","inh","fr","sq","dv","zh","sd","ml"],"example":"en"},"wordClickFunctionality":{"type":"string","enum":["play-audio","no-audio"],"example":"play-audio"},"isReadingByRevelationOrder":{"type":"boolean","example":true},"wordByWordContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordDisplay":{"type":"array","items":{"type":"string","enum":["tooltip","inline"]},"example":["tooltip"]},"wordByWordTooltipContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordInlineContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":[]},"selectedReadingTranslation":{"type":"string","minLength":1,"maxLength":255,"example":"131"},"selectedReflectionLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1},"selectedLessonLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}},"required":["readingPreference","selectedWordByWordLocale","wordClickFunctionality","selectedReadingTranslation"],"additionalProperties":false},"quranReaderStyles":{"type":"object","properties":{"tafsirFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranTextFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"translationFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"wordByWordFontScale":{"type":"integer","minimum":1,"maximum":6,"example":3},"reflectionFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"qnaFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"lessonFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"surahInfoFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"hadithFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"layersFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranFont":{"type":"string","enum":["code_v1","code_v2","text_uthmani","text_indopak","qpc_uthmani_hafs","tajweed","tajweed_v4"],"example":"code_v1"},"mushafLines":{"type":"string","enum":["15_lines","16_lines"],"example":"16_lines"},"showTajweedRules":{"type":"boolean","example":true}},"required":["tafsirFontScale","quranTextFontScale","translationFontScale","wordByWordFontScale","reflectionFontScale","qnaFontScale","lessonFontScale","surahInfoFontScale","hadithFontScale","layersFontScale"],"additionalProperties":false},"translations":{"type":"object","properties":{"selectedTranslations":{"type":"array","items":{"type":"integer","example":131}}},"additionalProperties":false},"tafsirs":{"type":"object","properties":{"selectedTafsirs":{"type":"array","items":{"type":"string","example":"en-tafisr-ibn-kathir"}}},"additionalProperties":false},"audio":{"type":"object","properties":{"reciter":{"type":"integer","example":7},"playbackRate":{"type":"integer","enum":[0.25,0.5,0.75,1,1.25,1.5,1.75,2],"example":1},"showTooltipWhenPlayingAudio":{"type":"boolean","example":true},"enableAutoScrolling":{"type":"boolean","example":true}},"required":["reciter"],"additionalProperties":false},"language":{"type":"object","properties":{"language":{"type":"string","enum":["en","ar","bn","fa","fr","id","it","nl","pt","ru","sq","th","tr","ur","zh","ms","es","sw","vi"]}},"additionalProperties":false},"userHasCustomised":{"type":"object","properties":{"userHasCustomised":{"type":"boolean","example":false}},"required":["userHasCustomised"],"additionalProperties":false}},"additionalProperties":false,"title":"Preference"}},"additionalProperties":false},"example":{"success":true,"data":{"theme":{"type":"auto"},"reading":{"readingPreference":"translation","selectedWordByWordLocale":"en","wordClickFunctionality":"play-audio","isReadingByRevelationOrder":true,"wordByWordContentType":["translation"],"wordByWordDisplay":["tooltip"],"wordByWordTooltipContentType":["translation"],"wordByWordInlineContentType":[],"selectedReadingTranslation":"131","selectedReflectionLanguages":["string"],"selectedLessonLanguages":["string"]},"quranReaderStyles":{"tafsirFontScale":3,"quranTextFontScale":3,"translationFontScale":3,"wordByWordFontScale":3,"reflectionFontScale":3,"qnaFontScale":3,"lessonFontScale":3,"surahInfoFontScale":3,"hadithFontScale":3,"layersFontScale":3,"quranFont":"code_v1","mushafLines":"16_lines","showTajweedRules":true},"translations":{"selectedTranslations":[131]},"tafsirs":{"selectedTafsirs":["en-tafisr-ibn-kathir"]},"audio":{"reciter":7,"playbackRate":1,"showTooltipWhenPlayingAudio":true,"enableAutoScrolling":true},"language":{"language":"en"},"userHasCustomised":{"userHasCustomised":false}}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Preferences","method":"get","path":"/v1/preferences","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user preferences","description":{"content":"Get all user preferences like theme, favorite reciter, default language etc.","type":"text/plain"},"url":{"path":["v1","preferences"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Get all user preferences like theme, favorite reciter, default language etc. Request has been handled successfully. -
    Schema
      data object
      theme object
      reading object
      = 1`"} schema={{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}}>= 1`"} schema={{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}}>
      quranReaderStyles object
      = 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 6`"} schema={{"type":"integer","minimum":1,"maximum":6,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>
      translations object
      tafsirs object
      audio object
      language object
      userHasCustomised object
    +
    Schema
      data object
      theme object
      reading object
      = 1`"} schema={{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}}>= 1`"} schema={{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}}>
      quranReaderStyles object
      = 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 6`"} schema={{"type":"integer","minimum":1,"maximum":6,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>
      translations object
      tafsirs object
      audio object
      language object
      userHasCustomised object
    The request is missing required parameters or is invalid. @@ -72,4 +72,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-user-reading-sessions.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-reading-sessions.api.mdx similarity index 69% rename from docs/user_related_apis_versioned/get-user-reading-sessions.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-reading-sessions.api.mdx index 4712daff..8c32ffc9 100644 --- a/docs/user_related_apis_versioned/get-user-reading-sessions.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-reading-sessions.api.mdx @@ -1,11 +1,11 @@ --- -id: get-user-reading-sessions +id: auth-get-v-1-reading-sessions title: "Get user reading sessions" description: "Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for 'Continue reading' / 'Recently read'. For streaks, goals, and calendar-style progress tracking, use Activity Days." sidebar_label: "Get user reading sessions" hide_title: true hide_table_of_contents: true -api: {"description":"Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for \"Continue reading\" / \"Recently read\". For streaks, goals, and calendar-style progress tracking, use Activity Days.","tags":["Reading Sessions"],"parameters":[{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav126k000e7e21h96r5yb0"},"updatedAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"chapterNumber":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5}},"required":["id","updatedAt"],"additionalProperties":false,"title":"ReadingSession"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/reading-sessions","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user reading sessions","description":{"content":"Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for \"Continue reading\" / \"Recently read\". For streaks, goals, and calendar-style progress tracking, use Activity Days.","type":"text/plain"},"url":{"path":["v1","reading-sessions"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for \"Continue reading\" / \"Recently read\". For streaks, goals, and calendar-style progress tracking, use Activity Days.","tags":["Reading Sessions"],"parameters":[{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wrpk000h7z3f2t6a57dg"},"updatedAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"chapterNumber":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5}},"required":["id","updatedAt"],"additionalProperties":false,"title":"ReadingSession"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wrpk000h7z3f2t6a57dg","updatedAt":"2023-01-21T07:28:13.023Z","chapterNumber":1,"verseNumber":5}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1ReadingSessions","method":"get","path":"/v1/reading-sessions","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user reading sessions","description":{"content":"Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for \"Continue reading\" / \"Recently read\". For streaks, goals, and calendar-style progress tracking, use Activity Days.","type":"text/plain"},"url":{"path":["v1","reading-sessions"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for "Continue reading" / "Recently read". For streaks, goals, and calendar-style progress tracking, use Activity Days. -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    +
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    The request is missing required parameters or is invalid. @@ -72,4 +72,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/add-user-bookmark.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-streaks-current-streak-days.api.mdx similarity index 69% rename from docs/user_related_apis_versioned/add-user-bookmark.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-streaks-current-streak-days.api.mdx index 8075051a..c4ed3026 100644 --- a/docs/user_related_apis_versioned/add-user-bookmark.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-streaks-current-streak-days.api.mdx @@ -1,12 +1,12 @@ --- -id: add-user-bookmark -title: "Add user bookmark" -description: "Add a bookmark by details." -sidebar_label: "Add user bookmark" +id: auth-get-v-1-streaks-current-streak-days +title: "Get current streak days" +description: "Get current active streak days." +sidebar_label: "Get current streak days" hide_title: true hide_table_of_contents: true -api: {"description":"Add a bookmark by details.","tags":["Bookmarks"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["key","verseNumber","mushaf"],"additionalProperties":false,"title":"Ayah"},{"type":"object","required":["key","mushaf"],"additionalProperties":false,"title":"Surah, Juz, Or page"}]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","example":"cmmav10y500057e21hjilhplh"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5},"group":{"type":"string"},"isInDefaultCollection":{"type":"boolean","example":true}},"required":["id","createdAt","type","key","isInDefaultCollection"],"additionalProperties":false,"title":"Bookmark"}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"key":2,"type":"ayah","verseNumber":3,"isReading":true,"mushaf":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add user bookmark","description":{"content":"Add a bookmark by details.","type":"text/plain"},"url":{"path":["v1","bookmarks"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} -sidebar_class_name: "post api-method" +api: {"description":"Get current active streak days.","tags":["Streaks"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN"],"description":"The type of the streak","example":"QURAN"},"required":true,"description":"The type of the streak"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"days":{"type":"integer","description":"The number of days the current streak is active for.","example":5}},"required":["days"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"days":5}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1StreaksCurrentStreakDays","method":"get","path":"/v1/streaks/current-streak-days","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get current streak days","description":{"content":"Get current active streak days.","type":"text/plain"},"url":{"path":["v1","streaks","current-streak-days"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The type of the streak","type":"text/plain"},"key":"type","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"GET"}} +sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null displayed_sidebar: APIsSidebar @@ -21,17 +21,17 @@ import SchemaTabs from "@theme/SchemaTabs"; import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import TabItem from "@theme/TabItem"; -## Add user bookmark +## Get current streak days -Add a bookmark by details. +Get current active streak days. -
    Request Body
      anyOf
    +
    Query Parameters
    Header Parameters
    Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -72,4 +72,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-streaks.api.mdx b/docs/user_related_apis_versioned/auth-get-v-1-streaks.api.mdx similarity index 72% rename from docs/user_related_apis_versioned/get-streaks.api.mdx rename to docs/user_related_apis_versioned/auth-get-v-1-streaks.api.mdx index a3b9bee1..2e1bb304 100644 --- a/docs/user_related_apis_versioned/get-streaks.api.mdx +++ b/docs/user_related_apis_versioned/auth-get-v-1-streaks.api.mdx @@ -1,11 +1,11 @@ --- -id: get-streaks +id: auth-get-v-1-streaks title: "Get streaks" description: "Get user streaks." sidebar_label: "Get streaks" hide_title: true hide_table_of_contents: true -api: {"description":"Get user streaks.","tags":["Streaks"],"parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date after which any streaks would be returned (inclusive)","example":"2023-09-01"},"description":"The date after which any streaks would be returned (inclusive)"},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date before which any streaks would be returned (inclusive)","example":"2023-09-31"},"description":"The date before which any streaks would be returned (inclusive)"},{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN"],"description":"The type of the streak","example":"QURAN"},"description":"The type of the streak"},{"in":"query","name":"sortOrder","schema":{"type":"string","enum":["asc","desc"],"description":"The sorting order of `orderBy` field","example":"desc","default":"desc"},"description":"The sorting order of `orderBy` field"},{"in":"query","name":"orderBy","schema":{"type":"string","enum":["startDate","days"],"description":"Which field to order the streaks by","example":"startDate","default":"startDate"},"description":"Which field to order the streaks by"},{"in":"query","name":"status","schema":{"type":"string","enum":["ACTIVE","BROKEN"],"description":"The status of the streak.","example":"ACTIVE"},"description":"The status of the streak."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The id of the streak.","example":"cmmav127k000f7e21hy00bd6f"},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the streak.","example":"2023-09-01"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the streak.","example":"2023-09-31"},"status":{"type":"string","enum":["ACTIVE","BROKEN"],"description":"The status of the streak.","example":"ACTIVE"},"days":{"type":"integer","description":"The number of days the streak is/was active for.","example":5}},"required":["id","startDate","endDate","status","days"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/streaks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get streaks","description":{"content":"Get user streaks.","type":"text/plain"},"url":{"path":["v1","streaks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The date after which any streaks would be returned (inclusive)","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"The date before which any streaks would be returned (inclusive)","type":"text/plain"},"key":"to","value":""},{"disabled":false,"description":{"content":"The type of the streak","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The sorting order of `orderBy` field","type":"text/plain"},"key":"sortOrder","value":""},{"disabled":false,"description":{"content":"Which field to order the streaks by","type":"text/plain"},"key":"orderBy","value":""},{"disabled":false,"description":{"content":"The status of the streak.","type":"text/plain"},"key":"status","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"description":"Get user streaks.","tags":["Streaks"],"parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date after which any streaks would be returned (inclusive)","example":"2023-09-01"},"description":"The date after which any streaks would be returned (inclusive)"},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date before which any streaks would be returned (inclusive)","example":"2023-09-31"},"description":"The date before which any streaks would be returned (inclusive)"},{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN"],"description":"The type of the streak","example":"QURAN"},"description":"The type of the streak"},{"in":"query","name":"sortOrder","schema":{"type":"string","enum":["asc","desc"],"description":"The sorting order of `orderBy` field","example":"desc","default":"desc"},"description":"The sorting order of `orderBy` field"},{"in":"query","name":"orderBy","schema":{"type":"string","enum":["startDate","days"],"description":"Which field to order the streaks by","example":"startDate","default":"startDate"},"description":"Which field to order the streaks by"},{"in":"query","name":"status","schema":{"type":"string","enum":["ACTIVE","BROKEN"],"description":"The status of the streak.","example":"ACTIVE"},"description":"The status of the streak."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The id of the streak.","example":"cmoa3wrr2000i7z3fe8swbujv"},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the streak.","example":"2023-09-01"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the streak.","example":"2023-09-31"},"status":{"type":"string","enum":["ACTIVE","BROKEN"],"description":"The status of the streak.","example":"ACTIVE"},"days":{"type":"integer","description":"The number of days the streak is/was active for.","example":5}},"required":["id","startDate","endDate","status","days"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wrr2000i7z3fe8swbujv","startDate":"2023-09-01","endDate":"2023-09-31","status":"ACTIVE","days":5}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Streaks","method":"get","path":"/v1/streaks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get streaks","description":{"content":"Get user streaks.","type":"text/plain"},"url":{"path":["v1","streaks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The date after which any streaks would be returned (inclusive)","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"The date before which any streaks would be returned (inclusive)","type":"text/plain"},"key":"to","value":""},{"disabled":false,"description":{"content":"The type of the streak","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"The sorting order of `orderBy` field","type":"text/plain"},"key":"sortOrder","value":""},{"disabled":false,"description":{"content":"Which field to order the streaks by","type":"text/plain"},"key":"orderBy","value":""},{"disabled":false,"description":{"content":"The status of the streak.","type":"text/plain"},"key":"status","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; Get user streaks. -
    Query Parameters
    +
    Query Parameters
    Request has been handled successfully. -
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    +
    Schema
      data object[]
    • Array [
    • ]
    • pagination object
    The request is missing required parameters or is invalid. @@ -72,4 +72,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/update-note-by-id.api.mdx b/docs/user_related_apis_versioned/auth-patch-v-1-notes-by-note-id.api.mdx similarity index 51% rename from docs/user_related_apis_versioned/update-note-by-id.api.mdx rename to docs/user_related_apis_versioned/auth-patch-v-1-notes-by-note-id.api.mdx index 9722ac78..21f9edf3 100644 --- a/docs/user_related_apis_versioned/update-note-by-id.api.mdx +++ b/docs/user_related_apis_versioned/auth-patch-v-1-notes-by-note-id.api.mdx @@ -1,11 +1,11 @@ --- -id: update-note-by-id +id: auth-patch-v-1-notes-by-note-id title: "Update note by ID" description: "Update a note by its ID." sidebar_label: "Update note by ID" hide_title: true hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Update a note by its ID.","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The unique identifier of the note to be retrieved or manipulated.","example":"asda12312312"},"required":true,"description":"The unique identifier of the note to be retrieved or manipulated."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"saveToQR":{"type":"boolean","description":"Indicates whether the updated note should be saved to the QuranReflect, defaults to false.","example":false,"default":false}},"required":["body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"patch","path":"/v1/notes/:noteId","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"body":"This is a sample note body.","saveToQR":false},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"}} +api: {"tags":["Notes"],"description":"Update a note by its ID.","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The unique identifier of the note to be retrieved or manipulated.","example":"asda12312312"},"required":true,"description":"The unique identifier of the note to be retrieved or manipulated."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"saveToQR":{"type":"boolean","description":"Indicates whether the updated note should be saved to the QuranReflect, defaults to false.","example":false,"default":false}},"required":["body"],"additionalProperties":false},"example":{"body":"This is a sample note body.","saveToQR":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPatchV1NotesByNoteId","method":"patch","path":"/v1/notes/{noteId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"body":"This is a sample note body.","saveToQR":false},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update note by ID","description":{"content":"Update a note by its ID.","type":"text/plain"},"url":{"path":["v1","notes",":noteId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The unique identifier of the note to be retrieved or manipulated.","type":"text/plain"},"type":"any","value":"","key":"noteId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "patch api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -27,11 +27,15 @@ import TabItem from "@theme/TabItem"; Update a note by its ID. -
    Path Parameters
    Request Body
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
    +
    Path Parameters
    Query Parameters
    Request Body
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
    Request has been handled successfully. -
    Schema
      data object
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
      attachedEntities object[]
      +
      Response Headers
      • X-Mutation-At string
        + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
      Schema
        data object
        = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
        attachedEntities object[]
        An array of attached entities associated with the note. @@ -39,7 +43,7 @@ An array of attached entities associated with the note. Additional metadata for the attached entity. -
      • ]
    +
  • ]
  • The request is missing required parameters or is invalid. @@ -55,7 +59,11 @@ Forbidden error. Can either be due to access token not being passed, having been Not Found. The resource being accessed does not exist. -
    Schema
    +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    Validation Error. The request includes one or more invalid params. Please check the request params and try again. diff --git a/docs/user_related_apis_versioned/add-update-activity-day.api.mdx b/docs/user_related_apis_versioned/auth-post-v-1-activity-days.api.mdx similarity index 73% rename from docs/user_related_apis_versioned/add-update-activity-day.api.mdx rename to docs/user_related_apis_versioned/auth-post-v-1-activity-days.api.mdx index 2ff9169c..8d92a583 100644 --- a/docs/user_related_apis_versioned/add-update-activity-day.api.mdx +++ b/docs/user_related_apis_versioned/auth-post-v-1-activity-days.api.mdx @@ -1,11 +1,11 @@ --- -id: add-update-activity-day +id: auth-post-v-1-activity-days title: "Add/update activity day" description: "Create or update a daily activity record (one per date per type). Activity Days power streaks, goals, and calendar-style progress." sidebar_label: "Add/update activity day" hide_title: true hide_table_of_contents: true -api: {"description":"Create or update a daily activity record (one per date per type). Activity Days power streaks, goals, and calendar-style progress.\n\nFor `type=QURAN`, provide `seconds`, `ranges`, and `mushafId`. You can optionally pass `date` (YYYY-MM-DD) to backfill activity for a past day (for example when the user manually adds time). This endpoint enqueues progress updates and uses the `x-timezone` header to interpret day boundaries and calculate streaks accurately.","tags":["Activity Days"],"parameters":[{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day, can be today or a past date. If not passed, default to today","example":"2023-09-01"},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"}},"required":["type"],"additionalProperties":false,"oneOf":[{"type":"object","required":["seconds","ranges","mushafId"],"additionalProperties":false,"title":"QURAN"}]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/activity-days","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"date":"2023-09-01","type":"QURAN","seconds":5,"ranges":["1:5-1:10"],"mushafId":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add/update activity day","description":{"content":"Create or update a daily activity record (one per date per type). Activity Days power streaks, goals, and calendar-style progress.\n\nFor `type=QURAN`, provide `seconds`, `ranges`, and `mushafId`. You can optionally pass `date` (YYYY-MM-DD) to backfill activity for a past day (for example when the user manually adds time). This endpoint enqueues progress updates and uses the `x-timezone` header to interpret day boundaries and calculate streaks accurately.","type":"text/plain"},"url":{"path":["v1","activity-days"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Create or update a daily activity record (one per date per type). Activity Days power streaks, goals, and calendar-style progress.\n\nFor `type=QURAN`, provide `seconds`, `ranges`, and `mushafId`. You can optionally pass `date` (YYYY-MM-DD) to backfill activity for a past day (for example when the user manually adds time). This endpoint enqueues progress updates and uses the `x-timezone` header to interpret day boundaries and calculate streaks accurately.","tags":["Activity Days"],"parameters":[{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day, can be today or a past date. If not passed, default to today","example":"2023-09-01"},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"}},"required":["type"],"additionalProperties":false,"oneOf":[{"type":"object","required":["seconds","ranges","mushafId"],"additionalProperties":false,"title":"QURAN"}]},"example":{"seconds":5,"ranges":["1:5-1:10"],"mushafId":4}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"}},"additionalProperties":false},"example":{"success":true,"data":{}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1ActivityDays","method":"post","path":"/v1/activity-days","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"date":"2023-09-01","type":"QURAN","seconds":5,"ranges":["1:5-1:10"],"mushafId":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add/update activity day","description":{"content":"Create or update a daily activity record (one per date per type). Activity Days power streaks, goals, and calendar-style progress.\n\nFor `type=QURAN`, provide `seconds`, `ranges`, and `mushafId`. You can optionally pass `date` (YYYY-MM-DD) to backfill activity for a past day (for example when the user manually adds time). This endpoint enqueues progress updates and uses the `x-timezone` header to interpret day boundaries and calculate streaks accurately.","type":"text/plain"},"url":{"path":["v1","activity-days"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -33,7 +33,7 @@ For `type=QURAN`, provide `seconds`, `ranges`, and `mushafId`. You can optionall Request has been handled successfully. -
    Schema
    +
    Schema
    The request is missing required parameters or is invalid. @@ -74,4 +74,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/auth-post-v-1-bookmarks.api.mdx b/docs/user_related_apis_versioned/auth-post-v-1-bookmarks.api.mdx new file mode 100644 index 00000000..84587b12 --- /dev/null +++ b/docs/user_related_apis_versioned/auth-post-v-1-bookmarks.api.mdx @@ -0,0 +1,82 @@ +--- +id: auth-post-v-1-bookmarks +title: "Add user bookmark" +description: "Add or update a bookmark by details. Omit `isReading` to create or update a regular standalone bookmark. Set `isReading=true` to set the user's singleton reading bookmark. Set `isReading=false` to unset the current reading bookmark; in that case the response `data` can be `null` if no reading bookmark was set. For Quran.com-style saved or favorite ayah bookmarks, use `POST /v1/collections/__default__/bookmarks`." +sidebar_label: "Add user bookmark" +hide_title: true +hide_table_of_contents: true +api: {"description":"Add or update a bookmark by details. Omit `isReading` to create or update a regular standalone bookmark. Set `isReading=true` to set the user's singleton reading bookmark. Set `isReading=false` to unset the current reading bookmark; in that case the response `data` can be `null` if no reading bookmark was set. For Quran.com-style saved or favorite ayah bookmarks, use `POST /v1/collections/__default__/bookmarks`.","tags":["Bookmarks"],"parameters":[{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["key","type","verseNumber"],"additionalProperties":false,"title":"Ayah"},{"type":"object","required":["key","type"],"additionalProperties":false,"title":"Surah, Juz, Or page"}]},"example":{"key":2,"type":"ayah","verseNumber":3,"isReading":true,"mushafId":4,"mushaf":4}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqim00057z3fe30y0b3e"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"group":{"type":"string","example":"verses_6236"},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false},"collectionsCount":{"type":"integer","description":"Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.","example":1}},"required":["id","createdAt","type","key","group","isInDefaultCollection","isReading"],"additionalProperties":false,"nullable":true,"title":"NullableBookmark"}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Bookmarks","method":"post","path":"/v1/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"key":2,"type":"ayah","verseNumber":3,"isReading":true,"mushafId":4,"mushaf":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add user bookmark","description":{"content":"Add or update a bookmark by details. Omit `isReading` to create or update a regular standalone bookmark. Set `isReading=true` to set the user's singleton reading bookmark. Set `isReading=false` to unset the current reading bookmark; in that case the response `data` can be `null` if no reading bookmark was set. For Quran.com-style saved or favorite ayah bookmarks, use `POST /v1/collections/__default__/bookmarks`.","type":"text/plain"},"url":{"path":["v1","bookmarks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "post api-method" +info_path: docs/user_related_apis_versioned/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Add user bookmark + + + +Add or update a bookmark by details. Omit `isReading` to create or update a regular standalone bookmark. Set `isReading=true` to set the user's singleton reading bookmark. Set `isReading=false` to unset the current reading bookmark; in that case the response `data` can be `null` if no reading bookmark was set. For Quran.com-style saved or favorite ayah bookmarks, use `POST /v1/collections/__default__/bookmarks`. + +
    Query Parameters
    Request Body
      oneOf
    + +Request has been handled successfully. + +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object nullable
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    diff --git a/docs/user_related_apis_versioned/auth-post-v-1-collections-by-collection-id-bookmarks.api.mdx b/docs/user_related_apis_versioned/auth-post-v-1-collections-by-collection-id-bookmarks.api.mdx new file mode 100644 index 00000000..ef084615 --- /dev/null +++ b/docs/user_related_apis_versioned/auth-post-v-1-collections-by-collection-id-bookmarks.api.mdx @@ -0,0 +1,83 @@ +--- +id: auth-post-v-1-collections-by-collection-id-bookmarks +title: "Add collection Bookmark" +description: "Add a bookmark to a collection. Use `collectionId='__default__'` to add an ayah bookmark to the virtual Favorites collection used by Quran.com." +sidebar_label: "Add collection Bookmark" +hide_title: true +hide_table_of_contents: true +api: {"description":"Add a bookmark to a collection. Use `collectionId=\"__default__\"` to add an ayah bookmark to the virtual Favorites collection used by Quran.com.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The collection ID. Use `__default__` to add an ayah bookmark to the virtual Favorites collection used by Quran.com.","example":"cmoa3wqvw00097z3f9tk87gga"},"required":true,"description":"The collection ID. Use `__default__` to add an ayah bookmark to the virtual Favorites collection used by Quran.com."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["key","verseNumber"],"additionalProperties":false,"title":"Ayah"},{"type":"object","required":["key"],"additionalProperties":false,"title":"Surah, Juz, Or Page"}]},"example":{"key":2,"type":"ayah","verseNumber":3,"mushafId":4,"mushaf":4}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection bookmark added"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"collection bookmark added"}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1CollectionsByCollectionIdBookmarks","method":"post","path":"/v1/collections/{collectionId}/bookmarks","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"key":2,"type":"ayah","verseNumber":3,"mushafId":4,"mushaf":4},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add collection Bookmark","description":{"content":"Add a bookmark to a collection. Use `collectionId=\"__default__\"` to add an ayah bookmark to the virtual Favorites collection used by Quran.com.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId","bookmarks"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The collection ID. Use `__default__` to add an ayah bookmark to the virtual Favorites collection used by Quran.com.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "post api-method" +info_path: docs/user_related_apis_versioned/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Add collection Bookmark + + + +Add a bookmark to a collection. Use `collectionId="__default__"` to add an ayah bookmark to the virtual Favorites collection used by Quran.com. + +
    Path Parameters
    Query Parameters
    Request Body
      oneOf
    + +Request has been handled successfully. + +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    + \ No newline at end of file diff --git a/docs/user_related_apis_versioned/update-collection.api.mdx b/docs/user_related_apis_versioned/auth-post-v-1-collections-by-collection-id.api.mdx similarity index 53% rename from docs/user_related_apis_versioned/update-collection.api.mdx rename to docs/user_related_apis_versioned/auth-post-v-1-collections-by-collection-id.api.mdx index 72c1baee..49162b10 100644 --- a/docs/user_related_apis_versioned/update-collection.api.mdx +++ b/docs/user_related_apis_versioned/auth-post-v-1-collections-by-collection-id.api.mdx @@ -1,11 +1,11 @@ --- -id: update-collection +id: auth-post-v-1-collections-by-collection-id title: "Update collection" description: "Update an existing collection." sidebar_label: "Update collection" hide_title: true hide_table_of_contents: true -api: {"description":"Update an existing collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be updated."},"required":true,"description":"The Id of the collection to be updated."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the collection to be updated."}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection renamed"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/collections/{collectionId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"string"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update collection","description":{"content":"Update an existing collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The Id of the collection to be updated.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Update an existing collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be updated."},"required":true,"description":"The Id of the collection to be updated."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the collection to be updated."}},"required":["name"],"additionalProperties":false},"example":{"name":"string"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection renamed"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"collection renamed"}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1CollectionsByCollectionId","method":"post","path":"/v1/collections/{collectionId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"string"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update collection","description":{"content":"Update an existing collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The Id of the collection to be updated.","type":"text/plain"},"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -27,11 +27,15 @@ import TabItem from "@theme/TabItem"; Update an existing collection. -
    Path Parameters
    Request Body
    +
    Path Parameters
    Query Parameters
    Request Body
    Request has been handled successfully. -
    Schema
      data object
    +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -47,7 +51,11 @@ Forbidden error. Can either be due to access token not being passed, having been Not Found. The resource being accessed does not exist. -
    Schema
    +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    Validation Error. The request includes one or more invalid params. Please check the request params and try again. diff --git a/docs/user_related_apis_versioned/auth-post-v-1-collections.api.mdx b/docs/user_related_apis_versioned/auth-post-v-1-collections.api.mdx new file mode 100644 index 00000000..80ffd577 --- /dev/null +++ b/docs/user_related_apis_versioned/auth-post-v-1-collections.api.mdx @@ -0,0 +1,83 @@ +--- +id: auth-post-v-1-collections +title: "Add collection" +description: "Create a new collection under user's account." +sidebar_label: "Add collection" +hide_title: true +hide_table_of_contents: true +api: {"description":"Create a new collection under user's account.","tags":["Collections"],"parameters":[{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the new collection to be created.","example":"Woman in Quran"}},"required":["name"],"additionalProperties":false},"example":{"name":"Woman in Quran"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqsk00087z3f5hp42h08"},"name":{"type":"string","example":"Woman in Quran"},"slug":{"type":"string","nullable":true,"example":"woman-in-quran"},"isPrivate":{"type":"boolean","example":false},"isDefault":{"type":"boolean","example":false},"updatedAt":{"type":"string","format":"date-time","nullable":true,"example":"2023-01-21T07:28:13.023Z"},"url":{"type":"string","nullable":true,"example":"cmnkcpmvc000814v9f5jtbsxf"},"bookmarksCount":{"type":"integer","example":1},"resourcesCount":{"type":"integer","example":1},"count":{"type":"integer","example":1}},"required":["id","name","slug","isPrivate","isDefault","updatedAt"],"additionalProperties":false,"title":"Collection"}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wqsk00087z3f5hp42h08","name":"Woman in Quran","slug":"woman-in-quran","isPrivate":false,"isDefault":false,"updatedAt":"2023-01-21T07:28:13.023Z","url":"cmnkcpmvc000814v9f5jtbsxf","bookmarksCount":1,"resourcesCount":1,"count":1}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Collections","method":"post","path":"/v1/collections","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"Woman in Quran"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add collection","description":{"content":"Create a new collection under user's account.","type":"text/plain"},"url":{"path":["v1","collections"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "post api-method" +info_path: docs/user_related_apis_versioned/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Add collection + + + +Create a new collection under user's account. + +
    Query Parameters
    Request Body
    + +Request has been handled successfully. + +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    + \ No newline at end of file diff --git a/docs/user_related_apis_versioned/create-a-goal.api.mdx b/docs/user_related_apis_versioned/auth-post-v-1-goals.api.mdx similarity index 72% rename from docs/user_related_apis_versioned/create-a-goal.api.mdx rename to docs/user_related_apis_versioned/auth-post-v-1-goals.api.mdx index 7c28bdca..aa0b21ab 100644 --- a/docs/user_related_apis_versioned/create-a-goal.api.mdx +++ b/docs/user_related_apis_versioned/auth-post-v-1-goals.api.mdx @@ -1,11 +1,11 @@ --- -id: create-a-goal +id: auth-post-v-1-goals title: "Create a goal" description: "Create a goal" sidebar_label: "Create a goal" hide_title: true hide_table_of_contents: true -api: {"description":"Create a goal","tags":["Goals"],"parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"amount":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"duration":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"category":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"}},"required":["type","amount","category"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The id of the goal.","example":"cmmav11g9000d7e219d05gas2"}},"required":["id"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/goals","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":0,"category":"QURAN"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a goal","description":{"content":"Create a goal","type":"text/plain"},"url":{"path":["v1","goals"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Create a goal","tags":["Goals"],"parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"amount":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"duration":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"category":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"}},"required":["type","amount","category"],"additionalProperties":false},"example":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":1,"category":"QURAN"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The id of the goal.","example":"cmoa3wr5c000g7z3fgv0y0rvo"}},"required":["id"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wr5c000g7z3fgv0y0rvo"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Goals","method":"post","path":"/v1/goals","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":0,"category":"QURAN"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a goal","description":{"content":"Create a goal","type":"text/plain"},"url":{"path":["v1","goals"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -43,7 +43,7 @@ The amount of the goal. Depending on the goal type, the amount value and format Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -84,4 +84,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-bookmark.api.mdx b/docs/user_related_apis_versioned/auth-post-v-1-notes-by-note-id-publish.api.mdx similarity index 55% rename from docs/user_related_apis_versioned/get-bookmark.api.mdx rename to docs/user_related_apis_versioned/auth-post-v-1-notes-by-note-id-publish.api.mdx index f731cb83..688b619d 100644 --- a/docs/user_related_apis_versioned/get-bookmark.api.mdx +++ b/docs/user_related_apis_versioned/auth-post-v-1-notes-by-note-id-publish.api.mdx @@ -1,12 +1,12 @@ --- -id: get-bookmark -title: "Get bookmark" -description: "Get a bookmark by details" -sidebar_label: "Get bookmark" +id: auth-post-v-1-notes-by-note-id-publish +title: "Publish note" +description: "Publish a note to QR." +sidebar_label: "Publish note" hide_title: true hide_table_of_contents: true -api: {"description":"Get a bookmark by details","tags":["Bookmarks"],"parameters":[{"in":"query","name":"verseNumber","schema":{"type":"integer","description":"The Ayah number of the bookmark"},"required":false,"description":"The Ayah number of the bookmark"},{"in":"query","name":"isReading","schema":{"type":"boolean","description":"Whether to fetch the reading bookmark"},"required":false,"description":"Whether to fetch the reading bookmark"},{"in":"query","name":"key","schema":{"type":"integer","oneOf":[{},{"x-required":true}],"description":"Surah, Juz or page number.","example":2},"required":false,"description":"Surah, Juz or page number."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"oneOf":[{},{"x-required":true}],"description":"The bookmark type.","default":"ayah"},"required":false,"description":"The bookmark type."},{"in":"query","name":"mushaf","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","example":"cmmav10y500057e21hjilhplh"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5},"group":{"type":"string"},"isInDefaultCollection":{"type":"boolean","example":true}},"required":["id","createdAt","type","key","isInDefaultCollection"],"additionalProperties":false,"title":"Bookmark"}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/bookmarks/bookmark","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get bookmark","description":{"content":"Get a bookmark by details","type":"text/plain"},"url":{"path":["v1","bookmarks","bookmark"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"The Ayah number of the bookmark","type":"text/plain"},"key":"verseNumber","value":""},{"disabled":false,"description":{"content":"Whether to fetch the reading bookmark","type":"text/plain"},"key":"isReading","value":""},{"disabled":false,"description":{"content":"Surah, Juz or page number.","type":"text/plain"},"key":"key","value":""},{"disabled":false,"description":{"content":"The bookmark type.","type":"text/plain"},"key":"type","value":""},{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushaf","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} -sidebar_class_name: "get api-method" +api: {"tags":["Notes"],"description":"Publish a note to QR.","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The unique identifier of the note to be retrieved or manipulated.","example":"asda12312312"},"required":true,"description":"The unique identifier of the note to be retrieved or manipulated."},{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:112-2:115"]}},"required":["body"],"additionalProperties":false},"example":{"body":"This is a sample note body.","ranges":["2:112-2:115"]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"success":{"type":"boolean"},"postId":{"type":"number","format":"float"}},"required":["success"],"additionalProperties":false,"description":"Response object indicating the success of the note publishing operation and the optional post ID if successful.","example":{"success":true,"postId":123}}},"additionalProperties":false},"example":{"success":true,"data":{"success":true,"postId":123}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1NotesByNoteIdPublish","method":"post","path":"/v1/notes/{noteId}/publish","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"body":"This is a sample note body.","ranges":["2:112-2:115"]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Publish note","description":{"content":"Publish a note to QR.","type":"text/plain"},"url":{"path":["v1","notes",":noteId","publish"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The unique identifier of the note to be retrieved or manipulated.","type":"text/plain"},"type":"any","value":"","key":"noteId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null displayed_sidebar: APIsSidebar @@ -21,17 +21,25 @@ import SchemaTabs from "@theme/SchemaTabs"; import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import TabItem from "@theme/TabItem"; -## Get bookmark +## Publish note -Get a bookmark by details +Publish a note to QR. -
    Query Parameters
    +
    Path Parameters
    Query Parameters
    Request Body
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
    Request has been handled successfully. -
    Schema
      data object
    +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
      + +Response object indicating the success of the note publishing operation and the optional post ID if successful. + +
    The request is missing required parameters or is invalid. @@ -47,7 +55,11 @@ Forbidden error. Can either be due to access token not being passed, having been Not Found. The resource being accessed does not exist. -
    Schema
    +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    Validation Error. The request includes one or more invalid params. Please check the request params and try again. diff --git a/docs/user_related_apis_versioned/auth-post-v-1-notes.api.mdx b/docs/user_related_apis_versioned/auth-post-v-1-notes.api.mdx new file mode 100644 index 00000000..f1bedc57 --- /dev/null +++ b/docs/user_related_apis_versioned/auth-post-v-1-notes.api.mdx @@ -0,0 +1,95 @@ +--- +id: auth-post-v-1-notes +title: "Add note" +description: "Add a new note." +sidebar_label: "Add note" +hide_title: true +hide_table_of_contents: true +api: {"tags":["Notes"],"description":"Add a new note.","parameters":[{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"saveToQR":{"type":"boolean","description":"Indicates whether the note should be saved to the QuranReflect.","example":true},"attachedEntity":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["body","saveToQR"],"additionalProperties":false},"example":{"body":"This is a sample note body.","saveToQR":true,"attachedEntity":{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}},"ranges":["2:255-2:257"]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Notes","method":"post","path":"/v1/notes","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"body":"This is a sample note body.","saveToQR":true,"attachedEntity":{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}},"ranges":["2:255-2:257"]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add note","description":{"content":"Add a new note.","type":"text/plain"},"url":{"path":["v1","notes"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "post api-method" +info_path: docs/user_related_apis_versioned/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Add note + + + +Add a new note. + +
    Query Parameters
    Request Body
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
      attachedEntity object
      entityMetadata object
      + +Additional metadata for the attached entity. + +
    + +Request has been handled successfully. + +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
      attachedEntities object[]
      + +An array of attached entities associated with the note. + +
    • Array [
    • entityMetadata object
      + +Additional metadata for the attached entity. + +
    • ]
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
    Schema
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    + \ No newline at end of file diff --git a/docs/user_related_apis_versioned/bulk-add-or-update-preferences.api.mdx b/docs/user_related_apis_versioned/auth-post-v-1-preferences-bulk.api.mdx similarity index 77% rename from docs/user_related_apis_versioned/bulk-add-or-update-preferences.api.mdx rename to docs/user_related_apis_versioned/auth-post-v-1-preferences-bulk.api.mdx index 24b3769d..958a6611 100644 --- a/docs/user_related_apis_versioned/bulk-add-or-update-preferences.api.mdx +++ b/docs/user_related_apis_versioned/auth-post-v-1-preferences-bulk.api.mdx @@ -1,11 +1,11 @@ --- -id: bulk-add-or-update-preferences +id: auth-post-v-1-preferences-bulk title: "Bulk add or update preferences" description: "Add or update one or more user preferences groups like favorite Tafsirs and translations." sidebar_label: "Bulk add or update preferences" hide_title: true hide_table_of_contents: true -api: {"description":"Add or update one or more user preferences groups like favorite Tafsirs and translations.","tags":["Preferences"],"parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"theme":{"type":"object","properties":{"type":{"type":"string","enum":["auto","light","sepia","dark"],"example":"auto"}},"additionalProperties":false},"reading":{"type":"object","properties":{"readingPreference":{"type":"string","enum":["translation","reading","readingTranslation"],"example":"translation"},"selectedWordByWordLocale":{"type":"string","enum":["en","ur","id","bn","tr","fa","ru","hi","de","ta","inh","fr","sq","dv","zh","sd","ml"],"example":"en"},"wordClickFunctionality":{"type":"string","enum":["play-audio","no-audio"],"example":"play-audio"},"isReadingByRevelationOrder":{"type":"boolean","example":true},"wordByWordContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordDisplay":{"type":"array","items":{"type":"string","enum":["tooltip","inline"]},"example":["tooltip"]},"wordByWordTooltipContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordInlineContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":[]},"selectedReadingTranslation":{"type":"string","minLength":1,"maxLength":255,"example":"131"},"selectedReflectionLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1},"selectedLessonLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}},"required":["readingPreference","selectedWordByWordLocale","wordClickFunctionality","selectedReadingTranslation"],"additionalProperties":false},"quranReaderStyles":{"type":"object","properties":{"tafsirFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranTextFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"translationFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"wordByWordFontScale":{"type":"integer","minimum":1,"maximum":6,"example":3},"reflectionFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"qnaFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"lessonFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"surahInfoFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"hadithFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"layersFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranFont":{"type":"string","enum":["code_v1","code_v2","text_uthmani","text_indopak","qpc_uthmani_hafs","tajweed","tajweed_v4"],"example":"code_v1"},"mushafLines":{"type":"string","enum":["15_lines","16_lines"],"example":"16_lines"},"showTajweedRules":{"type":"boolean","example":true}},"required":["tafsirFontScale","quranTextFontScale","translationFontScale","wordByWordFontScale","reflectionFontScale","qnaFontScale","lessonFontScale","surahInfoFontScale","hadithFontScale","layersFontScale"],"additionalProperties":false},"translations":{"type":"object","properties":{"selectedTranslations":{"type":"array","items":{"type":"integer","example":131}}},"additionalProperties":false},"tafsirs":{"type":"object","properties":{"selectedTafsirs":{"type":"array","items":{"type":"string","example":"en-tafisr-ibn-kathir"}}},"additionalProperties":false},"audio":{"type":"object","properties":{"reciter":{"type":"integer","example":7},"playbackRate":{"type":"integer","enum":[0.25,0.5,0.75,1,1.25,1.5,1.75,2],"example":1},"showTooltipWhenPlayingAudio":{"type":"boolean","example":true},"enableAutoScrolling":{"type":"boolean","example":true}},"required":["reciter"],"additionalProperties":false},"language":{"type":"object","properties":{"language":{"type":"string","enum":["en","ar","bn","fa","fr","id","it","nl","pt","ru","sq","th","tr","ur","zh","ms","es","sw","vi"]}},"additionalProperties":false},"userHasCustomised":{"type":"object","properties":{"userHasCustomised":{"type":"boolean","example":false}},"required":["userHasCustomised"],"additionalProperties":false}},"additionalProperties":false,"title":"Preference"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["preferences updated"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/preferences/bulk","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"theme":{"type":"auto"},"reading":{"readingPreference":"translation","selectedWordByWordLocale":"en","wordClickFunctionality":"play-audio","isReadingByRevelationOrder":true,"wordByWordContentType":["translation"],"wordByWordDisplay":["tooltip"],"wordByWordTooltipContentType":["translation"],"wordByWordInlineContentType":[],"selectedReadingTranslation":"131","selectedReflectionLanguages":["string"],"selectedLessonLanguages":["string"]},"quranReaderStyles":{"tafsirFontScale":3,"quranTextFontScale":3,"translationFontScale":3,"wordByWordFontScale":3,"reflectionFontScale":3,"qnaFontScale":3,"lessonFontScale":3,"surahInfoFontScale":3,"hadithFontScale":3,"layersFontScale":3,"quranFont":"code_v1","mushafLines":"16_lines","showTajweedRules":true},"translations":{"selectedTranslations":[131]},"tafsirs":{"selectedTafsirs":["en-tafisr-ibn-kathir"]},"audio":{"reciter":7,"playbackRate":1,"showTooltipWhenPlayingAudio":true,"enableAutoScrolling":true},"language":{"language":"en"},"userHasCustomised":{"userHasCustomised":false}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Bulk add or update preferences","description":{"content":"Add or update one or more user preferences groups like favorite Tafsirs and translations.","type":"text/plain"},"url":{"path":["v1","preferences","bulk"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Add or update one or more user preferences groups like favorite Tafsirs and translations.","tags":["Preferences"],"parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"theme":{"type":"object","properties":{"type":{"type":"string","enum":["auto","light","sepia","dark"],"example":"auto"}},"additionalProperties":false},"reading":{"type":"object","properties":{"readingPreference":{"type":"string","enum":["translation","reading","readingTranslation"],"example":"translation"},"selectedWordByWordLocale":{"type":"string","enum":["en","ur","id","bn","tr","fa","ru","hi","de","ta","inh","fr","sq","dv","zh","sd","ml"],"example":"en"},"wordClickFunctionality":{"type":"string","enum":["play-audio","no-audio"],"example":"play-audio"},"isReadingByRevelationOrder":{"type":"boolean","example":true},"wordByWordContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordDisplay":{"type":"array","items":{"type":"string","enum":["tooltip","inline"]},"example":["tooltip"]},"wordByWordTooltipContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordInlineContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":[]},"selectedReadingTranslation":{"type":"string","minLength":1,"maxLength":255,"example":"131"},"selectedReflectionLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1},"selectedLessonLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}},"required":["readingPreference","selectedWordByWordLocale","wordClickFunctionality","selectedReadingTranslation"],"additionalProperties":false},"quranReaderStyles":{"type":"object","properties":{"tafsirFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranTextFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"translationFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"wordByWordFontScale":{"type":"integer","minimum":1,"maximum":6,"example":3},"reflectionFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"qnaFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"lessonFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"surahInfoFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"hadithFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"layersFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranFont":{"type":"string","enum":["code_v1","code_v2","text_uthmani","text_indopak","qpc_uthmani_hafs","tajweed","tajweed_v4"],"example":"code_v1"},"mushafLines":{"type":"string","enum":["15_lines","16_lines"],"example":"16_lines"},"showTajweedRules":{"type":"boolean","example":true}},"required":["tafsirFontScale","quranTextFontScale","translationFontScale","wordByWordFontScale","reflectionFontScale","qnaFontScale","lessonFontScale","surahInfoFontScale","hadithFontScale","layersFontScale"],"additionalProperties":false},"translations":{"type":"object","properties":{"selectedTranslations":{"type":"array","items":{"type":"integer","example":131}}},"additionalProperties":false},"tafsirs":{"type":"object","properties":{"selectedTafsirs":{"type":"array","items":{"type":"string","example":"en-tafisr-ibn-kathir"}}},"additionalProperties":false},"audio":{"type":"object","properties":{"reciter":{"type":"integer","example":7},"playbackRate":{"type":"integer","enum":[0.25,0.5,0.75,1,1.25,1.5,1.75,2],"example":1},"showTooltipWhenPlayingAudio":{"type":"boolean","example":true},"enableAutoScrolling":{"type":"boolean","example":true}},"required":["reciter"],"additionalProperties":false},"language":{"type":"object","properties":{"language":{"type":"string","enum":["en","ar","bn","fa","fr","id","it","nl","pt","ru","sq","th","tr","ur","zh","ms","es","sw","vi"]}},"additionalProperties":false},"userHasCustomised":{"type":"object","properties":{"userHasCustomised":{"type":"boolean","example":false}},"required":["userHasCustomised"],"additionalProperties":false}},"additionalProperties":false,"title":"Preference"},"example":{"theme":{"type":"auto"},"reading":{"readingPreference":"translation","selectedWordByWordLocale":"en","wordClickFunctionality":"play-audio","isReadingByRevelationOrder":true,"wordByWordContentType":["translation"],"wordByWordDisplay":["tooltip"],"wordByWordTooltipContentType":["translation"],"wordByWordInlineContentType":[],"selectedReadingTranslation":"131","selectedReflectionLanguages":["string"],"selectedLessonLanguages":["string"]},"quranReaderStyles":{"tafsirFontScale":3,"quranTextFontScale":3,"translationFontScale":3,"wordByWordFontScale":3,"reflectionFontScale":3,"qnaFontScale":3,"lessonFontScale":3,"surahInfoFontScale":3,"hadithFontScale":3,"layersFontScale":3,"quranFont":"code_v1","mushafLines":"16_lines","showTajweedRules":true},"translations":{"selectedTranslations":[131]},"tafsirs":{"selectedTafsirs":["en-tafisr-ibn-kathir"]},"audio":{"reciter":7,"playbackRate":1,"showTooltipWhenPlayingAudio":true,"enableAutoScrolling":true},"language":{"language":"en"},"userHasCustomised":{"userHasCustomised":false}}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["preferences updated"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"preferences updated"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1PreferencesBulk","method":"post","path":"/v1/preferences/bulk","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"theme":{"type":"auto"},"reading":{"readingPreference":"translation","selectedWordByWordLocale":"en","wordClickFunctionality":"play-audio","isReadingByRevelationOrder":true,"wordByWordContentType":["translation"],"wordByWordDisplay":["tooltip"],"wordByWordTooltipContentType":["translation"],"wordByWordInlineContentType":[],"selectedReadingTranslation":"131","selectedReflectionLanguages":["string"],"selectedLessonLanguages":["string"]},"quranReaderStyles":{"tafsirFontScale":3,"quranTextFontScale":3,"translationFontScale":3,"wordByWordFontScale":3,"reflectionFontScale":3,"qnaFontScale":3,"lessonFontScale":3,"surahInfoFontScale":3,"hadithFontScale":3,"layersFontScale":3,"quranFont":"code_v1","mushafLines":"16_lines","showTajweedRules":true},"translations":{"selectedTranslations":[131]},"tafsirs":{"selectedTafsirs":["en-tafisr-ibn-kathir"]},"audio":{"reciter":7,"playbackRate":1,"showTooltipWhenPlayingAudio":true,"enableAutoScrolling":true},"language":{"language":"en"},"userHasCustomised":{"userHasCustomised":false}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Bulk add or update preferences","description":{"content":"Add or update one or more user preferences groups like favorite Tafsirs and translations.","type":"text/plain"},"url":{"path":["v1","preferences","bulk"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Add or update one or more user preferences groups like favorite Tafsirs and tran Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -72,4 +72,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/add-or-update-preference.api.mdx b/docs/user_related_apis_versioned/auth-post-v-1-preferences.api.mdx similarity index 79% rename from docs/user_related_apis_versioned/add-or-update-preference.api.mdx rename to docs/user_related_apis_versioned/auth-post-v-1-preferences.api.mdx index f48c4aa0..2c7a607f 100644 --- a/docs/user_related_apis_versioned/add-or-update-preference.api.mdx +++ b/docs/user_related_apis_versioned/auth-post-v-1-preferences.api.mdx @@ -1,11 +1,11 @@ --- -id: add-or-update-preference +id: auth-post-v-1-preferences title: "Add or update preference" description: "Add or update one user preferences group like favorite Tafsirs or translations." sidebar_label: "Add or update preference" hide_title: true hide_table_of_contents: true -api: {"description":"Add or update one user preferences group like favorite Tafsirs or translations.","tags":["Preferences"],"parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"group":{"type":"string","enum":["tafsirs","translations","audio","theme","quranReaderStyles","reading","language","userHasCustomised"],"description":"The preference group to be added or updated.","example":"tafsirs"},"key":{"type":"string","description":"The preference key to be added or updated.","example":"selectedTafsirs"},"value":{"description":"The preference value to be added or updated.","example":"[\"en-tafisr-ibn-kathir\"]"}},"required":["group","key","value"],"additionalProperties":false,"anyOf":[{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["key"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["preference updated"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/preferences","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"group":"tafsirs","key":"selectedTafsirs","value":"[\"en-tafisr-ibn-kathir\"]"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add or update preference","description":{"content":"Add or update one user preferences group like favorite Tafsirs or translations.","type":"text/plain"},"url":{"path":["v1","preferences"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Add or update one user preferences group like favorite Tafsirs or translations.","tags":["Preferences"],"parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"group":{"type":"string","enum":["tafsirs","translations","audio","theme","quranReaderStyles","reading","language","userHasCustomised"],"description":"The preference group to be added or updated.","example":"tafsirs"},"key":{"type":"string","description":"The preference key to be added or updated.","example":"selectedTafsirs"},"value":{"description":"The preference value to be added or updated.","example":"[\"en-tafisr-ibn-kathir\"]"}},"required":["group","key","value"],"additionalProperties":false,"oneOf":[{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["key"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false},{"type":"object","required":["value"],"additionalProperties":false}]},"example":{"key":"type"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["preference updated"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"preference updated"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Preferences","method":"post","path":"/v1/preferences","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"group":"tafsirs","key":"selectedTafsirs","value":"[\"en-tafisr-ibn-kathir\"]"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add or update preference","description":{"content":"Add or update one user preferences group like favorite Tafsirs or translations.","type":"text/plain"},"url":{"path":["v1","preferences"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -27,11 +27,11 @@ import TabItem from "@theme/TabItem"; Add or update one user preferences group like favorite Tafsirs or translations. -
    Query Parameters
    Request Body
      anyOf= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 6`"} schema={{"type":"integer","minimum":1,"maximum":6,"example":3}}>= 1`"} schema={{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}}>
    +
    Query Parameters
    Request Body
      oneOf= 1` and `<= 10`"} schema={{"type":"integer","minimum":1,"maximum":10,"example":3}}>= 1` and `<= 6`"} schema={{"type":"integer","minimum":1,"maximum":6,"example":3}}>= 1`"} schema={{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}}>
    Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -72,4 +72,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/add-or-update-user-reading-session.api.mdx b/docs/user_related_apis_versioned/auth-post-v-1-reading-sessions.api.mdx similarity index 67% rename from docs/user_related_apis_versioned/add-or-update-user-reading-session.api.mdx rename to docs/user_related_apis_versioned/auth-post-v-1-reading-sessions.api.mdx index 3bdb177a..d332de2a 100644 --- a/docs/user_related_apis_versioned/add-or-update-user-reading-session.api.mdx +++ b/docs/user_related_apis_versioned/auth-post-v-1-reading-sessions.api.mdx @@ -1,11 +1,11 @@ --- -id: add-or-update-user-reading-session +id: auth-post-v-1-reading-sessions title: "Add or update user reading session" description: "Track the user's most recent reading location (Surah/Ayah) for 'Continue reading' / 'Recently read' UX." sidebar_label: "Add or update user reading session" hide_title: true hide_table_of_contents: true -api: {"description":"Track the user's most recent reading location (Surah/Ayah) for \"Continue reading\" / \"Recently read\" UX.\n\nA new reading session will be created if the user does not have an existing one in the past 20 minutes; otherwise, the existing reading session will be updated with the latest read Ayah.\n\nFor streaks, goals, and calendar-style progress tracking, use [Activity Days](/docs/user_related_apis_versioned/add-update-activity-day) instead.","tags":["Reading Sessions"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"chapterNumber":{"type":"integer","minimum":1,"description":"The Surah number to be added to reading session.","example":1},"verseNumber":{"type":"integer","minimum":1,"description":"The Ayah number to be added to reading session.","example":1}},"required":["chapterNumber","verseNumber"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"type":"string","enum":["reading session created","reading session updated"],"example":"reading session created"}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/reading-sessions","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"chapterNumber":1,"verseNumber":1},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add or update user reading session","description":{"content":"Track the user's most recent reading location (Surah/Ayah) for \"Continue reading\" / \"Recently read\" UX.\n\nA new reading session will be created if the user does not have an existing one in the past 20 minutes; otherwise, the existing reading session will be updated with the latest read Ayah.\n\nFor streaks, goals, and calendar-style progress tracking, use [Activity Days](/docs/user_related_apis_versioned/add-update-activity-day) instead.","type":"text/plain"},"url":{"path":["v1","reading-sessions"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Track the user's most recent reading location (Surah/Ayah) for \"Continue reading\" / \"Recently read\" UX.\n\nA new reading session will be created if the user does not have an existing one in the past 20 minutes; otherwise, the existing reading session will be updated with the latest read Ayah.\n\nFor streaks, goals, and calendar-style progress tracking, see [Reading Sessions vs Activity Days](/docs/user-related-apis/reading-sessions-vs-activity-days).","tags":["Reading Sessions"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"chapterNumber":{"type":"integer","minimum":1,"description":"The Surah number to be added to reading session.","example":1},"verseNumber":{"type":"integer","minimum":1,"description":"The Ayah number to be added to reading session.","example":1}},"required":["chapterNumber","verseNumber"],"additionalProperties":false},"example":{"chapterNumber":1,"verseNumber":1}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"type":"string","enum":["reading session created","reading session updated"],"example":"reading session created"}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"reading session created"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1ReadingSessions","method":"post","path":"/v1/reading-sessions","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"chapterNumber":1,"verseNumber":1},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Add or update user reading session","description":{"content":"Track the user's most recent reading location (Surah/Ayah) for \"Continue reading\" / \"Recently read\" UX.\n\nA new reading session will be created if the user does not have an existing one in the past 20 minutes; otherwise, the existing reading session will be updated with the latest read Ayah.\n\nFor streaks, goals, and calendar-style progress tracking, see [Reading Sessions vs Activity Days](/docs/user-related-apis/reading-sessions-vs-activity-days).","type":"text/plain"},"url":{"path":["v1","reading-sessions"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -29,13 +29,13 @@ Track the user's most recent reading location (Surah/Ayah) for "Continue reading A new reading session will be created if the user does not have an existing one in the past 20 minutes; otherwise, the existing reading session will be updated with the latest read Ayah. -For streaks, goals, and calendar-style progress tracking, use [Activity Days](/docs/user_related_apis_versioned/add-update-activity-day) instead. +For streaks, goals, and calendar-style progress tracking, see [Reading Sessions vs Activity Days](/docs/user-related-apis/reading-sessions-vs-activity-days).
    Request Body
      = 1`"} schema={{"type":"integer","minimum":1,"description":"The Surah number to be added to reading session.","example":1}}>= 1`"} schema={{"type":"integer","minimum":1,"description":"The Ayah number to be added to reading session.","example":1}}>
    Request has been handled successfully. -
    Schema
      data object
    +
    Schema
      data object
    The request is missing required parameters or is invalid. @@ -76,4 +76,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/update-a-goal.api.mdx b/docs/user_related_apis_versioned/auth-put-v-1-goals-by-id.api.mdx similarity index 73% rename from docs/user_related_apis_versioned/update-a-goal.api.mdx rename to docs/user_related_apis_versioned/auth-put-v-1-goals-by-id.api.mdx index d8a95ddd..5ab208de 100644 --- a/docs/user_related_apis_versioned/update-a-goal.api.mdx +++ b/docs/user_related_apis_versioned/auth-put-v-1-goals-by-id.api.mdx @@ -1,11 +1,11 @@ --- -id: update-a-goal +id: auth-put-v-1-goals-by-id title: "Update a goal" description: "Update a goal" sidebar_label: "Update a goal" hide_title: true hide_table_of_contents: true -api: {"description":"Update a goal","tags":["Goals"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The id of the goal.","example":"cmmav11g9000d7e219d05gas2"},"required":true,"description":"The id of the goal."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"amount":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"duration":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"category":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"put","path":"/v1/goals/{id}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":0,"category":"QURAN"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update a goal","description":{"content":"Update a goal","type":"text/plain"},"url":{"path":["v1","goals",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The id of the goal.","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PUT","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"description":"Update a goal","tags":["Goals"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The id of the goal.","example":"cmoa3wr5c000g7z3fgv0y0rvo"},"required":true,"description":"The id of the goal."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"amount":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"duration":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"category":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"}},"additionalProperties":false},"example":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":1,"category":"QURAN"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPutV1GoalsById","method":"put","path":"/v1/goals/{id}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":0,"category":"QURAN"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update a goal","description":{"content":"Update a goal","type":"text/plain"},"url":{"path":["v1","goals",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","type":"text/plain"},"key":"mushafId","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) The id of the goal.","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PUT","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "put api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -27,7 +27,7 @@ import TabItem from "@theme/TabItem"; Update a goal -
    Path Parameters
    Query Parameters
    Header Parameters
    Request Body
      amount object
      +
      Path Parameters
      Query Parameters
      Header Parameters
      Request Body
        amount object
        The amount of the goal. Depending on the goal type, the amount value and format will be different @@ -43,7 +43,7 @@ The amount of the goal. Depending on the goal type, the amount value and format Request has been handled successfully. -
        Schema
          data object
        +
        Schema
          data object
        The request is missing required parameters or is invalid. @@ -84,4 +84,3 @@ The server is currently unable to handle the request due to a temporary overload The server did not receive a timely response from the upstream server.
        Schema
        - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/comments-controller-create.api.mdx b/docs/user_related_apis_versioned/comments-controller-create.api.mdx index 7ed2efa9..bd0da75e 100644 --- a/docs/user_related_apis_versioned/comments-controller-create.api.mdx +++ b/docs/user_related_apis_versioned/comments-controller-create.api.mdx @@ -5,7 +5,7 @@ description: "Add a comment to a post or reply to an existing comment. Supports sidebar_label: "Create a new comment" hide_title: true hide_table_of_contents: true -api: {"operationId":"CommentsController_create","description":"Add a comment to a post or reply to an existing comment. Supports mentions and notifies the post author.","parameters":[],"requestBody":{"required":true,"description":"Comment with postId and optional parentId","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"description":"Comment details for creation","allOf":[{"type":"object","properties":{"body":{"type":"string","description":"Comment body text","example":"This is a thoughtful comment about the post","maxLength":8000},"postId":{"type":"number","description":"ID of the post this comment belongs to","example":123},"isPrivate":{"type":"boolean","default":false,"description":"Whether the comment is private","example":false},"parentId":{"type":"number","description":"ID of the parent comment (for replies)","example":456},"mentions":{"description":"User mentions in the comment","type":"array","items":{"type":"object","properties":{"marker":{"type":"string","pattern":"/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/","example":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}"},"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["marker","userId","displayName"],"title":"UserMentionAttributes"}}},"required":["body","postId","isPrivate"],"title":"CreateCommentDto"}]}},"required":["comment"],"title":"CreateCommentBody"}}}},"responses":{"201":{"description":"Comment created","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"},"success":{"type":"boolean"}},"required":["comment","success"],"title":"CreateCommentResponse"}}}},"400":{"description":"Invalid comment - empty body or invalid postId"},"401":{"description":"User not authenticated"},"404":{"description":"Post or parent comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/comments","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"comment":{"body":"This is a thoughtful comment about the post","postId":123,"isPrivate":false,"parentId":456,"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}]}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a new comment","description":{"content":"Add a comment to a post or reply to an existing comment. Supports mentions and notifies the post author.","type":"text/plain"},"url":{"path":["v1","comments"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"CommentsController_create","description":"Add a comment to a post or reply to an existing comment. Supports mentions and notifies the post author.","parameters":[],"requestBody":{"required":true,"description":"Comment with postId and optional parentId","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"description":"Comment details for creation","allOf":[{"type":"object","properties":{"body":{"type":"string","description":"Comment body text","example":"This is a thoughtful comment about the post","maxLength":8000},"postId":{"type":"number","description":"ID of the post this comment belongs to","example":123},"isPrivate":{"type":"boolean","default":false,"description":"Whether the comment is private","example":false},"parentId":{"type":"number","description":"ID of the parent comment (for replies)","example":456},"mentions":{"description":"User mentions in the comment","type":"array","items":{"type":"object","properties":{"marker":{"type":"string","pattern":"/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/","example":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}"},"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["marker","userId","displayName"],"title":"UserMentionAttributes"}}},"required":["body","postId","isPrivate"],"title":"CreateCommentDto"}]}},"required":["comment"],"title":"CreateCommentBody"},"example":{"comment":{"body":"This is a thoughtful comment about the post","postId":123,"isPrivate":false,"parentId":456,"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}]}}}}},"responses":{"201":{"description":"Comment created","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"},"success":{"type":"boolean"}},"required":["comment","success"],"title":"CreateCommentResponse"},"example":{"comment":{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]},"success":true}}}},"400":{"description":"Invalid comment - empty body or invalid postId"},"401":{"description":"User not authenticated"},"404":{"description":"Post or parent comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/comments","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"comment":{"body":"This is a thoughtful comment about the post","postId":123,"isPrivate":false,"parentId":456,"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}]}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a new comment","description":{"content":"Add a comment to a post or reply to an existing comment. Supports mentions and notifies the post author.","type":"text/plain"},"url":{"path":["v1","comments"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ User mentions in the comment Comment created -
      Schema
        comment object required
        author object
        avatarUrls object required
        mentions object[]
      • Array [
      • avatarUrls object required
      • ]
      • tags object[]
      • Array [
      • ]
      +
      Schema
        comment object required
        author object
        avatarUrls object required
        mentions object[]
      • Array [
      • avatarUrls object required
      • ]
      • tags object[]
      • Array [
      • ]
      Invalid comment - empty body or invalid postId diff --git a/docs/user_related_apis_versioned/comments-controller-delete-comment.api.mdx b/docs/user_related_apis_versioned/comments-controller-delete-comment.api.mdx index 846128eb..2ad79cac 100644 --- a/docs/user_related_apis_versioned/comments-controller-delete-comment.api.mdx +++ b/docs/user_related_apis_versioned/comments-controller-delete-comment.api.mdx @@ -5,7 +5,7 @@ description: "Soft-delete a comment and its direct replies. Only the comment own sidebar_label: "Delete a comment" hide_title: true hide_table_of_contents: true -api: {"operationId":"CommentsController_deleteComment","description":"Soft-delete a comment and its direct replies. Only the comment owner, post owner, or admins can delete.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric comment ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Comment deleted","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean","example":true}}}}}},"400":{"description":"User not authorized to delete this comment"},"401":{"description":"User not authenticated"},"404":{"description":"The comment has already been deleted"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/comments/{id}/delete","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete a comment","description":{"content":"Soft-delete a comment and its direct replies. Only the comment owner, post owner, or admins can delete.","type":"text/plain"},"url":{"path":["v1","comments",":id","delete"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric comment ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"CommentsController_deleteComment","description":"Soft-delete a comment and its direct replies. Only the comment owner, post owner, or admins can delete.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric comment ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Comment deleted","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean","example":true}}},"example":{"removed":true}}}},"400":{"description":"User not authorized to delete this comment"},"401":{"description":"User not authenticated"},"404":{"description":"The comment has already been deleted"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/comments/{id}/delete","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete a comment","description":{"content":"Soft-delete a comment and its direct replies. Only the comment owner, post owner, or admins can delete.","type":"text/plain"},"url":{"path":["v1","comments",":id","delete"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric comment ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Soft-delete a comment and its direct replies. Only the comment owner, post owner Comment deleted -
      Schema
      +
      Schema
      User not authorized to delete this comment diff --git a/docs/user_related_apis_versioned/comments-controller-get.api.mdx b/docs/user_related_apis_versioned/comments-controller-get.api.mdx index 2041b539..bdacc1ac 100644 --- a/docs/user_related_apis_versioned/comments-controller-get.api.mdx +++ b/docs/user_related_apis_versioned/comments-controller-get.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve paginated replies (nested comments) for a parent comment sidebar_label: "Get replies to a comment" hide_title: true hide_table_of_contents: true -api: {"operationId":"CommentsController_get","description":"Retrieve paginated replies (nested comments) for a parent comment with author info.","parameters":[{"name":"id","required":true,"in":"path","description":"Parent comment ID","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"Comment replies with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}},"comment":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}},"required":["total","currentPage","limit","pages","replies","comment"],"title":"CommentRepliesResponse"}}}},"404":{"description":"Parent comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/comments/{id}/replies","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get replies to a comment","description":{"content":"Retrieve paginated replies (nested comments) for a parent comment with author info.","type":"text/plain"},"url":{"path":["v1","comments",":id","replies"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Number of results to return","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Parent comment ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"CommentsController_get","description":"Retrieve paginated replies (nested comments) for a parent comment with author info.","parameters":[{"name":"id","required":true,"in":"path","description":"Parent comment ID","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"Comment replies with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}},"comment":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}},"required":["total","currentPage","limit","pages","replies","comment"],"title":"CommentRepliesResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"replies":[{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]}],"comment":{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]}}}}},"404":{"description":"Parent comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/comments/{id}/replies","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get replies to a comment","description":{"content":"Retrieve paginated replies (nested comments) for a parent comment with author info.","type":"text/plain"},"url":{"path":["v1","comments",":id","replies"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Number of results to return","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Parent comment ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve paginated replies (nested comments) for a parent comment with author in Comment replies with pagination -
      Schema
        replies object[] required
      • Array [
      • author object
        avatarUrls object required
        mentions object[]
      • Array [
      • avatarUrls object required
      • ]
      • tags object[]
      • Array [
      • ]
      • ]
      • comment object required
        author object
        avatarUrls object required
        mentions object[]
      • Array [
      • avatarUrls object required
      • ]
      • tags object[]
      • Array [
      • ]
      +
      Schema
        replies object[] required
      • Array [
      • author object
        avatarUrls object required
        mentions object[]
      • Array [
      • avatarUrls object required
      • ]
      • tags object[]
      • Array [
      • ]
      • ]
      • comment object required
        author object
        avatarUrls object required
        mentions object[]
      • Array [
      • avatarUrls object required
      • ]
      • tags object[]
      • Array [
      • ]
      Parent comment not found diff --git a/docs/user_related_apis_versioned/comments-controller-toggle-like.api.mdx b/docs/user_related_apis_versioned/comments-controller-toggle-like.api.mdx index f2c86aa5..3c72b6f5 100644 --- a/docs/user_related_apis_versioned/comments-controller-toggle-like.api.mdx +++ b/docs/user_related_apis_versioned/comments-controller-toggle-like.api.mdx @@ -5,7 +5,7 @@ description: "Toggle like status. If liked, removes like. Notifies comment autho sidebar_label: "Toggle like/unlike a comment" hide_title: true hide_table_of_contents: true -api: {"operationId":"CommentsController_toggleLike","description":"Toggle like status. If liked, removes like. Notifies comment author on new likes.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric comment ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Like toggled","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true if liked, false if unliked"}}}}}},"401":{"description":"User not authenticated"},"404":{"description":"Comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/comments/{id}/toggle-like","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle like/unlike a comment","description":{"content":"Toggle like status. If liked, removes like. Notifies comment author on new likes.","type":"text/plain"},"url":{"path":["v1","comments",":id","toggle-like"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric comment ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"CommentsController_toggleLike","description":"Toggle like status. If liked, removes like. Notifies comment author on new likes.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric comment ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Like toggled","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true if liked, false if unliked"}}},"example":{"liked":true}}}},"401":{"description":"User not authenticated"},"404":{"description":"Comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/comments/{id}/toggle-like","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle like/unlike a comment","description":{"content":"Toggle like status. If liked, removes like. Notifies comment author on new likes.","type":"text/plain"},"url":{"path":["v1","comments",":id","toggle-like"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric comment ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Toggle like status. If liked, removes like. Notifies comment author on new likes Like toggled -
      Schema
      +
      Schema
      User not authenticated diff --git a/docs/user_related_apis_versioned/delete-collection-bookmark-by-id.api.mdx b/docs/user_related_apis_versioned/delete-collection-bookmark-by-id.api.mdx deleted file mode 100644 index d295ab7d..00000000 --- a/docs/user_related_apis_versioned/delete-collection-bookmark-by-id.api.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: delete-collection-bookmark-by-id -title: "Delete collection bookmark by id" -description: "Delete a bookmark from an existing collection by bookmark's id. When successfully deleted, the bookmark itself does not get deleted but rather only detached from the collection." -sidebar_label: "Delete collection bookmark by id" -hide_title: true -hide_table_of_contents: true -api: {"description":"Delete a bookmark from an existing collection by bookmark's id. When successfully deleted, the bookmark itself does not get deleted but rather only detached from the collection.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be deleted.","example":"cmmav11b5000a7e212dpa1dnn"},"required":true,"description":"The Id of the collection to be deleted."},{"in":"path","name":"bookmarkId","schema":{"type":"string","description":"The Id of the bookmark to be deleted.","example":"cmmav11b5000b7e21a1jd79vo"},"required":true,"description":"The Id of the bookmark to be deleted."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection bookmark deleted"]}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"delete","path":"/v1/collections/{collectionId}/bookmarks/{bookmarkId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete collection bookmark by id","description":{"content":"Delete a bookmark from an existing collection by bookmark's id. When successfully deleted, the bookmark itself does not get deleted but rather only detached from the collection.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId","bookmarks",":bookmarkId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The Id of the collection to be deleted.","type":"text/plain"},"type":"any","value":"","key":"collectionId"},{"disabled":false,"description":{"content":"(Required) The Id of the bookmark to be deleted.","type":"text/plain"},"type":"any","value":"","key":"bookmarkId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} -sidebar_class_name: "delete api-method" -info_path: docs/user_related_apis_versioned/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Delete collection bookmark by id - - - -Delete a bookmark from an existing collection by bookmark's id. When successfully deleted, the bookmark itself does not get deleted but rather only detached from the collection. - -
      Path Parameters
      - -Request has been handled successfully. - -
      Schema
        data object
      - -The request is missing required parameters or is invalid. - -
      Schema
      - -The request is unauthorized. - -
      Schema
      - -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
      - -Not Found. The resource being accessed does not exist. - -
      Schema
      - -Validation Error. The request includes one or more invalid params. Please check the request params and try again. - -
      Schema
      - -Too many requests, please try again later. - -
      Schema
      - -Server Error. Something went wrong, try again later. - -
      Schema
      - -Invalid response from the upstream server - -
      Schema
      - -The server is currently unable to handle the request due to a temporary overload or scheduled maintenance - -
      Schema
      - -The server did not receive a timely response from the upstream server. - -
      Schema
      - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/delete-note-by-id.api.mdx b/docs/user_related_apis_versioned/delete-note-by-id.api.mdx deleted file mode 100644 index 9eaa9e3b..00000000 --- a/docs/user_related_apis_versioned/delete-note-by-id.api.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: delete-note-by-id -title: "Delete note by ID" -description: "Delete a note by its ID." -sidebar_label: "Delete note by ID" -hide_title: true -hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Delete a note by its ID.","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The ID of the note to delete."},"required":true,"description":"The ID of the note to delete."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"success":{"type":"boolean"}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"delete","path":"/v1/notes/:noteId","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"}} -sidebar_class_name: "delete api-method" -info_path: docs/user_related_apis_versioned/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Delete note by ID - - - -Delete a note by its ID. - -
      Path Parameters
      - -Request has been handled successfully. - -
      Schema
        data object
      - -The request is missing required parameters or is invalid. - -
      Schema
      - -The request is unauthorized. - -
      Schema
      - -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
      - -Not Found. The resource being accessed does not exist. - -
      Schema
      - -Validation Error. The request includes one or more invalid params. Please check the request params and try again. - -
      Schema
      - -Too many requests, please try again later. - -
      Schema
      - -Server Error. Something went wrong, try again later. - -
      Schema
      - -Invalid response from the upstream server - -
      Schema
      - -The server is currently unable to handle the request due to a temporary overload or scheduled maintenance - -
      Schema
      - -The server did not receive a timely response from the upstream server. - -
      Schema
      - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-collection-items-by-id.api.mdx b/docs/user_related_apis_versioned/get-collection-items-by-id.api.mdx deleted file mode 100644 index ccd310eb..00000000 --- a/docs/user_related_apis_versioned/get-collection-items-by-id.api.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: get-collection-items-by-id -title: "Get collection items by id" -description: "Get all resources that belong to an existing collection by collection id." -sidebar_label: "Get collection items by id" -hide_title: true -hide_table_of_contents: true -api: {"description":"Get all resources that belong to an existing collection by collection id.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","example":"cmmav11d8000c7e211dux16dq"}},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyAdded","verseKey"],"description":"Sort the collection items either by the time they were added at descendingly or by Ayah key."},"description":"Sort the collection items either by the time they were added at descendingly or by Ayah key."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmmav10gp00007e218inaaqwg"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmmav10gq00017e21hhx26c71"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"collection":{"type":"object","properties":{"id":{"type":"string","example":"cmmav113800077e21b8bfgkgs"},"updatedAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"name":{"type":"string","example":"Woman in Quran"}},"required":["id","updatedAt","name"],"additionalProperties":false,"title":"Collection"},"bookmarks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"cmmav10y500057e21hjilhplh"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5},"group":{"type":"string"},"isInDefaultCollection":{"type":"boolean","example":true}},"required":["id","createdAt","type","key","isInDefaultCollection"],"additionalProperties":false,"title":"Bookmark"}}},"additionalProperties":false},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmmav10gq00027e21duag6muk"},"endCursor":{"type":"string","example":"cmmav10gq00037e21biib30ta"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/collections/{collectionId}","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get collection items by id","description":{"content":"Get all resources that belong to an existing collection by collection id.","type":"text/plain"},"url":{"path":["v1","collections",":collectionId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort the collection items either by the time they were added at descendingly or by Ayah key.","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched. Should be used together with `before`","type":"text/plain"},"key":"last","value":""},{"disabled":false,"description":{"content":"The number of items to be fetched.","type":"text/plain"},"key":"first","value":""},{"disabled":false,"description":{"content":"The cursor after which you want to get the next page of items. Should be used together with `first`","type":"text/plain"},"key":"after","value":""},{"disabled":false,"description":{"content":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","type":"text/plain"},"key":"before","value":""}],"variable":[{"disabled":false,"type":"any","value":"","key":"collectionId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} -sidebar_class_name: "get api-method" -info_path: docs/user_related_apis_versioned/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Get collection items by id - - - -Get all resources that belong to an existing collection by collection id. - -
      Path Parameters
      Query Parameters
      - -Request has been handled successfully. - -
      Schema
        data object
        collection object
        bookmarks object[]
      • Array [
      • ]
      • pagination object
      - -The request is missing required parameters or is invalid. - -
      Schema
      - -The request is unauthorized. - -
      Schema
      - -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
      - -Not Found. The resource being accessed does not exist. - -
      Schema
      - -Validation Error. The request includes one or more invalid params. Please check the request params and try again. - -
      Schema
      - -Too many requests, please try again later. - -
      Schema
      - -Server Error. Something went wrong, try again later. - -
      Schema
      - -Invalid response from the upstream server - -
      Schema
      - -The server is currently unable to handle the request due to a temporary overload or scheduled maintenance - -
      Schema
      - -The server did not receive a timely response from the upstream server. - -
      Schema
      - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-current-streak-days.api.mdx b/docs/user_related_apis_versioned/get-current-streak-days.api.mdx deleted file mode 100644 index 0dbbcf1f..00000000 --- a/docs/user_related_apis_versioned/get-current-streak-days.api.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: get-current-streak-days -title: "Get current streak days" -description: "Get current active streak days." -sidebar_label: "Get current streak days" -hide_title: true -hide_table_of_contents: true -api: {"description":"Get current active streak days.","tags":["Streaks"],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN"],"description":"The type of the streak","example":"QURAN"},"required":true,"description":"The type of the streak"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"days":{"type":"integer","description":"The number of days the current streak is active for.","example":5}},"required":["days"],"additionalProperties":false}}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/streaks/current-streak-days","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get current streak days","description":{"content":"Get current active streak days.","type":"text/plain"},"url":{"path":["v1","streaks","current-streak-days"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The type of the streak","type":"text/plain"},"key":"type","value":""}],"variable":[]},"header":[{"disabled":false,"description":{"content":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","type":"text/plain"},"key":"x-timezone","value":""},{"key":"Accept","value":"application/json"}],"method":"GET"}} -sidebar_class_name: "get api-method" -info_path: docs/user_related_apis_versioned/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Get current streak days - - - -Get current active streak days. - -
      Query Parameters
      Header Parameters
      - -Request has been handled successfully. - -
      Schema
        data object[]
      • Array [
      • ]
      - -The request is missing required parameters or is invalid. - -
      Schema
      - -The request is unauthorized. - -
      Schema
      - -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
      - -Not Found. The resource being accessed does not exist. - -
      Schema
      - -Validation Error. The request includes one or more invalid params. Please check the request params and try again. - -
      Schema
      - -Too many requests, please try again later. - -
      Schema
      - -Server Error. Something went wrong, try again later. - -
      Schema
      - -Invalid response from the upstream server - -
      Schema
      - -The server is currently unable to handle the request due to a temporary overload or scheduled maintenance - -
      Schema
      - -The server did not receive a timely response from the upstream server. - -
      Schema
      - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/get-mutations.api.mdx b/docs/user_related_apis_versioned/get-mutations.api.mdx new file mode 100644 index 00000000..21dfa15b --- /dev/null +++ b/docs/user_related_apis_versioned/get-mutations.api.mdx @@ -0,0 +1,95 @@ +--- +id: get-mutations +title: "Get mutations" +description: "Get list of mutations that were applied to resources after a certain point in time." +sidebar_label: "Get mutations" +hide_title: true +hide_table_of_contents: true +api: {"description":"Get list of mutations that were applied to resources after a certain point in time.","tags":["Sync"],"parameters":[{"in":"query","name":"mutationsSince","schema":{"type":"number","format":"float","description":"The timestamp to get mutations since.","example":1731636500303},"required":true,"description":"The timestamp to get mutations since."},{"in":"query","name":"resources","schema":{"type":"string","description":"Comma-separated list of resources to filter mutations by (e.g. \"BOOKMARK,COLLECTION,COLLECTION_BOOKMARK,NOTE\"). If not provided, all accessible resources will be returned.","example":"BOOKMARK,COLLECTION,COLLECTION_BOOKMARK"},"required":false,"description":"Comma-separated list of resources to filter mutations by (e.g. \"BOOKMARK,COLLECTION,COLLECTION_BOOKMARK,NOTE\"). If not provided, all accessible resources will be returned."},{"in":"query","name":"metadataOnly","schema":{"type":"boolean","description":"When true, returns only the lastMutationAt timestamp without fetching actual mutations. This is significantly faster (single DB query vs multiple joins) and ideal for: 1) Checking if new data exists before performing a full sync, 2) Implementing periodic background polling to detect changes, 3) Recovering the current lastMutationAt if the client missed the X-Mutation-At header from a previous successful mutation response. Response will only contain { lastMutationAt: number }.","example":true,"default":false},"required":false,"description":"When true, returns only the lastMutationAt timestamp without fetching actual mutations. This is significantly faster (single DB query vs multiple joins) and ideal for: 1) Checking if new data exists before performing a full sync, 2) Implementing periodic background polling to detect changes, 3) Recovering the current lastMutationAt if the client missed the X-Mutation-At header from a previous successful mutation response. Response will only contain { lastMutationAt: number }."},{"in":"query","name":"limit","schema":{"type":"number","format":"float","minimum":1,"maximum":1000,"description":"Maximum number of mutations to return per page (1-1000).","example":100,"default":100},"required":false,"description":"Maximum number of mutations to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"number","format":"float","minimum":1,"description":"Page number (1-based).","example":1,"default":1},"required":false,"description":"Page number (1-based)."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"mutations":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CREATE","UPDATE","DELETE"],"description":"The type of the mutation","example":"CREATE"},"resource":{"type":"string","enum":["BOOKMARK","COLLECTION","COLLECTION_BOOKMARK","NOTE"],"description":"The resource the mutation was applied to.","example":"BOOKMARK"},"resourceId":{"type":"string","description":"The id of the resource the mutation was applied to. Will not be present for resources that use composite keys (e.g. COLLECTION_BOOKMARK uses data.collection and data.bookmark instead).","example":"lqc794i0qnxq4pdlfanfbd2r"},"data":{"type":"object","properties":{},"description":"The latest version of the data of the resource that was mutated. Will be empty when the mutation is a delete.","example":{"bookmarkType":"ayah","bookmarkGroup":"verses_6236","key":6,"verseNumber":3}},"timestamp":{"type":"number","format":"float","description":"Unix timestamp when the latest mutation of the resource occurred","example":1731636500303}},"required":["type","resource","timestamp"],"additionalProperties":false,"description":"Represents a single mutation/change to a resource"},"description":"Array of mutations that occurred after lastMutationAt. Will be omitted when metadataOnly is set to true.","example":[{"type":"CREATE","resource":"BOOKMARK","resourceId":"u54maufl0ftmarp73ei0hg64","data":{"bookmarkType":"ayah","bookmarkGroup":"verses_6236","key":6,"verseNumber":3},"timestamp":1769340915572},{"type":"UPDATE","resource":"COLLECTION","resourceId":"na6orcv0pbcomiphmkv0yhma","data":{"name":"New collection!","slug":"new-collection","isPrivate":true},"timestamp":1769340915572},{"type":"CREATE","resource":"COLLECTION_BOOKMARK","data":{"collection":"na6orcv0pbcomiphmkv0yhma","bookmark":"u54maufl0ftmarp73ei0hg64"},"timestamp":1769340915575},{"type":"DELETE","resource":"NOTE","resourceId":"his2lubkxxr3l102nqptmnur","data":{},"timestamp":1769341113173}]},"page":{"type":"number","format":"float","description":"Current page number","example":1},"limit":{"type":"number","format":"float","description":"Items per page","example":100},"total":{"type":"number","format":"float","description":"Total number of mutations","example":150},"hasMore":{"type":"boolean","description":"Whether more pages exist","example":true},"lastMutationAt":{"type":"number","format":"float","description":"Timestamp of the latest mutation. This should be used for subsequent sync requests. If metadataOnly is true, this will be the only field returned.","example":1731636500303}},"required":["lastMutationAt"],"additionalProperties":false,"description":"Response schema for get mutations endpoint"}},"additionalProperties":false}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"get","path":"/v1/sync","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get mutations","description":{"content":"Get list of mutations that were applied to resources after a certain point in time.","type":"text/plain"},"url":{"path":["v1","sync"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp to get mutations since.","type":"text/plain"},"key":"mutationsSince","value":""},{"disabled":false,"description":{"content":"Comma-separated list of resources to filter mutations by (e.g. \"BOOKMARK,COLLECTION,COLLECTION_BOOKMARK,NOTE\"). If not provided, all accessible resources will be returned.","type":"text/plain"},"key":"resources","value":""},{"disabled":false,"description":{"content":"When true, returns only the lastMutationAt timestamp without fetching actual mutations. This is significantly faster (single DB query vs multiple joins) and ideal for: 1) Checking if new data exists before performing a full sync, 2) Implementing periodic background polling to detect changes, 3) Recovering the current lastMutationAt if the client missed the X-Mutation-At header from a previous successful mutation response. Response will only contain { lastMutationAt: number }.","type":"text/plain"},"key":"metadataOnly","value":""},{"disabled":false,"description":{"content":"Maximum number of mutations to return per page (1-1000).","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (1-based).","type":"text/plain"},"key":"page","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +sidebar_class_name: "get api-method" +info_path: docs/user_related_apis_versioned/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Get mutations + + + +Get list of mutations that were applied to resources after a certain point in time. + +
      Query Parameters
      + +Request has been handled successfully. + +
      Response Headers
      • X-Mutation-At string
        + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
      Schema
        data object
        + +Response schema for get mutations endpoint + +
        mutations object[]
        + +Array of mutations that occurred after lastMutationAt. Will be omitted when metadataOnly is set to true. + +
      • Array [
      • data object
        + +The latest version of the data of the resource that was mutated. Will be empty when the mutation is a delete. + +
      • ]
      + +The request is missing required parameters or is invalid. + +
      Schema
      + +The request is unauthorized. + +
      Schema
      + +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
      + +Not Found. The resource being accessed does not exist. + +
      Schema
      + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
      Schema
        error object
      + +Validation Error. The request includes one or more invalid params. Please check the request params and try again. + +
      Schema
      + +Too many requests, please try again later. + +
      Schema
      + +Server Error. Something went wrong, try again later. + +
      Schema
      + +Invalid response from the upstream server + +
      Schema
      + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
      Schema
      + +The server did not receive a timely response from the upstream server. + +
      Schema
      + \ No newline at end of file diff --git a/docs/user_related_apis_versioned/posts-controller-create.api.mdx b/docs/user_related_apis_versioned/posts-controller-create.api.mdx index e87c4544..f2f07010 100644 --- a/docs/user_related_apis_versioned/posts-controller-create.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-create.api.mdx @@ -5,7 +5,7 @@ description: "Create a new post (reflection) with Quran references. Posts can be sidebar_label: "Create post" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_create","description":"Create a new post (reflection) with Quran references. Posts can be public, drafts, or associated with a room (group/page). Supports user mentions and multiple Quran verse references. Minimum body length is 6 characters.","parameters":[],"requestBody":{"required":true,"description":"Post creation payload containing the post object with body, references, mentions, and visibility settings","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"roomPostStatus":{"enum":[0,1,2],"type":"number","description":"The room post status, defaults to publicly: 1. As Room: 0, Publicly: 1, Only Members: 2"},"body":{"type":"string","minLength":6},"draft":{"type":"boolean"},"references":{"type":"array","items":{"type":"object","properties":{"chapterId":{"type":"number","minimum":1},"from":{"type":"number","default":0},"to":{"type":"number","default":0}},"required":["chapterId","from","to"],"title":"ReferenceAttributes"}},"mentions":{"type":"array","items":{"type":"object","properties":{"marker":{"type":"string","pattern":"/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/","example":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}"},"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["marker","userId","displayName"],"title":"UserMentionAttributes"}},"roomId":{"type":"number"},"postAsAuthorId":{"type":"string"},"publishedAt":{"format":"date-time","type":"string"}},"required":["roomPostStatus","body","draft","references","mentions","roomId","postAsAuthorId","publishedAt"],"title":"CreatePostDto"}},"required":["post"],"title":"CreatePostBodyDto"}}}},"responses":{"201":{"description":"Post created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"},"success":{"type":"boolean"}},"required":["post","success"],"title":"PostCreatedResponse"}}}},"400":{"description":"Invalid post data - body too short, invalid references, or invalid room post status"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"post":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":0,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":0,"postAsAuthorId":"string","publishedAt":"2026-03-29T20:06:48.634Z"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create post","description":{"content":"Create a new post (reflection) with Quran references. Posts can be public, drafts, or associated with a room (group/page). Supports user mentions and multiple Quran verse references. Minimum body length is 6 characters.","type":"text/plain"},"url":{"path":["v1","posts"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"PostsController_create","description":"Create a new post (reflection) with Quran references. Posts can be public, drafts, or associated with a room (group/page). Supports user mentions and multiple Quran verse references. Minimum body length is 6 characters.","parameters":[],"requestBody":{"required":true,"description":"Post creation payload containing the post object with body, references, mentions, and visibility settings","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"roomPostStatus":{"enum":[0,1,2],"type":"number","description":"The room post status, defaults to publicly: 1. As Room: 0, Publicly: 1, Only Members: 2"},"body":{"type":"string","minLength":6},"draft":{"type":"boolean"},"references":{"type":"array","items":{"type":"object","properties":{"chapterId":{"type":"number","minimum":1},"from":{"type":"number","default":0},"to":{"type":"number","default":0}},"required":["chapterId","from","to"],"title":"ReferenceAttributes"}},"mentions":{"type":"array","items":{"type":"object","properties":{"marker":{"type":"string","pattern":"/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/","example":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}"},"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["marker","userId","displayName"],"title":"UserMentionAttributes"}},"roomId":{"type":"number"},"postAsAuthorId":{"type":"string"},"publishedAt":{"format":"date-time","type":"string"}},"required":["roomPostStatus","body","draft","references","mentions","roomId","postAsAuthorId","publishedAt"],"title":"CreatePostDto"}},"required":["post"],"title":"CreatePostBodyDto"},"example":{"post":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":1,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":1,"postAsAuthorId":"string","publishedAt":"2026-04-02T00:00:00.000Z"}}}}},"responses":{"201":{"description":"Post created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"},"success":{"type":"boolean"}},"required":["data","success"],"title":"PostCreatedResponse"},"example":{"data":{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"},"success":true}}}},"400":{"description":"Invalid post data - body too short, invalid references, or invalid room post status"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"post":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":0,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":0,"postAsAuthorId":"string","publishedAt":"2026-04-23T07:01:53.437Z"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create post","description":{"content":"Create a new post (reflection) with Quran references. Posts can be public, drafts, or associated with a room (group/page). Supports user mentions and multiple Quran verse references. Minimum body length is 6 characters.","type":"text/plain"},"url":{"path":["v1","posts"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Post creation payload containing the post object with body, references, mentions Post created successfully -
      Schema
        post object required
        tags object[]
      • Array [
      • ]
      • references object[]
      • Array [
      • ]
      • recentComment object
        author object required
        avatarUrls object required
        room object nullable
        mentions object[]
      • Array [
      • avatarUrls object required
      • ]
      +
      Schema
        data object required
        tags object[]
      • Array [
      • ]
      • references object[]
      • Array [
      • ]
      • recentComment object
        author object required
        avatarUrls object required
        room object nullable
        mentions object[]
      • Array [
      • avatarUrls object required
      • ]
      Invalid post data - body too short, invalid references, or invalid room post status diff --git a/docs/user_related_apis_versioned/posts-controller-delete.api.mdx b/docs/user_related_apis_versioned/posts-controller-delete.api.mdx index 28449cc1..42c36b1a 100644 --- a/docs/user_related_apis_versioned/posts-controller-delete.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-delete.api.mdx @@ -5,7 +5,7 @@ description: "Soft-delete a post by marking it as removed. Only the post author sidebar_label: "Delete post" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_delete","description":"Soft-delete a post by marking it as removed. Only the post author or admins can delete posts. Related engagement counts (likes, comments, saves) update asynchronously via background jobs, so metrics may briefly lag.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to delete","schema":{"type":"number"}}],"responses":{"200":{"description":"Post deletion accepted and queued for processing","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to delete this post"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"delete","path":"/v1/posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete post","description":{"content":"Soft-delete a post by marking it as removed. Only the post author or admins can delete posts. Related engagement counts (likes, comments, saves) update asynchronously via background jobs, so metrics may briefly lag.","type":"text/plain"},"url":{"path":["v1","posts",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to delete","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +api: {"operationId":"PostsController_delete","description":"Soft-delete a post by marking it as removed. Only the post author or admins can delete posts. Related engagement counts (likes, comments, saves) update asynchronously via background jobs, so metrics may briefly lag.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to delete","schema":{"type":"number"}}],"responses":{"200":{"description":"Post deletion accepted and queued for processing","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}},"example":{"success":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to delete this post"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"delete","path":"/v1/posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete post","description":{"content":"Soft-delete a post by marking it as removed. Only the post author or admins can delete posts. Related engagement counts (likes, comments, saves) update asynchronously via background jobs, so metrics may briefly lag.","type":"text/plain"},"url":{"path":["v1","posts",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to delete","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Soft-delete a post by marking it as removed. Only the post author or admins can Post deletion accepted and queued for processing -
      Schema
      +
      Schema
      User not authenticated diff --git a/docs/user_related_apis_versioned/posts-controller-edit.api.mdx b/docs/user_related_apis_versioned/posts-controller-edit.api.mdx index 913ce910..87a8b8e4 100644 --- a/docs/user_related_apis_versioned/posts-controller-edit.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-edit.api.mdx @@ -5,7 +5,7 @@ description: "Update an existing post. Only the post author or admins can edit. sidebar_label: "Edit post" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_edit","description":"Update an existing post. Only the post author or admins can edit. Supports updating body, references, mentions, draft status, and room visibility settings.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to update","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Partial post data to update - only include fields to change","content":{"application/json":{"schema":{"type":"object","properties":{"roomPostStatus":{"enum":[0,1,2],"type":"number","description":"The room post status, defaults to publicly: 1. As Room: 0, Publicly: 1, Only Members: 2"},"body":{"type":"string","minLength":6},"draft":{"type":"boolean"},"references":{"type":"array","items":{"type":"object","properties":{"chapterId":{"type":"number","minimum":1},"from":{"type":"number","default":0},"to":{"type":"number","default":0}},"required":["chapterId","from","to"],"title":"ReferenceAttributes"}},"mentions":{"type":"array","items":{"type":"object","properties":{"marker":{"type":"string","pattern":"/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/","example":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}"},"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["marker","userId","displayName"],"title":"UserMentionAttributes"}},"roomId":{"type":"number"},"postAsAuthorId":{"type":"string"},"publishedAt":{"format":"date-time","type":"string"}},"title":"UpdatePostDto"}}}},"responses":{"200":{"description":"Post updated successfully with the updated post data","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"},"success":{"type":"boolean"}},"required":["post","success"],"title":"PostCreatedResponse"}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to edit this post"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":0,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":0,"postAsAuthorId":"string","publishedAt":"2026-03-29T20:06:48.634Z"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Edit post","description":{"content":"Update an existing post. Only the post author or admins can edit. Supports updating body, references, mentions, draft status, and room visibility settings.","type":"text/plain"},"url":{"path":["v1","posts",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to update","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"PostsController_edit","description":"Update an existing post. Only the post author or admins can edit. Supports updating body, references, mentions, draft status, and room visibility settings.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to update","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Partial post data to update - only include fields to change","content":{"application/json":{"schema":{"type":"object","properties":{"roomPostStatus":{"enum":[0,1,2],"type":"number","description":"The room post status, defaults to publicly: 1. As Room: 0, Publicly: 1, Only Members: 2"},"body":{"type":"string","minLength":6},"draft":{"type":"boolean"},"references":{"type":"array","items":{"type":"object","properties":{"chapterId":{"type":"number","minimum":1},"from":{"type":"number","default":0},"to":{"type":"number","default":0}},"required":["chapterId","from","to"],"title":"ReferenceAttributes"}},"mentions":{"type":"array","items":{"type":"object","properties":{"marker":{"type":"string","pattern":"/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/","example":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}"},"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["marker","userId","displayName"],"title":"UserMentionAttributes"}},"roomId":{"type":"number"},"postAsAuthorId":{"type":"string"},"publishedAt":{"format":"date-time","type":"string"}},"title":"UpdatePostDto"},"example":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":1,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":1,"postAsAuthorId":"string","publishedAt":"2026-04-02T00:00:00.000Z"}}}},"responses":{"200":{"description":"Post updated successfully with the updated post data","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"},"success":{"type":"boolean"}},"required":["data","success"],"title":"PostCreatedResponse"},"example":{"data":{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"},"success":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to edit this post"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":0,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":0,"postAsAuthorId":"string","publishedAt":"2026-04-23T07:01:53.436Z"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Edit post","description":{"content":"Update an existing post. Only the post author or admins can edit. Supports updating body, references, mentions, draft status, and room visibility settings.","type":"text/plain"},"url":{"path":["v1","posts",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to update","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "patch api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Partial post data to update - only include fields to change Post updated successfully with the updated post data -
      Schema
        post object required
        tags object[]
      • Array [
      • ]
      • references object[]
      • Array [
      • ]
      • recentComment object
        author object required
        avatarUrls object required
        room object nullable
        mentions object[]
      • Array [
      • avatarUrls object required
      • ]
      +
      Schema
        data object required
        tags object[]
      • Array [
      • ]
      • references object[]
      • Array [
      • ]
      • recentComment object
        author object required
        avatarUrls object required
        room object nullable
        mentions object[]
      • Array [
      • avatarUrls object required
      • ]
      User not authenticated diff --git a/docs/user_related_apis_versioned/posts-controller-export-multiple-posts.api.mdx b/docs/user_related_apis_versioned/posts-controller-export-multiple-posts.api.mdx index 18a4a22b..4ca769f4 100644 --- a/docs/user_related_apis_versioned/posts-controller-export-multiple-posts.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-export-multiple-posts.api.mdx @@ -5,7 +5,7 @@ description: "Generate a downloadable PDF document containing selected posts wit sidebar_label: "Export posts as PDF" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_exportMultiplePosts","description":"Generate a downloadable PDF document containing selected posts with their full content, Quran references, and author information. Ayah translations are rendered according to user language preferences.","parameters":[],"requestBody":{"required":true,"description":"Array of post IDs to include in the PDF export (minimum 1)","content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"description":"Array of post IDs to export","example":[1,2,3],"minItems":1,"type":"array","items":{"type":"number"}}},"required":["ids"],"title":"ExportPostsDto"}}}},"responses":{"200":{"description":"PDF file generated and returned as binary attachment","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request - empty or invalid post IDs array"},"401":{"description":"User not authenticated"},"404":{"description":"No accessible posts found for the given IDs"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/export/pdf","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"ids":[1,2,3]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Export posts as PDF","description":{"content":"Generate a downloadable PDF document containing selected posts with their full content, Quran references, and author information. Ayah translations are rendered according to user language preferences.","type":"text/plain"},"url":{"path":["v1","posts","export","pdf"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/pdf"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"PostsController_exportMultiplePosts","description":"Generate a downloadable PDF document containing selected posts with their full content, Quran references, and author information. Ayah translations are rendered according to user language preferences.","parameters":[],"requestBody":{"required":true,"description":"Array of post IDs to include in the PDF export (minimum 1)","content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"description":"Array of post IDs to export","example":[1,2,3],"minItems":1,"type":"array","items":{"type":"number"}}},"required":["ids"],"title":"ExportPostsDto"},"example":{"ids":[1,2,3]}}}},"responses":{"200":{"description":"PDF file generated and returned as binary attachment","content":{"application/pdf":{"schema":{"type":"string","format":"binary"},"example":"string"}}},"400":{"description":"Invalid request - empty or invalid post IDs array"},"401":{"description":"User not authenticated"},"404":{"description":"No accessible posts found for the given IDs"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/export/pdf","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"ids":[1,2,3]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Export posts as PDF","description":{"content":"Generate a downloadable PDF document containing selected posts with their full content, Quran references, and author information. Ayah translations are rendered according to user language preferences.","type":"text/plain"},"url":{"path":["v1","posts","export","pdf"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/pdf"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -39,7 +39,7 @@ PDF file generated and returned as binary attachment string -
    +
    Invalid request - empty or invalid post IDs array diff --git a/docs/user_related_apis_versioned/posts-controller-feed.api.mdx b/docs/user_related_apis_versioned/posts-controller-feed.api.mdx index e3d0cccb..69895c08 100644 --- a/docs/user_related_apis_versioned/posts-controller-feed.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-feed.api.mdx @@ -1,11 +1,11 @@ --- id: posts-controller-feed title: "Get posts feed" -description: "Retrieve a paginated feed of posts (reflections). Supports filtering by authors, tags, Quran references, groups, pages, and post types. Results can be filtered by language preferences from user settings or query parameters." +description: "Retrieve a paginated feed of Quran Reflect posts, including reflections and lessons. Supports filtering by authors, tags, Quran references, groups, pages, and post types. Response items include engagement metadata such as `likesCount`, `commentsCount`, and `recentComment` when available. Use the dedicated comment endpoints to retrieve comment objects and totals. For ayah-by-ayah reads, use `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`, and use `filter[postTypeIds]=1` for reflections or `filter[postTypeIds]=2` for lessons." sidebar_label: "Get posts feed" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_feed","description":"Retrieve a paginated feed of posts (reflections). Supports filtering by authors, tags, Quran references, groups, pages, and post types. Results can be filtered by language preferences from user settings or query parameters.","parameters":[{"name":"tab","required":false,"in":"query","description":"Feed tab type. feed shows personalized content, trending shows explore, following shows posts from followed users.","schema":{"enum":["newest","latest","following","draft","favorite","most_popular","only_room_members","public","feed","trending","popular"],"type":"string"}},{"name":"languages","required":false,"in":"query","description":"Array of language IDs to filter posts by reflection language","schema":{"type":"array","items":{"type":"number"}}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20)","schema":{"minimum":1,"default":20,"type":"number"}},{"required":false,"name":"authors","in":"query","schema":{"type":"array","items":{"type":"string"}}},{"required":false,"name":"tags","in":"query","schema":{"type":"array","items":{"type":"string"}}},{"required":false,"name":"references","in":"query","schema":{"type":"array","items":{"type":"object","properties":{"chapterId":{"type":"number","minimum":1},"from":{"type":"number","default":0},"to":{"type":"number","default":0}},"required":["chapterId","from","to"],"title":"ReferenceAttributes"}}},{"required":false,"name":"groups","in":"query","schema":{"type":"array","items":{"type":"string"}}},{"required":false,"name":"pages","in":"query","schema":{"type":"array","items":{"type":"string"}}},{"required":false,"name":"postTypeIds","in":"query","schema":{"type":"array","items":{"type":"number"}}},{"required":false,"name":"tagsOperator","in":"query","schema":{"enum":["OR","AND"],"type":"string"}},{"required":false,"name":"referencesOperator","in":"query","schema":{"enum":["OR","AND"],"type":"string"}},{"required":false,"name":"verifiedOnly","in":"query","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"description":"Feed retrieved successfully with paginated posts","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/feed","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get posts feed","description":{"content":"Retrieve a paginated feed of posts (reflections). Supports filtering by authors, tags, Quran references, groups, pages, and post types. Results can be filtered by language preferences from user settings or query parameters.","type":"text/plain"},"url":{"path":["v1","posts","feed"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Feed tab type. feed shows personalized content, trending shows explore, following shows posts from followed users.","type":"text/plain"},"key":"tab","value":""},{"disabled":false,"description":{"content":"Array of language IDs to filter posts by reflection language","type":"text/plain"},"key":"languages","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Number of posts per page (default: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"key":"authors","value":""},{"disabled":false,"key":"tags","value":""},{"disabled":false,"key":"references","value":""},{"disabled":false,"key":"groups","value":""},{"disabled":false,"key":"pages","value":""},{"disabled":false,"key":"postTypeIds","value":""},{"disabled":false,"key":"tagsOperator","value":""},{"disabled":false,"key":"referencesOperator","value":""},{"disabled":false,"key":"verifiedOnly","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_feed","description":"Retrieve a paginated feed of Quran Reflect posts, including reflections and lessons. Supports filtering by authors, tags, Quran references, groups, pages, and post types. Response items include engagement metadata such as `likesCount`, `commentsCount`, and `recentComment` when available. Use the dedicated comment endpoints to retrieve comment objects and totals. For ayah-by-ayah reads, use `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`, and use `filter[postTypeIds]=1` for reflections or `filter[postTypeIds]=2` for lessons.","parameters":[{"name":"tab","required":false,"in":"query","description":"Feed tab type. `feed` shows personalized content, `trending` shows explore, and `following` shows posts from followed users.","schema":{"type":"string","enum":["newest","latest","following","draft","favorite","most_popular","only_room_members","public","feed","trending","popular"]}},{"name":"languages","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of language IDs to filter posts by reflection language, for example `languages=1,2`.","schema":{"type":"array","items":{"type":"number"},"example":[1,2]}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1).","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20).","schema":{"minimum":1,"default":20,"type":"number"}},{"name":"filter[verifiedOnly]","required":false,"in":"query","description":"Whether to limit the feed to verified contributors. Public ayah-by-ayah reads typically combine this with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.","schema":{"type":"boolean","default":false,"example":true}},{"name":"filter[referencesOperator]","required":false,"in":"query","description":"Operator applied to multiple Quran reference filters.","schema":{"type":"string","enum":["OR","AND"]}},{"name":"filter[tagsOperator]","required":false,"in":"query","description":"Operator applied to multiple tag filters.","schema":{"type":"string","enum":["OR","AND"]}},{"name":"filter[postTypeIds]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated Quran Reflect post type IDs. Use `1` for reflections and `2` for lessons.","schema":{"type":"array","items":{"type":"number"},"example":[1,2]}},{"name":"filter[pages]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of page subdomains to include.","schema":{"type":"array","items":{"type":"string"},"example":["quran-reflections","khutbahapp"]}},{"name":"filter[groups]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of group URLs to include.","schema":{"type":"array","items":{"type":"string"},"example":["my-group","ramadan-circle"]}},{"name":"filter[references][0][to]","required":false,"in":"query","description":"Ending ayah number for reference filter index `0`. For a single ayah, use the same value as `from`.","schema":{"type":"number","minimum":1,"example":255}},{"name":"filter[references][0][from]","required":false,"in":"query","description":"Starting ayah number for reference filter index `0`. Pair with the matching `chapterId` and `to` values.","schema":{"type":"number","minimum":1,"example":255}},{"name":"filter[references][0][chapterId]","required":false,"in":"query","description":"Reference filter example for index `0`. Use additional indices such as `filter[references][1][chapterId]` for more references.","schema":{"type":"number","minimum":1,"example":2}},{"name":"filter[tags]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of tag values to include.","schema":{"type":"array","items":{"type":"string"},"example":["ramadan","patience"]}},{"name":"filter[authors]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of author identifiers to include.","schema":{"type":"array","items":{"type":"string"},"example":["user-1","user-2"]}}],"responses":{"200":{"description":"Feed retrieved successfully with paginated posts","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/feed","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get posts feed","description":{"content":"Retrieve a paginated feed of Quran Reflect posts, including reflections and lessons. Supports filtering by authors, tags, Quran references, groups, pages, and post types. Response items include engagement metadata such as `likesCount`, `commentsCount`, and `recentComment` when available. Use the dedicated comment endpoints to retrieve comment objects and totals. For ayah-by-ayah reads, use `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`, and use `filter[postTypeIds]=1` for reflections or `filter[postTypeIds]=2` for lessons.","type":"text/plain"},"url":{"path":["v1","posts","feed"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Feed tab type. `feed` shows personalized content, `trending` shows explore, and `following` shows posts from followed users.","type":"text/plain"},"key":"tab","value":""},{"disabled":false,"description":{"content":"Comma-separated list of language IDs to filter posts by reflection language, for example `languages=1,2`.","type":"text/plain"},"key":"languages","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1).","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Number of posts per page (default: 20).","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Whether to limit the feed to verified contributors. Public ayah-by-ayah reads typically combine this with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.","type":"text/plain"},"key":"filter[verifiedOnly]","value":""},{"disabled":false,"description":{"content":"Operator applied to multiple Quran reference filters.","type":"text/plain"},"key":"filter[referencesOperator]","value":""},{"disabled":false,"description":{"content":"Operator applied to multiple tag filters.","type":"text/plain"},"key":"filter[tagsOperator]","value":""},{"disabled":false,"description":{"content":"Comma-separated Quran Reflect post type IDs. Use `1` for reflections and `2` for lessons.","type":"text/plain"},"key":"filter[postTypeIds]","value":""},{"disabled":false,"description":{"content":"Comma-separated list of page subdomains to include.","type":"text/plain"},"key":"filter[pages]","value":""},{"disabled":false,"description":{"content":"Comma-separated list of group URLs to include.","type":"text/plain"},"key":"filter[groups]","value":""},{"disabled":false,"description":{"content":"Ending ayah number for reference filter index `0`. For a single ayah, use the same value as `from`.","type":"text/plain"},"key":"filter[references][0][to]","value":""},{"disabled":false,"description":{"content":"Starting ayah number for reference filter index `0`. Pair with the matching `chapterId` and `to` values.","type":"text/plain"},"key":"filter[references][0][from]","value":""},{"disabled":false,"description":{"content":"Reference filter example for index `0`. Use additional indices such as `filter[references][1][chapterId]` for more references.","type":"text/plain"},"key":"filter[references][0][chapterId]","value":""},{"disabled":false,"description":{"content":"Comma-separated list of tag values to include.","type":"text/plain"},"key":"filter[tags]","value":""},{"disabled":false,"description":{"content":"Comma-separated list of author identifiers to include.","type":"text/plain"},"key":"filter[authors]","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -25,11 +25,11 @@ import TabItem from "@theme/TabItem"; -Retrieve a paginated feed of posts (reflections). Supports filtering by authors, tags, Quran references, groups, pages, and post types. Results can be filtered by language preferences from user settings or query parameters. +Retrieve a paginated feed of Quran Reflect posts, including reflections and lessons. Supports filtering by authors, tags, Quran references, groups, pages, and post types. Response items include engagement metadata such as `likesCount`, `commentsCount`, and `recentComment` when available. Use the dedicated comment endpoints to retrieve comment objects and totals. For ayah-by-ayah reads, use `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`, and use `filter[postTypeIds]=1` for reflections or `filter[postTypeIds]=2` for lessons. -
    Query Parameters
    +
    Query Parameters
    Feed retrieved successfully with paginated posts -
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    +
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    \ No newline at end of file diff --git a/docs/user_related_apis_versioned/posts-controller-find-one.api.mdx b/docs/user_related_apis_versioned/posts-controller-find-one.api.mdx index c78715b0..480fa0ae 100644 --- a/docs/user_related_apis_versioned/posts-controller-find-one.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-find-one.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve a specific post by its unique numeric ID. Returns the ful sidebar_label: "Get post by ID" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_findOne","description":"Retrieve a specific post by its unique numeric ID. Returns the full post with author details, tags, references, room information, and engagement metrics. Admins can view additional moderation details.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Post found and returned with all associated data","content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}}},"404":{"description":"Post not found or has been deleted"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get post by ID","description":{"content":"Retrieve a specific post by its unique numeric ID. Returns the full post with author details, tags, references, room information, and engagement metrics. Admins can view additional moderation details.","type":"text/plain"},"url":{"path":["v1","posts",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_findOne","description":"Retrieve a specific post by its unique numeric ID. Returns the full post with author details, tags, references, room information, and engagement metrics. Admins can view additional moderation details.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Post found and returned with all associated data","content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"},"example":{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}}}},"404":{"description":"Post not found or has been deleted"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get post by ID","description":{"content":"Retrieve a specific post by its unique numeric ID. Returns the full post with author details, tags, references, room information, and engagement metrics. Admins can view additional moderation details.","type":"text/plain"},"url":{"path":["v1","posts",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve a specific post by its unique numeric ID. Returns the full post with au Post found and returned with all associated data -
    Schema
      tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    +
    Schema
      tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    Post not found or has been deleted diff --git a/docs/user_related_apis_versioned/posts-controller-get-all-comment.api.mdx b/docs/user_related_apis_versioned/posts-controller-get-all-comment.api.mdx index 946acd1f..0bc8a74e 100644 --- a/docs/user_related_apis_versioned/posts-controller-get-all-comment.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-get-all-comment.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve all comments for a post in a single request without pagin sidebar_label: "Get all post comments" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getAllComment","description":"Retrieve all comments for a post in a single request without pagination. Useful for displaying full comment threads or export scenarios.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"All comments returned with total count","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}},"total":{"type":"number","example":"10 // works also with swagger setup"}},"required":["comments","total"],"title":"PostAllCommentsResponse"}}}},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}/all-comments","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all post comments","description":{"content":"Retrieve all comments for a post in a single request without pagination. Useful for displaying full comment threads or export scenarios.","type":"text/plain"},"url":{"path":["v1","posts",":id","all-comments"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getAllComment","description":"Retrieve all comments for a post in a single request without pagination. Useful for displaying full comment threads or export scenarios.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"All comments returned with total count","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}},"total":{"type":"number","example":"10 // works also with swagger setup"}},"required":["comments","total"],"title":"PostAllCommentsResponse"},"example":{"comments":[{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]}],"total":"10 // works also with swagger setup"}}}},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}/all-comments","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get all post comments","description":{"content":"Retrieve all comments for a post in a single request without pagination. Useful for displaying full comment threads or export scenarios.","type":"text/plain"},"url":{"path":["v1","posts",":id","all-comments"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve all comments for a post in a single request without pagination. Useful All comments returned with total count -
    Schema
      comments object[] required
    • Array [
    • author object
      avatarUrls object required
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • tags object[]
    • Array [
    • ]
    • ]
    +
    Schema
      comments object[] required
    • Array [
    • author object
      avatarUrls object required
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • tags object[]
    • Array [
    • ]
    • ]
    Post not found diff --git a/docs/user_related_apis_versioned/posts-controller-get-comments.api.mdx b/docs/user_related_apis_versioned/posts-controller-get-comments.api.mdx index a17e4939..34473485 100644 --- a/docs/user_related_apis_versioned/posts-controller-get-comments.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-get-comments.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve paginated top-level comments for a post. Use the replies sidebar_label: "Get post comments" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getComments","description":"Retrieve paginated top-level comments for a post. Use the replies endpoint to get nested replies for specific comments.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"Comments retrieved with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}}},"required":["total","currentPage","limit","pages","comments"],"title":"PostCommentsResponse"}}}},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}/comments","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get post comments","description":{"content":"Retrieve paginated top-level comments for a post. Use the replies endpoint to get nested replies for specific comments.","type":"text/plain"},"url":{"path":["v1","posts",":id","comments"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Number of results to return","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getComments","description":"Retrieve paginated top-level comments for a post. Use the replies endpoint to get nested replies for specific comments.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"Comments retrieved with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"CommentAuthor"},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"],"title":"CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"],"title":"Comment"}}},"required":["total","currentPage","limit","pages","comments"],"title":"PostCommentsResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"comments":[{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]}]}}}},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}/comments","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get post comments","description":{"content":"Retrieve paginated top-level comments for a post. Use the replies endpoint to get nested replies for specific comments.","type":"text/plain"},"url":{"path":["v1","posts",":id","comments"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Number of results to return","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve paginated top-level comments for a post. Use the replies endpoint to ge Comments retrieved with pagination metadata -
    Schema
      comments object[] required
    • Array [
    • author object
      avatarUrls object required
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • tags object[]
    • Array [
    • ]
    • ]
    +
    Schema
      comments object[] required
    • Array [
    • author object
      avatarUrls object required
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • tags object[]
    • Array [
    • ]
    • ]
    Post not found diff --git a/docs/user_related_apis_versioned/posts-controller-get-liked-state.api.mdx b/docs/user_related_apis_versioned/posts-controller-get-liked-state.api.mdx index 8d030215..3a147e69 100644 --- a/docs/user_related_apis_versioned/posts-controller-get-liked-state.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-get-liked-state.api.mdx @@ -5,7 +5,7 @@ description: "Returns whether the authenticated user currently likes the post. T sidebar_label: "Get post liked state" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getLikedState","description":"Returns whether the authenticated user currently likes the post. This lightweight endpoint avoids loading the full post payload for simple like-state checks.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to check liked state for","schema":{"type":"number"}}],"responses":{"200":{"description":"Like state retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true when the post is liked by the current user"}}}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}/liked","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get post liked state","description":{"content":"Returns whether the authenticated user currently likes the post. This lightweight endpoint avoids loading the full post payload for simple like-state checks.","type":"text/plain"},"url":{"path":["v1","posts",":id","liked"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to check liked state for","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getLikedState","description":"Returns whether the authenticated user currently likes the post. This lightweight endpoint avoids loading the full post payload for simple like-state checks.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to check liked state for","schema":{"type":"number"}}],"responses":{"200":{"description":"Like state retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true when the post is liked by the current user"}}},"example":{"liked":true}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{id}/liked","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get post liked state","description":{"content":"Returns whether the authenticated user currently likes the post. This lightweight endpoint avoids loading the full post payload for simple like-state checks.","type":"text/plain"},"url":{"path":["v1","posts",":id","liked"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to check liked state for","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Returns whether the authenticated user currently likes the post. This lightweigh Like state retrieved successfully -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/posts-controller-get-loggedin-user-posts.api.mdx b/docs/user_related_apis_versioned/posts-controller-get-loggedin-user-posts.api.mdx index 44eff074..3a0de590 100644 --- a/docs/user_related_apis_versioned/posts-controller-get-loggedin-user-posts.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-get-loggedin-user-posts.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve posts created by the currently authenticated user. Suppor sidebar_label: "Get current user posts" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getLoggedinUserPosts","description":"Retrieve posts created by the currently authenticated user. Supports filtering by tab (MY_REFLECTIONS, SAVED, DRAFTS), sorting options, and post type filtering.","parameters":[{"name":"tab","required":false,"in":"query","description":"Profile tab filter (default: my_reflections)","schema":{"enum":["my_reflections","saved","notes","mentions"],"type":"string"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order for posts (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20, max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"postTypeIds","required":false,"in":"query","description":"Array of post type IDs to filter by","schema":{"type":"array","items":{"type":"number"}}}],"responses":{"200":{"description":"User posts retrieved successfully with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"}}}},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/my-posts","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get current user posts","description":{"content":"Retrieve posts created by the currently authenticated user. Supports filtering by tab (MY_REFLECTIONS, SAVED, DRAFTS), sorting options, and post type filtering.","type":"text/plain"},"url":{"path":["v1","posts","my-posts"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Profile tab filter (default: my_reflections)","type":"text/plain"},"key":"tab","value":""},{"disabled":false,"description":{"content":"Sort order for posts (default: latest)","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"Number of posts per page (default: 20, max: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Array of post type IDs to filter by","type":"text/plain"},"key":"postTypeIds","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getLoggedinUserPosts","description":"Retrieve posts created by the currently authenticated user. Supports filtering by tab (MY_REFLECTIONS, SAVED, DRAFTS), sorting options, and post type filtering.","parameters":[{"name":"tab","required":false,"in":"query","description":"Profile tab filter (default: my_reflections)","schema":{"enum":["my_reflections","saved","notes","mentions"],"type":"string"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order for posts (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20, max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"postTypeIds","required":false,"in":"query","description":"Array of post type IDs to filter by","schema":{"type":"array","items":{"type":"number"}}}],"responses":{"200":{"description":"User posts retrieved successfully with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/my-posts","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get current user posts","description":{"content":"Retrieve posts created by the currently authenticated user. Supports filtering by tab (MY_REFLECTIONS, SAVED, DRAFTS), sorting options, and post type filtering.","type":"text/plain"},"url":{"path":["v1","posts","my-posts"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Profile tab filter (default: my_reflections)","type":"text/plain"},"key":"tab","value":""},{"disabled":false,"description":{"content":"Sort order for posts (default: latest)","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"Number of posts per page (default: 20, max: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Array of post type IDs to filter by","type":"text/plain"},"key":"postTypeIds","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve posts created by the currently authenticated user. Supports filtering b User posts retrieved successfully with pagination metadata -
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    +
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    User not authenticated diff --git a/docs/user_related_apis_versioned/posts-controller-get-my-posts-by-verse.api.mdx b/docs/user_related_apis_versioned/posts-controller-get-my-posts-by-verse.api.mdx index 23e45f6f..7dcce644 100644 --- a/docs/user_related_apis_versioned/posts-controller-get-my-posts-by-verse.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-get-my-posts-by-verse.api.mdx @@ -1,11 +1,11 @@ --- id: posts-controller-get-my-posts-by-verse title: "Get posts by verse" -description: "Retrieve all posts written by the current user for a specific Quran verse. Returns posts referencing the exact verse key." +description: "Retrieve all posts written by the current user for a specific Quran verse. This endpoint requires a user-bound token and returns only the authenticated user's own posts. It is not part of the public `client_credentials`-compatible read subset; for public ayah-by-ayah reads, use `GET /v1/posts/feed` with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`." sidebar_label: "Get posts by verse" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getMyPostsByVerse","description":"Retrieve all posts written by the current user for a specific Quran verse. Returns posts referencing the exact verse key.","parameters":[{"name":"verseKey","required":true,"in":"path","description":"Verse key in format chapter:verse","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:255","type":"string"}}],"responses":{"200":{"description":"User posts for the specified verse","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"}}}},"400":{"description":"Invalid verse key format"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/by-verse/{verseKey}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get posts by verse","description":{"content":"Retrieve all posts written by the current user for a specific Quran verse. Returns posts referencing the exact verse key.","type":"text/plain"},"url":{"path":["v1","posts","by-verse",":verseKey"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Verse key in format chapter:verse","type":"text/plain"},"type":"any","value":"","key":"verseKey"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getMyPostsByVerse","description":"Retrieve all posts written by the current user for a specific Quran verse. This endpoint requires a user-bound token and returns only the authenticated user's own posts. It is not part of the public `client_credentials`-compatible read subset; for public ayah-by-ayah reads, use `GET /v1/posts/feed` with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.","parameters":[{"name":"verseKey","required":true,"in":"path","description":"Verse key in format chapter:verse","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:255","type":"string"}}],"responses":{"200":{"description":"User posts for the specified verse","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}},"400":{"description":"Invalid verse key format"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/by-verse/{verseKey}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get posts by verse","description":{"content":"Retrieve all posts written by the current user for a specific Quran verse. This endpoint requires a user-bound token and returns only the authenticated user's own posts. It is not part of the public `client_credentials`-compatible read subset; for public ayah-by-ayah reads, use `GET /v1/posts/feed` with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.","type":"text/plain"},"url":{"path":["v1","posts","by-verse",":verseKey"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Verse key in format chapter:verse","type":"text/plain"},"type":"any","value":"","key":"verseKey"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -25,13 +25,13 @@ import TabItem from "@theme/TabItem"; -Retrieve all posts written by the current user for a specific Quran verse. Returns posts referencing the exact verse key. +Retrieve all posts written by the current user for a specific Quran verse. This endpoint requires a user-bound token and returns only the authenticated user's own posts. It is not part of the public `client_credentials`-compatible read subset; for public ayah-by-ayah reads, use `GET /v1/posts/feed` with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.
    Path Parameters
    User posts for the specified verse -
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    +
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    Invalid verse key format diff --git a/docs/user_related_apis_versioned/posts-controller-get-my-posts-count-within-range.api.mdx b/docs/user_related_apis_versioned/posts-controller-get-my-posts-count-within-range.api.mdx index 7db49ece..16b9cda4 100644 --- a/docs/user_related_apis_versioned/posts-controller-get-my-posts-count-within-range.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-get-my-posts-count-within-range.api.mdx @@ -5,7 +5,7 @@ description: "Count how many posts the current user has written for verses withi sidebar_label: "Get posts count within range" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getMyPostsCountWithinRange","description":"Count how many posts the current user has written for verses within a specified Quran verse range. Useful for reading goals and progress tracking.","parameters":[{"name":"from","required":true,"in":"query","description":"Start verse key in format chapter:verse (e.g., \"2:1\")","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:1","type":"string"}},{"name":"to","required":true,"in":"query","description":"End verse key in format chapter:verse (e.g., \"2:286\")","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:286","type":"string"}}],"responses":{"200":{"description":"Count of posts within the specified verse range","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number","example":5}}}}}},"400":{"description":"Invalid verse range - malformed keys or from > to"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/count-within-range","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get posts count within range","description":{"content":"Count how many posts the current user has written for verses within a specified Quran verse range. Useful for reading goals and progress tracking.","type":"text/plain"},"url":{"path":["v1","posts","count-within-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Start verse key in format chapter:verse (e.g., \"2:1\")","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"(Required) End verse key in format chapter:verse (e.g., \"2:286\")","type":"text/plain"},"key":"to","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getMyPostsCountWithinRange","description":"Count how many posts the current user has written for verses within a specified Quran verse range. Useful for reading goals and progress tracking.","parameters":[{"name":"from","required":true,"in":"query","description":"Start verse key in format chapter:verse (e.g., \"2:1\")","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:1","type":"string"}},{"name":"to","required":true,"in":"query","description":"End verse key in format chapter:verse (e.g., \"2:286\")","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:286","type":"string"}}],"responses":{"200":{"description":"Count of posts within the specified verse range","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number","example":5}}},"example":{"count":5}}}},"400":{"description":"Invalid verse range - malformed keys or from > to"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/count-within-range","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get posts count within range","description":{"content":"Count how many posts the current user has written for verses within a specified Quran verse range. Useful for reading goals and progress tracking.","type":"text/plain"},"url":{"path":["v1","posts","count-within-range"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Start verse key in format chapter:verse (e.g., \"2:1\")","type":"text/plain"},"key":"from","value":""},{"disabled":false,"description":{"content":"(Required) End verse key in format chapter:verse (e.g., \"2:286\")","type":"text/plain"},"key":"to","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Count how many posts the current user has written for verses within a specified Count of posts within the specified verse range -
    Schema
    +
    Schema
    Invalid verse range - malformed keys or from > to diff --git a/docs/user_related_apis_versioned/posts-controller-get-related-posts.api.mdx b/docs/user_related_apis_versioned/posts-controller-get-related-posts.api.mdx index 319bfe6c..8221a9dc 100644 --- a/docs/user_related_apis_versioned/posts-controller-get-related-posts.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-get-related-posts.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve posts related to a given post by matching its Quran refer sidebar_label: "Get related posts" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getRelatedPosts","description":"Retrieve posts related to a given post by matching its Quran references with OR logic. Results are filtered by language preferences and ordered by popularity, excluding the source post.","parameters":[{"name":"postId","required":true,"in":"path","description":"Source post ID used for related-post matching","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 8, max: 8)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Related posts retrieved successfully with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"}}}},"404":{"description":"Source post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{postId}/related","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get related posts","description":{"content":"Retrieve posts related to a given post by matching its Quran references with OR logic. Results are filtered by language preferences and ordered by popularity, excluding the source post.","type":"text/plain"},"url":{"path":["v1","posts",":postId","related"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Number of posts per page (default: 8, max: 8)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Source post ID used for related-post matching","type":"text/plain"},"type":"any","value":"","key":"postId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getRelatedPosts","description":"Retrieve posts related to a given post by matching its Quran references with OR logic. Results are filtered by language preferences and ordered by popularity, excluding the source post.","parameters":[{"name":"postId","required":true,"in":"path","description":"Source post ID used for related-post matching","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 8, max: 8)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Related posts retrieved successfully with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}},"404":{"description":"Source post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/{postId}/related","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get related posts","description":{"content":"Retrieve posts related to a given post by matching its Quran references with OR logic. Results are filtered by language preferences and ordered by popularity, excluding the source post.","type":"text/plain"},"url":{"path":["v1","posts",":postId","related"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Number of posts per page (default: 8, max: 8)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Source post ID used for related-post matching","type":"text/plain"},"type":"any","value":"","key":"postId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,9 +31,8 @@ Retrieve posts related to a given post by matching its Quran references with OR Related posts retrieved successfully with pagination metadata -
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    +
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    Source post not found
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/posts-controller-get-user-post.api.mdx b/docs/user_related_apis_versioned/posts-controller-get-user-post.api.mdx index 49f615db..3c3596de 100644 --- a/docs/user_related_apis_versioned/posts-controller-get-user-post.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-get-user-post.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve public posts created by a specific user. If viewing own p sidebar_label: "Get user posts" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_getUserPost","description":"Retrieve public posts created by a specific user. If viewing own posts while authenticated, returns all posts including drafts. Supports sorting and filtering by post type.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user whose posts to retrieve","schema":{"type":"string"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order for posts (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20, max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"postTypeIds","required":false,"in":"query","description":"Array of post type IDs to filter by","schema":{"type":"array","items":{"type":"number"}}}],"responses":{"200":{"description":"User posts retrieved with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/user-posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user posts","description":{"content":"Retrieve public posts created by a specific user. If viewing own posts while authenticated, returns all posts including drafts. Supports sorting and filtering by post type.","type":"text/plain"},"url":{"path":["v1","posts","user-posts",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort order for posts (default: latest)","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"Number of posts per page (default: 20, max: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Array of post type IDs to filter by","type":"text/plain"},"key":"postTypeIds","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user whose posts to retrieve","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_getUserPost","description":"Retrieve public posts created by a specific user. If viewing own posts while authenticated, returns all posts including drafts. Supports sorting and filtering by post type.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user whose posts to retrieve","schema":{"type":"string"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order for posts (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20, max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"postTypeIds","required":false,"in":"query","description":"Array of post type IDs to filter by","schema":{"type":"array","items":{"type":"number"}}}],"responses":{"200":{"description":"User posts retrieved with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/user-posts/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user posts","description":{"content":"Retrieve public posts created by a specific user. If viewing own posts while authenticated, returns all posts including drafts. Supports sorting and filtering by post type.","type":"text/plain"},"url":{"path":["v1","posts","user-posts",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort order for posts (default: latest)","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"Number of posts per page (default: 20, max: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number for pagination (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Array of post type IDs to filter by","type":"text/plain"},"key":"postTypeIds","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user whose posts to retrieve","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,5 +31,5 @@ Retrieve public posts created by a specific user. If viewing own posts while aut User posts retrieved with pagination metadata -
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    +
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    \ No newline at end of file diff --git a/docs/user_related_apis_versioned/posts-controller-report-abuse.api.mdx b/docs/user_related_apis_versioned/posts-controller-report-abuse.api.mdx index 0acd3f3c..3e033dc5 100644 --- a/docs/user_related_apis_versioned/posts-controller-report-abuse.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-report-abuse.api.mdx @@ -5,7 +5,7 @@ description: "Report a post for moderation review. Provide a reason for the repo sidebar_label: "Report post abuse" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_reportAbuse","description":"Report a post for moderation review. Provide a reason for the report to help moderators evaluate the content. Multiple reports on the same post may trigger automatic review.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to report","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Report details including reason for flagging the content","content":{"application/json":{"schema":{"type":"object","properties":{"report":{"type":"object","properties":{"abuse":{"type":"string"},"comments":{"type":"string","default":""}},"required":["abuse","comments"],"title":"ReportAbuseDto"}},"required":["report"],"title":"ReportAbuseBodyDto"}}}},"responses":{"200":{"description":"Report submitted successfully for moderation review","content":{"application/json":{"schema":{"type":"object","properties":{"reported":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/{id}/report","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"report":{"abuse":"string","comments":"string"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Report post abuse","description":{"content":"Report a post for moderation review. Provide a reason for the report to help moderators evaluate the content. Multiple reports on the same post may trigger automatic review.","type":"text/plain"},"url":{"path":["v1","posts",":id","report"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to report","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"PostsController_reportAbuse","description":"Report a post for moderation review. Provide a reason for the report to help moderators evaluate the content. Multiple reports on the same post may trigger automatic review.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to report","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Report details including reason for flagging the content","content":{"application/json":{"schema":{"type":"object","properties":{"report":{"type":"object","properties":{"abuse":{"type":"string"},"comments":{"type":"string","default":""}},"required":["abuse","comments"],"title":"ReportAbuseDto"}},"required":["report"],"title":"ReportAbuseBodyDto"},"example":{"report":{"abuse":"string","comments":""}}}}},"responses":{"200":{"description":"Report submitted successfully for moderation review","content":{"application/json":{"schema":{"type":"object","properties":{"reported":{"type":"boolean","example":true}}},"example":{"reported":true}}}},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/{id}/report","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"report":{"abuse":"string","comments":"string"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Report post abuse","description":{"content":"Report a post for moderation review. Provide a reason for the report to help moderators evaluate the content. Multiple reports on the same post may trigger automatic review.","type":"text/plain"},"url":{"path":["v1","posts",":id","report"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to report","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Report details including reason for flagging the content Report submitted successfully for moderation review -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/posts-controller-toggle-like.api.mdx b/docs/user_related_apis_versioned/posts-controller-toggle-like.api.mdx index 19af1d6a..4403b2fd 100644 --- a/docs/user_related_apis_versioned/posts-controller-toggle-like.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-toggle-like.api.mdx @@ -5,7 +5,7 @@ description: "Toggle like status for a post. If already liked, removes the like. sidebar_label: "Toggle post like" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_toggleLike","description":"Toggle like status for a post. If already liked, removes the like. If not liked, adds a like. Updates the post like count and triggers notifications.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to like/unlike","schema":{"type":"number"}}],"responses":{"200":{"description":"Like status toggled - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true if now liked, false if now unliked"}}}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/{id}/toggle-like","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle post like","description":{"content":"Toggle like status for a post. If already liked, removes the like. If not liked, adds a like. Updates the post like count and triggers notifications.","type":"text/plain"},"url":{"path":["v1","posts",":id","toggle-like"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to like/unlike","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"PostsController_toggleLike","description":"Toggle like status for a post. If already liked, removes the like. If not liked, adds a like. Updates the post like count and triggers notifications.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to like/unlike","schema":{"type":"number"}}],"responses":{"200":{"description":"Like status toggled - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true if now liked, false if now unliked"}}},"example":{"liked":true}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/{id}/toggle-like","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle post like","description":{"content":"Toggle like status for a post. If already liked, removes the like. If not liked, adds a like. Updates the post like count and triggers notifications.","type":"text/plain"},"url":{"path":["v1","posts",":id","toggle-like"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to like/unlike","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Toggle like status for a post. If already liked, removes the like. If not liked, Like status toggled - returns new state -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/posts-controller-toggle-save.api.mdx b/docs/user_related_apis_versioned/posts-controller-toggle-save.api.mdx index 4d9f3d7b..41a06821 100644 --- a/docs/user_related_apis_versioned/posts-controller-toggle-save.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-toggle-save.api.mdx @@ -5,7 +5,7 @@ description: "Toggle save/bookmark status for a post. Saved posts appear in the sidebar_label: "Toggle post save" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_toggleSave","description":"Toggle save/bookmark status for a post. Saved posts appear in the SAVED tab of the user profile for easy access later.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to save/unsave","schema":{"type":"number"}}],"responses":{"200":{"description":"Save status toggled - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"saved":{"type":"boolean","description":"true if now saved, false if now unsaved"}}}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/{id}/toggle-save","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle post save","description":{"content":"Toggle save/bookmark status for a post. Saved posts appear in the SAVED tab of the user profile for easy access later.","type":"text/plain"},"url":{"path":["v1","posts",":id","toggle-save"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to save/unsave","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"PostsController_toggleSave","description":"Toggle save/bookmark status for a post. Saved posts appear in the SAVED tab of the user profile for easy access later.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to save/unsave","schema":{"type":"number"}}],"responses":{"200":{"description":"Save status toggled - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"saved":{"type":"boolean","description":"true if now saved, false if now unsaved"}}},"example":{"saved":true}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/posts/{id}/toggle-save","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle post save","description":{"content":"Toggle save/bookmark status for a post. Saved posts appear in the SAVED tab of the user profile for easy access later.","type":"text/plain"},"url":{"path":["v1","posts",":id","toggle-save"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID to save/unsave","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Toggle save/bookmark status for a post. Saved posts appear in the SAVED tab of t Save status toggled - returns new state -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/posts-controller-view-tracking.api.mdx b/docs/user_related_apis_versioned/posts-controller-view-tracking.api.mdx index 1458359f..f186763f 100644 --- a/docs/user_related_apis_versioned/posts-controller-view-tracking.api.mdx +++ b/docs/user_related_apis_versioned/posts-controller-view-tracking.api.mdx @@ -5,7 +5,7 @@ description: "Record that a post has been viewed by the current user (if authent sidebar_label: "Track post view" hide_title: true hide_table_of_contents: true -api: {"operationId":"PostsController_viewTracking","description":"Record that a post has been viewed by the current user (if authenticated). Used for analytics and engagement tracking. Does not require authentication but will track user-specific views when logged in.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"View tracked successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/viewed/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Track post view","description":{"content":"Record that a post has been viewed by the current user (if authenticated). Used for analytics and engagement tracking. Does not require authentication but will track user-specific views when logged in.","type":"text/plain"},"url":{"path":["v1","posts","viewed",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"PostsController_viewTracking","description":"Record that a post has been viewed by the current user (if authenticated). Used for analytics and engagement tracking. Does not require authentication but will track user-specific views when logged in.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"View tracked successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}},"example":{"success":true}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/posts/viewed/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Track post view","description":{"content":"Record that a post has been viewed by the current user (if authenticated). Used for analytics and engagement tracking. Does not require authentication but will track user-specific views when logged in.","type":"text/plain"},"url":{"path":["v1","posts","viewed",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,5 +31,5 @@ Record that a post has been viewed by the current user (if authenticated). Used View tracked successfully -
    Schema
    +
    Schema
    \ No newline at end of file diff --git a/docs/user_related_apis_versioned/publish-note.api.mdx b/docs/user_related_apis_versioned/publish-note.api.mdx deleted file mode 100644 index 5d03239d..00000000 --- a/docs/user_related_apis_versioned/publish-note.api.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -id: publish-note -title: "Publish note" -description: "Publish a note to QR." -sidebar_label: "Publish note" -hide_title: true -hide_table_of_contents: true -api: {"tags":["Notes"],"description":"Publish a note to QR.","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The unique identifier of the note to be retrieved or manipulated.","example":"asda12312312"},"required":true,"description":"The unique identifier of the note to be retrieved or manipulated."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:112-2:115"]}},"required":["body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"success":{"type":"boolean"},"postId":{"type":"number","format":"float"}},"required":["success"],"additionalProperties":false,"description":"Response object indicating the success of the note publishing operation and the optional post ID if successful.","example":{"success":true,"postId":123}}},"additionalProperties":false}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/notes/:noteId/publish","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"body":"This is a sample note body.","ranges":["2:112-2:115"]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"}} -sidebar_class_name: "post api-method" -info_path: docs/user_related_apis_versioned/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Publish note - - - -Publish a note to QR. - -
    Path Parameters
    Request Body
      = 6 characters` and `<= 10000 characters`"} schema={{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."}}>
    - -Request has been handled successfully. - -
    Schema
      data object
      - -Response object indicating the success of the note publishing operation and the optional post ID if successful. - -
    - -The request is missing required parameters or is invalid. - -
    Schema
    - -The request is unauthorized. - -
    Schema
    - -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
    - -Not Found. The resource being accessed does not exist. - -
    Schema
    - -Validation Error. The request includes one or more invalid params. Please check the request params and try again. - -
    Schema
    - -Too many requests, please try again later. - -
    Schema
    - -Server Error. Something went wrong, try again later. - -
    Schema
    - -Invalid response from the upstream server - -
    Schema
    - -The server is currently unable to handle the request due to a temporary overload or scheduled maintenance - -
    Schema
    - -The server did not receive a timely response from the upstream server. - -
    Schema
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/rooms-controller-accept-by-private-token.api.mdx b/docs/user_related_apis_versioned/rooms-controller-accept-by-private-token.api.mdx index 194119f5..c3f7ae04 100644 --- a/docs/user_related_apis_versioned/rooms-controller-accept-by-private-token.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-accept-by-private-token.api.mdx @@ -5,7 +5,7 @@ description: "Accept an invitation using a private room URL with embedded token. sidebar_label: "Accept room invite by private token" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_acceptByPrivateToken","description":"Accept an invitation using a private room URL with embedded token. Alternative to the /accept-invite endpoint for direct link access.","parameters":[{"name":"url","required":false,"in":"path","description":"Group URL identifier","schema":{"type":"string"}},{"name":"subdomain","required":false,"in":"path","description":"Page subdomain identifier","schema":{"type":"string"}},{"name":"token","required":true,"in":"path","description":"Private invitation token","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation accepted - user added to room"},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/group/{url}/accept/{token}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Accept room invite by private token","description":{"content":"Accept an invitation using a private room URL with embedded token. Alternative to the /accept-invite endpoint for direct link access.","type":"text/plain"},"url":{"path":["v1","rooms","group",":url","accept",":token"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"Group URL identifier","type":"text/plain"},"type":"any","value":"","key":"url"},{"disabled":false,"description":{"content":"Page subdomain identifier","type":"text/plain"},"type":"any","value":"","key":"subdomain"},{"disabled":false,"description":{"content":"(Required) Private invitation token","type":"text/plain"},"type":"any","value":"","key":"token"}]},"method":"GET"}} +api: {"operationId":"RoomsController_acceptByPrivateToken","description":"Accept an invitation using a private room URL with embedded token. Alternative to the /accept-invite endpoint for direct link access.","parameters":[{"name":"url","required":false,"in":"path","description":"Group URL identifier","schema":{"type":"string"}},{"name":"subdomain","required":false,"in":"path","description":"Page subdomain identifier","schema":{"type":"string"}},{"name":"token","required":true,"in":"path","description":"Private invitation token","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation accepted - user added to room","content":{"application/json":{"schema":{"type":"object","properties":{"roomId":{"type":"number","example":42},"success":{"type":"boolean","example":true},"isNewMember":{"type":"boolean","example":true}},"required":["roomId","success","isNewMember"],"title":"RoomAcceptByPrivateTokenResponseDto"},"example":{"roomId":42,"success":true,"isNewMember":true}}}},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/group/{url}/accept/{token}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Accept room invite by private token","description":{"content":"Accept an invitation using a private room URL with embedded token. Alternative to the /accept-invite endpoint for direct link access.","type":"text/plain"},"url":{"path":["v1","rooms","group",":url","accept",":token"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"Group URL identifier","type":"text/plain"},"type":"any","value":"","key":"url"},{"disabled":false,"description":{"content":"Page subdomain identifier","type":"text/plain"},"type":"any","value":"","key":"subdomain"},{"disabled":false,"description":{"content":"(Required) Private invitation token","type":"text/plain"},"type":"any","value":"","key":"token"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Accept an invitation using a private room URL with embedded token. Alternative t Invitation accepted - user added to room -
    +
    Schema
    Invalid or expired token diff --git a/docs/user_related_apis_versioned/rooms-controller-accept-invite.api.mdx b/docs/user_related_apis_versioned/rooms-controller-accept-invite.api.mdx index ded82ae3..c23058d2 100644 --- a/docs/user_related_apis_versioned/rooms-controller-accept-invite.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-accept-invite.api.mdx @@ -5,7 +5,7 @@ description: "Accept an invitation to join a room using the token from the invit sidebar_label: "Accept room invite" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_acceptInvite","description":"Accept an invitation to join a room using the token from the invite link. Adds user as member.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"token","required":true,"in":"query","description":"Invitation token from invite link","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation accepted - user is now a member"},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/accept-invite","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Accept room invite","description":{"content":"Accept an invitation to join a room using the token from the invite link. Adds user as member.","type":"text/plain"},"url":{"path":["v1","rooms",":id","accept-invite"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Invitation token from invite link","type":"text/plain"},"key":"token","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"RoomsController_acceptInvite","description":"Accept an invitation to join a room using the token from the invite link. Adds user as member.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"token","required":true,"in":"query","description":"Invitation token from invite link","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation accepted - user is now a member","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean","example":true}},"required":["accepted"],"title":"RoomInviteAcceptedResponseDto"},"example":{"accepted":true}}}},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/accept-invite","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Accept room invite","description":{"content":"Accept an invitation to join a room using the token from the invite link. Adds user as member.","type":"text/plain"},"url":{"path":["v1","rooms",":id","accept-invite"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Invitation token from invite link","type":"text/plain"},"key":"token","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Accept an invitation to join a room using the token from the invite link. Adds u Invitation accepted - user is now a member -
    +
    Schema
    Invalid or expired token diff --git a/docs/user_related_apis_versioned/rooms-controller-admins-access.api.mdx b/docs/user_related_apis_versioned/rooms-controller-admins-access.api.mdx index 5c307c49..f74f2604 100644 --- a/docs/user_related_apis_versioned/rooms-controller-admins-access.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-admins-access.api.mdx @@ -5,7 +5,7 @@ description: "Grant or revoke admin privileges for a user in a room. Only room o sidebar_label: "Update room admin access" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_adminsAccess","description":"Grant or revoke admin privileges for a user in a room. Only room owners or existing admins can modify admin access.","parameters":[],"requestBody":{"required":true,"description":"Contains roomId, userId, and admin boolean to grant/revoke access","content":{"application/json":{"schema":{"type":"object","properties":{"roomId":{"type":"number"},"userId":{"type":"string"},"admin":{"type":"boolean"}},"required":["roomId","userId","admin"],"title":"RoomAdminUpdateDto"}}}},"responses":{"200":{"description":"Admin access updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to modify admin access"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/admins-access","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"roomId":0,"userId":"string","admin":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update room admin access","description":{"content":"Grant or revoke admin privileges for a user in a room. Only room owners or existing admins can modify admin access.","type":"text/plain"},"url":{"path":["v1","rooms","admins-access"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_adminsAccess","description":"Grant or revoke admin privileges for a user in a room. Only room owners or existing admins can modify admin access.","parameters":[],"requestBody":{"required":true,"description":"Contains roomId, userId, and admin boolean to grant/revoke access","content":{"application/json":{"schema":{"type":"object","properties":{"roomId":{"type":"number"},"userId":{"type":"string"},"admin":{"type":"boolean"}},"required":["roomId","userId","admin"],"title":"RoomAdminUpdateDto"},"example":{"roomId":1,"userId":"string","admin":true}}}},"responses":{"200":{"description":"Admin access updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}},"example":{"success":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to modify admin access"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/admins-access","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"roomId":0,"userId":"string","admin":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update room admin access","description":{"content":"Grant or revoke admin privileges for a user in a room. Only room owners or existing admins can modify admin access.","type":"text/plain"},"url":{"path":["v1","rooms","admins-access"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Contains roomId, userId, and admin boolean to grant/revoke access Admin access updated successfully -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/rooms-controller-create-new-group.api.mdx b/docs/user_related_apis_versioned/rooms-controller-create-new-group.api.mdx index 1d1226ea..6bdc5665 100644 --- a/docs/user_related_apis_versioned/rooms-controller-create-new-group.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-create-new-group.api.mdx @@ -5,7 +5,7 @@ description: "Create a new community group for sharing reflections. Groups can b sidebar_label: "Create a new group" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_createNewGroup","description":"Create a new community group for sharing reflections. Groups can be public or private, and the creator becomes the owner.","parameters":[],"requestBody":{"required":true,"description":"Group creation details including name, description, URL, and visibility","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","maxLength":200},"url":{"type":"string","minLength":1,"maxLength":50},"public":{"type":"boolean"}},"required":["name","url"],"title":"CreateGroupDto"}}}},"responses":{"201":{"description":"Group created successfully"},"400":{"description":"Invalid group data or URL already taken"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/groups","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"string","description":"string","url":"string","public":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a new group","description":{"content":"Create a new community group for sharing reflections. Groups can be public or private, and the creator becomes the owner.","type":"text/plain"},"url":{"path":["v1","rooms","groups"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_createNewGroup","description":"Create a new community group for sharing reflections. Groups can be public or private, and the creator becomes the owner.","parameters":[],"requestBody":{"required":true,"description":"Group creation details including name, description, URL, and visibility","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","maxLength":200},"url":{"type":"string","minLength":1,"maxLength":50},"public":{"type":"boolean"}},"required":["name","url"],"title":"CreateGroupDto"},"example":{"name":"string","description":"string","url":"string","public":true}}}},"responses":{"201":{"description":"Group created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"roomType":{"type":"string"},"isActive":{"type":"boolean"},"isVerified":{"type":"boolean"},"isPublic":{"type":"boolean"},"isOwner":{"type":"boolean"},"isAdmin":{"type":"boolean"},"ownerId":{"type":"string"},"postsCount":{"type":"number"},"membersCount":{"type":"number"},"url":{"type":"string"},"avatarUrls":{"type":"object","properties":{"thumb":{"required":true,"type":"string"},"original":{"required":true,"type":"string"}}},"createdAt":{"format":"date-time","type":"string"},"isMember":{"type":"boolean"},"subdomain":{"type":"string"},"country":{"type":"string"}},"required":["id","name","description","roomType","isActive","isVerified","isPublic","isOwner","isAdmin","ownerId","postsCount","membersCount","avatarUrls"],"title":"RoomListItemDto"}},"required":["success","data"],"title":"RoomCreatedResponseDto"},"example":{"success":true,"data":{"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}}}}},"400":{"description":"Invalid group data or URL already taken"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/groups","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"string","description":"string","url":"string","public":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a new group","description":{"content":"Create a new community group for sharing reflections. Groups can be public or private, and the creator becomes the owner.","type":"text/plain"},"url":{"path":["v1","rooms","groups"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Group creation details including name, description, URL, and visibility Group created successfully -
    +
    Schema
      data object required
      avatarUrls object required
    Invalid group data or URL already taken diff --git a/docs/user_related_apis_versioned/rooms-controller-create-new-page.api.mdx b/docs/user_related_apis_versioned/rooms-controller-create-new-page.api.mdx index 96efd2df..73e1e863 100644 --- a/docs/user_related_apis_versioned/rooms-controller-create-new-page.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-create-new-page.api.mdx @@ -5,7 +5,7 @@ description: "Submit a request to create a new organizational page. Pages requir sidebar_label: "Create a new page" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_createNewPage","description":"Submit a request to create a new organizational page. Pages require admin approval and include organization details, contact info, and purpose statement.","parameters":[],"requestBody":{"required":true,"description":"Page creation details including name, description, URL, organization info, and purpose","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"jobTitle":{"type":"string"},"contactNumber":{"type":"string"},"organizationName":{"type":"string"},"organizationWebsite":{"type":"string"},"purpose":{"type":"string"},"additionalDetails":{"type":"string"},"country":{"type":"string"},"url":{"type":"string"},"public":{"type":"boolean"}},"required":["name","jobTitle","contactNumber","organizationName","purpose","url"],"title":"CreatePageDto"}}}},"responses":{"201":{"description":"Page request submitted for admin review","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"},"message":{"type":"string"}}}}}},"400":{"description":"Invalid page data or URL already taken"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/pages","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"string","description":"string","jobTitle":"string","contactNumber":"string","organizationName":"string","organizationWebsite":"string","purpose":"string","additionalDetails":"string","country":"string","url":"string","public":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a new page","description":{"content":"Submit a request to create a new organizational page. Pages require admin approval and include organization details, contact info, and purpose statement.","type":"text/plain"},"url":{"path":["v1","rooms","pages"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_createNewPage","description":"Submit a request to create a new organizational page. Pages require admin approval and include organization details, contact info, and purpose statement.","parameters":[],"requestBody":{"required":true,"description":"Page creation details including name, description, URL, organization info, and purpose","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"jobTitle":{"type":"string"},"contactNumber":{"type":"string"},"organizationName":{"type":"string"},"organizationWebsite":{"type":"string"},"purpose":{"type":"string"},"additionalDetails":{"type":"string"},"country":{"type":"string"},"url":{"type":"string"},"public":{"type":"boolean"}},"required":["name","jobTitle","contactNumber","organizationName","purpose","url"],"title":"CreatePageDto"},"example":{"name":"string","description":"string","jobTitle":"string","contactNumber":"string","organizationName":"string","organizationWebsite":"string","purpose":"string","additionalDetails":"string","country":"string","url":"string","public":true}}}},"responses":{"201":{"description":"Page request submitted for admin review","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"},"message":{"type":"string"}}},"example":{"success":true,"data":{},"message":"string"}}}},"400":{"description":"Invalid page data or URL already taken"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/pages","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"name":"string","description":"string","jobTitle":"string","contactNumber":"string","organizationName":"string","organizationWebsite":"string","purpose":"string","additionalDetails":"string","country":"string","url":"string","public":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Create a new page","description":{"content":"Submit a request to create a new organizational page. Pages require admin approval and include organization details, contact info, and purpose statement.","type":"text/plain"},"url":{"path":["v1","rooms","pages"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Page creation details including name, description, URL, organization info, and p Page request submitted for admin review -
    Schema
    +
    Schema
    Invalid page data or URL already taken diff --git a/docs/user_related_apis_versioned/rooms-controller-follow-page.api.mdx b/docs/user_related_apis_versioned/rooms-controller-follow-page.api.mdx index 0bfbd93a..55c2be11 100644 --- a/docs/user_related_apis_versioned/rooms-controller-follow-page.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-follow-page.api.mdx @@ -5,7 +5,7 @@ description: "Follow an organizational page to see their posts in your feed. Pag sidebar_label: "Follow a page" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_followPage","description":"Follow an organizational page to see their posts in your feed. Pages represent verified organizations or scholars.","parameters":[{"name":"pageId","required":true,"in":"path","description":"Unique numeric page ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully followed the page","content":{"application/json":{"schema":{"type":"object","properties":{"followed":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{pageId}/follow","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Follow a page","description":{"content":"Follow an organizational page to see their posts in your feed. Pages represent verified organizations or scholars.","type":"text/plain"},"url":{"path":["v1","rooms",":pageId","follow"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric page ID","type":"text/plain"},"type":"any","value":"","key":"pageId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"RoomsController_followPage","description":"Follow an organizational page to see their posts in your feed. Pages represent verified organizations or scholars.","parameters":[{"name":"pageId","required":true,"in":"path","description":"Unique numeric page ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully followed the page","content":{"application/json":{"schema":{"type":"object","properties":{"followed":{"type":"boolean","example":true}}},"example":{"followed":true}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{pageId}/follow","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Follow a page","description":{"content":"Follow an organizational page to see their posts in your feed. Pages represent verified organizations or scholars.","type":"text/plain"},"url":{"path":["v1","rooms",":pageId","follow"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric page ID","type":"text/plain"},"type":"any","value":"","key":"pageId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Follow an organizational page to see their posts in your feed. Pages represent v Successfully followed the page -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/rooms-controller-get-room-members.api.mdx b/docs/user_related_apis_versioned/rooms-controller-get-room-members.api.mdx index 7154f763..b49c46b0 100644 --- a/docs/user_related_apis_versioned/rooms-controller-get-room-members.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-get-room-members.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve paginated list of members in a room (group or page). Retu sidebar_label: "Get room members" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_getRoomMembers","description":"Retrieve paginated list of members in a room (group or page). Returns user profiles with their roles.","parameters":[{"name":"limit","required":false,"in":"query","description":"Members per page (default: 10)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Room members retrieved with pagination"},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/members","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room members","description":{"content":"Retrieve paginated list of members in a room (group or page). Returns user profiles with their roles.","type":"text/plain"},"url":{"path":["v1","rooms",":id","members"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Members per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"RoomsController_getRoomMembers","description":"Retrieve paginated list of members in a room (group or page). Returns user profiles with their roles.","parameters":[{"name":"limit","required":false,"in":"query","description":"Members per page (default: 10)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Room members retrieved with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"user-1"},"username":{"type":"string","example":"member.username"},"firstName":{"type":"string","example":"Member"},"lastName":{"type":"string","example":"User"},"verified":{"type":"boolean","example":true},"avatarUrls":{"type":"object","example":{"small":"https://avatars.quran.foundation/users/user-1/small.png","medium":"https://avatars.quran.foundation/users/user-1/medium.png","large":"https://avatars.quran.foundation/users/user-1/large.png"}},"isAdmin":{"type":"boolean","example":false},"isOwner":{"type":"boolean","example":false},"isFollowed":{"type":"boolean","example":true},"isActive":{"type":"boolean","example":true},"followersCount":{"type":"number","example":42}},"required":["id","username","firstName","lastName","verified","avatarUrls","isAdmin","isOwner","isFollowed","isActive","followersCount"],"title":"MemberSerializedDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"RoomMembersResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"id":"user-1","username":"member.username","firstName":"Member","lastName":"User","verified":true,"avatarUrls":{"small":"https://avatars.quran.foundation/users/user-1/small.png","medium":"https://avatars.quran.foundation/users/user-1/medium.png","large":"https://avatars.quran.foundation/users/user-1/large.png"},"isAdmin":false,"isOwner":false,"isFollowed":true,"isActive":true,"followersCount":42}]}}}},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/members","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room members","description":{"content":"Retrieve paginated list of members in a room (group or page). Returns user profiles with their roles.","type":"text/plain"},"url":{"path":["v1","rooms",":id","members"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Members per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve paginated list of members in a room (group or page). Returns user profi Room members retrieved with pagination -
    +
    Schema
      data object[] required
    • Array [
    • ]
    Room not found diff --git a/docs/user_related_apis_versioned/rooms-controller-get-room-posts.api.mdx b/docs/user_related_apis_versioned/rooms-controller-get-room-posts.api.mdx index 36becb30..032d7536 100644 --- a/docs/user_related_apis_versioned/rooms-controller-get-room-posts.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-get-room-posts.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve paginated posts shared within a room. Supports filtering sidebar_label: "Get room posts" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_getRoomPosts","description":"Retrieve paginated posts shared within a room. Supports filtering by tab (REFLECTIONS, DISCUSSIONS) and sorting (LATEST, POPULAR).","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Posts per page (max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"tab","required":false,"in":"query","description":"Filter posts by content type","schema":{"enum":["reflections","saved","public","members_only"],"type":"string"}}],"responses":{"200":{"description":"Room posts with pagination"},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/posts","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room posts","description":{"content":"Retrieve paginated posts shared within a room. Supports filtering by tab (REFLECTIONS, DISCUSSIONS) and sorting (LATEST, POPULAR).","type":"text/plain"},"url":{"path":["v1","rooms",":id","posts"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort order (default: latest)","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"Posts per page (max: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Filter posts by content type","type":"text/plain"},"key":"tab","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"RoomsController_getRoomPosts","description":"Retrieve paginated posts shared within a room. Supports filtering by tab (REFLECTIONS, DISCUSSIONS) and sorting (LATEST, POPULAR).","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Posts per page (max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"tab","required":false,"in":"query","description":"Filter posts by content type","schema":{"enum":["reflections","saved","public","members_only"],"type":"string"}}],"responses":{"200":{"description":"Room posts with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/posts","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room posts","description":{"content":"Retrieve paginated posts shared within a room. Supports filtering by tab (REFLECTIONS, DISCUSSIONS) and sorting (LATEST, POPULAR).","type":"text/plain"},"url":{"path":["v1","rooms",":id","posts"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Sort order (default: latest)","type":"text/plain"},"key":"sortBy","value":""},{"disabled":false,"description":{"content":"Posts per page (max: 20)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Filter posts by content type","type":"text/plain"},"key":"tab","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve paginated posts shared within a room. Supports filtering by tab (REFLEC Room posts with pagination -
    +
    Schema
      data object[] required
    • Array [
    • tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    • ]
    Room not found diff --git a/docs/user_related_apis_versioned/rooms-controller-get-room-profile-by-id.api.mdx b/docs/user_related_apis_versioned/rooms-controller-get-room-profile-by-id.api.mdx index 7b9ca9dd..3dd8fb97 100644 --- a/docs/user_related_apis_versioned/rooms-controller-get-room-profile-by-id.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-get-room-profile-by-id.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve a room profile by its unique numeric ID. Returns room det sidebar_label: "Get room profile by ID" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_getRoomProfileById","description":"Retrieve a room profile by its unique numeric ID. Returns room details, member counts, and relationship status for the current user.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Room profile retrieved successfully"},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room profile by ID","description":{"content":"Retrieve a room profile by its unique numeric ID. Returns room details, member counts, and relationship status for the current user.","type":"text/plain"},"url":{"path":["v1","rooms",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"RoomsController_getRoomProfileById","description":"Retrieve a room profile by its unique numeric ID. Returns room details, member counts, and relationship status for the current user.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Room profile retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"privateToken":{"type":"string","example":"private-room-token"},"mutualFollowers":{"type":"array","items":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"}},"mutualFollowersCount":{"type":"number","example":2},"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"roomType":{"type":"string"},"isActive":{"type":"boolean"},"isVerified":{"type":"boolean"},"isPublic":{"type":"boolean"},"isOwner":{"type":"boolean"},"isAdmin":{"type":"boolean"},"ownerId":{"type":"string"},"postsCount":{"type":"number"},"membersCount":{"type":"number"},"url":{"type":"string"},"avatarUrls":{"type":"object","properties":{"thumb":{"required":true,"type":"string"},"original":{"required":true,"type":"string"}}},"createdAt":{"format":"date-time","type":"string"},"isMember":{"type":"boolean"},"subdomain":{"type":"string"},"country":{"type":"string"}},"required":["id","name","description","roomType","isActive","isVerified","isPublic","isOwner","isAdmin","ownerId","postsCount","membersCount","avatarUrls"],"title":"RoomProfileResponseDto"},"example":{"privateToken":"private-room-token","mutualFollowers":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}],"mutualFollowersCount":2,"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}}}},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room profile by ID","description":{"content":"Retrieve a room profile by its unique numeric ID. Returns room details, member counts, and relationship status for the current user.","type":"text/plain"},"url":{"path":["v1","rooms",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve a room profile by its unique numeric ID. Returns room details, member c Room profile retrieved successfully -
    +
    Schema
      mutualFollowers object[]
    • Array [
    • settings object required
    • ]
    • avatarUrls object required
    Room not found diff --git a/docs/user_related_apis_versioned/rooms-controller-get-room-profile.api.mdx b/docs/user_related_apis_versioned/rooms-controller-get-room-profile.api.mdx index d77ad283..0717f59c 100644 --- a/docs/user_related_apis_versioned/rooms-controller-get-room-profile.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-get-room-profile.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve a room profile by its unique URL (for groups) or subdomai sidebar_label: "Get room profile by URL or subdomain" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_getRoomProfile","description":"Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Returns room details, member counts, and relationship status.","parameters":[{"name":"url","required":false,"in":"path","description":"Group URL identifier (lowercase)","schema":{"type":"string"}},{"name":"subdomain","required":false,"in":"path","description":"Page subdomain identifier (lowercase)","schema":{"type":"string"}}],"responses":{"200":{"description":"Room profile with details and membership info"},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/group/{url}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room profile by URL or subdomain","description":{"content":"Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Returns room details, member counts, and relationship status.","type":"text/plain"},"url":{"path":["v1","rooms","group",":url"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"Group URL identifier (lowercase)","type":"text/plain"},"type":"any","value":"","key":"url"},{"disabled":false,"description":{"content":"Page subdomain identifier (lowercase)","type":"text/plain"},"type":"any","value":"","key":"subdomain"}]},"method":"GET"}} +api: {"operationId":"RoomsController_getRoomProfile","description":"Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Returns room details, member counts, and relationship status.","parameters":[{"name":"url","required":false,"in":"path","description":"Group URL identifier (lowercase)","schema":{"type":"string"}},{"name":"subdomain","required":false,"in":"path","description":"Page subdomain identifier (lowercase)","schema":{"type":"string"}}],"responses":{"200":{"description":"Room profile with details and membership info","content":{"application/json":{"schema":{"type":"object","properties":{"privateToken":{"type":"string","example":"private-room-token"},"mutualFollowers":{"type":"array","items":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"}},"mutualFollowersCount":{"type":"number","example":2},"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"roomType":{"type":"string"},"isActive":{"type":"boolean"},"isVerified":{"type":"boolean"},"isPublic":{"type":"boolean"},"isOwner":{"type":"boolean"},"isAdmin":{"type":"boolean"},"ownerId":{"type":"string"},"postsCount":{"type":"number"},"membersCount":{"type":"number"},"url":{"type":"string"},"avatarUrls":{"type":"object","properties":{"thumb":{"required":true,"type":"string"},"original":{"required":true,"type":"string"}}},"createdAt":{"format":"date-time","type":"string"},"isMember":{"type":"boolean"},"subdomain":{"type":"string"},"country":{"type":"string"}},"required":["id","name","description","roomType","isActive","isVerified","isPublic","isOwner","isAdmin","ownerId","postsCount","membersCount","avatarUrls"],"title":"RoomProfileResponseDto"},"example":{"privateToken":"private-room-token","mutualFollowers":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}],"mutualFollowersCount":2,"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}}}},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/group/{url}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get room profile by URL or subdomain","description":{"content":"Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Returns room details, member counts, and relationship status.","type":"text/plain"},"url":{"path":["v1","rooms","group",":url"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"Group URL identifier (lowercase)","type":"text/plain"},"type":"any","value":"","key":"url"},{"disabled":false,"description":{"content":"Page subdomain identifier (lowercase)","type":"text/plain"},"type":"any","value":"","key":"subdomain"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Room profile with details and membership info -
    +
    Schema
      mutualFollowers object[]
    • Array [
    • settings object required
    • ]
    • avatarUrls object required
    Room not found diff --git a/docs/user_related_apis_versioned/rooms-controller-get-rooms.api.mdx b/docs/user_related_apis_versioned/rooms-controller-get-rooms.api.mdx index a67d28e0..5138ee79 100644 --- a/docs/user_related_apis_versioned/rooms-controller-get-rooms.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-get-rooms.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve rooms the user has joined (joined-rooms) or manages as ad sidebar_label: "Get joined or managed rooms" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_getRooms","description":"Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-rooms). Supports search and pagination.","parameters":[{"name":"query","required":false,"in":"query","description":"Search query for room names","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Rooms per page (default: 5)","schema":{"minimum":1,"maximum":5,"default":5,"type":"number"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order (default: NAME_ASC)","schema":{"enum":["NAME_ASC","NAME_DESC","LATEST_ACTIVITY"],"type":"string"}}],"responses":{"200":{"description":"Rooms retrieved with pagination"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/joined-rooms","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get joined or managed rooms","description":{"content":"Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-rooms). Supports search and pagination.","type":"text/plain"},"url":{"path":["v1","rooms","joined-rooms"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search query for room names","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Rooms per page (default: 5)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Sort order (default: NAME_ASC)","type":"text/plain"},"key":"sortBy","value":""}],"variable":[]},"method":"GET"}} +api: {"operationId":"RoomsController_getRooms","description":"Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-rooms). Supports search and pagination.","parameters":[{"name":"query","required":false,"in":"query","description":"Search query for room names","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Rooms per page (default: 5)","schema":{"minimum":1,"maximum":5,"default":5,"type":"number"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order (default: NAME_ASC)","schema":{"enum":["NAME_ASC","NAME_DESC","LATEST_ACTIVITY"],"type":"string"}}],"responses":{"200":{"description":"Rooms retrieved with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"roomType":{"type":"string"},"isActive":{"type":"boolean"},"isVerified":{"type":"boolean"},"isPublic":{"type":"boolean"},"isOwner":{"type":"boolean"},"isAdmin":{"type":"boolean"},"ownerId":{"type":"string"},"postsCount":{"type":"number"},"membersCount":{"type":"number"},"url":{"type":"string"},"avatarUrls":{"type":"object","properties":{"thumb":{"required":true,"type":"string"},"original":{"required":true,"type":"string"}}},"createdAt":{"format":"date-time","type":"string"},"isMember":{"type":"boolean"},"subdomain":{"type":"string"},"country":{"type":"string"}},"required":["id","name","description","roomType","isActive","isVerified","isPublic","isOwner","isAdmin","ownerId","postsCount","membersCount","avatarUrls"],"title":"RoomListItemDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"PaginatedRoomsResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}]}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/joined-rooms","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get joined or managed rooms","description":{"content":"Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-rooms). Supports search and pagination.","type":"text/plain"},"url":{"path":["v1","rooms","joined-rooms"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search query for room names","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Rooms per page (default: 5)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Sort order (default: NAME_ASC)","type":"text/plain"},"key":"sortBy","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-r Rooms retrieved with pagination -
    +
    Schema
      data object[] required
    • Array [
    • avatarUrls object required
    • ]
    User not authenticated diff --git a/docs/user_related_apis_versioned/rooms-controller-invite-user-to-room.api.mdx b/docs/user_related_apis_versioned/rooms-controller-invite-user-to-room.api.mdx index d4ca0994..196e1123 100644 --- a/docs/user_related_apis_versioned/rooms-controller-invite-user-to-room.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-invite-user-to-room.api.mdx @@ -5,7 +5,7 @@ description: "Send an invitation to a user to join the room. User will receive a sidebar_label: "Invite user to room" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_inviteUserToRoom","description":"Send an invitation to a user to join the room. User will receive a notification/email with an invite link. Only admins can invite.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"User identification for invitation (email or userId)","content":{"application/json":{"schema":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}}},"required":["userIds","emails"],"title":"InviteUserDto"}}}},"responses":{"200":{"description":"Invitation sent successfully"},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to invite members"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{id}/invite","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"userIds":["string"],"emails":["string"]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Invite user to room","description":{"content":"Send an invitation to a user to join the room. User will receive a notification/email with an invite link. Only admins can invite.","type":"text/plain"},"url":{"path":["v1","rooms",":id","invite"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Content-Type","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_inviteUserToRoom","description":"Send an invitation to a user to join the room. User will receive a notification/email with an invite link. Only admins can invite.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"User identification for invitation (email or userId)","content":{"application/json":{"schema":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}}},"required":["userIds","emails"],"title":"InviteUserDto"},"example":{"userIds":["string"],"emails":["string"]}}}},"responses":{"200":{"description":"Invitation sent successfully","content":{"application/json":{"schema":{"type":"object","properties":{"invited":{"type":"boolean","example":true},"inviteStatus":{"type":"object","additionalProperties":{"oneOf":[{"type":"boolean"},{"type":"string"}]},"example":{"user-123":true,"user-456":"already_a_member"}}},"required":["invited","inviteStatus"],"title":"RoomInviteUserResponseDto"},"example":{"invited":true,"inviteStatus":{"user-123":true,"user-456":"already_a_member"}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to invite members"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{id}/invite","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"userIds":["string"],"emails":["string"]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Invite user to room","description":{"content":"Send an invitation to a user to join the room. User will receive a notification/email with an invite link. Only admins can invite.","type":"text/plain"},"url":{"path":["v1","rooms",":id","invite"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ User identification for invitation (email or userId) Invitation sent successfully -
    +
    Schema
      inviteStatus object required
    User not authenticated diff --git a/docs/user_related_apis_versioned/rooms-controller-join-room.api.mdx b/docs/user_related_apis_versioned/rooms-controller-join-room.api.mdx index b62cf2a3..877e095d 100644 --- a/docs/user_related_apis_versioned/rooms-controller-join-room.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-join-room.api.mdx @@ -5,7 +5,7 @@ description: "Join a public group as a member. For private groups, an invitation sidebar_label: "Join a group" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_joinRoom","description":"Join a public group as a member. For private groups, an invitation is required. Returns whether the join was successful.","parameters":[{"name":"groupId","required":true,"in":"path","description":"Unique numeric group ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully joined the group","content":{"application/json":{"schema":{"type":"object","properties":{"joined":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"Group is private - invitation required"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{groupId}/join","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Join a group","description":{"content":"Join a public group as a member. For private groups, an invitation is required. Returns whether the join was successful.","type":"text/plain"},"url":{"path":["v1","rooms",":groupId","join"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric group ID","type":"text/plain"},"type":"any","value":"","key":"groupId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"RoomsController_joinRoom","description":"Join a public group as a member. For private groups, an invitation is required. Returns whether the join was successful.","parameters":[{"name":"groupId","required":true,"in":"path","description":"Unique numeric group ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully joined the group","content":{"application/json":{"schema":{"type":"object","properties":{"joined":{"type":"boolean","example":true}}},"example":{"joined":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"Group is private - invitation required"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{groupId}/join","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Join a group","description":{"content":"Join a public group as a member. For private groups, an invitation is required. Returns whether the join was successful.","type":"text/plain"},"url":{"path":["v1","rooms",":groupId","join"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric group ID","type":"text/plain"},"type":"any","value":"","key":"groupId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Join a public group as a member. For private groups, an invitation is required. Successfully joined the group -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/rooms-controller-leave-group.api.mdx b/docs/user_related_apis_versioned/rooms-controller-leave-group.api.mdx index 8f4c02fe..47129754 100644 --- a/docs/user_related_apis_versioned/rooms-controller-leave-group.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-leave-group.api.mdx @@ -5,7 +5,7 @@ description: "Leave a group the user is currently a member of. Owners cannot lea sidebar_label: "Leave a group" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_leaveGroup","description":"Leave a group the user is currently a member of. Owners cannot leave - they must transfer ownership first.","parameters":[{"name":"groupId","required":true,"in":"path","description":"Unique numeric group ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully left the group","content":{"application/json":{"schema":{"type":"object","properties":{"left":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"Owner cannot leave - transfer ownership first"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{groupId}/leave","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Leave a group","description":{"content":"Leave a group the user is currently a member of. Owners cannot leave - they must transfer ownership first.","type":"text/plain"},"url":{"path":["v1","rooms",":groupId","leave"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric group ID","type":"text/plain"},"type":"any","value":"","key":"groupId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"RoomsController_leaveGroup","description":"Leave a group the user is currently a member of. Owners cannot leave - they must transfer ownership first.","parameters":[{"name":"groupId","required":true,"in":"path","description":"Unique numeric group ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully left the group","content":{"application/json":{"schema":{"type":"object","properties":{"left":{"type":"boolean","example":true}}},"example":{"left":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"Owner cannot leave - transfer ownership first"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{groupId}/leave","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Leave a group","description":{"content":"Leave a group the user is currently a member of. Owners cannot leave - they must transfer ownership first.","type":"text/plain"},"url":{"path":["v1","rooms",":groupId","leave"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric group ID","type":"text/plain"},"type":"any","value":"","key":"groupId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Leave a group the user is currently a member of. Owners cannot leave - they must Successfully left the group -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/rooms-controller-reject-invite.api.mdx b/docs/user_related_apis_versioned/rooms-controller-reject-invite.api.mdx index ea8e2985..05b24212 100644 --- a/docs/user_related_apis_versioned/rooms-controller-reject-invite.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-reject-invite.api.mdx @@ -5,7 +5,7 @@ description: "Decline an invitation to join a room. Invalidates the invite token sidebar_label: "Reject room invite" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_rejectInvite","description":"Decline an invitation to join a room. Invalidates the invite token.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"token","required":true,"in":"query","description":"Invitation token from invite link","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation rejected"},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/reject-invite","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Reject room invite","description":{"content":"Decline an invitation to join a room. Invalidates the invite token.","type":"text/plain"},"url":{"path":["v1","rooms",":id","reject-invite"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Invitation token from invite link","type":"text/plain"},"key":"token","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"RoomsController_rejectInvite","description":"Decline an invitation to join a room. Invalidates the invite token.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"token","required":true,"in":"query","description":"Invitation token from invite link","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation rejected","content":{"application/json":{"schema":{"type":"object","properties":{"rejected":{"type":"boolean","example":true}},"required":["rejected"],"title":"RoomInviteRejectedResponseDto"},"example":{"rejected":true}}}},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/{id}/reject-invite","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Reject room invite","description":{"content":"Decline an invitation to join a room. Invalidates the invite token.","type":"text/plain"},"url":{"path":["v1","rooms",":id","reject-invite"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) Invitation token from invite link","type":"text/plain"},"key":"token","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Decline an invitation to join a room. Invalidates the invite token. Invitation rejected -
    +
    Schema
    Invalid or expired token diff --git a/docs/user_related_apis_versioned/rooms-controller-remove-member.api.mdx b/docs/user_related_apis_versioned/rooms-controller-remove-member.api.mdx index 2d8001cf..4248e65b 100644 --- a/docs/user_related_apis_versioned/rooms-controller-remove-member.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-remove-member.api.mdx @@ -5,7 +5,7 @@ description: "Remove a user from a room (group or page). Only admins can remove sidebar_label: "Remove member from room" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_removeMember","description":"Remove a user from a room (group or page). Only admins can remove other members. Users can remove themselves.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"userId","required":true,"in":"path","description":"UUID of the user to remove","schema":{"type":"string"}}],"responses":{"200":{"description":"Member removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to remove this member"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"delete","path":"/v1/rooms/{id}/members/{userId}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Remove member from room","description":{"content":"Remove a user from a room (group or page). Only admins can remove other members. Users can remove themselves.","type":"text/plain"},"url":{"path":["v1","rooms",":id","members",":userId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"},{"disabled":false,"description":{"content":"(Required) UUID of the user to remove","type":"text/plain"},"type":"any","value":"","key":"userId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +api: {"operationId":"RoomsController_removeMember","description":"Remove a user from a room (group or page). Only admins can remove other members. Users can remove themselves.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"userId","required":true,"in":"path","description":"UUID of the user to remove","schema":{"type":"string"}}],"responses":{"200":{"description":"Member removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}},"example":{"success":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to remove this member"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"delete","path":"/v1/rooms/{id}/members/{userId}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Remove member from room","description":{"content":"Remove a user from a room (group or page). Only admins can remove other members. Users can remove themselves.","type":"text/plain"},"url":{"path":["v1","rooms",":id","members",":userId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"id"},{"disabled":false,"description":{"content":"(Required) UUID of the user to remove","type":"text/plain"},"type":"any","value":"","key":"userId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Remove a user from a room (group or page). Only admins can remove other members. Member removed successfully -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/rooms-controller-search-rooms.api.mdx b/docs/user_related_apis_versioned/rooms-controller-search-rooms.api.mdx index 22966ea9..fa703b45 100644 --- a/docs/user_related_apis_versioned/rooms-controller-search-rooms.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-search-rooms.api.mdx @@ -5,7 +5,7 @@ description: "Search for public groups and pages by name or description. Results sidebar_label: "Search rooms" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_searchRooms","description":"Search for public groups and pages by name or description. Results can be filtered by room type.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term for room name/description","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"type":"number"}},{"name":"roomType","required":false,"in":"query","description":"Filter by room type: GROUP or PAGE","schema":{"type":"string"}}],"responses":{"200":{"description":"Matching rooms with pagination"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/search","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Search rooms","description":{"content":"Search for public groups and pages by name or description. Results can be filtered by room type.","type":"text/plain"},"url":{"path":["v1","rooms","search"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search term for room name/description","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Filter by room type: GROUP or PAGE","type":"text/plain"},"key":"roomType","value":""}],"variable":[]},"method":"GET"}} +api: {"operationId":"RoomsController_searchRooms","description":"Search for public groups and pages by name or description. Results can be filtered by room type.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term for room name/description","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"type":"number"}},{"name":"roomType","required":false,"in":"query","description":"Filter by room type: GROUP or PAGE","schema":{"type":"string"}}],"responses":{"200":{"description":"Matching rooms with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"roomType":{"type":"string"},"isActive":{"type":"boolean"},"isVerified":{"type":"boolean"},"isPublic":{"type":"boolean"},"isOwner":{"type":"boolean"},"isAdmin":{"type":"boolean"},"ownerId":{"type":"string"},"postsCount":{"type":"number"},"membersCount":{"type":"number"},"url":{"type":"string"},"avatarUrls":{"type":"object","properties":{"thumb":{"required":true,"type":"string"},"original":{"required":true,"type":"string"}}},"createdAt":{"format":"date-time","type":"string"},"isMember":{"type":"boolean"},"subdomain":{"type":"string"},"country":{"type":"string"}},"required":["id","name","description","roomType","isActive","isVerified","isPublic","isOwner","isAdmin","ownerId","postsCount","membersCount","avatarUrls"],"title":"RoomListItemDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"PaginatedRoomsResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}]}}}}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/rooms/search","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Search rooms","description":{"content":"Search for public groups and pages by name or description. Results can be filtered by room type.","type":"text/plain"},"url":{"path":["v1","rooms","search"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search term for room name/description","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Filter by room type: GROUP or PAGE","type":"text/plain"},"key":"roomType","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,5 +31,5 @@ Search for public groups and pages by name or description. Results can be filter Matching rooms with pagination -
    +
    Schema
      data object[] required
    • Array [
    • avatarUrls object required
    • ]
    \ No newline at end of file diff --git a/docs/user_related_apis_versioned/rooms-controller-unfollow-page.api.mdx b/docs/user_related_apis_versioned/rooms-controller-unfollow-page.api.mdx index 9b0a75f8..30700e63 100644 --- a/docs/user_related_apis_versioned/rooms-controller-unfollow-page.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-unfollow-page.api.mdx @@ -5,7 +5,7 @@ description: "Stop following a page. Their posts will no longer appear in your p sidebar_label: "Unfollow a page" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_unfollowPage","description":"Stop following a page. Their posts will no longer appear in your personalized feed.","parameters":[{"name":"pageId","required":true,"in":"path","description":"Unique numeric page ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully unfollowed the page","content":{"application/json":{"schema":{"type":"object","properties":{"unfollowed":{"type":"boolean","example":true}}}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{pageId}/unfollow","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Unfollow a page","description":{"content":"Stop following a page. Their posts will no longer appear in your personalized feed.","type":"text/plain"},"url":{"path":["v1","rooms",":pageId","unfollow"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric page ID","type":"text/plain"},"type":"any","value":"","key":"pageId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"RoomsController_unfollowPage","description":"Stop following a page. Their posts will no longer appear in your personalized feed.","parameters":[{"name":"pageId","required":true,"in":"path","description":"Unique numeric page ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully unfollowed the page","content":{"application/json":{"schema":{"type":"object","properties":{"unfollowed":{"type":"boolean","example":true}}},"example":{"unfollowed":true}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/rooms/{pageId}/unfollow","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Unfollow a page","description":{"content":"Stop following a page. Their posts will no longer appear in your personalized feed.","type":"text/plain"},"url":{"path":["v1","rooms",":pageId","unfollow"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric page ID","type":"text/plain"},"type":"any","value":"","key":"pageId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Stop following a page. Their posts will no longer appear in your personalized fe Successfully unfollowed the page -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/rooms-controller-update-group.api.mdx b/docs/user_related_apis_versioned/rooms-controller-update-group.api.mdx index 7749e956..fb194cab 100644 --- a/docs/user_related_apis_versioned/rooms-controller-update-group.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-update-group.api.mdx @@ -5,7 +5,7 @@ description: "Update group properties like name, description, URL, avatar, count sidebar_label: "Update a group" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_updateGroup","description":"Update group properties like name, description, URL, avatar, country, or public visibility. Only group admins/owners can update.","parameters":[],"requestBody":{"required":true,"description":"Group fields to update - all fields optional except id","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","maxLength":200},"url":{"type":"string","minLength":1,"maxLength":50},"removeAvatar":{"type":"boolean"},"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"country":{"type":"string","nullable":true},"public":{"type":"boolean","nullable":true,"default":null}},"required":["id"],"title":"UpdateGroupDto"}}}},"responses":{"200":{"description":"Group updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"room":{"type":"object"}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to update this group"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/rooms/groups","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"id":0,"name":"string","description":"string","url":"string","removeAvatar":true,"avatar":"string","country":"string","public":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update a group","description":{"content":"Update group properties like name, description, URL, avatar, country, or public visibility. Only group admins/owners can update.","type":"text/plain"},"url":{"path":["v1","rooms","groups"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_updateGroup","description":"Update group properties like name, description, URL, avatar, country, or public visibility. Only group admins/owners can update.","parameters":[],"requestBody":{"required":true,"description":"Group fields to update - all fields optional except id","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","maxLength":200},"url":{"type":"string","minLength":1,"maxLength":50},"removeAvatar":{"type":"boolean"},"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"country":{"type":"string","nullable":true},"public":{"type":"boolean","nullable":true,"default":null}},"required":["id"],"title":"UpdateGroupDto"},"example":{"id":1,"name":"string","description":"string","url":"string","removeAvatar":true,"avatar":"string","country":"string","public":null}}}},"responses":{"200":{"description":"Group updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"room":{"type":"object"}}},"example":{"success":true,"room":{}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to update this group"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/rooms/groups","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"id":0,"name":"string","description":"string","url":"string","removeAvatar":true,"avatar":"string","country":"string","public":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update a group","description":{"content":"Update group properties like name, description, URL, avatar, country, or public visibility. Only group admins/owners can update.","type":"text/plain"},"url":{"path":["v1","rooms","groups"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "patch api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Group fields to update - all fields optional except id Group updated successfully -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/rooms-controller-update-page.api.mdx b/docs/user_related_apis_versioned/rooms-controller-update-page.api.mdx index d0609811..b1783f24 100644 --- a/docs/user_related_apis_versioned/rooms-controller-update-page.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-update-page.api.mdx @@ -5,7 +5,7 @@ description: "Update page properties like name, description, contact info, organ sidebar_label: "Update a page" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_updatePage","description":"Update page properties like name, description, contact info, organization details, or visibility. Only page admins/owners can update.","parameters":[],"requestBody":{"required":true,"description":"Page fields to update - all fields optional except id","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"removeAvatar":{"type":"boolean"},"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"public":{"type":"boolean","nullable":true,"default":null},"name":{"type":"string"},"description":{"type":"string"},"organizationWebsite":{"type":"string"},"country":{"type":"string"},"url":{"type":"string"}},"required":["id"],"title":"UpdatePageDto"}}}},"responses":{"200":{"description":"Page updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"room":{"type":"object"}}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to update this page"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/rooms/pages","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"id":0,"removeAvatar":true,"avatar":"string","public":true,"name":"string","description":"string","organizationWebsite":"string","country":"string","url":"string"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update a page","description":{"content":"Update page properties like name, description, contact info, organization details, or visibility. Only page admins/owners can update.","type":"text/plain"},"url":{"path":["v1","rooms","pages"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_updatePage","description":"Update page properties like name, description, contact info, organization details, or visibility. Only page admins/owners can update.","parameters":[],"requestBody":{"required":true,"description":"Page fields to update - all fields optional except id","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"removeAvatar":{"type":"boolean"},"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"public":{"type":"boolean","nullable":true,"default":null},"name":{"type":"string"},"description":{"type":"string"},"organizationWebsite":{"type":"string"},"country":{"type":"string"},"url":{"type":"string"}},"required":["id"],"title":"UpdatePageDto"},"example":{"id":1,"removeAvatar":true,"avatar":"string","public":null,"name":"string","description":"string","organizationWebsite":"string","country":"string","url":"string"}}}},"responses":{"200":{"description":"Page updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"room":{"type":"object"}}},"example":{"success":true,"room":{}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to update this page"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/rooms/pages","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"id":0,"removeAvatar":true,"avatar":"string","public":true,"name":"string","description":"string","organizationWebsite":"string","country":"string","url":"string"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update a page","description":{"content":"Update page properties like name, description, contact info, organization details, or visibility. Only page admins/owners can update.","type":"text/plain"},"url":{"path":["v1","rooms","pages"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "patch api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Page fields to update - all fields optional except id Page updated successfully -
    Schema
    +
    Schema
    User not authenticated diff --git a/docs/user_related_apis_versioned/rooms-controller-update-post-privacy.api.mdx b/docs/user_related_apis_versioned/rooms-controller-update-post-privacy.api.mdx index ca8d8c95..e61d701c 100644 --- a/docs/user_related_apis_versioned/rooms-controller-update-post-privacy.api.mdx +++ b/docs/user_related_apis_versioned/rooms-controller-update-post-privacy.api.mdx @@ -5,7 +5,7 @@ description: "Change the visibility of a post within a room. Toggle between publ sidebar_label: "Update post privacy in room" hide_title: true hide_table_of_contents: true -api: {"operationId":"RoomsController_updatePostPrivacy","description":"Change the visibility of a post within a room. Toggle between public (visible outside room) and private (members only). Only admins can modify.","parameters":[{"name":"roomId","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"postId","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Privacy setting with isPublic boolean","content":{"application/json":{"schema":{"type":"object","properties":{"isPublic":{"type":"boolean"}},"required":["isPublic"],"title":"RoomPostUpdatePrivacyDto"}}}},"responses":{"200":{"description":"Post privacy updated successfully"},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to modify post privacy"},"404":{"description":"Room or post not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/rooms/{roomId}/posts/{postId}/privacy","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"isPublic":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update post privacy in room","description":{"content":"Change the visibility of a post within a room. Toggle between public (visible outside room) and private (members only). Only admins can modify.","type":"text/plain"},"url":{"path":["v1","rooms",":roomId","posts",":postId","privacy"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"roomId"},{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"postId"}]},"header":[{"key":"Content-Type","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"RoomsController_updatePostPrivacy","description":"Change the visibility of a post within a room. Toggle between public (visible outside room) and private (members only). Only admins can modify.","parameters":[{"name":"roomId","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"postId","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Privacy setting with isPublic boolean","content":{"application/json":{"schema":{"type":"object","properties":{"isPublic":{"type":"boolean"}},"required":["isPublic"],"title":"RoomPostUpdatePrivacyDto"},"example":{"isPublic":true}}}},"responses":{"200":{"description":"Post privacy updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"],"title":"PostTag"}},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"],"title":"PostReference"}},"author":{"type":"object"},"recentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"],"title":"UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"],"title":"PostRecentComment"},"room":{"nullable":true,"allOf":[{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"],"title":"PostRoom"}]},"mentions":{"type":"array","items":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"],"title":"UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"],"title":"PostSerialized"},"example":{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to modify post privacy"},"404":{"description":"Room or post not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/rooms/{roomId}/posts/{postId}/privacy","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"isPublic":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update post privacy in room","description":{"content":"Change the visibility of a post within a room. Toggle between public (visible outside room) and private (members only). Only admins can modify.","type":"text/plain"},"url":{"path":["v1","rooms",":roomId","posts",":postId","privacy"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Unique numeric room ID","type":"text/plain"},"type":"any","value":"","key":"roomId"},{"disabled":false,"description":{"content":"(Required) Unique numeric post ID","type":"text/plain"},"type":"any","value":"","key":"postId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "patch api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Privacy setting with isPublic boolean Post privacy updated successfully -
    +
    Schema
      tags object[]
    • Array [
    • ]
    • references object[]
    • Array [
    • ]
    • recentComment object
      author object required
      avatarUrls object required
      room object nullable
      mentions object[]
    • Array [
    • avatarUrls object required
    • ]
    User not authenticated diff --git a/docs/user_related_apis_versioned/scopes.mdx b/docs/user_related_apis_versioned/scopes.mdx index df16da07..8299bdcb 100644 --- a/docs/user_related_apis_versioned/scopes.mdx +++ b/docs/user_related_apis_versioned/scopes.mdx @@ -170,3 +170,9 @@ granting access to the scopes your app is requesting first. | note.update | Update your notes | | note.delete | Delete your notes | | note.publish | Publish your notes | + +## Sync + +| Scope | Description | +| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| sync | Sync your data across devices. Required for the sync endpoints (`GET /v1/sync`, `POST /v1/sync`) to pull and push mutations for bookmarks, collections, and notes. | diff --git a/docs/user_related_apis_versioned/sidebar.js b/docs/user_related_apis_versioned/sidebar.js index d87c2992..bf184c8b 100644 --- a/docs/user_related_apis_versioned/sidebar.js +++ b/docs/user_related_apis_versioned/sidebar.js @@ -1 +1 @@ -module.exports = [{"type":"doc","id":"user_related_apis_versioned/user-related-apis"},{"type":"category","label":"Collections","items":[{"type":"doc","id":"user_related_apis_versioned/add-collection","label":"Add collection","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/get-all-collections","label":"Get all collections","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/add-collection-bookmark","label":"Add collection Bookmark","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/delete-collection","label":"Delete collection","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/get-collection-items-by-id","label":"Get collection items by id","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/update-collection","label":"Update collection","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/delete-collection-bookmark-by-id","label":"Delete collection bookmark by id","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/get-all-collection-items","label":"Get all collection items","className":"api-method get"}]},{"type":"category","label":"Bookmarks","items":[{"type":"doc","id":"user_related_apis_versioned/add-user-bookmark","label":"Add user bookmark","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/get-user-bookmarks","label":"Get user bookmarks","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/delete-bookmark","label":"Delete Bookmark","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/get-bookmarks-within-a-range-of-ayahs","label":"Get bookmarks within a range of Ayahs","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/get-bookmark","label":"Get bookmark","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/get-bookmark-collections","label":"Get bookmark collections","className":"api-method get"}]},{"type":"category","label":"Preferences","items":[{"type":"doc","id":"user_related_apis_versioned/add-or-update-preference","label":"Add or update preference","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/get-user-preferences","label":"Get user preferences","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/bulk-add-or-update-preferences","label":"Bulk add or update preferences","className":"api-method post"}]},{"type":"category","label":"Reading Sessions","items":[{"type":"doc","id":"user_related_apis_versioned/add-or-update-user-reading-session","label":"Add or update user reading session","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/get-user-reading-sessions","label":"Get user reading sessions","className":"api-method get"}]},{"type":"category","label":"Goals","items":[{"type":"doc","id":"user_related_apis_versioned/get-todays-goal-plan","label":"Get today's goal plan","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/update-a-goal","label":"Update a goal","className":"api-method put"},{"type":"doc","id":"user_related_apis_versioned/delete-a-goal","label":"Delete a goal","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/create-a-goal","label":"Create a goal","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/generate-timeline-estimation","label":"Generate timeline estimation","className":"api-method get"}]},{"type":"category","label":"Streaks","items":[{"type":"doc","id":"user_related_apis_versioned/get-streaks","label":"Get streaks","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/get-current-streak-days","label":"Get current streak days","className":"api-method get"}]},{"type":"category","label":"Activity Days","items":[{"type":"doc","id":"user_related_apis_versioned/add-update-activity-day","label":"Add/update activity day","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/get-activity-days","label":"Get activity days","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/estimate-reading-time","label":"Estimate reading time","className":"api-method get"}]},{"type":"category","label":"Users","items":[{"type":"doc","id":"user_related_apis_versioned/users-controller-edit-profile","label":"Edit user profile","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/users-controller-profile","label":"Get user profile","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/users-controller-update-profile","label":"Update user profile","className":"api-method put"},{"type":"doc","id":"user_related_apis_versioned/users-controller-rooms","label":"Get logged-in user rooms","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/users-controller-search","label":"Search for users","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/users-controller-toggle-follow","label":"Toggle follow/unfollow a user","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/users-controller-remove-follower","label":"Remove a follower","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/users-controller-get-featured-users","label":"Get featured users for follow recommendation","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/users-controller-follow-featured-users","label":"Follow all featured users","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/users-controller-get-user-profile","label":"Get user profile by id or username","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/users-controller-get-user-followers","label":"Get user followers","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/users-controller-get-user-following","label":"Get users followed by user","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/users-controller-delete-account","label":"Delete user account permanently","className":"api-method delete"}]},{"type":"category","label":"Notes","items":[{"type":"doc","id":"user_related_apis_versioned/get-all-notes","label":"Get all notes","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/add-note","label":"Add note","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/get-notes-by-verse","label":"Get notes by verse","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/get-notes-by-attached-entity","label":"Get notes by attached entity","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/get-notes-count-within-verse-range","label":"Get notes count within verse range","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/get-notes-by-verse-range","label":"Get notes by verse range","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/get-note-by-id","label":"Get note by ID","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/update-note-by-id","label":"Update note by ID","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/delete-note-by-id","label":"Delete note by ID","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/publish-note","label":"Publish note","className":"api-method post"}]},{"type":"category","label":"Rooms","items":[{"type":"doc","id":"user_related_apis_versioned/rooms-controller-admins-access","label":"Update room admin access","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-update-group","label":"Update a group","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-create-new-group","label":"Create a new group","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-update-page","label":"Update a page","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-create-new-page","label":"Create a new page","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-get-room-members","label":"Get room members","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-invite-user-to-room","label":"Invite user to room","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-accept-invite","label":"Accept room invite","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-reject-invite","label":"Reject room invite","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-remove-member","label":"Remove member from room","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-get-rooms","label":"Get joined or managed rooms","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-search-rooms","label":"Search rooms","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-get-room-profile","label":"Get room profile by URL or subdomain","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-accept-by-private-token","label":"Accept room invite by private token","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-get-room-profile-by-id","label":"Get room profile by ID","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-get-room-posts","label":"Get room posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-join-room","label":"Join a group","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-leave-group","label":"Leave a group","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-follow-page","label":"Follow a page","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-unfollow-page","label":"Unfollow a page","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-update-post-privacy","label":"Update post privacy in room","className":"api-method patch"}]},{"type":"category","label":"Posts","items":[{"type":"doc","id":"user_related_apis_versioned/posts-controller-feed","label":"Get posts feed","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-related-posts","label":"Get related posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-loggedin-user-posts","label":"Get current user posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-find-one","label":"Get post by ID","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-delete","label":"Delete post","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-edit","label":"Edit post","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-view-tracking","label":"Track post view","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-create","label":"Create post","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-report-abuse","label":"Report post abuse","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-user-post","label":"Get user posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-toggle-like","label":"Toggle post like","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-toggle-save","label":"Toggle post save","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-comments","label":"Get post comments","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-all-comment","label":"Get all post comments","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-export-multiple-posts","label":"Export posts as PDF","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-my-posts-count-within-range","label":"Get posts count within range","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-my-posts-by-verse","label":"Get posts by verse","className":"api-method get"}]},{"type":"category","label":"Tags","items":[{"type":"doc","id":"user_related_apis_versioned/tags-controller-find","label":"Search and retrieve tags","className":"api-method get"}]},{"type":"category","label":"Comments","items":[{"type":"doc","id":"user_related_apis_versioned/comments-controller-create","label":"Create a new comment","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/comments-controller-delete-comment","label":"Delete a comment","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/comments-controller-toggle-like","label":"Toggle like/unlike a comment","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/comments-controller-get","label":"Get replies to a comment","className":"api-method get"}]}]; \ No newline at end of file +module.exports = [{"type":"doc","id":"user_related_apis_versioned/user-related-apis"},{"type":"category","label":"Collections","items":[{"type":"doc","id":"user_related_apis_versioned/auth-post-v-1-collections","label":"Add collection","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-collections","label":"Get all collections","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-post-v-1-collections-by-collection-id-bookmarks","label":"Add collection Bookmark","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/auth-delete-v-1-collections-by-collection-id-bookmarks","label":"Delete collection bookmark by details","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/auth-delete-v-1-collections-by-collection-id","label":"Delete collection","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-collections-by-collection-id","label":"Get collection items by id","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-post-v-1-collections-by-collection-id","label":"Update collection","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/auth-delete-v-1-collections-by-collection-id-bookmarks-by-bookmark-id","label":"Delete collection bookmark by id","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-collections-all","label":"Get all collection items","className":"api-method get"}]},{"type":"category","label":"Bookmarks","items":[{"type":"doc","id":"user_related_apis_versioned/auth-post-v-1-bookmarks","label":"Add user bookmark","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-bookmarks","label":"Get user bookmarks","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-delete-v-1-bookmarks-by-bookmark-id","label":"Delete Bookmark","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-bookmarks-ayahs-range","label":"Get bookmarks within a range of Ayahs","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-bookmarks-bookmark","label":"Get bookmark","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-bookmarks-collections","label":"Get bookmark collections","className":"api-method get"}]},{"type":"category","label":"Preferences","items":[{"type":"doc","id":"user_related_apis_versioned/auth-post-v-1-preferences","label":"Add or update preference","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-preferences","label":"Get user preferences","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-post-v-1-preferences-bulk","label":"Bulk add or update preferences","className":"api-method post"}]},{"type":"category","label":"Reading Sessions","items":[{"type":"doc","id":"user_related_apis_versioned/auth-post-v-1-reading-sessions","label":"Add or update user reading session","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-reading-sessions","label":"Get user reading sessions","className":"api-method get"}]},{"type":"category","label":"Goals","items":[{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-goals-get-todays-plan","label":"Get today's goal plan","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-put-v-1-goals-by-id","label":"Update a goal","className":"api-method put"},{"type":"doc","id":"user_related_apis_versioned/auth-delete-v-1-goals-by-id","label":"Delete a goal","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/auth-post-v-1-goals","label":"Create a goal","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-goals-estimate","label":"Generate timeline estimation","className":"api-method get"}]},{"type":"category","label":"Streaks","items":[{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-streaks","label":"Get streaks","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-streaks-current-streak-days","label":"Get current streak days","className":"api-method get"}]},{"type":"category","label":"Activity Days","items":[{"type":"doc","id":"user_related_apis_versioned/auth-post-v-1-activity-days","label":"Add/update activity day","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-activity-days","label":"Get activity days","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-activity-days-estimate-reading-time","label":"Estimate reading time","className":"api-method get"}]},{"type":"category","label":"Users","items":[{"type":"doc","id":"user_related_apis_versioned/users-controller-edit-profile","label":"Edit user profile","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/users-controller-profile","label":"Get user profile","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/users-controller-update-profile","label":"Update user profile","className":"api-method put"},{"type":"doc","id":"user_related_apis_versioned/users-controller-rooms","label":"Get logged-in user rooms","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/users-controller-search","label":"Search for users","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/users-controller-toggle-follow","label":"Toggle follow/unfollow a user","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/users-controller-remove-follower","label":"Remove a follower","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/users-controller-get-user-profile","label":"Get user profile by id or username","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/users-controller-get-user-followers","label":"Get user followers","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/users-controller-get-user-following","label":"Get users followed by user","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/users-controller-delete-account","label":"Delete user account permanently","className":"api-method delete"}]},{"type":"category","label":"Notes","items":[{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-notes","label":"Get all notes","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-post-v-1-notes","label":"Add note","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-notes-by-verse-by-verse-key","label":"Get notes by verse","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-notes-by-attached-entity","label":"Get notes by attached entity","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-notes-count-within-range","label":"Get notes count within verse range","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-notes-by-range","label":"Get notes by verse range","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-get-v-1-notes-by-note-id","label":"Get note by ID","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/auth-patch-v-1-notes-by-note-id","label":"Update note by ID","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/auth-delete-v-1-notes-by-note-id","label":"Delete note by ID","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/auth-post-v-1-notes-by-note-id-publish","label":"Publish note","className":"api-method post"}]},{"type":"category","label":"Rooms","items":[{"type":"doc","id":"user_related_apis_versioned/rooms-controller-admins-access","label":"Update room admin access","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-update-group","label":"Update a group","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-create-new-group","label":"Create a new group","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-update-page","label":"Update a page","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-create-new-page","label":"Create a new page","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-get-room-members","label":"Get room members","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-invite-user-to-room","label":"Invite user to room","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-accept-invite","label":"Accept room invite","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-reject-invite","label":"Reject room invite","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-remove-member","label":"Remove member from room","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-get-rooms","label":"Get joined or managed rooms","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-search-rooms","label":"Search rooms","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-get-room-profile","label":"Get room profile by URL or subdomain","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-accept-by-private-token","label":"Accept room invite by private token","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-get-room-profile-by-id","label":"Get room profile by ID","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-get-room-posts","label":"Get room posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-join-room","label":"Join a group","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-leave-group","label":"Leave a group","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-follow-page","label":"Follow a page","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-unfollow-page","label":"Unfollow a page","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/rooms-controller-update-post-privacy","label":"Update post privacy in room","className":"api-method patch"}]},{"type":"category","label":"Posts","items":[{"type":"doc","id":"user_related_apis_versioned/posts-controller-feed","label":"Get posts feed","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-related-posts","label":"Get related posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-loggedin-user-posts","label":"Get current user posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-liked-state","label":"Get post liked state","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-find-one","label":"Get post by ID","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-delete","label":"Delete post","className":"api-method delete"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-edit","label":"Edit post","className":"api-method patch"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-view-tracking","label":"Track post view","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-create","label":"Create post","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-report-abuse","label":"Report post abuse","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-user-post","label":"Get user posts","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-toggle-like","label":"Toggle post like","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-toggle-save","label":"Toggle post save","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-comments","label":"Get post comments","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-all-comment","label":"Get all post comments","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-export-multiple-posts","label":"Export posts as PDF","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-my-posts-count-within-range","label":"Get posts count within range","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/posts-controller-get-my-posts-by-verse","label":"Get posts by verse","className":"api-method get"}]},{"type":"category","label":"Tags","items":[{"type":"doc","id":"user_related_apis_versioned/tags-controller-find","label":"Search and retrieve tags","className":"api-method get"}]},{"type":"category","label":"Comments","items":[{"type":"doc","id":"user_related_apis_versioned/comments-controller-create","label":"Create a new comment","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/comments-controller-delete-comment","label":"Delete a comment","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/comments-controller-toggle-like","label":"Toggle like/unlike a comment","className":"api-method post"},{"type":"doc","id":"user_related_apis_versioned/comments-controller-get","label":"Get replies to a comment","className":"api-method get"}]},{"type":"category","label":"Sync","items":[{"type":"doc","id":"user_related_apis_versioned/get-mutations","label":"Get mutations","className":"api-method get"},{"type":"doc","id":"user_related_apis_versioned/sync-local-mutations","label":"Sync local mutations","className":"api-method post"}]}]; \ No newline at end of file diff --git a/docs/user_related_apis_versioned/sync-local-mutations.api.mdx b/docs/user_related_apis_versioned/sync-local-mutations.api.mdx new file mode 100644 index 00000000..fa2c8b0d --- /dev/null +++ b/docs/user_related_apis_versioned/sync-local-mutations.api.mdx @@ -0,0 +1,99 @@ +--- +id: sync-local-mutations +title: "Sync local mutations" +description: "An endpoint to sync local mutations to the server." +sidebar_label: "Sync local mutations" +hide_title: true +hide_table_of_contents: true +api: {"description":"An endpoint to sync local mutations to the server.","tags":["Sync"],"parameters":[{"in":"query","name":"lastMutationAt","schema":{"type":"number","format":"float","description":"The timestamp of the last mutation that was applied on the server. The value needs to match the latest value from get mutations endpoint, otherwise, the request will be rejected.","example":1731636500303},"required":true,"description":"The timestamp of the last mutation that was applied on the server. The value needs to match the latest value from get mutations endpoint, otherwise, the request will be rejected."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mutations":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CREATE","UPDATE","DELETE"],"description":"The type of the mutation","example":"CREATE"},"resource":{"type":"string","enum":["BOOKMARK","COLLECTION","COLLECTION_BOOKMARK","NOTE"],"description":"Resource the mutation applies to.","example":"BOOKMARK"},"resourceId":{"type":"string","description":"Server's ID for finding the resource during update/delete operations.","example":"lqc794i0qnxq4pdlfanfbd2r"},"data":{"type":"object","properties":{},"description":"Resource data. Format depends on resource type.","example":{"bookmarkType":"ayah","bookmarkGroup":"verses_6236","key":6,"verseNumber":3}}},"required":["type","resource"],"additionalProperties":false,"description":"Represents a single mutation/change to a resource"}}},"required":["mutations"],"additionalProperties":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"mutations":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CREATE","UPDATE","DELETE"],"description":"The type of the mutation","example":"CREATE"},"resource":{"type":"string","enum":["BOOKMARK","COLLECTION","COLLECTION_BOOKMARK","NOTE"],"description":"The resource the mutation was applied to.","example":"BOOKMARK"},"resourceId":{"type":"string","description":"The id of the resource the mutation was applied to. Will not be present for resources that use composite keys (e.g. COLLECTION_BOOKMARK uses data.collection and data.bookmark instead).","example":"lqc794i0qnxq4pdlfanfbd2r"},"data":{"type":"object","properties":{},"description":"The latest version of the data of the resource that was mutated. Will be empty when the mutation is a delete.","example":{"bookmarkType":"ayah","bookmarkGroup":"verses_6236","key":6,"verseNumber":3}},"timestamp":{"type":"number","format":"float","description":"Unix timestamp when the latest mutation of the resource occurred","example":1731636500303}},"required":["type","resource","timestamp"],"additionalProperties":false,"description":"Represents a single mutation/change to a resource"},"description":"Array of mutations that were successfully applied on the server.","example":[{"type":"CREATE","resource":"BOOKMARK","resourceId":"u54maufl0ftmarp73ei0hg64","data":{"bookmarkType":"ayah","bookmarkGroup":"verses_6236","key":6,"verseNumber":3},"timestamp":1769340915572},{"type":"UPDATE","resource":"COLLECTION","resourceId":"na6orcv0pbcomiphmkv0yhma","data":{"name":"New collection!","slug":"new-collection","isPrivate":true},"timestamp":1769340915572},{"type":"CREATE","resource":"COLLECTION_BOOKMARK","data":{"collection":"na6orcv0pbcomiphmkv0yhma","bookmark":"u54maufl0ftmarp73ei0hg64"},"timestamp":1769340915575},{"type":"DELETE","resource":"NOTE","resourceId":"his2lubkxxr3l102nqptmnur","data":{},"timestamp":1769341113173}]},"page":{"type":"number","format":"float","description":"Current page number","example":1},"limit":{"type":"number","format":"float","description":"Items per page","example":100},"total":{"type":"number","format":"float","description":"Total number of mutations","example":150},"hasMore":{"type":"boolean","description":"Whether more pages exist","example":true},"lastMutationAt":{"type":"number","format":"float","description":"Timestamp of the latest mutation that was applied on the server. This should be used for subsequent sync requests.","example":1731636500303}},"required":["lastMutationAt"],"additionalProperties":false,"description":"Response schema for post mutations endpoint"}},"additionalProperties":false}}},"headers":{"X-Mutation-At":{"description":"Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.","schema":{"type":"string","example":"1731636500303"}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"409":{"description":"Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"OutOfSyncError"},"message":{"type":"string","example":"Invalid lastMutationAt, please re-sync your data and try again."}}}}},"examples":{"Out of sync":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"Invalid lastMutationAt, please re-sync your data and try again."}}},"First sync - wrong lastMutationAt":{"value":{"success":false,"error":{"code":"OutOfSyncError","message":"First sync detected. Please use lastMutationAt=-1 for initial sync."}}}}}}},"422":{"description":"Validation Error. The request includes one or more invalid params.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"ValidationError"},"message":{"type":"string","example":"Invalid mutations"}}}}},"examples":{"Invalid mutations format":{"value":{"success":false,"error":{"code":"ValidationError","message":"Invalid mutations"}}},"Too many mutations":{"value":{"success":false,"error":{"code":"ValidationError","message":"Mutations must not exceed 100"}}},"Missing resource":{"value":{"success":false,"error":{"code":"ValidationError","message":"Missing resource at mutation[0]"}}},"Invalid resource":{"value":{"success":false,"error":{"code":"ValidationError","message":"Invalid resource: \"invalidResource\" at mutation[0]"}}},"Missing mutation type":{"value":{"success":false,"error":{"code":"ValidationError","message":"Missing mutation type at mutation[0]"}}},"Invalid mutation type":{"value":{"success":false,"error":{"code":"ValidationError","message":"Invalid mutation type: \"invalidType\" at mutation[0]"}}},"Missing resourceId":{"value":{"success":false,"error":{"code":"ValidationError","message":"Missing resourceId at mutation[0]"}}},"Invalid resourceId type":{"value":{"success":false,"error":{"code":"ValidationError","message":"Invalid resourceId at mutation[0]"}}},"Missing data":{"value":{"success":false,"error":{"code":"ValidationError","message":"Missing data at mutation[0]"}}}}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"method":"post","path":"/v1/sync","servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"mutations":[{"type":"CREATE","resource":"BOOKMARK","resourceId":"lqc794i0qnxq4pdlfanfbd2r","data":{"bookmarkType":"ayah","bookmarkGroup":"verses_6236","key":6,"verseNumber":3}}]},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Sync local mutations","description":{"content":"An endpoint to sync local mutations to the server.","type":"text/plain"},"url":{"path":["v1","sync"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"(Required) The timestamp of the last mutation that was applied on the server. The value needs to match the latest value from get mutations endpoint, otherwise, the request will be rejected.","type":"text/plain"},"key":"lastMutationAt","value":""}],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +sidebar_class_name: "post api-method" +info_path: docs/user_related_apis_versioned/user-related-apis +custom_edit_url: null +displayed_sidebar: APIsSidebar +--- + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Sync local mutations + + + +An endpoint to sync local mutations to the server. + +
    Query Parameters
    Request Body
      mutations object[] required
    • Array [
    • data object
      + +Resource data. Format depends on resource type. + +
    • ]
    + +Request has been handled successfully. + +
    Response Headers
    • X-Mutation-At string
      + +Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control. + +
    Schema
      data object
      + +Response schema for post mutations endpoint + +
      mutations object[]
      + +Array of mutations that were successfully applied on the server. + +
    • Array [
    • data object
      + +The latest version of the data of the resource that was mutated. Will be empty when the mutation is a delete. + +
    • ]
    + +The request is missing required parameters or is invalid. + +
    Schema
    + +The request is unauthorized. + +
    Schema
    + +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
    + +Not Found. The resource being accessed does not exist. + +
    Schema
    + +Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation. + +
    Schema
      error object
    + +Validation Error. The request includes one or more invalid params. + +
    Schema
      error object
    + +Too many requests, please try again later. + +
    Schema
    + +Server Error. Something went wrong, try again later. + +
    Schema
    + +Invalid response from the upstream server + +
    Schema
    + +The server is currently unable to handle the request due to a temporary overload or scheduled maintenance + +
    Schema
    + +The server did not receive a timely response from the upstream server. + +
    Schema
    + \ No newline at end of file diff --git a/docs/user_related_apis_versioned/tags-controller-find.api.mdx b/docs/user_related_apis_versioned/tags-controller-find.api.mdx index d671d32c..1fbdfdc6 100644 --- a/docs/user_related_apis_versioned/tags-controller-find.api.mdx +++ b/docs/user_related_apis_versioned/tags-controller-find.api.mdx @@ -5,7 +5,7 @@ description: "Search for tags by query string. Returns paginated results matchin sidebar_label: "Search and retrieve tags" hide_title: true hide_table_of_contents: true -api: {"operationId":"TagsController_find","description":"Search for tags by query string. Returns paginated results matching the search term. Useful for tag autocomplete and discovery features.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"type":"number"}}],"responses":{"200":{"description":"Tags matching search query with pagination","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"rank":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"postsCount":{"type":"number"},"commentsCount":{"type":"number"}},"required":["id","createdAt","updatedAt"],"title":"Tag"}}}}}},"tags":["Tags"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/tags","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Search and retrieve tags","description":{"content":"Search for tags by query string. Returns paginated results matching the search term. Useful for tag autocomplete and discovery features.","type":"text/plain"},"url":{"path":["v1","tags"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search term","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Number of results to return","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number","type":"text/plain"},"key":"page","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"TagsController_find","description":"Search for tags by query string. Returns paginated results matching the search term. Useful for tag autocomplete and discovery features.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"type":"number"}}],"responses":{"200":{"description":"Tags matching search query with pagination","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"rank":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"postsCount":{"type":"number"},"commentsCount":{"type":"number"}},"required":["id","createdAt","updatedAt"],"title":"Tag"}},"example":[{"id":1,"name":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","rank":0,"languageId":1,"languageName":"string","postsCount":1,"commentsCount":1}]}}}},"tags":["Tags"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/tags","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Search and retrieve tags","description":{"content":"Search for tags by query string. Returns paginated results matching the search term. Useful for tag autocomplete and discovery features.","type":"text/plain"},"url":{"path":["v1","tags"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search term","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Number of results to return","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number","type":"text/plain"},"key":"page","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,5 +31,5 @@ Search for tags by query string. Returns paginated results matching the search t Tags matching search query with pagination -
    Schema
    • Array [
    • ]
    +
    Schema
    • Array [
    • ]
    \ No newline at end of file diff --git a/docs/user_related_apis_versioned/user-related-apis.info.mdx b/docs/user_related_apis_versioned/user-related-apis.info.mdx index 1a73f12a..3c1527a5 100644 --- a/docs/user_related_apis_versioned/user-related-apis.info.mdx +++ b/docs/user_related_apis_versioned/user-related-apis.info.mdx @@ -26,6 +26,8 @@ Quran.Foundation user-related APIs enable your app to seamlessly integrate with We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). + For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs. + ## Pagination We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. diff --git a/docs/user_related_apis_versioned/users-controller-delete-account.api.mdx b/docs/user_related_apis_versioned/users-controller-delete-account.api.mdx index 0e29ab93..8c46eda8 100644 --- a/docs/user_related_apis_versioned/users-controller-delete-account.api.mdx +++ b/docs/user_related_apis_versioned/users-controller-delete-account.api.mdx @@ -5,7 +5,7 @@ description: "Permanently delete the authenticated user account and all associat sidebar_label: "Delete user account permanently" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_deleteAccount","description":"Permanently delete the authenticated user account and all associated data from QuranReflect and Quran.com. This action is irreversible. The user is immediately banned to prevent further actions, then all data is deleted in the background. All posts, comments, likes, preferences, and memberships will be removed. If the user owns rooms, posts by other members will be converted to global posts.","parameters":[],"responses":{"200":{"description":"Account deletion initiated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Account deletion initiated successfully"}}}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"delete","path":"/v1/users","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete user account permanently","description":{"content":"Permanently delete the authenticated user account and all associated data from QuranReflect and Quran.com. This action is irreversible. The user is immediately banned to prevent further actions, then all data is deleted in the background. All posts, comments, likes, preferences, and memberships will be removed. If the user owns rooms, posts by other members will be converted to global posts.","type":"text/plain"},"url":{"path":["v1","users"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} +api: {"operationId":"UsersController_deleteAccount","description":"Permanently delete the authenticated user account and all associated data from QuranReflect and Quran.com. This action is irreversible. The user is immediately banned to prevent further actions, then all data is deleted in the background. All posts, comments, likes, preferences, and memberships will be removed. If the user owns rooms, posts by other members will be converted to global posts.","parameters":[],"responses":{"200":{"description":"Account deletion initiated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Account deletion initiated successfully"}}}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"delete","path":"/v1/users","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Delete user account permanently","description":{"content":"Permanently delete the authenticated user account and all associated data from QuranReflect and Quran.com. This action is irreversible. The user is immediately banned to prevent further actions, then all data is deleted in the background. All posts, comments, likes, preferences, and memberships will be removed. If the user owns rooms, posts by other members will be converted to global posts.","type":"text/plain"},"url":{"path":["v1","users"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"DELETE"}} sidebar_class_name: "delete api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null diff --git a/docs/user_related_apis_versioned/users-controller-edit-profile.api.mdx b/docs/user_related_apis_versioned/users-controller-edit-profile.api.mdx index d725306f..adcbb9e4 100644 --- a/docs/user_related_apis_versioned/users-controller-edit-profile.api.mdx +++ b/docs/user_related_apis_versioned/users-controller-edit-profile.api.mdx @@ -5,7 +5,7 @@ description: "Partially update the authenticated user settings and preferences l sidebar_label: "Edit user profile" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_editProfile","description":"Partially update the authenticated user settings and preferences like notification settings, privacy options, and display preferences.","parameters":[],"requestBody":{"required":true,"description":"Settings fields to update - only include fields you want to change","content":{"application/json":{"schema":{"type":"object","properties":{"languageId":{"type":"number"},"reflectionLanguages":{"type":"array","items":{"type":"string"}},"ayahLanguages":{"type":"array","items":{"type":"string"}},"customized":{"type":"boolean"},"hideFollowSuggestion":{"type":"boolean","description":"Hide follow suggestion popup after liking a post"},"showFollowFeaturedSuggestion":{"type":"boolean","description":"Show featured follow suggestion popup on QR onboarding"}},"title":"EditProfileDto"}}}},"responses":{"200":{"description":"Settings updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}}}}},"400":{"description":"Invalid settings data"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/users/profile","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"languageId":0,"reflectionLanguages":["string"],"ayahLanguages":["string"],"customized":true,"hideFollowSuggestion":true,"showFollowFeaturedSuggestion":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Edit user profile","description":{"content":"Partially update the authenticated user settings and preferences like notification settings, privacy options, and display preferences.","type":"text/plain"},"url":{"path":["v1","users","profile"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"UsersController_editProfile","description":"Partially update the authenticated user settings and preferences like notification settings, privacy options, and display preferences.","parameters":[],"requestBody":{"required":true,"description":"Settings fields to update - only include fields you want to change","content":{"application/json":{"schema":{"type":"object","properties":{"languageId":{"type":"number"},"reflectionLanguages":{"type":"array","items":{"type":"string"}},"ayahLanguages":{"type":"array","items":{"type":"string"}},"customized":{"type":"boolean"},"hideFollowSuggestion":{"type":"boolean","description":"Hide follow suggestion popup after liking a post"},"showFollowFeaturedSuggestion":{"type":"boolean","description":"Show featured follow suggestion popup on QR onboarding"}},"title":"EditProfileDto"},"example":{"languageId":1,"reflectionLanguages":["string"],"ayahLanguages":["string"],"customized":true,"hideFollowSuggestion":true,"showFollowFeaturedSuggestion":true}}}},"responses":{"200":{"description":"Settings updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}},"example":{"success":true}}}},"400":{"description":"Invalid settings data"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"patch","path":"/v1/users/profile","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"languageId":0,"reflectionLanguages":["string"],"ayahLanguages":["string"],"customized":true,"hideFollowSuggestion":true,"showFollowFeaturedSuggestion":true},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Edit user profile","description":{"content":"Partially update the authenticated user settings and preferences like notification settings, privacy options, and display preferences.","type":"text/plain"},"url":{"path":["v1","users","profile"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "patch api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Settings fields to update - only include fields you want to change Settings updated successfully -
    Schema
    +
    Schema
    Invalid settings data diff --git a/docs/user_related_apis_versioned/users-controller-follow-featured-users.api.mdx b/docs/user_related_apis_versioned/users-controller-follow-featured-users.api.mdx deleted file mode 100644 index eb0ac000..00000000 --- a/docs/user_related_apis_versioned/users-controller-follow-featured-users.api.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -id: users-controller-follow-featured-users -title: "Follow all featured users" -description: "Follows all eligible featured user recommendations in one action." -sidebar_label: "Follow all featured users" -hide_title: true -hide_table_of_contents: true -api: {"operationId":"UsersController_followFeaturedUsers","description":"Follows all eligible featured user recommendations in one action.","parameters":[],"responses":{"200":{"description":"Summary of follow-all operation","content":{"application/json":{"schema":{"type":"object","properties":{"requested":{"type":"number","example":9},"followed":{"type":"number","example":7},"skipped":{"type":"number","example":1},"failed":{"type":"number","example":1},"complete":{"type":"boolean","example":true},"failedItems":{"type":"array","items":{"type":"object","properties":{"followeeId":{"type":"string","example":"user-id-123"},"reason":{"type":"string","example":"FOLLOW_FAILED"}},"required":["followeeId","reason"],"title":"FailedFeaturedFollowItemDto"}}},"required":["requested","followed","skipped","failed","complete"],"title":"FollowFeaturedUsersResponseDto"}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/users/featured/follow-all","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Follow all featured users","description":{"content":"Follows all eligible featured user recommendations in one action.","type":"text/plain"},"url":{"path":["v1","users","featured","follow-all"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} -sidebar_class_name: "post api-method" -info_path: docs/user_related_apis_versioned/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Follow all featured users - - - -Follows all eligible featured user recommendations in one action. - -
    - -Summary of follow-all operation - -
    Schema
      failedItems object[]
    • Array [
    • ]
    - -User not authenticated - -
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/users-controller-get-featured-users.api.mdx b/docs/user_related_apis_versioned/users-controller-get-featured-users.api.mdx deleted file mode 100644 index 242d4f12..00000000 --- a/docs/user_related_apis_versioned/users-controller-get-featured-users.api.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -id: users-controller-get-featured-users -title: "Get featured users for follow recommendation" -description: "Returns a sorted list of feature-enabled users excluding banned, dangerous, and followed accounts." -sidebar_label: "Get featured users for follow recommendation" -hide_title: true -hide_table_of_contents: true -api: {"operationId":"UsersController_getFeaturedUsers","description":"Returns a sorted list of feature-enabled users excluding banned, dangerous, and followed accounts.","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size (default/max: 9)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Featured users result","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"1f8d6f3f-2f57-4c3e-b7b5-5f6a9d7f7a55"},"username":{"type":"string","example":"example.user"},"verified":{"type":"boolean","example":true},"firstName":{"type":"string","example":"Example"},"lastName":{"type":"string","example":"User"},"fullName":{"type":"string","example":"Example User"},"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"followersCount":{"type":"number","example":1200},"bio":{"type":"string","example":"I write reflections on the Quran."}},"required":["id","username","verified","firstName","lastName","fullName","avatarUrls","followersCount"],"title":"FeaturedUserDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"FeaturedUsersResponseDto"}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/featured","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get featured users for follow recommendation","description":{"content":"Returns a sorted list of feature-enabled users excluding banned, dangerous, and followed accounts.","type":"text/plain"},"url":{"path":["v1","users","featured"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Page size (default/max: 9)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} -sidebar_class_name: "get api-method" -info_path: docs/user_related_apis_versioned/user-related-apis -custom_edit_url: null -displayed_sidebar: APIsSidebar ---- - -import ApiTabs from "@theme/ApiTabs"; -import MimeTabs from "@theme/MimeTabs"; -import ParamsItem from "@theme/ParamsItem"; -import ResponseSamples from "@theme/ResponseSamples"; -import SchemaItem from "@theme/SchemaItem"; -import SchemaTabs from "@theme/SchemaTabs"; -import DiscriminatorTabs from "@theme/DiscriminatorTabs"; -import TabItem from "@theme/TabItem"; - -## Get featured users for follow recommendation - - - -Returns a sorted list of feature-enabled users excluding banned, dangerous, and followed accounts. - -
    Query Parameters
    - -Featured users result - -
    Schema
      data object[] required
    • Array [
    • ]
    - -User not authenticated - -
    - \ No newline at end of file diff --git a/docs/user_related_apis_versioned/users-controller-get-user-followers.api.mdx b/docs/user_related_apis_versioned/users-controller-get-user-followers.api.mdx index 4c86ab9b..bb364f41 100644 --- a/docs/user_related_apis_versioned/users-controller-get-user-followers.api.mdx +++ b/docs/user_related_apis_versioned/users-controller-get-user-followers.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve a paginated list of users who follow the specified user. sidebar_label: "Get user followers" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_getUserFollowers","description":"Retrieve a paginated list of users who follow the specified user. Includes follow relationship to the viewer if authenticated.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"List of followers with pagination"},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/{id}/followers","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user followers","description":{"content":"Retrieve a paginated list of users who follow the specified user. Includes follow relationship to the viewer if authenticated.","type":"text/plain"},"url":{"path":["v1","users",":id","followers"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"UsersController_getUserFollowers","description":"Retrieve a paginated list of users who follow the specified user. Includes follow relationship to the viewer if authenticated.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"List of followers with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"isFollowed":{"type":"boolean","example":false},"followed":{"type":"boolean","example":false},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSearchDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"UsersSearchResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"isFollowed":false,"followed":false,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string"}]}}}},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/{id}/followers","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user followers","description":{"content":"Retrieve a paginated list of users who follow the specified user. Includes follow relationship to the viewer if authenticated.","type":"text/plain"},"url":{"path":["v1","users",":id","followers"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve a paginated list of users who follow the specified user. Includes follo List of followers with pagination -
    +
    Schema
      data object[] required
    • Array [
    • settings object required
    • ]
    User not found diff --git a/docs/user_related_apis_versioned/users-controller-get-user-following.api.mdx b/docs/user_related_apis_versioned/users-controller-get-user-following.api.mdx index 141ecaa5..02d0ba29 100644 --- a/docs/user_related_apis_versioned/users-controller-get-user-following.api.mdx +++ b/docs/user_related_apis_versioned/users-controller-get-user-following.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve a paginated list of users that the specified user follows sidebar_label: "Get users followed by user" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_getUserFollowing","description":"Retrieve a paginated list of users that the specified user follows. Includes follow relationship to the viewer if authenticated.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"List of followed users with pagination"},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/{id}/following","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get users followed by user","description":{"content":"Retrieve a paginated list of users that the specified user follows. Includes follow relationship to the viewer if authenticated.","type":"text/plain"},"url":{"path":["v1","users",":id","following"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user","type":"text/plain"},"type":"any","value":"","key":"id"}]},"method":"GET"}} +api: {"operationId":"UsersController_getUserFollowing","description":"Retrieve a paginated list of users that the specified user follows. Includes follow relationship to the viewer if authenticated.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"List of followed users with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"isFollowed":{"type":"boolean","example":false},"followed":{"type":"boolean","example":false},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSearchDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"UsersSearchResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"isFollowed":false,"followed":false,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string"}]}}}},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/{id}/following","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get users followed by user","description":{"content":"Retrieve a paginated list of users that the specified user follows. Includes follow relationship to the viewer if authenticated.","type":"text/plain"},"url":{"path":["v1","users",":id","following"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve a paginated list of users that the specified user follows. Includes fol List of followed users with pagination -
    +
    Schema
      data object[] required
    • Array [
    • settings object required
    • ]
    User not found diff --git a/docs/user_related_apis_versioned/users-controller-get-user-profile.api.mdx b/docs/user_related_apis_versioned/users-controller-get-user-profile.api.mdx index 55c387f9..dd3afb59 100644 --- a/docs/user_related_apis_versioned/users-controller-get-user-profile.api.mdx +++ b/docs/user_related_apis_versioned/users-controller-get-user-profile.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve a user profile by either UUID or username. If viewing you sidebar_label: "Get user profile by id or username" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_getUserProfile","description":"Retrieve a user profile by either UUID or username. If viewing your own profile, returns full data; otherwise returns public profile with follow relationship status.","parameters":[{"name":"id","required":false,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"username","required":false,"in":"path","description":"Username of the user (case-insensitive)","schema":{"type":"string"}},{"name":"qdc","required":false,"in":"query","description":"Include Quran.com connected account data","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Own profile with full data including settings","content":{"application/json":{"schema":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"}}}},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user profile by id or username","description":{"content":"Retrieve a user profile by either UUID or username. If viewing your own profile, returns full data; otherwise returns public profile with follow relationship status.","type":"text/plain"},"url":{"path":["v1","users",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Include Quran.com connected account data","type":"text/plain"},"key":"qdc","value":""}],"variable":[{"disabled":false,"description":{"content":"UUID of the user","type":"text/plain"},"type":"any","value":"","key":"id"},{"disabled":false,"description":{"content":"Username of the user (case-insensitive)","type":"text/plain"},"type":"any","value":"","key":"username"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"UsersController_getUserProfile","description":"Retrieve a user profile by either UUID or username. If viewing your own profile, returns full data; otherwise returns public profile with follow relationship status.","parameters":[{"name":"id","required":false,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"username","required":false,"in":"path","description":"Username of the user (case-insensitive)","schema":{"type":"string"}},{"name":"qdc","required":false,"in":"query","description":"Include Quran.com connected account data","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Own profile with full data including settings","content":{"application/json":{"schema":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"},"example":{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}}}},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/{id}","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user profile by id or username","description":{"content":"Retrieve a user profile by either UUID or username. If viewing your own profile, returns full data; otherwise returns public profile with follow relationship status.","type":"text/plain"},"url":{"path":["v1","users",":id"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Include Quran.com connected account data","type":"text/plain"},"key":"qdc","value":""}],"variable":[{"disabled":false,"description":{"content":"UUID of the user","type":"text/plain"},"type":"any","value":"","key":"id"},{"disabled":false,"description":{"content":"Username of the user (case-insensitive)","type":"text/plain"},"type":"any","value":"","key":"username"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve a user profile by either UUID or username. If viewing your own profile, Own profile with full data including settings -
    Schema
      settings object required
    +
    Schema
      settings object required
    User not found diff --git a/docs/user_related_apis_versioned/users-controller-profile.api.mdx b/docs/user_related_apis_versioned/users-controller-profile.api.mdx index 9ef83f72..0f168070 100644 --- a/docs/user_related_apis_versioned/users-controller-profile.api.mdx +++ b/docs/user_related_apis_versioned/users-controller-profile.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve the complete profile of the authenticated user including sidebar_label: "Get user profile" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_profile","description":"Retrieve the complete profile of the authenticated user including personal info, settings, statistics, and connected accounts.","parameters":[{"name":"qdc","required":false,"in":"query","description":"Include Quran.com (QDC) connected account data","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Full user profile with all data","content":{"application/json":{"schema":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/profile","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user profile","description":{"content":"Retrieve the complete profile of the authenticated user including personal info, settings, statistics, and connected accounts.","type":"text/plain"},"url":{"path":["v1","users","profile"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Include Quran.com (QDC) connected account data","type":"text/plain"},"key":"qdc","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"UsersController_profile","description":"Retrieve the complete profile of the authenticated user including personal info, settings, statistics, and connected accounts.","parameters":[{"name":"qdc","required":false,"in":"query","description":"Include Quran.com (QDC) connected account data","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Full user profile with all data","content":{"application/json":{"schema":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"},"example":{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/profile","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get user profile","description":{"content":"Retrieve the complete profile of the authenticated user including personal info, settings, statistics, and connected accounts.","type":"text/plain"},"url":{"path":["v1","users","profile"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Include Quran.com (QDC) connected account data","type":"text/plain"},"key":"qdc","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve the complete profile of the authenticated user including personal info, Full user profile with all data -
    Schema
      settings object required
    +
    Schema
      settings object required
    User not authenticated diff --git a/docs/user_related_apis_versioned/users-controller-remove-follower.api.mdx b/docs/user_related_apis_versioned/users-controller-remove-follower.api.mdx index 076eb3dc..ab90cbd8 100644 --- a/docs/user_related_apis_versioned/users-controller-remove-follower.api.mdx +++ b/docs/user_related_apis_versioned/users-controller-remove-follower.api.mdx @@ -5,7 +5,7 @@ description: "Remove a user from your followers list. They will no longer see yo sidebar_label: "Remove a follower" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_removeFollower","description":"Remove a user from your followers list. They will no longer see you as followed and won't receive notifications about your activity.","parameters":[{"name":"followerId","required":true,"in":"path","description":"UUID of the follower to remove","schema":{"type":"string"}}],"responses":{"200":{"description":"Follower removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean","example":true}}}}}},"400":{"description":"Invalid follower id or follower relationship doesn't exist"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/users/{followerId}/remove-follower","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Remove a follower","description":{"content":"Remove a user from your followers list. They will no longer see you as followed and won't receive notifications about your activity.","type":"text/plain"},"url":{"path":["v1","users",":followerId","remove-follower"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the follower to remove","type":"text/plain"},"type":"any","value":"","key":"followerId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} +api: {"operationId":"UsersController_removeFollower","description":"Remove a user from your followers list. They will no longer see you as followed and won't receive notifications about your activity.","parameters":[{"name":"followerId","required":true,"in":"path","description":"UUID of the follower to remove","schema":{"type":"string"}}],"responses":{"200":{"description":"Follower removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean","example":true}}},"example":{"removed":true}}}},"400":{"description":"Invalid follower id or follower relationship doesn't exist"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/users/{followerId}/remove-follower","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Remove a follower","description":{"content":"Remove a user from your followers list. They will no longer see you as followed and won't receive notifications about your activity.","type":"text/plain"},"url":{"path":["v1","users",":followerId","remove-follower"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the follower to remove","type":"text/plain"},"type":"any","value":"","key":"followerId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Remove a user from your followers list. They will no longer see you as followed Follower removed successfully -
    Schema
    +
    Schema
    Invalid follower id or follower relationship doesn't exist diff --git a/docs/user_related_apis_versioned/users-controller-rooms.api.mdx b/docs/user_related_apis_versioned/users-controller-rooms.api.mdx index 7dabfaa9..13ee0305 100644 --- a/docs/user_related_apis_versioned/users-controller-rooms.api.mdx +++ b/docs/user_related_apis_versioned/users-controller-rooms.api.mdx @@ -5,7 +5,7 @@ description: "Retrieve all rooms (groups and pages) the authenticated user is a sidebar_label: "Get logged-in user rooms" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_rooms","description":"Retrieve all rooms (groups and pages) the authenticated user is a member of. Supports filtering by name and pagination.","parameters":[{"name":"name","required":false,"in":"query","description":"Filter rooms by name","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Rooms per page (default: 10)","schema":{"type":"number"}}],"responses":{"200":{"description":"User rooms with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"group":{"type":"string"},"public":{"type":"boolean"},"roomType":{"type":"string"},"verified":{"type":"boolean"},"subdomain":{"type":"string"},"description":{"type":"string"},"membersCount":{"type":"number"},"avatarUrl":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}}},"required":["id","name","group","public","roomType","verified","subdomain","description","membersCount","avatarUrl"],"title":"UserRoomDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"UserRoomsResponse"}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/my-rooms","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get logged-in user rooms","description":{"content":"Retrieve all rooms (groups and pages) the authenticated user is a member of. Supports filtering by name and pagination.","type":"text/plain"},"url":{"path":["v1","users","my-rooms"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Filter rooms by name","type":"text/plain"},"key":"name","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Rooms per page (default: 10)","type":"text/plain"},"key":"limit","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"UsersController_rooms","description":"Retrieve all rooms (groups and pages) the authenticated user is a member of. Supports filtering by name and pagination.","parameters":[{"name":"name","required":false,"in":"query","description":"Filter rooms by name","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Rooms per page (default: 10)","schema":{"type":"number"}}],"responses":{"200":{"description":"User rooms with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"group":{"type":"string"},"public":{"type":"boolean"},"roomType":{"type":"string"},"verified":{"type":"boolean"},"subdomain":{"type":"string"},"description":{"type":"string"},"membersCount":{"type":"number"},"avatarUrl":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}}},"required":["id","name","group","public","roomType","verified","subdomain","description","membersCount","avatarUrl"],"title":"UserRoomDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"UserRoomsResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"id":1,"name":"string","group":"string","public":true,"roomType":"string","verified":true,"subdomain":"string","description":"string","membersCount":1,"avatarUrl":{"small":"string","medium":"string","large":"string"}}]}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/my-rooms","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Get logged-in user rooms","description":{"content":"Retrieve all rooms (groups and pages) the authenticated user is a member of. Supports filtering by name and pagination.","type":"text/plain"},"url":{"path":["v1","users","my-rooms"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Filter rooms by name","type":"text/plain"},"key":"name","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Rooms per page (default: 10)","type":"text/plain"},"key":"limit","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,7 +31,7 @@ Retrieve all rooms (groups and pages) the authenticated user is a member of. Sup User rooms with pagination metadata -
    Schema
      data object[] required
    • Array [
    • avatarUrl object required
    • ]
    +
    Schema
      data object[] required
    • Array [
    • avatarUrl object required
    • ]
    User not authenticated diff --git a/docs/user_related_apis_versioned/users-controller-search.api.mdx b/docs/user_related_apis_versioned/users-controller-search.api.mdx index 87cdad2e..71a32813 100644 --- a/docs/user_related_apis_versioned/users-controller-search.api.mdx +++ b/docs/user_related_apis_versioned/users-controller-search.api.mdx @@ -5,7 +5,7 @@ description: "Search users by name or username. Supports mentioning in posts, fi sidebar_label: "Search for users" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_search","description":"Search users by name or username. Supports mentioning in posts, finding users for room invites, and general discovery. Results can be scoped to specific contexts.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term for name/username","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"all","required":false,"in":"query","description":"Search all users (not just followed)","schema":{"type":"boolean"}},{"name":"postingAs","required":false,"in":"query","description":"Filter for posting-as feature","schema":{"type":"boolean"}},{"name":"postingAsUserId","required":false,"in":"query","description":"User ID for posting-as context","schema":{"type":"string"}},{"name":"roomId","required":false,"in":"query","description":"Room ID for scoped search","schema":{"type":"number"}}],"responses":{"200":{"description":"Matching users with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"UsersSearchResponse"}}}}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/search","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Search for users","description":{"content":"Search users by name or username. Supports mentioning in posts, finding users for room invites, and general discovery. Results can be scoped to specific contexts.","type":"text/plain"},"url":{"path":["v1","users","search"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search term for name/username","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Search all users (not just followed)","type":"text/plain"},"key":"all","value":""},{"disabled":false,"description":{"content":"Filter for posting-as feature","type":"text/plain"},"key":"postingAs","value":""},{"disabled":false,"description":{"content":"User ID for posting-as context","type":"text/plain"},"key":"postingAsUserId","value":""},{"disabled":false,"description":{"content":"Room ID for scoped search","type":"text/plain"},"key":"roomId","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} +api: {"operationId":"UsersController_search","description":"Search users by name or username. Supports mentioning in posts, finding users for room invites, and general discovery. Results can be scoped to specific contexts.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term for name/username","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"all","required":false,"in":"query","description":"Search all users (not just followed)","schema":{"type":"boolean"}},{"name":"postingAs","required":false,"in":"query","description":"Filter for posting-as feature","schema":{"type":"boolean"}},{"name":"postingAsUserId","required":false,"in":"query","description":"User ID for posting-as context","schema":{"type":"string"}},{"name":"roomId","required":false,"in":"query","description":"Room ID for scoped search","schema":{"type":"number"}}],"responses":{"200":{"description":"Matching users with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"isFollowed":{"type":"boolean","example":false},"followed":{"type":"boolean","example":false},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSearchDto"}}},"required":["total","currentPage","limit","pages","data"],"title":"UsersSearchResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"isFollowed":false,"followed":false,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string"}]}}}}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"get","path":"/v1/users/search","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Search for users","description":{"content":"Search users by name or username. Supports mentioning in posts, finding users for room invites, and general discovery. Results can be scoped to specific contexts.","type":"text/plain"},"url":{"path":["v1","users","search"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Search term for name/username","type":"text/plain"},"key":"query","value":""},{"disabled":false,"description":{"content":"Results per page (default: 10)","type":"text/plain"},"key":"limit","value":""},{"disabled":false,"description":{"content":"Page number (default: 1)","type":"text/plain"},"key":"page","value":""},{"disabled":false,"description":{"content":"Search all users (not just followed)","type":"text/plain"},"key":"all","value":""},{"disabled":false,"description":{"content":"Filter for posting-as feature","type":"text/plain"},"key":"postingAs","value":""},{"disabled":false,"description":{"content":"User ID for posting-as context","type":"text/plain"},"key":"postingAsUserId","value":""},{"disabled":false,"description":{"content":"Room ID for scoped search","type":"text/plain"},"key":"roomId","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}} sidebar_class_name: "get api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -31,5 +31,5 @@ Search users by name or username. Supports mentioning in posts, finding users fo Matching users with pagination -
    Schema
      data object[] required
    • Array [
    • settings object required
    • ]
    +
    Schema
      data object[] required
    • Array [
    • settings object required
    • ]
    \ No newline at end of file diff --git a/docs/user_related_apis_versioned/users-controller-toggle-follow.api.mdx b/docs/user_related_apis_versioned/users-controller-toggle-follow.api.mdx index 663e7f7f..113c65fa 100644 --- a/docs/user_related_apis_versioned/users-controller-toggle-follow.api.mdx +++ b/docs/user_related_apis_versioned/users-controller-toggle-follow.api.mdx @@ -5,7 +5,7 @@ description: "Follow or unfollow another user. When following, their posts will sidebar_label: "Toggle follow/unfollow a user" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_toggleFollow","description":"Follow or unfollow another user. When following, their posts will appear in your FOLLOWING feed. Can optionally specify action to force follow/unfollow.","parameters":[{"name":"followeeId","required":true,"in":"path","description":"UUID of the user to follow/unfollow","schema":{"type":"string"}}],"requestBody":{"required":false,"description":"Optional: specify \"follow\" or \"unfollow\" action explicitly","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"enum":["follow","unfollow"],"type":"string","description":"The intended action: follow or unfollow","example":"follow"}},"title":"ToggleFollowDto"}}}},"responses":{"200":{"description":"Follow status changed - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"followed":{"type":"boolean","description":"true if now following"}}}}}},"400":{"description":"Cannot follow yourself or action already in desired state"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/users/{followeeId}/toggle-follow","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"action":"follow"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle follow/unfollow a user","description":{"content":"Follow or unfollow another user. When following, their posts will appear in your FOLLOWING feed. Can optionally specify action to force follow/unfollow.","type":"text/plain"},"url":{"path":["v1","users",":followeeId","toggle-follow"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user to follow/unfollow","type":"text/plain"},"type":"any","value":"","key":"followeeId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"UsersController_toggleFollow","description":"Follow or unfollow another user. When following, their posts will appear in your FOLLOWING feed. Can optionally specify action to force follow/unfollow.","parameters":[{"name":"followeeId","required":true,"in":"path","description":"UUID of the user to follow/unfollow","schema":{"type":"string"}}],"requestBody":{"required":false,"description":"Optional: specify \"follow\" or \"unfollow\" action explicitly","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"enum":["follow","unfollow"],"type":"string","description":"The intended action: follow or unfollow","example":"follow"}},"title":"ToggleFollowDto"},"example":{"action":"follow"}}}},"responses":{"200":{"description":"Follow status changed - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"followed":{"type":"boolean","description":"true if now following"}}},"example":{"followed":true}}}},"400":{"description":"Cannot follow yourself or action already in desired state"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"post","path":"/v1/users/{followeeId}/toggle-follow","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"action":"follow"},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Toggle follow/unfollow a user","description":{"content":"Follow or unfollow another user. When following, their posts will appear in your FOLLOWING feed. Can optionally specify action to force follow/unfollow.","type":"text/plain"},"url":{"path":["v1","users",":followeeId","toggle-follow"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) UUID of the user to follow/unfollow","type":"text/plain"},"type":"any","value":"","key":"followeeId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "post api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Optional: specify "follow" or "unfollow" action explicitly Follow status changed - returns new state -
    Schema
    +
    Schema
    Cannot follow yourself or action already in desired state diff --git a/docs/user_related_apis_versioned/users-controller-update-profile.api.mdx b/docs/user_related_apis_versioned/users-controller-update-profile.api.mdx index 635b10bc..3f42e586 100644 --- a/docs/user_related_apis_versioned/users-controller-update-profile.api.mdx +++ b/docs/user_related_apis_versioned/users-controller-update-profile.api.mdx @@ -5,7 +5,7 @@ description: "Update user profile information including name, bio, username, ava sidebar_label: "Update user profile" hide_title: true hide_table_of_contents: true -api: {"operationId":"UsersController_updateProfile","description":"Update user profile information including name, bio, username, avatar, and social links. Validates username uniqueness.","parameters":[],"requestBody":{"required":true,"description":"Profile fields to update wrapped in a user object","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"removeAvatar":{"type":"boolean"}},"title":"UpdateProfileDto"}},"required":["user"],"title":"UpdateProfileBodyDto"}}}},"responses":{"200":{"description":"Profile updated and returned with new values","content":{"application/json":{"schema":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"}}}},"400":{"description":"Invalid profile data or username taken"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"put","path":"/v1/users/profile","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"user":{"avatar":"string","firstName":"string","lastName":"string","bio":"string","country":"string","removeAvatar":true}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update user profile","description":{"content":"Update user profile information including name, bio, username, avatar, and social links. Validates username uniqueness.","type":"text/plain"},"url":{"path":["v1","users","profile"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PUT","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} +api: {"operationId":"UsersController_updateProfile","description":"Update user profile information including name, bio, username, avatar, and social links. Validates username uniqueness.","parameters":[],"requestBody":{"required":true,"description":"Profile fields to update wrapped in a user object","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"removeAvatar":{"type":"boolean"}},"title":"UpdateProfileDto"}},"required":["user"],"title":"UpdateProfileBodyDto"},"example":{"user":{"avatar":"string","firstName":"string","lastName":"string","bio":"string","country":"string","removeAvatar":true}}}}},"responses":{"200":{"description":"Profile updated and returned with new values","content":{"application/json":{"schema":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"],"title":"UserSerializedDto"},"example":{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}}}},"400":{"description":"Invalid profile data or username taken"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}],"method":"put","path":"/v1/users/profile","security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"jsonRequestBodyExample":{"user":{"avatar":"string","firstName":"string","lastName":"string","bio":"string","country":"string","removeAvatar":true}},"info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"postman":{"name":"Update user profile","description":{"content":"Update user profile information including name, bio, username, avatar, and social links. Validates username uniqueness.","type":"text/plain"},"url":{"path":["v1","users","profile"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PUT","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}} sidebar_class_name: "put api-method" info_path: docs/user_related_apis_versioned/user-related-apis custom_edit_url: null @@ -35,7 +35,7 @@ Profile fields to update wrapped in a user object Profile updated and returned with new values -
    Schema
      settings object required
    +
    Schema
      settings object required
    Invalid profile data or username taken diff --git a/openAPI/oauth2-apis/v1.json b/openAPI/oauth2-apis/v1.json index e28a310b..078999ac 100644 --- a/openAPI/oauth2-apis/v1.json +++ b/openAPI/oauth2-apis/v1.json @@ -537,4 +537,3 @@ } } } - diff --git a/openAPI/user-related-apis/v1.json b/openAPI/user-related-apis/v1.json index 732d5e36..64442202 100644 --- a/openAPI/user-related-apis/v1.json +++ b/openAPI/user-related-apis/v1.json @@ -1 +1,27353 @@ -{"openapi":"3.0.0","info":{"title":"User-related APIs","version":"1.0.0","description":"Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together"},"servers":[{"url":"https://apis-prelive.quran.foundation/auth","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/auth","description":"Production Server"}],"components":{"securitySchemes":{"x-auth-token":{"type":"apiKey","in":"header","name":"x-auth-token","description":"The JWT access token required for accessing the endpoints."},"x-client-id":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your client id"}},"schemas":{"NullableBookmark":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqim00057z3fe30y0b3e"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"group":{"type":"string","example":"verses_6236"},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false},"collectionsCount":{"type":"integer","description":"Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.","example":1}},"required":["id","createdAt","type","key","group","isInDefaultCollection","isReading"],"additionalProperties":false,"nullable":true},"RawBookmark":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqiu00067z3fh6oieeiq"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"bookmarkType":{"oneOf":[{"type":"string","example":"ayah"},{"type":"object","properties":{"type":{"type":"string","example":"ayah"}},"required":["type"]}]},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"bookmarkGroup":{"oneOf":[{"type":"string","example":"verses_6236"},{"type":"object","properties":{"name":{"type":"string","example":"verses_6236"}},"required":["name"]}]},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false}},"required":["id","createdAt","bookmarkType","key","bookmarkGroup","isInDefaultCollection","isReading"]},"Bookmark":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqim00057z3fe30y0b3e"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"group":{"type":"string","example":"verses_6236"},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false},"collectionsCount":{"type":"integer","description":"Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.","example":1}},"required":["id","createdAt","type","key","group","isInDefaultCollection","isReading"],"additionalProperties":false},"BookmarkWithCollectionsCount":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqim00057z3fe30y0b3e"},"createdAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"type":{"type":"string","example":"ayah"},"key":{"type":"integer","example":1},"verseNumber":{"type":"integer","nullable":true,"example":5},"group":{"type":"string","example":"verses_6236"},"isInDefaultCollection":{"type":"boolean","example":true},"isReading":{"type":"boolean","nullable":true,"example":false},"collectionsCount":{"type":"integer","description":"Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.","example":1}},"required":["id","createdAt","type","key","group","isInDefaultCollection","isReading","collectionsCount"],"additionalProperties":false},"Collection":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wqsk00087z3f5hp42h08"},"name":{"type":"string","example":"Woman in Quran"},"slug":{"type":"string","nullable":true,"example":"woman-in-quran"},"isPrivate":{"type":"boolean","example":false},"isDefault":{"type":"boolean","example":false},"updatedAt":{"type":"string","format":"date-time","nullable":true,"example":"2023-01-21T07:28:13.023Z"},"url":{"type":"string","nullable":true,"example":"cmnkcpmvc000814v9f5jtbsxf"},"bookmarksCount":{"type":"integer","example":1},"resourcesCount":{"type":"integer","example":1},"count":{"type":"integer","example":1}},"required":["id","name","slug","isPrivate","isDefault","updatedAt"],"additionalProperties":false},"EstimatedGoalTimelineDay":{"type":"object","properties":{"date":{"type":"string","format":"date-time","description":"The date of the estimated day","example":"2023-01-21T07:28:13.023Z"},"amount":{"oneOf":[{"type":"string","example":"1:5-1:10"},{"type":"integer","minimum":1,"example":600}],"description":"The amount of the day's goal."}},"required":["date","amount"],"additionalProperties":false},"EstimatedGoalTimeline":{"type":"object","properties":{"week":{"type":"array","items":{"$ref":"#/components/schemas/EstimatedGoalTimelineDay"}}},"additionalProperties":false},"Preference":{"type":"object","properties":{"theme":{"type":"object","properties":{"type":{"type":"string","enum":["auto","light","sepia","dark"],"example":"auto"}},"additionalProperties":false},"reading":{"type":"object","properties":{"readingPreference":{"type":"string","enum":["translation","reading","readingTranslation"],"example":"translation"},"selectedWordByWordLocale":{"type":"string","enum":["en","ur","id","bn","tr","fa","ru","hi","de","ta","inh","fr","sq","dv","zh","sd","ml"],"example":"en"},"wordClickFunctionality":{"type":"string","enum":["play-audio","no-audio"],"example":"play-audio"},"isReadingByRevelationOrder":{"type":"boolean","example":true},"wordByWordContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordDisplay":{"type":"array","items":{"type":"string","enum":["tooltip","inline"]},"example":["tooltip"]},"wordByWordTooltipContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]},"wordByWordInlineContentType":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":[]},"selectedReadingTranslation":{"type":"string","minLength":1,"maxLength":255,"example":"131"},"selectedReflectionLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1},"selectedLessonLanguages":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}},"required":["readingPreference","selectedWordByWordLocale","wordClickFunctionality","selectedReadingTranslation"],"additionalProperties":false},"quranReaderStyles":{"type":"object","properties":{"tafsirFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranTextFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"translationFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"wordByWordFontScale":{"type":"integer","minimum":1,"maximum":6,"example":3},"reflectionFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"qnaFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"lessonFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"surahInfoFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"hadithFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"layersFontScale":{"type":"integer","minimum":1,"maximum":10,"example":3},"quranFont":{"type":"string","enum":["code_v1","code_v2","text_uthmani","text_indopak","qpc_uthmani_hafs","tajweed","tajweed_v4"],"example":"code_v1"},"mushafLines":{"type":"string","enum":["15_lines","16_lines"],"example":"16_lines"},"showTajweedRules":{"type":"boolean","example":true}},"required":["tafsirFontScale","quranTextFontScale","translationFontScale","wordByWordFontScale","reflectionFontScale","qnaFontScale","lessonFontScale","surahInfoFontScale","hadithFontScale","layersFontScale"],"additionalProperties":false},"translations":{"type":"object","properties":{"selectedTranslations":{"type":"array","items":{"type":"integer","example":131}}},"additionalProperties":false},"tafsirs":{"type":"object","properties":{"selectedTafsirs":{"type":"array","items":{"type":"string","example":"en-tafisr-ibn-kathir"}}},"additionalProperties":false},"audio":{"type":"object","properties":{"reciter":{"type":"integer","example":7},"playbackRate":{"type":"integer","enum":[0.25,0.5,0.75,1,1.25,1.5,1.75,2],"example":1},"showTooltipWhenPlayingAudio":{"type":"boolean","example":true},"enableAutoScrolling":{"type":"boolean","example":true}},"required":["reciter"],"additionalProperties":false},"language":{"type":"object","properties":{"language":{"type":"string","enum":["en","ar","bn","fa","fr","id","it","nl","pt","ru","sq","th","tr","ur","zh","ms","es","sw","vi"]}},"additionalProperties":false},"userHasCustomised":{"type":"object","properties":{"userHasCustomised":{"type":"boolean","example":false}},"required":["userHasCustomised"],"additionalProperties":false}},"additionalProperties":false},"ReadingSession":{"type":"object","properties":{"id":{"type":"string","example":"cmoa3wrpk000h7z3f2t6a57dg"},"updatedAt":{"type":"string","format":"date-time","example":"2023-01-21T07:28:13.023Z"},"chapterNumber":{"type":"integer","example":1},"verseNumber":{"type":"integer","example":5}},"required":["id","updatedAt"],"additionalProperties":false},"UserProfile":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time","example":"2022-12-06T06:16:20.229Z"},"email":{"type":"string","example":"muhajir@quran.com"},"firstName":{"type":"string","example":"Muhammad"},"lastName":{"type":"string","example":"Muhajir"},"photoUrl":{"type":"string","example":"https://photos.quran.com/img/muhajir.jpg"}},"additionalProperties":false},"EditProfileDto":{"type":"object","properties":{"languageId":{"type":"number"},"reflectionLanguages":{"type":"array","items":{"type":"string"}},"ayahLanguages":{"type":"array","items":{"type":"string"}},"customized":{"type":"boolean"},"hideFollowSuggestion":{"type":"boolean","description":"Hide follow suggestion popup after liking a post"},"showFollowFeaturedSuggestion":{"type":"boolean","description":"Show featured follow suggestion popup on QR onboarding"}}},"UserSerializedDto":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"},"followed":{"type":"boolean"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"]},"UpdateProfileDto":{"type":"object","properties":{"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"firstName":{"type":"string"},"lastName":{"type":"string"},"bio":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"removeAvatar":{"type":"boolean"}}},"UpdateProfileBodyDto":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/UpdateProfileDto"}},"required":["user"]},"UserRoomDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"group":{"type":"string"},"public":{"type":"boolean"},"roomType":{"type":"string"},"verified":{"type":"boolean"},"subdomain":{"type":"string"},"description":{"type":"string"},"membersCount":{"type":"number"},"avatarUrl":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}}},"required":["id","name","group","public","roomType","verified","subdomain","description","membersCount","avatarUrl"]},"UserRoomsResponse":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"$ref":"#/components/schemas/UserRoomDto"}}},"required":["total","currentPage","limit","pages","data"]},"UserSearchDto":{"type":"object","properties":{"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"createdAt":{"type":"object","example":"2000-01-21 00:00:00"},"joiningYear":{"type":"number","example":2025},"isPasswordSet":{"type":"boolean","example":true},"isFollowed":{"type":"boolean","example":false},"followed":{"type":"boolean","example":false},"settings":{"type":"object","properties":{"ayahLanguages":{"required":false,"type":"array","items":{"type":"number"}},"reflectionLanguages":{"required":false,"type":"array","items":{"type":"number"}}}},"username":{"type":"string"},"id":{"type":"string"},"verified":{"type":"boolean","default":false},"postAs":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"postsCount":{"type":"number","default":0},"averageToxicity":{"type":"number","default":0},"languageId":{"type":"number"},"banned":{"type":"boolean","default":false},"memberType":{"type":"number"},"followersCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"isAdmin":{"type":"boolean","default":false},"languageIsoCode":{"type":"string","default":"en"},"bio":{"type":"string"},"country":{"type":"string"}},"required":["avatarUrls","createdAt","joiningYear","settings","id"]},"UsersSearchResponse":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"$ref":"#/components/schemas/UserSearchDto"}}},"required":["total","currentPage","limit","pages","data"]},"ToggleFollowDto":{"type":"object","properties":{"action":{"enum":["follow","unfollow"],"type":"string","description":"The intended action: follow or unfollow","example":"follow"}}},"FeaturedUserDto":{"type":"object","properties":{"id":{"type":"string","example":"1f8d6f3f-2f57-4c3e-b7b5-5f6a9d7f7a55"},"username":{"type":"string","example":"example.user"},"verified":{"type":"boolean","example":true},"firstName":{"type":"string","example":"Example"},"lastName":{"type":"string","example":"User"},"fullName":{"type":"string","example":"Example User"},"avatarUrls":{"type":"object","example":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"}},"followersCount":{"type":"number","example":1200},"bio":{"type":"string","example":"I write reflections on the Quran."}},"required":["id","username","verified","firstName","lastName","fullName","avatarUrls","followersCount"]},"FeaturedUsersResponseDto":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"$ref":"#/components/schemas/FeaturedUserDto"}}},"required":["total","currentPage","limit","pages","data"]},"FailedFeaturedFollowItemDto":{"type":"object","properties":{"followeeId":{"type":"string","example":"user-id-123"},"reason":{"type":"string","example":"FOLLOW_FAILED"}},"required":["followeeId","reason"]},"FollowFeaturedUsersResponseDto":{"type":"object","properties":{"requested":{"type":"number","example":9},"followed":{"type":"number","example":7},"skipped":{"type":"number","example":1},"failed":{"type":"number","example":1},"complete":{"type":"boolean","example":true},"failedItems":{"type":"array","items":{"$ref":"#/components/schemas/FailedFeaturedFollowItemDto"}}},"required":["requested","followed","skipped","failed","complete"]},"RoomAdminUpdateDto":{"type":"object","properties":{"roomId":{"type":"number"},"userId":{"type":"string"},"admin":{"type":"boolean"}},"required":["roomId","userId","admin"]},"UpdateGroupDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","maxLength":200},"url":{"type":"string","minLength":1,"maxLength":50},"removeAvatar":{"type":"boolean"},"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"country":{"type":"string","nullable":true},"public":{"type":"boolean","nullable":true,"default":null}},"required":["id"]},"UpdatePageDto":{"type":"object","properties":{"id":{"type":"number"},"removeAvatar":{"type":"boolean"},"avatar":{"type":"string","pattern":"/^data:image\\/[a-z]+;base64,/"},"public":{"type":"boolean","nullable":true,"default":null},"name":{"type":"string"},"description":{"type":"string"},"organizationWebsite":{"type":"string"},"country":{"type":"string"},"url":{"type":"string"}},"required":["id"]},"MemberSerializedDto":{"type":"object","properties":{"id":{"type":"string","example":"user-1"},"username":{"type":"string","example":"member.username"},"firstName":{"type":"string","example":"Member"},"lastName":{"type":"string","example":"User"},"verified":{"type":"boolean","example":true},"avatarUrls":{"type":"object","example":{"small":"https://avatars.quran.foundation/users/user-1/small.png","medium":"https://avatars.quran.foundation/users/user-1/medium.png","large":"https://avatars.quran.foundation/users/user-1/large.png"}},"isAdmin":{"type":"boolean","example":false},"isOwner":{"type":"boolean","example":false},"isFollowed":{"type":"boolean","example":true},"isActive":{"type":"boolean","example":true},"followersCount":{"type":"number","example":42}},"required":["id","username","firstName","lastName","verified","avatarUrls","isAdmin","isOwner","isFollowed","isActive","followersCount"]},"RoomMembersResponseDto":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"$ref":"#/components/schemas/MemberSerializedDto"}}},"required":["total","currentPage","limit","pages","data"]},"InviteUserDto":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}}},"required":["userIds","emails"]},"RoomInviteUserResponseDto":{"type":"object","properties":{"invited":{"type":"boolean","example":true},"inviteStatus":{"type":"object","additionalProperties":{"oneOf":[{"type":"boolean"},{"type":"string"}]},"example":{"user-123":true,"user-456":"already_a_member"}}},"required":["invited","inviteStatus"]},"RoomInviteAcceptedResponseDto":{"type":"object","properties":{"accepted":{"type":"boolean","example":true}},"required":["accepted"]},"RoomInviteRejectedResponseDto":{"type":"object","properties":{"rejected":{"type":"boolean","example":true}},"required":["rejected"]},"CreatePageDto":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"jobTitle":{"type":"string"},"contactNumber":{"type":"string"},"organizationName":{"type":"string"},"organizationWebsite":{"type":"string"},"purpose":{"type":"string"},"additionalDetails":{"type":"string"},"country":{"type":"string"},"url":{"type":"string"},"public":{"type":"boolean"}},"required":["name","jobTitle","contactNumber","organizationName","purpose","url"]},"CreateGroupDto":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","maxLength":200},"url":{"type":"string","minLength":1,"maxLength":50},"public":{"type":"boolean"}},"required":["name","url"]},"RoomListItemDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"roomType":{"type":"string"},"isActive":{"type":"boolean"},"isVerified":{"type":"boolean"},"isPublic":{"type":"boolean"},"isOwner":{"type":"boolean"},"isAdmin":{"type":"boolean"},"ownerId":{"type":"string"},"postsCount":{"type":"number"},"membersCount":{"type":"number"},"url":{"type":"string"},"avatarUrls":{"type":"object","properties":{"thumb":{"required":true,"type":"string"},"original":{"required":true,"type":"string"}}},"createdAt":{"format":"date-time","type":"string"},"isMember":{"type":"boolean"},"subdomain":{"type":"string"},"country":{"type":"string"}},"required":["id","name","description","roomType","isActive","isVerified","isPublic","isOwner","isAdmin","ownerId","postsCount","membersCount","avatarUrls"]},"RoomCreatedResponseDto":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/RoomListItemDto"}},"required":["success","data"]},"PaginatedRoomsResponseDto":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"$ref":"#/components/schemas/RoomListItemDto"}}},"required":["total","currentPage","limit","pages","data"]},"RoomProfileResponseDto":{"type":"object","properties":{"privateToken":{"type":"string","example":"private-room-token"},"mutualFollowers":{"type":"array","items":{"$ref":"#/components/schemas/UserSerializedDto"}},"mutualFollowersCount":{"type":"number","example":2},"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"roomType":{"type":"string"},"isActive":{"type":"boolean"},"isVerified":{"type":"boolean"},"isPublic":{"type":"boolean"},"isOwner":{"type":"boolean"},"isAdmin":{"type":"boolean"},"ownerId":{"type":"string"},"postsCount":{"type":"number"},"membersCount":{"type":"number"},"url":{"type":"string"},"avatarUrls":{"type":"object","properties":{"thumb":{"required":true,"type":"string"},"original":{"required":true,"type":"string"}}},"createdAt":{"format":"date-time","type":"string"},"isMember":{"type":"boolean"},"subdomain":{"type":"string"},"country":{"type":"string"}},"required":["id","name","description","roomType","isActive","isVerified","isPublic","isOwner","isAdmin","ownerId","postsCount","membersCount","avatarUrls"]},"RoomAcceptByPrivateTokenResponseDto":{"type":"object","properties":{"roomId":{"type":"number","example":42},"success":{"type":"boolean","example":true},"isNewMember":{"type":"boolean","example":true}},"required":["roomId","success","isNewMember"]},"PostTag":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"}},"required":["id"]},"PostReference":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"chapterId":{"type":"number"}},"required":["id"]},"UserAuthor":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"]},"PostRecentComment":{"type":"object","properties":{"id":{"type":"number"},"author":{"$ref":"#/components/schemas/UserAuthor"},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","author","body","createdAt"]},"PostRoom":{"type":"object","properties":{"isAdmin":{"type":"object"},"isOwner":{"type":"object"},"isPublic":{"type":"object"},"id":{"type":"number"},"subdomain":{"type":"string"},"roomType":{"type":"string"},"verified":{"type":"boolean","default":false},"name":{"type":"string"},"_group":{"type":"string"}},"required":["id"]},"UserWithMentionLocations":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"},"locations":{"type":"object"},"followersCount":{"type":"number"},"displayName":{"type":"string"}},"required":["avatarUrls","id","locations","followersCount"]},"PostSerialized":{"type":"object","properties":{"tags":{"type":"array","items":{"$ref":"#/components/schemas/PostTag"}},"references":{"type":"array","items":{"$ref":"#/components/schemas/PostReference"}},"author":{"type":"object"},"recentComment":{"$ref":"#/components/schemas/PostRecentComment"},"room":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/PostRoom"}]},"mentions":{"type":"array","items":{"$ref":"#/components/schemas/UserWithMentionLocations"}},"isLiked":{"type":"boolean"},"isByFollowedUser":{"type":"boolean"},"isCommentedOn":{"type":"boolean"},"isSaved":{"type":"boolean"},"id":{"type":"number"},"authorId":{"type":"string"},"body":{"type":"string"},"discussionId":{"type":"number"},"draft":{"type":"boolean","default":false},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"global":{"type":"boolean"},"toxicityScore":{"type":"number"},"reported":{"type":"boolean","default":false},"views":{"type":"number"},"removed":{"type":"boolean","default":false},"verified":{"type":"boolean","default":false},"roomPostStatus":{"description":"@description 0: OnlyMembers, 1: Publicly, 2: AsRoom","default":0,"enum":[0,1,2],"type":"number"},"hidden":{"type":"boolean","default":false},"commentsCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"viewsCount":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"description":"featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,","enum":[1,2,3,4,5,6,30],"type":"number"},"reviewedAt":{"format":"date-time","type":"string"},"featuredAt":{"format":"date-time","type":"string"},"estimatedReadingTime":{"type":"number","default":0},"roomId":{"type":"number"},"postTypeId":{"type":"number"},"postTypeName":{"type":"string"}},"required":["id","authorId","createdAt","updatedAt","commentsCount","roomId","postTypeId"]},"FeedResponseDto":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"data":{"type":"array","items":{"$ref":"#/components/schemas/PostSerialized"}}},"required":["total","currentPage","limit","pages","data"]},"RoomPostUpdatePrivacyDto":{"type":"object","properties":{"isPublic":{"type":"boolean"}},"required":["isPublic"]},"ReferenceAttributes":{"type":"object","properties":{"chapterId":{"type":"number","minimum":1},"from":{"type":"number","default":0},"to":{"type":"number","default":0}},"required":["chapterId","from","to"]},"UserMentionAttributes":{"type":"object","properties":{"marker":{"type":"string","pattern":"/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/","example":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}"},"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["marker","userId","displayName"]},"CreatePostDto":{"type":"object","properties":{"roomPostStatus":{"enum":[0,1,2],"type":"number","description":"The room post status, defaults to publicly: 1. As Room: 0, Publicly: 1, Only Members: 2"},"body":{"type":"string","minLength":6},"draft":{"type":"boolean"},"references":{"type":"array","items":{"$ref":"#/components/schemas/ReferenceAttributes"}},"mentions":{"type":"array","items":{"$ref":"#/components/schemas/UserMentionAttributes"}},"roomId":{"type":"number"},"postAsAuthorId":{"type":"string"},"publishedAt":{"format":"date-time","type":"string"}},"required":["roomPostStatus","body","draft","references","mentions","roomId","postAsAuthorId","publishedAt"]},"CreatePostBodyDto":{"type":"object","properties":{"post":{"$ref":"#/components/schemas/CreatePostDto"}},"required":["post"]},"PostCreatedResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostSerialized"},"success":{"type":"boolean"}},"required":["data","success"]},"UpdatePostDto":{"type":"object","properties":{"roomPostStatus":{"enum":[0,1,2],"type":"number","description":"The room post status, defaults to publicly: 1. As Room: 0, Publicly: 1, Only Members: 2"},"body":{"type":"string","minLength":6},"draft":{"type":"boolean"},"references":{"type":"array","items":{"$ref":"#/components/schemas/ReferenceAttributes"}},"mentions":{"type":"array","items":{"$ref":"#/components/schemas/UserMentionAttributes"}},"roomId":{"type":"number"},"postAsAuthorId":{"type":"string"},"publishedAt":{"format":"date-time","type":"string"}}},"ReportAbuseDto":{"type":"object","properties":{"abuse":{"type":"string"},"comments":{"type":"string","default":""}},"required":["abuse","comments"]},"ReportAbuseBodyDto":{"type":"object","properties":{"report":{"$ref":"#/components/schemas/ReportAbuseDto"}},"required":["report"]},"CommentAuthor":{"type":"object","properties":{"postsCount":{"type":"number"},"avatarUrls":{"type":"object","properties":{"small":{"required":true,"type":"string"},"medium":{"required":true,"type":"string"},"large":{"required":true,"type":"string"}}},"id":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean","default":false},"firstName":{"type":"string"},"lastName":{"type":"string"},"memberType":{"type":"number"}},"required":["avatarUrls","id"]},"CommentTag":{"type":"object","properties":{"language":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"commentsCount":{"type":"number"}},"required":["id"]},"Comment":{"type":"object","properties":{"id":{"type":"number"},"postId":{"type":"number"},"authorId":{"type":"string"},"parentId":{"type":"number"},"isPrivate":{"type":"boolean","default":false},"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"toxicityScore":{"type":"number"},"repliesCount":{"type":"number","default":0},"likesCount":{"type":"number","default":0},"reported":{"type":"boolean","default":false},"removed":{"type":"boolean","default":false},"hidden":{"type":"boolean","default":false},"languageId":{"type":"number"},"languageName":{"type":"string"},"moderationStatus":{"type":"number"},"author":{"$ref":"#/components/schemas/CommentAuthor"},"mentions":{"type":"array","items":{"$ref":"#/components/schemas/UserWithMentionLocations"}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/CommentTag"}}},"required":["id","postId","authorId","parentId","isPrivate","body","createdAt","updatedAt"]},"PostCommentsResponse":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}}},"required":["total","currentPage","limit","pages","comments"]},"PostAllCommentsResponse":{"type":"object","properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}},"total":{"type":"number","example":"10 // works also with swagger setup"}},"required":["comments","total"]},"ExportPostsDto":{"type":"object","properties":{"ids":{"description":"Array of post IDs to export","example":[1,2,3],"minItems":1,"type":"array","items":{"type":"number"}}},"required":["ids"]},"Tag":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"rank":{"type":"number","default":0},"languageId":{"type":"number"},"languageName":{"type":"string"},"postsCount":{"type":"number"},"commentsCount":{"type":"number"}},"required":["id","createdAt","updatedAt"]},"CreateCommentDto":{"type":"object","properties":{"body":{"type":"string","description":"Comment body text","example":"This is a thoughtful comment about the post","maxLength":8000},"postId":{"type":"number","description":"ID of the post this comment belongs to","example":123},"isPrivate":{"type":"boolean","default":false,"description":"Whether the comment is private","example":false},"parentId":{"type":"number","description":"ID of the parent comment (for replies)","example":456},"mentions":{"description":"User mentions in the comment","type":"array","items":{"$ref":"#/components/schemas/UserMentionAttributes"}}},"required":["body","postId","isPrivate"]},"CreateCommentBody":{"type":"object","properties":{"comment":{"description":"Comment details for creation","allOf":[{"$ref":"#/components/schemas/CreateCommentDto"}]}},"required":["comment"]},"CreateCommentResponse":{"type":"object","properties":{"comment":{"$ref":"#/components/schemas/Comment"},"success":{"type":"boolean"}},"required":["comment","success"]},"CommentRepliesResponse":{"type":"object","properties":{"total":{"type":"number","example":10},"currentPage":{"type":"number","example":1},"limit":{"type":"number","example":10},"pages":{"type":"number","example":1},"replies":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}},"comment":{"$ref":"#/components/schemas/Comment"}},"required":["total","currentPage","limit","pages","replies","comment"]}},"responses":{}},"security":[{"x-auth-token":[],"x-client-id":[]}],"paths":{"/v1/collections":{"post":{"description":"Create a new collection under user's account.","tags":["Collections"],"summary":"Add collection","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the new collection to be created.","example":"Woman in Quran"}},"required":["name"],"additionalProperties":false},"example":{"name":"Woman in Quran"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/Collection"}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wqsk00087z3f5hp42h08","name":"Woman in Quran","slug":"woman-in-quran","isPrivate":false,"isDefault":false,"updatedAt":"2023-01-21T07:28:13.023Z","url":"cmnkcpmvc000814v9f5jtbsxf","bookmarksCount":1,"resourcesCount":1,"count":1}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Collections"},"get":{"tags":["Collections"],"description":"List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination)","summary":"Get all collections","parameters":[{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyUpdated","alphabetical"],"description":"Sort the collections list either by the time they were updated at descendingly or alphabetically.","example":"recentlyUpdated"},"description":"Sort the collections list either by the time they were updated at descendingly or alphabetically."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"description":"The bookmark type."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Collection"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wqsk00087z3f5hp42h08","name":"Woman in Quran","slug":"woman-in-quran","isPrivate":false,"isDefault":false,"updatedAt":"2023-01-21T07:28:13.023Z","url":"cmnkcpmvc000814v9f5jtbsxf","bookmarksCount":1,"resourcesCount":1,"count":1}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Collections"}},"/v1/collections/{collectionId}/bookmarks":{"post":{"description":"Add a bookmark to a collection. Use `collectionId=\"__default__\"` to add an ayah bookmark to the virtual Favorites collection used by Quran.com.","tags":["Collections"],"summary":"Add collection Bookmark","parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The collection ID. Use `__default__` to add an ayah bookmark to the virtual Favorites collection used by Quran.com.","example":"cmoa3wqvw00097z3f9tk87gga"},"required":true,"description":"The collection ID. Use `__default__` to add an ayah bookmark to the virtual Favorites collection used by Quran.com."}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"key":{"type":"integer","description":"The Surah number.","example":2},"type":{"type":"string","enum":["ayah"],"description":"The bookmark type.","default":"ayah"},"verseNumber":{"type":"integer","example":3},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.","example":4},"mushaf":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.","example":4}},"required":["key","verseNumber"],"additionalProperties":false,"title":"Ayah"},{"type":"object","properties":{"key":{"type":"integer","description":"Surah, Juz or page number."},"type":{"type":"string","enum":["juz","page","surah"],"description":"The bookmark type.","example":"surah"},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.","example":4},"mushaf":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.","example":4}},"required":["key"],"additionalProperties":false,"title":"Surah, Juz, Or Page"}]},"example":{"key":2,"type":"ayah","verseNumber":3,"mushafId":4,"mushaf":4}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection bookmark added"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"collection bookmark added"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1CollectionsByCollectionIdBookmarks"},"delete":{"description":"Delete a bookmark from a collection by bookmark details. Use `collectionId=\"__default__\"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan.","tags":["Collections"],"summary":"Delete collection bookmark by details","parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection.","example":"cmoa3wr2h000f7z3ffr5fc0z1"},"required":true,"description":"The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"}},"additionalProperties":false},"example":{"success":true,"data":{}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"key":{"type":"integer","description":"Surah number","example":2},"type":{"type":"string","enum":["ayah"],"description":"The bookmark type.","default":"ayah"},"verseNumber":{"type":"integer","example":3},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.","example":4},"mushaf":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.","example":4}},"required":["key","verseNumber"],"additionalProperties":false,"title":"Ayah"},{"type":"object","properties":{"key":{"type":"integer","description":"Surah, Juz or page number."},"type":{"type":"string","enum":["juz","page","surah"],"description":"The bookmark type.","example":"surah"},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.","example":4},"mushaf":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.","example":4}},"required":["key"],"additionalProperties":false,"title":"Surah, Juz, Or Page"},{"type":"object","properties":{"bookmarkId":{"type":"string","description":"The Id of the bookmark to be deleted.","example":"cmoa3wr2h000e7z3fcxefa6rx"}},"required":["bookmarkId"],"additionalProperties":false,"title":"Bookmark ID"}],"title":"input"},"example":{"key":2,"type":"ayah","verseNumber":3,"mushafId":4,"mushaf":4}}}},"operationId":"authDeleteV1CollectionsByCollectionIdBookmarks"}},"/v1/collections/{collectionId}":{"delete":{"description":"Delete a an existing collection.","tags":["Collections"],"summary":"Delete collection","parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be deleted.","example":"cmoa3wqwh000a7z3f0d6y5mte"},"required":true,"description":"The Id of the collection to be deleted."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection deleted"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"collection deleted"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1CollectionsByCollectionId"},"get":{"description":"Get all resources that belong to an existing collection by collection id. Use `__default__` to fetch the virtual Favorites collection.","tags":["Collections"],"summary":"Get collection items by id","parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"Collection ID. Use `__default__` for the virtual Favorites collection.","example":"cmoa3wr17000d7z3f7ssph68y"},"description":"Collection ID. Use `__default__` for the virtual Favorites collection."},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyAdded","verseKey"],"description":"Sort the collection items either by the time they were added at descendingly or by Ayah key."},"description":"Sort the collection items either by the time they were added at descendingly or by Ayah key."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"collection":{"$ref":"#/components/schemas/Collection"},"bookmarks":{"type":"array","items":{"$ref":"#/components/schemas/BookmarkWithCollectionsCount"}}},"additionalProperties":false},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"collection":{"id":"cmoa3wqsk00087z3f5hp42h08","name":"Woman in Quran","slug":"woman-in-quran","isPrivate":false,"isDefault":false,"updatedAt":"2023-01-21T07:28:13.023Z","url":"cmnkcpmvc000814v9f5jtbsxf","bookmarksCount":1,"resourcesCount":1,"count":1},"bookmarks":[{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}]},"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1CollectionsByCollectionId"},"post":{"description":"Update an existing collection.","tags":["Collections"],"summary":"Update collection","parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be updated."},"required":true,"description":"The Id of the collection to be updated."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the collection to be updated."}},"required":["name"],"additionalProperties":false},"example":{"name":"string"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection renamed"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"collection renamed"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1CollectionsByCollectionId"}},"/v1/collections/{collectionId}/bookmarks/{bookmarkId}":{"delete":{"description":"Delete a bookmark from a collection by bookmark ID. Use `collectionId=\"__default__\"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan.","tags":["Collections"],"summary":"Delete collection bookmark by id","parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection.","example":"cmoa3wqxe000b7z3f6d6ia4ih"},"required":true,"description":"The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection."},{"in":"path","name":"bookmarkId","schema":{"type":"string","description":"The Id of the bookmark to be deleted.","example":"cmoa3wqxe000c7z3f61siesdm"},"required":true,"description":"The Id of the bookmark to be deleted."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["collection bookmark deleted"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"collection bookmark deleted"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1CollectionsByCollectionIdBookmarksByBookmarkId"}},"/v1/collections/all":{"get":{"description":"Get all existing collections along with resources that belong to them.","tags":["Collections"],"summary":"Get all collection items","parameters":[{"in":"query","name":"sortBy","schema":{"type":"string","enum":["recentlyAdded","verseKey"],"description":"Sort the collection items either by the time they were added at descendingly or alphabetically."},"description":"Sort the collection items either by the time they were added at descendingly or alphabetically."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"description":"The bookmark type."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Bookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1CollectionsAll"}},"/v1/bookmarks":{"post":{"description":"Add or update a bookmark by details. Omit `isReading` to create or update a regular standalone bookmark. Set `isReading=true` to set the user's singleton reading bookmark. Set `isReading=false` to unset the current reading bookmark; in that case the response `data` can be `null` if no reading bookmark was set. For Quran.com-style saved or favorite ayah bookmarks, use `POST /v1/collections/__default__/bookmarks`.","tags":["Bookmarks"],"summary":"Add user bookmark","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"key":{"type":"integer","description":"The Surah number.","example":2},"type":{"type":"string","enum":["ayah"],"description":"The bookmark type.","default":"ayah"},"verseNumber":{"type":"integer","description":"The Ayah number to be added.","example":3},"isReading":{"type":"boolean","description":"Reading bookmark flag. Set `true` to set the user's current reading bookmark. Set `false` to unset the current reading bookmark. Omit this field to create or update a regular bookmark."},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.","example":4},"mushaf":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.","example":4}},"required":["key","type","verseNumber"],"additionalProperties":false,"title":"Ayah"},{"type":"object","properties":{"key":{"type":"integer","description":"Surah, Juz or page number."},"type":{"type":"string","enum":["juz","page","surah"],"description":"The bookmark type.","example":"surah"},"isReading":{"type":"boolean","description":"Reading bookmark flag. Set `true` to set the user's current reading bookmark. Set `false` to unset the current reading bookmark. Omit this field to create or update a regular bookmark."},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.","example":4},"mushaf":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.","example":4}},"required":["key","type"],"additionalProperties":false,"title":"Surah, Juz, Or page"}]},"example":{"key":2,"type":"ayah","verseNumber":3,"isReading":true,"mushafId":4,"mushaf":4}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/NullableBookmark"}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Bookmarks"},"get":{"description":"Get all bookmarks. This includes bookmarks belonging to a collection.","tags":["Bookmarks"],"summary":"Get user bookmarks","parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"required":false,"description":"The bookmark type."},{"in":"query","name":"isReading","schema":{"type":"boolean","description":"Whether to fetch only the reading bookmark"},"required":false,"description":"Whether to fetch only the reading bookmark"},{"in":"query","name":"key","schema":{"type":"integer","description":"Filter by key (surah/juz/page number)"},"required":false,"description":"Filter by key (surah/juz/page number)"},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"required":false,"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"required":false,"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"required":false,"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"required":false,"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/BookmarkWithCollectionsCount"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Bookmarks"}},"/v1/bookmarks/{bookmarkId}":{"delete":{"description":"Delete a standalone bookmark by id. This endpoint fully removes orphan bookmarks only. If the bookmark belongs to the virtual Favorites collection or any custom collection, it is not removed; this endpoint only sets `isReading` to `false` and leaves the bookmark attached to those collections. To remove it from Favorites or a custom collection, use the corresponding collection delete endpoint instead.","tags":["Bookmarks"],"summary":"Delete Bookmark","parameters":[{"in":"path","name":"bookmarkId","schema":{"type":"string","description":"The id of the bookmark to be deleted.","example":"cmoa3wqk500077z3f018r4rzn"},"required":true,"description":"The id of the bookmark to be deleted."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["bookmark deleted"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"bookmark deleted"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1BookmarksByBookmarkId"}},"/v1/bookmarks/ayahs-range":{"get":{"description":"Get all bookmarks within a specific Ayahs range.","tags":["Bookmarks"],"summary":"Get bookmarks within a range of Ayahs","parameters":[{"in":"query","name":"chapterNumber","schema":{"type":"integer","description":"The number of the Surah that the Ayahs range belong to."},"required":true,"description":"The number of the Surah that the Ayahs range belong to."},{"in":"query","name":"rangeStartAyahNumber","schema":{"type":"integer","description":"The Ayah number at which the range starts."},"required":true,"description":"The Ayah number at which the range starts."},{"in":"query","name":"rangeEndAyahNumber","schema":{"type":"integer","description":"The Ayah number at which the range ends."},"required":true,"description":"The Ayah number at which the range ends."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/RawBookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wqiu00067z3fh6oieeiq","createdAt":"2023-01-21T07:28:13.023Z","bookmarkType":"ayah","key":1,"verseNumber":5,"bookmarkGroup":"verses_6236","isInDefaultCollection":true,"isReading":false}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1BookmarksAyahsRange"}},"/v1/bookmarks/bookmark":{"get":{"description":"Get a bookmark by details","tags":["Bookmarks"],"summary":"Get bookmark","parameters":[{"in":"query","name":"verseNumber","schema":{"type":"integer","description":"The Ayah number of the bookmark"},"description":"The Ayah number of the bookmark"},{"in":"query","name":"isReading","schema":{"type":"boolean","description":"Whether to fetch the reading bookmark"},"description":"Whether to fetch the reading bookmark"},{"in":"query","name":"key","schema":{"type":"integer","oneOf":[{},{"x-required":true}],"description":"Surah, Juz or page number.","example":2},"description":"Surah, Juz or page number."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"oneOf":[{},{"x-required":true}],"description":"The bookmark type.","default":"ayah"},"description":"The bookmark type."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.","example":4},"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name."},{"in":"query","name":"mushaf","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.","example":4},"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/Bookmark"}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wqim00057z3fe30y0b3e","createdAt":"2023-01-21T07:28:13.023Z","type":"ayah","key":1,"verseNumber":5,"group":"verses_6236","isInDefaultCollection":true,"isReading":false,"collectionsCount":1}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1BookmarksBookmark"}},"/v1/bookmarks/collections":{"get":{"description":"Get named collection IDs for a bookmark by bookmark details. Pass `includeDefault=true` to also append `__default__` when the bookmark belongs to Favorites.","tags":["Bookmarks"],"summary":"Get bookmark collections","parameters":[{"in":"query","name":"key","schema":{"type":"number","format":"float","description":"Surah, Juz or page number."},"required":true,"description":"Surah, Juz or page number."},{"in":"query","name":"type","schema":{"type":"string","enum":["page","juz","surah","ayah"],"description":"The bookmark type.","default":"ayah"},"required":false,"description":"The bookmark type."},{"in":"query","name":"includeDefault","schema":{"type":"boolean","description":"When `true`, append `__default__` if the bookmark belongs to the virtual Favorites collection."},"required":false,"description":"When `true`, append `__default__` if the bookmark belongs to the virtual Favorites collection."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"required":false,"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"required":false,"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"required":false,"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"required":false,"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"string","description":"Collection ID. When `includeDefault=true`, this array may also include `__default__`.","example":"cmnkcpmvc000814v9f5jtbsxf"}}},"additionalProperties":false},"example":{"success":true,"data":["cmnkcpmvc000814v9f5jtbsxf"]}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1BookmarksCollections"}},"/v1/preferences":{"post":{"description":"Add or update one user preferences group like favorite Tafsirs or translations.","tags":["Preferences"],"summary":"Add or update preference","parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"group":{"type":"string","enum":["tafsirs","translations","audio","theme","quranReaderStyles","reading","language","userHasCustomised"],"description":"The preference group to be added or updated.","example":"tafsirs"},"key":{"type":"string","description":"The preference key to be added or updated.","example":"selectedTafsirs"},"value":{"description":"The preference value to be added or updated.","example":"[\"en-tafisr-ibn-kathir\"]"}},"required":["group","key","value"],"additionalProperties":false,"oneOf":[{"type":"object","properties":{"key":{"type":"string","enum":["type"]}},"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","enum":["readingPreference","selectedWordByWordLocale","wordClickFunctionality","isReadingByRevelationOrder","wordByWordContentType","wordByWordDisplay","wordByWordTooltipContentType","wordByWordInlineContentType","selectedReadingTranslation","selectedReflectionLanguages","selectedLessonLanguages"]}},"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","enum":["tafsirFontScale","quranTextFontScale","translationFontScale","wordByWordFontScale","reflectionFontScale","qnaFontScale","lessonFontScale","surahInfoFontScale","hadithFontScale","layersFontScale","quranFont","mushafLines","showTajweedRules"]}},"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","enum":["selectedTranslations"]}},"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","enum":["selectedTafsirs"]}},"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","enum":["reciter","playbackRate","showTooltipWhenPlayingAudio","enableAutoScrolling","repeatSettings"]}},"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","enum":["language"]}},"additionalProperties":false},{"type":"object","properties":{"value":{"type":"string","enum":["en","ar","bn","fa","fr","id","it","nl","pt","ru","sq","th","tr","ur","zh","ms","es","sw","vi"]}},"additionalProperties":false},{"type":"object","properties":{"value":{"type":"string","enum":["auto","light","sepia","dark"],"example":"auto"}},"additionalProperties":false},{"type":"object","properties":{"value":{"type":"string","enum":["translation","reading","readingTranslation"],"example":"translation"}},"required":["value"],"additionalProperties":false},{"type":"object","properties":{"value":{"type":"string","enum":["en","ur","id","bn","tr","fa","ru","hi","de","ta","inh","fr","sq","dv","zh","sd","ml"],"example":"en"}},"required":["value"],"additionalProperties":false},{"type":"object","properties":{"value":{"type":"string","enum":["play-audio","no-audio"],"example":"play-audio"}},"required":["value"],"additionalProperties":false},{"type":"object","properties":{"value":{"type":"boolean","example":true}},"additionalProperties":false},{"type":"object","properties":{"value":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":["translation"]}},"additionalProperties":false},{"type":"object","properties":{"value":{"type":"array","items":{"type":"string","enum":["tooltip","inline"]},"example":["tooltip"]}},"additionalProperties":false},{"type":"object","properties":{"value":{"type":"array","items":{"type":"string","enum":["translation","transliteration"]},"example":[]}},"additionalProperties":false},{"type":"object","properties":{"value":{"type":"string","enum":["code_v1","code_v2","text_uthmani","text_indopak","qpc_uthmani_hafs","tajweed","tajweed_v4"],"example":"code_v1"}},"additionalProperties":false},{"type":"object","properties":{"value":{"type":"string","enum":["15_lines","16_lines"],"example":"16_lines"}},"additionalProperties":false},{"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":10,"example":3}},"required":["value"],"additionalProperties":false},{"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":6,"example":3}},"additionalProperties":false},{"type":"object","properties":{"value":{"type":"array","items":{"type":"integer","example":131}}},"additionalProperties":false},{"type":"object","properties":{"value":{"type":"array","items":{"type":"string","example":"en-tafisr-ibn-kathir"}}},"additionalProperties":false},{"type":"object","properties":{"value":{"type":"integer","enum":[0.25,0.5,0.75,1,1.25,1.5,1.75,2],"example":1}},"additionalProperties":false},{"type":"object","properties":{"value":{"type":"boolean","example":false}},"required":["value"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","enum":["userHasCustomised"]}},"required":["key"],"additionalProperties":false},{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":255,"example":"131"}},"required":["value"],"additionalProperties":false},{"type":"object","properties":{"value":{"type":"array","items":{"type":"string","maxLength":10},"minItems":1}},"required":["value"],"additionalProperties":false}]},"example":{"key":"type"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["preference updated"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"preference updated"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Preferences"},"get":{"description":"Get all user preferences like theme, favorite reciter, default language etc.","tags":["Preferences"],"summary":"Get user preferences","parameters":[],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/Preference"}},"additionalProperties":false},"example":{"success":true,"data":{"theme":{"type":"auto"},"reading":{"readingPreference":"translation","selectedWordByWordLocale":"en","wordClickFunctionality":"play-audio","isReadingByRevelationOrder":true,"wordByWordContentType":["translation"],"wordByWordDisplay":["tooltip"],"wordByWordTooltipContentType":["translation"],"wordByWordInlineContentType":[],"selectedReadingTranslation":"131","selectedReflectionLanguages":["string"],"selectedLessonLanguages":["string"]},"quranReaderStyles":{"tafsirFontScale":3,"quranTextFontScale":3,"translationFontScale":3,"wordByWordFontScale":3,"reflectionFontScale":3,"qnaFontScale":3,"lessonFontScale":3,"surahInfoFontScale":3,"hadithFontScale":3,"layersFontScale":3,"quranFont":"code_v1","mushafLines":"16_lines","showTajweedRules":true},"translations":{"selectedTranslations":[131]},"tafsirs":{"selectedTafsirs":["en-tafisr-ibn-kathir"]},"audio":{"reciter":7,"playbackRate":1,"showTooltipWhenPlayingAudio":true,"enableAutoScrolling":true},"language":{"language":"en"},"userHasCustomised":{"userHasCustomised":false}}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Preferences"}},"/v1/preferences/bulk":{"post":{"description":"Add or update one or more user preferences groups like favorite Tafsirs and translations.","tags":["Preferences"],"summary":"Bulk add or update preferences","parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preference"},"example":{"theme":{"type":"auto"},"reading":{"readingPreference":"translation","selectedWordByWordLocale":"en","wordClickFunctionality":"play-audio","isReadingByRevelationOrder":true,"wordByWordContentType":["translation"],"wordByWordDisplay":["tooltip"],"wordByWordTooltipContentType":["translation"],"wordByWordInlineContentType":[],"selectedReadingTranslation":"131","selectedReflectionLanguages":["string"],"selectedLessonLanguages":["string"]},"quranReaderStyles":{"tafsirFontScale":3,"quranTextFontScale":3,"translationFontScale":3,"wordByWordFontScale":3,"reflectionFontScale":3,"qnaFontScale":3,"lessonFontScale":3,"surahInfoFontScale":3,"hadithFontScale":3,"layersFontScale":3,"quranFont":"code_v1","mushafLines":"16_lines","showTajweedRules":true},"translations":{"selectedTranslations":[131]},"tafsirs":{"selectedTafsirs":["en-tafisr-ibn-kathir"]},"audio":{"reciter":7,"playbackRate":1,"showTooltipWhenPlayingAudio":true,"enableAutoScrolling":true},"language":{"language":"en"},"userHasCustomised":{"userHasCustomised":false}}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["preferences updated"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"preferences updated"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1PreferencesBulk"}},"/v1/reading-sessions":{"post":{"description":"Track the user's most recent reading location (Surah/Ayah) for \"Continue reading\" / \"Recently read\" UX.\n\nA new reading session will be created if the user does not have an existing one in the past 20 minutes; otherwise, the existing reading session will be updated with the latest read Ayah.\n\nFor streaks, goals, and calendar-style progress tracking, see [Reading Sessions vs Activity Days](/docs/user-related-apis/reading-sessions-vs-activity-days).","tags":["Reading Sessions"],"summary":"Add or update user reading session","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"chapterNumber":{"type":"integer","minimum":1,"description":"The Surah number to be added to reading session.","example":1},"verseNumber":{"type":"integer","minimum":1,"description":"The Ayah number to be added to reading session.","example":1}},"required":["chapterNumber","verseNumber"],"additionalProperties":false},"example":{"chapterNumber":1,"verseNumber":1}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"type":"string","enum":["reading session created","reading session updated"],"example":"reading session created"}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"reading session created"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1ReadingSessions"},"get":{"description":"Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for \"Continue reading\" / \"Recently read\". For streaks, goals, and calendar-style progress tracking, use Activity Days.","tags":["Reading Sessions"],"summary":"Get user reading sessions","parameters":[{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/ReadingSession"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wrpk000h7z3f2t6a57dg","updatedAt":"2023-01-21T07:28:13.023Z","chapterNumber":1,"verseNumber":5}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1ReadingSessions"}},"/v1/goals/get-todays-plan":{"get":{"description":"Get today's goal plan.","tags":["Goals"],"summary":"Get today's goal plan","parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"required":true,"description":"The type of the goal."},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"hasGoal":{"type":"boolean","description":"User has a goal.","example":false}},"required":["hasGoal"],"additionalProperties":false,"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"The id of the activity day.","example":"cmoa3wq2b00047z3fbl4c6ew0"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day.","example":"2023-09-31"},"progress":{"type":"number","format":"float","minimum":0,"maximum":1,"description":"The progress of the reading goal of that activity day (if the user has a reading goal on that day).","example":0.695},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"ranges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The ranges read on that day (will be included only when the type is QURAN)","example":["1:1-1:2"]},"pagesRead":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages read on that day (will be included only when the type is QURAN)","example":1.637041020126048},"secondsRead":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading on that day (will be included only when the type is QURAN)","example":417},"versesRead":{"oneOf":[{"type":"integer"}],"description":"The number of Ayahs read on that day (will be included only when the type is QURAN)","example":24},"manuallyAddedSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading that was manually input by the user and not auto-tracked (will be included only when the type is QURAN)","example":24},"dailyTargetPages":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":1.637041020126048},"dailyTargetSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":5},"dailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"remainingDailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4}},"required":["id","date","progress","type","mushafId"],"additionalProperties":false,"description":"The Mushaf used to read on that day (will be included only when the type is QURAN) \n\nThe id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","title":"When user has a goal"}]}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wq2b00047z3fbl4c6ew0","date":"2023-09-31","progress":0.695,"type":"QURAN","ranges":["1:1-1:2"],"pagesRead":1.637041020126048,"secondsRead":417,"versesRead":24,"manuallyAddedSeconds":24,"dailyTargetPages":1.637041020126048,"dailyTargetSeconds":5,"dailyTargetRanges":["1:1-1:2"],"remainingDailyTargetRanges":["1:1-1:2"],"mushafId":4}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1GoalsGetTodaysPlan"}},"/v1/goals/{id}":{"put":{"description":"Update a goal","tags":["Goals"],"summary":"Update a goal","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The id of the goal.","example":"cmoa3wr5c000g7z3fgv0y0rvo"},"required":true,"description":"The id of the goal."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"amount":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"duration":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"category":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"}},"additionalProperties":false},"example":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":1,"category":"QURAN"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPutV1GoalsById"},"delete":{"description":"Delete a goal by id.","tags":["Goals"],"summary":"Delete a goal","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The id of the goal.","example":"cmoa3wr5c000g7z3fgv0y0rvo"},"required":true,"description":"The id of the goal."},{"in":"query","name":"category","schema":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"},"required":true,"description":"The category of the goal"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"message":{"enum":["goal deleted"]}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"message":"goal deleted"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1GoalsById"}},"/v1/goals":{"post":{"description":"Create a goal","tags":["Goals"],"summary":"Create a goal","parameters":[{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"amount":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"duration":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"category":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The category of the goal"}},"required":["type","amount","category"],"additionalProperties":false},"example":{"type":"QURAN_TIME","amount":"1:5-1:10","duration":1,"category":"QURAN"}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The id of the goal.","example":"cmoa3wr5c000g7z3fgv0y0rvo"}},"required":["id"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"id":"cmoa3wr5c000g7z3fgv0y0rvo"}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Goals"}},"/v1/goals/estimate":{"get":{"description":"Generate a timeline up to a week of the minimum daily amount required to meet the goal.","tags":["Goals"],"summary":"Generate timeline estimation","parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN_TIME","QURAN_PAGES","QURAN_RANGE","COURSE","QURAN_READING_PROGRAM","RAMADAN_CHALLENGE"],"description":"The type of the goal.","example":"QURAN_TIME"},"required":true,"description":"The type of the goal."},{"in":"query","name":"amount","schema":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10","x-required":true},{"type":"integer","minimum":1,"example":600,"x-required":true}],"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},"required":true,"description":"The amount of the goal. Depending on the goal type, the amount value and format will be different"},{"in":"query","name":"duration","schema":{"type":"integer","minimum":1,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},"required":false,"description":"The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based."},{"in":"query","name":"mushafId","schema":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4},"required":true,"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/EstimatedGoalTimeline"}},"additionalProperties":false},"example":{"success":true,"data":{"week":[{"date":"2023-01-21T07:28:13.023Z","amount":"1:5-1:10"}]}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1GoalsEstimate"}},"/v1/streaks":{"get":{"description":"Get user streaks.","tags":["Streaks"],"summary":"Get streaks","parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date after which any streaks would be returned (inclusive)","example":"2023-09-01"},"description":"The date after which any streaks would be returned (inclusive)"},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date before which any streaks would be returned (inclusive)","example":"2023-09-31"},"description":"The date before which any streaks would be returned (inclusive)"},{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN"],"description":"The type of the streak","example":"QURAN"},"description":"The type of the streak"},{"in":"query","name":"sortOrder","schema":{"type":"string","enum":["asc","desc"],"description":"The sorting order of `orderBy` field","example":"desc","default":"desc"},"description":"The sorting order of `orderBy` field"},{"in":"query","name":"orderBy","schema":{"type":"string","enum":["startDate","days"],"description":"Which field to order the streaks by","example":"startDate","default":"startDate"},"description":"Which field to order the streaks by"},{"in":"query","name":"status","schema":{"type":"string","enum":["ACTIVE","BROKEN"],"description":"The status of the streak.","example":"ACTIVE"},"description":"The status of the streak."},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The id of the streak.","example":"cmoa3wrr2000i7z3fe8swbujv"},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the streak.","example":"2023-09-01"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the streak.","example":"2023-09-31"},"status":{"type":"string","enum":["ACTIVE","BROKEN"],"description":"The status of the streak.","example":"ACTIVE"},"days":{"type":"integer","description":"The number of days the streak is/was active for.","example":5}},"required":["id","startDate","endDate","status","days"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wrr2000i7z3fe8swbujv","startDate":"2023-09-01","endDate":"2023-09-31","status":"ACTIVE","days":5}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Streaks"}},"/v1/streaks/current-streak-days":{"get":{"description":"Get current active streak days.","tags":["Streaks"],"summary":"Get current streak days","parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN"],"description":"The type of the streak","example":"QURAN"},"required":true,"description":"The type of the streak"},{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"days":{"type":"integer","description":"The number of days the current streak is active for.","example":5}},"required":["days"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"days":5}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1StreaksCurrentStreakDays"}},"/v1/activity-days":{"post":{"description":"Create or update a daily activity record (one per date per type). Activity Days power streaks, goals, and calendar-style progress.\n\nFor `type=QURAN`, provide `seconds`, `ranges`, and `mushafId`. You can optionally pass `date` (YYYY-MM-DD) to backfill activity for a past day (for example when the user manually adds time). This endpoint enqueues progress updates and uses the `x-timezone` header to interpret day boundaries and calculate streaks accurately.","tags":["Activity Days"],"summary":"Add/update activity day","parameters":[{"in":"header","name":"x-timezone","schema":{"type":"string","description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.","example":"Asia/Saigon"},"description":"The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day, can be today or a past date. If not passed, default to today","example":"2023-09-01"},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"}},"required":["type"],"additionalProperties":false,"oneOf":[{"type":"object","properties":{"seconds":{"type":"integer","minimum":1,"description":"Seconds spent reading the current request's ranges","example":5},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"},"description":"Current request's read range of Ayahs","example":["1:5-1:10"]},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4}},"required":["seconds","ranges","mushafId"],"additionalProperties":false,"title":"QURAN"}]},"example":{"seconds":5,"ranges":["1:5-1:10"],"mushafId":4}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"}},"additionalProperties":false},"example":{"success":true,"data":{}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1ActivityDays"},"get":{"description":"Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type.","tags":["Activity Days"],"summary":"Get activity days","parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The start date of the activity days","example":"2023-09-01"},"description":"The start date of the activity days"},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The last date of the activity days","example":"2023-09-31"},"description":"The last date of the activity days"},{"in":"query","name":"dateOrderBy","schema":{"type":"string","enum":["asc","desc"],"description":"Order by activity day's date","example":"desc","default":"desc"},"description":"Order by activity day's date"},{"in":"query","name":"type","schema":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"description":"The type of the activity day"},{"in":"query","name":"last","schema":{"type":"integer","minimum":1,"maximum":20,"description":"The number of items to be fetched. Should be used together with `before`","example":10},"description":"The number of items to be fetched. Should be used together with `before`"},{"in":"query","name":"first","schema":{"type":"integer","minimum":1,"maximum":20,"oneOf":[{"type":"integer"}],"description":"The number of items to be fetched.","example":10},"description":"The number of items to be fetched."},{"in":"query","name":"after","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor after which you want to get the next page of items. Should be used together with `first`","example":"cmoa3wq0z00007z3fh1v9g30d"},"description":"The cursor after which you want to get the next page of items. Should be used together with `first`"},{"in":"query","name":"before","schema":{"type":"string","oneOf":[{"type":"string"}],"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`","example":"cmoa3wq1000017z3f9atfhuvw"},"description":"The cursor before which the previous page of items will be fetched. Should be used together with `last`"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The id of the activity day.","example":"cmoa3wq2b00047z3fbl4c6ew0"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of the activity day.","example":"2023-09-31"},"progress":{"type":"number","format":"float","minimum":0,"maximum":1,"description":"The progress of the reading goal of that activity day (if the user has a reading goal on that day).","example":0.695},"type":{"type":"string","enum":["QURAN","LESSON","QURAN_READING_PROGRAM"],"description":"The type of the activity day","example":"QURAN"},"ranges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The ranges read on that day (will be included only when the type is QURAN)","example":["1:1-1:2"]},"pagesRead":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages read on that day (will be included only when the type is QURAN)","example":1.637041020126048},"secondsRead":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading on that day (will be included only when the type is QURAN)","example":417},"versesRead":{"oneOf":[{"type":"integer"}],"description":"The number of Ayahs read on that day (will be included only when the type is QURAN)","example":24},"manuallyAddedSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds spent reading that was manually input by the user and not auto-tracked (will be included only when the type is QURAN)","example":24},"dailyTargetPages":{"oneOf":[{"type":"number","format":"float"}],"description":"The number of pages user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":1.637041020126048},"dailyTargetSeconds":{"oneOf":[{"type":"integer"}],"description":"The number of seconds user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":5},"dailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"remainingDailyTargetRanges":{"oneOf":[{"type":"array","items":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"}}],"description":"The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)","example":["1:1-1:2"]},"mushafId":{"type":"integer","enum":[1,2,3,4,5,6,7,11,19],"description":"The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4","example":4}},"required":["id","date","progress","type","mushafId"],"additionalProperties":false,"description":"The Mushaf used to read on that day (will be included only when the type is QURAN) \n\nThe id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"cmoa3wq2b00047z3fbl4c6ew0","date":"2023-09-31","progress":0.695,"type":"QURAN","ranges":["1:1-1:2"],"pagesRead":1.637041020126048,"secondsRead":417,"versesRead":24,"manuallyAddedSeconds":24,"dailyTargetPages":1.637041020126048,"dailyTargetSeconds":5,"dailyTargetRanges":["1:1-1:2"],"remainingDailyTargetRanges":["1:1-1:2"],"mushafId":4}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1ActivityDays"}},"/v1/activity-days/estimate-reading-time":{"get":{"description":"Estimate the number of seconds it would take to read a range. We estimate it based on the average reading speed we have collected on quran.com.","tags":["Activity Days"],"summary":"Estimate reading time","parameters":[{"in":"query","name":"ranges","schema":{"type":"string","pattern":"^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$","description":"a comma separated string of Ayah ranges e.g. 1:1-1:2","example":"1:1-1:2"},"required":true,"description":"a comma separated string of Ayah ranges e.g. 1:1-1:2"}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"seconds":{"type":"integer","description":"The number of seconds it would take on average to read the range of Ayahs.","example":66.8}},"required":["seconds"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"seconds":66.8}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1ActivityDaysEstimateReadingTime"}},"/v1/users/profile":{"patch":{"operationId":"UsersController_editProfile","summary":"Edit user profile","description":"Partially update the authenticated user settings and preferences like notification settings, privacy options, and display preferences.","parameters":[],"requestBody":{"required":true,"description":"Settings fields to update - only include fields you want to change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditProfileDto"},"example":{"languageId":1,"reflectionLanguages":["string"],"ayahLanguages":["string"],"customized":true,"hideFollowSuggestion":true,"showFollowFeaturedSuggestion":true}}}},"responses":{"200":{"description":"Settings updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}},"example":{"success":true}}}},"400":{"description":"Invalid settings data"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]},"get":{"operationId":"UsersController_profile","summary":"Get user profile","description":"Retrieve the complete profile of the authenticated user including personal info, settings, statistics, and connected accounts.","parameters":[{"name":"qdc","required":false,"in":"query","description":"Include Quran.com (QDC) connected account data","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Full user profile with all data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSerializedDto"},"example":{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]},"put":{"operationId":"UsersController_updateProfile","summary":"Update user profile","description":"Update user profile information including name, bio, username, avatar, and social links. Validates username uniqueness.","parameters":[],"requestBody":{"required":true,"description":"Profile fields to update wrapped in a user object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileBodyDto"},"example":{"user":{"avatar":"string","firstName":"string","lastName":"string","bio":"string","country":"string","removeAvatar":true}}}}},"responses":{"200":{"description":"Profile updated and returned with new values","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSerializedDto"},"example":{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}}}},"400":{"description":"Invalid profile data or username taken"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/notes":{"get":{"tags":["Notes"],"description":"List notes owned by the user. This API contains pagination. Read more about [pagination](/#pagination)","summary":"Get all notes","parameters":[{"in":"query","name":"cursor","schema":{"type":"string","description":"A cursor for pagination, used to fetch the next set of results.","example":"cursor123"},"description":"A cursor for pagination, used to fetch the next set of results."},{"in":"query","name":"limit","schema":{"type":"number","format":"float","minimum":1,"maximum":50,"description":"The maximum number of notes to return, defaults to 20.","example":20,"default":20},"description":"The maximum number of notes to return, defaults to 20."},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["newest","oldest"],"description":"The sorting order of the notes, defaults to newest first.","example":"newest","default":"newest"},"description":"The sorting order of the notes, defaults to newest first."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1Notes"},"post":{"tags":["Notes"],"description":"Add a new note.","summary":"Add note","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"saveToQR":{"type":"boolean","description":"Indicates whether the note should be saved to the QuranReflect.","example":true},"attachedEntity":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["body","saveToQR"],"additionalProperties":false},"example":{"body":"This is a sample note body.","saveToQR":true,"attachedEntity":{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}},"ranges":["2:255-2:257"]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1Notes"}},"/v1/notes/by-verse/{verseKey}":{"get":{"tags":["Notes"],"description":"Retrieve notes by a specific verse.","summary":"Get notes by verse","parameters":[{"in":"query","name":"verseKey","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The verse key for which notes are being requested.","example":"2:255"},"required":true,"description":"The verse key for which notes are being requested."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmoa3wq1000027z3fciij2440"},"endCursor":{"type":"string","example":"cmoa3wq1000037z3fhr8z3edp"},"hasNextPage":{"type":"boolean","example":true},"hasPreviousPage":{"type":"boolean","example":false}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}],"pagination":{"startCursor":"cmoa3wq1000027z3fciij2440","endCursor":"cmoa3wq1000037z3fhr8z3edp","hasNextPage":true,"hasPreviousPage":false}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesByVerseByVerseKey"}},"/v1/notes/by-attached-entity":{"get":{"tags":["Notes"],"description":"Retrieve notes by attached entity.","summary":"Get notes by attached entity","parameters":[{"in":"query","name":"entityId","schema":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"required":true,"description":"The unique identifier for the attached entity."},{"in":"query","name":"entityType","schema":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"required":true,"description":"The type of the attached entity, must be one of the predefined NoteEntityType values."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}]}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesByAttachedEntity"}},"/v1/notes/count-within-range":{"get":{"tags":["Notes"],"description":"Get the count of notes within a range of verses.","summary":"Get notes count within verse range","parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The starting verse key of the range.","example":"2:12"},"required":true,"description":"The starting verse key of the range."},{"in":"query","name":"to","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The ending verse key of the range.","example":"2:18"},"required":true,"description":"The ending verse key of the range."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{},"additionalProperties":{"type":"integer","minimum":1},"description":"A map of verse keys to note counts, where each key is a verse key and each value is an integer count of notes.","example":{"1:2":5,"1:3":1,"1:4":1}}},"additionalProperties":false},"example":{"success":true,"data":{"1:2":5,"1:3":1,"1:4":1}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesCountWithinRange"}},"/v1/notes/by-range":{"get":{"tags":["Notes"],"description":"Retrieve notes by a range of verses.","summary":"Get notes by verse range","parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The starting verse key of the range.","example":"2:12"},"required":true,"description":"The starting verse key of the range."},{"in":"query","name":"to","schema":{"type":"string","pattern":"^(\\d+):(\\d+)$","description":"The ending verse key of the range.","example":"2:18"},"required":true,"description":"The ending verse key of the range."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}}},"additionalProperties":false},"example":{"success":true,"data":[{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}]}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesByRange"}},"/v1/notes/{noteId}":{"get":{"tags":["Notes"],"description":"Retrieve a note by its ID.","summary":"Get note by ID","parameters":[{"in":"query","name":"withAttachedEntities","schema":{"type":"boolean","description":"Specifies whether to include attached entities in the response, defaults to true.","example":true,"default":true},"description":"Specifies whether to include attached entities in the response, defaults to true."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authGetV1NotesByNoteId"},"patch":{"tags":["Notes"],"description":"Update a note by its ID.","summary":"Update note by ID","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The unique identifier of the note to be retrieved or manipulated.","example":"asda12312312"},"required":true,"description":"The unique identifier of the note to be retrieved or manipulated."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"saveToQR":{"type":"boolean","description":"Indicates whether the updated note should be saved to the QuranReflect, defaults to false.","example":false,"default":false}},"required":["body"],"additionalProperties":false},"example":{"body":"This is a sample note body.","saveToQR":false}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the note.","example":"asdasdqwe1231"},"createdAt":{"type":"string","format":"date-time","description":"The creation date of the note.","example":"2023-01-21T07:28:13.023Z"},"updatedAt":{"type":"string","format":"date-time","description":"The last update date of the note.","example":"2023-01-22T07:28:13.023Z"},"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"source":{"type":"string","description":"The source of the note.","example":"we23412312weq"},"attachedEntities":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","description":"The unique identifier for the attached entity.","example":"entity123"},"entityType":{"type":"string","enum":["reflection"],"description":"The type of the attached entity, must be one of the predefined NoteEntityType values.","example":"reflection"},"entityMetadata":{"type":"object","properties":{},"description":"Additional metadata for the attached entity.","example":{"key":"value"}}},"required":["entityId","entityType"],"additionalProperties":false},"description":"An array of attached entities associated with the note."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:255-2:257"]}},"required":["id","createdAt","updatedAt","body"],"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"id":"asdasdqwe1231","createdAt":"2023-01-21T07:28:13.023Z","updatedAt":"2023-01-22T07:28:13.023Z","body":"This is a sample note body.","source":"we23412312weq","attachedEntities":[{"entityId":"entity123","entityType":"reflection","entityMetadata":{"key":"value"}}],"ranges":["2:255-2:257"]}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPatchV1NotesByNoteId"},"delete":{"tags":["Notes"],"description":"Delete a note by its ID.","summary":"Delete note by ID","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The ID of the note to delete."},"required":true,"description":"The ID of the note to delete."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"success":{"type":"boolean"}},"additionalProperties":false}},"additionalProperties":false},"example":{"success":true,"data":{"success":true}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authDeleteV1NotesByNoteId"}},"/v1/notes/{noteId}/publish":{"post":{"tags":["Notes"],"description":"Publish a note to QR.","summary":"Publish note","parameters":[{"in":"path","name":"noteId","schema":{"type":"string","description":"The unique identifier of the note to be retrieved or manipulated.","example":"asda12312312"},"required":true,"description":"The unique identifier of the note to be retrieved or manipulated."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":6,"maxLength":10000,"description":"The main content of the note, must be between the specified minimum and maximum length.","example":"This is a sample note body."},"ranges":{"type":"array","items":{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$"},"description":"An array of verse ranges associated with the note.","example":["2:112-2:115"]}},"required":["body"],"additionalProperties":false},"example":{"body":"This is a sample note body.","ranges":["2:112-2:115"]}}}},"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"success":{"type":"boolean"},"postId":{"type":"number","format":"float"}},"required":["success"],"additionalProperties":false,"description":"Response object indicating the success of the note publishing operation and the optional post ID if successful.","example":{"success":true,"postId":123}}},"additionalProperties":false},"example":{"success":true,"data":{"success":true,"postId":123}}}}},"400":{"description":"The request is missing required parameters or is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request is missing required headers or is invalid"},"type":{"type":"string","example":"invalid_request"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"401":{"description":"The request is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request requires user authentication"},"type":{"type":"string","example":"unauthorized"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server understood the request, but refuses to authorize it"},"type":{"type":"string","example":"forbidden"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"404":{"description":"Not Found. The resource being accessed does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The requested resource could not be found"},"type":{"type":"string","example":"not_found"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"422":{"description":"Validation Error. The request includes one or more invalid params. Please check the request params and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The request was well-formed but was unable to be followed due to semantic errors"},"type":{"type":"string","example":"unprocessable_entity"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"429":{"description":"Too many requests, please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later"},"type":{"type":"string","example":"rate_limit_exceeded"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"500":{"description":"Server Error. Something went wrong, try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server encountered an internal error and was unable to complete your request"},"type":{"type":"string","example":"internal_server_error"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"502":{"description":"Invalid response from the upstream server","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},"type":{"type":"string","example":"bad_gateway"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"503":{"description":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server is currently unable to handle the request due to a temporary overload or scheduled maintenance"},"type":{"type":"string","example":"service_unavailable"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}},"504":{"description":"The server did not receive a timely response from the upstream server.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},"type":{"type":"string","example":"gateway_timeout"},"success":{"type":"boolean","example":false}},"additionalProperties":false}}}}},"operationId":"authPostV1NotesByNoteIdPublish"}},"/v1/users/my-rooms":{"get":{"operationId":"UsersController_rooms","summary":"Get logged-in user rooms","description":"Retrieve all rooms (groups and pages) the authenticated user is a member of. Supports filtering by name and pagination.","parameters":[{"name":"name","required":false,"in":"query","description":"Filter rooms by name","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Rooms per page (default: 10)","schema":{"type":"number"}}],"responses":{"200":{"description":"User rooms with pagination metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRoomsResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"id":1,"name":"string","group":"string","public":true,"roomType":"string","verified":true,"subdomain":"string","description":"string","membersCount":1,"avatarUrl":{"small":"string","medium":"string","large":"string"}}]}}}},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/users/search":{"get":{"operationId":"UsersController_search","summary":"Search for users","description":"Search users by name or username. Supports mentioning in posts, finding users for room invites, and general discovery. Results can be scoped to specific contexts.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term for name/username","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"all","required":false,"in":"query","description":"Search all users (not just followed)","schema":{"type":"boolean"}},{"name":"postingAs","required":false,"in":"query","description":"Filter for posting-as feature","schema":{"type":"boolean"}},{"name":"postingAsUserId","required":false,"in":"query","description":"User ID for posting-as context","schema":{"type":"string"}},{"name":"roomId","required":false,"in":"query","description":"Room ID for scoped search","schema":{"type":"number"}}],"responses":{"200":{"description":"Matching users with pagination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsersSearchResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"isFollowed":false,"followed":false,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string"}]}}}}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/users/{followeeId}/toggle-follow":{"post":{"operationId":"UsersController_toggleFollow","summary":"Toggle follow/unfollow a user","description":"Follow or unfollow another user. When following, their posts will appear in your FOLLOWING feed. Can optionally specify action to force follow/unfollow.","parameters":[{"name":"followeeId","required":true,"in":"path","description":"UUID of the user to follow/unfollow","schema":{"type":"string"}}],"requestBody":{"required":false,"description":"Optional: specify \"follow\" or \"unfollow\" action explicitly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToggleFollowDto"},"example":{"action":"follow"}}}},"responses":{"200":{"description":"Follow status changed - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"followed":{"type":"boolean","description":"true if now following"}}},"example":{"followed":true}}}},"400":{"description":"Cannot follow yourself or action already in desired state"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/users/{followerId}/remove-follower":{"post":{"operationId":"UsersController_removeFollower","summary":"Remove a follower","description":"Remove a user from your followers list. They will no longer see you as followed and won't receive notifications about your activity.","parameters":[{"name":"followerId","required":true,"in":"path","description":"UUID of the follower to remove","schema":{"type":"string"}}],"responses":{"200":{"description":"Follower removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean","example":true}}},"example":{"removed":true}}}},"400":{"description":"Invalid follower id or follower relationship doesn't exist"},"401":{"description":"User not authenticated"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/users/{id}":{"get":{"operationId":"UsersController_getUserProfile","summary":"Get user profile by id or username","description":"Retrieve a user profile by either UUID or username. If viewing your own profile, returns full data; otherwise returns public profile with follow relationship status.","parameters":[{"name":"id","required":false,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"username","required":false,"in":"path","description":"Username of the user (case-insensitive)","schema":{"type":"string"}},{"name":"qdc","required":false,"in":"query","description":"Include Quran.com connected account data","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Own profile with full data including settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSerializedDto"},"example":{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}}}},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/users/{username}/profile":{"get":{"operationId":"UsersController_getUserProfile","summary":"Get user profile by id or username","description":"Retrieve a user profile by either UUID or username. If viewing your own profile, returns full data; otherwise returns public profile with follow relationship status.","parameters":[{"name":"id","required":false,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"username","required":false,"in":"path","description":"Username of the user (case-insensitive)","schema":{"type":"string"}},{"name":"qdc","required":false,"in":"query","description":"Include Quran.com connected account data","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Own profile with full data including settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSerializedDto"},"example":{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}}}},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/users/{id}/followers":{"get":{"operationId":"UsersController_getUserFollowers","summary":"Get user followers","description":"Retrieve a paginated list of users who follow the specified user. Includes follow relationship to the viewer if authenticated.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"List of followers with pagination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsersSearchResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"isFollowed":false,"followed":false,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string"}]}}}},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/users/{id}/following":{"get":{"operationId":"UsersController_getUserFollowing","summary":"Get users followed by user","description":"Retrieve a paginated list of users that the specified user follows. Includes follow relationship to the viewer if authenticated.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"List of followed users with pagination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsersSearchResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"isFollowed":false,"followed":false,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string"}]}}}},"404":{"description":"User not found"}},"tags":["Users"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/admins-access":{"post":{"operationId":"RoomsController_adminsAccess","summary":"Update room admin access","description":"Grant or revoke admin privileges for a user in a room. Only room owners or existing admins can modify admin access.","parameters":[],"requestBody":{"required":true,"description":"Contains roomId, userId, and admin boolean to grant/revoke access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomAdminUpdateDto"},"example":{"roomId":1,"userId":"string","admin":true}}}},"responses":{"200":{"description":"Admin access updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}},"example":{"success":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to modify admin access"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/groups":{"patch":{"operationId":"RoomsController_updateGroup","summary":"Update a group","description":"Update group properties like name, description, URL, avatar, country, or public visibility. Only group admins/owners can update.","parameters":[],"requestBody":{"required":true,"description":"Group fields to update - all fields optional except id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGroupDto"},"example":{"id":1,"name":"string","description":"string","url":"string","removeAvatar":true,"avatar":"string","country":"string","public":null}}}},"responses":{"200":{"description":"Group updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"room":{"type":"object"}}},"example":{"success":true,"room":{}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to update this group"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]},"post":{"operationId":"RoomsController_createNewGroup","summary":"Create a new group","description":"Create a new community group for sharing reflections. Groups can be public or private, and the creator becomes the owner.","parameters":[],"requestBody":{"required":true,"description":"Group creation details including name, description, URL, and visibility","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGroupDto"},"example":{"name":"string","description":"string","url":"string","public":true}}}},"responses":{"201":{"description":"Group created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomCreatedResponseDto"},"example":{"success":true,"data":{"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}}}}},"400":{"description":"Invalid group data or URL already taken"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/pages":{"patch":{"operationId":"RoomsController_updatePage","summary":"Update a page","description":"Update page properties like name, description, contact info, organization details, or visibility. Only page admins/owners can update.","parameters":[],"requestBody":{"required":true,"description":"Page fields to update - all fields optional except id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePageDto"},"example":{"id":1,"removeAvatar":true,"avatar":"string","public":null,"name":"string","description":"string","organizationWebsite":"string","country":"string","url":"string"}}}},"responses":{"200":{"description":"Page updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"room":{"type":"object"}}},"example":{"success":true,"room":{}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to update this page"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]},"post":{"operationId":"RoomsController_createNewPage","summary":"Create a new page","description":"Submit a request to create a new organizational page. Pages require admin approval and include organization details, contact info, and purpose statement.","parameters":[],"requestBody":{"required":true,"description":"Page creation details including name, description, URL, organization info, and purpose","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePageDto"},"example":{"name":"string","description":"string","jobTitle":"string","contactNumber":"string","organizationName":"string","organizationWebsite":"string","purpose":"string","additionalDetails":"string","country":"string","url":"string","public":true}}}},"responses":{"201":{"description":"Page request submitted for admin review","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"},"message":{"type":"string"}}},"example":{"success":true,"data":{},"message":"string"}}}},"400":{"description":"Invalid page data or URL already taken"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/{id}/members":{"get":{"operationId":"RoomsController_getRoomMembers","summary":"Get room members","description":"Retrieve paginated list of members in a room (group or page). Returns user profiles with their roles.","parameters":[{"name":"limit","required":false,"in":"query","description":"Members per page (default: 10)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Room members retrieved with pagination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomMembersResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"id":"user-1","username":"member.username","firstName":"Member","lastName":"User","verified":true,"avatarUrls":{"small":"https://avatars.quran.foundation/users/user-1/small.png","medium":"https://avatars.quran.foundation/users/user-1/medium.png","large":"https://avatars.quran.foundation/users/user-1/large.png"},"isAdmin":false,"isOwner":false,"isFollowed":true,"isActive":true,"followersCount":42}]}}}},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/{id}/invite":{"post":{"operationId":"RoomsController_inviteUserToRoom","summary":"Invite user to room","description":"Send an invitation to a user to join the room. User will receive a notification/email with an invite link. Only admins can invite.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"User identification for invitation (email or userId)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteUserDto"},"example":{"userIds":["string"],"emails":["string"]}}}},"responses":{"200":{"description":"Invitation sent successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomInviteUserResponseDto"},"example":{"invited":true,"inviteStatus":{"user-123":true,"user-456":"already_a_member"}}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to invite members"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/{id}/accept-invite":{"get":{"operationId":"RoomsController_acceptInvite","summary":"Accept room invite","description":"Accept an invitation to join a room using the token from the invite link. Adds user as member.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"token","required":true,"in":"query","description":"Invitation token from invite link","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation accepted - user is now a member","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomInviteAcceptedResponseDto"},"example":{"accepted":true}}}},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/{id}/reject-invite":{"get":{"operationId":"RoomsController_rejectInvite","summary":"Reject room invite","description":"Decline an invitation to join a room. Invalidates the invite token.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"token","required":true,"in":"query","description":"Invitation token from invite link","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomInviteRejectedResponseDto"},"example":{"rejected":true}}}},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/{id}/members/{userId}":{"delete":{"operationId":"RoomsController_removeMember","summary":"Remove member from room","description":"Remove a user from a room (group or page). Only admins can remove other members. Users can remove themselves.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"userId","required":true,"in":"path","description":"UUID of the user to remove","schema":{"type":"string"}}],"responses":{"200":{"description":"Member removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}},"example":{"success":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to remove this member"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/joined-rooms":{"get":{"operationId":"RoomsController_getRooms","summary":"Get joined or managed rooms","description":"Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-rooms). Supports search and pagination.","parameters":[{"name":"query","required":false,"in":"query","description":"Search query for room names","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Rooms per page (default: 5)","schema":{"minimum":1,"maximum":5,"default":5,"type":"number"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order (default: NAME_ASC)","schema":{"enum":["NAME_ASC","NAME_DESC","LATEST_ACTIVITY"],"type":"string"}}],"responses":{"200":{"description":"Rooms retrieved with pagination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedRoomsResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}]}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/managed-rooms":{"get":{"operationId":"RoomsController_getRooms","summary":"Get joined or managed rooms","description":"Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-rooms). Supports search and pagination.","parameters":[{"name":"query","required":false,"in":"query","description":"Search query for room names","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Rooms per page (default: 5)","schema":{"minimum":1,"maximum":5,"default":5,"type":"number"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order (default: NAME_ASC)","schema":{"enum":["NAME_ASC","NAME_DESC","LATEST_ACTIVITY"],"type":"string"}}],"responses":{"200":{"description":"Rooms retrieved with pagination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedRoomsResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}]}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/search":{"get":{"operationId":"RoomsController_searchRooms","summary":"Search rooms","description":"Search for public groups and pages by name or description. Results can be filtered by room type.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term for room name/description","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Results per page (default: 10)","schema":{"type":"number"}},{"name":"roomType","required":false,"in":"query","description":"Filter by room type: GROUP or PAGE","schema":{"type":"string"}}],"responses":{"200":{"description":"Matching rooms with pagination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedRoomsResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}]}}}}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/group/{url}":{"get":{"operationId":"RoomsController_getRoomProfile","summary":"Get room profile by URL or subdomain","description":"Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Returns room details, member counts, and relationship status.","parameters":[{"name":"url","required":false,"in":"path","description":"Group URL identifier (lowercase)","schema":{"type":"string"}},{"name":"subdomain","required":false,"in":"path","description":"Page subdomain identifier (lowercase)","schema":{"type":"string"}}],"responses":{"200":{"description":"Room profile with details and membership info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomProfileResponseDto"},"example":{"privateToken":"private-room-token","mutualFollowers":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}],"mutualFollowersCount":2,"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}}}},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/page/{subdomain}":{"get":{"operationId":"RoomsController_getRoomProfile","summary":"Get room profile by URL or subdomain","description":"Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Returns room details, member counts, and relationship status.","parameters":[{"name":"url","required":false,"in":"path","description":"Group URL identifier (lowercase)","schema":{"type":"string"}},{"name":"subdomain","required":false,"in":"path","description":"Page subdomain identifier (lowercase)","schema":{"type":"string"}}],"responses":{"200":{"description":"Room profile with details and membership info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomProfileResponseDto"},"example":{"privateToken":"private-room-token","mutualFollowers":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}],"mutualFollowersCount":2,"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}}}},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/group/{url}/accept/{token}":{"get":{"operationId":"RoomsController_acceptByPrivateToken","summary":"Accept room invite by private token","description":"Accept an invitation using a private room URL with embedded token. Alternative to the /accept-invite endpoint for direct link access.","parameters":[{"name":"url","required":false,"in":"path","description":"Group URL identifier","schema":{"type":"string"}},{"name":"subdomain","required":false,"in":"path","description":"Page subdomain identifier","schema":{"type":"string"}},{"name":"token","required":true,"in":"path","description":"Private invitation token","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation accepted - user added to room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomAcceptByPrivateTokenResponseDto"},"example":{"roomId":42,"success":true,"isNewMember":true}}}},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/page/{subdomain}/accept/{token}":{"get":{"operationId":"RoomsController_acceptByPrivateToken","summary":"Accept room invite by private token","description":"Accept an invitation using a private room URL with embedded token. Alternative to the /accept-invite endpoint for direct link access.","parameters":[{"name":"url","required":false,"in":"path","description":"Group URL identifier","schema":{"type":"string"}},{"name":"subdomain","required":false,"in":"path","description":"Page subdomain identifier","schema":{"type":"string"}},{"name":"token","required":true,"in":"path","description":"Private invitation token","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation accepted - user added to room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomAcceptByPrivateTokenResponseDto"},"example":{"roomId":42,"success":true,"isNewMember":true}}}},"400":{"description":"Invalid or expired token"},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/{id}":{"get":{"operationId":"RoomsController_getRoomProfileById","summary":"Get room profile by ID","description":"Retrieve a room profile by its unique numeric ID. Returns room details, member counts, and relationship status for the current user.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Room profile retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomProfileResponseDto"},"example":{"privateToken":"private-room-token","mutualFollowers":[{"avatarUrls":{"small":"https://avatars.githubusercontent.com/u/12345678","medium":"https://avatars.githubusercontent.com/u/12345678","large":"https://avatars.githubusercontent.com/u/12345678"},"createdAt":"2000-01-21 00:00:00","joiningYear":2025,"isPasswordSet":true,"settings":{"ayahLanguages":[1],"reflectionLanguages":[1]},"username":"string","id":"string","verified":false,"postAs":false,"firstName":"string","lastName":"string","postsCount":0,"averageToxicity":0,"languageId":1,"banned":false,"memberType":1,"followersCount":0,"likesCount":0,"isAdmin":false,"languageIsoCode":"en","bio":"string","country":"string","followed":true}],"mutualFollowersCount":2,"id":1,"name":"string","description":"string","roomType":"string","isActive":true,"isVerified":true,"isPublic":true,"isOwner":true,"isAdmin":true,"ownerId":"string","postsCount":1,"membersCount":1,"url":"string","avatarUrls":{"thumb":"string","original":"string"},"createdAt":"2026-04-02T00:00:00.000Z","isMember":true,"subdomain":"string","country":"string"}}}},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/{id}/posts":{"get":{"operationId":"RoomsController_getRoomPosts","summary":"Get room posts","description":"Retrieve paginated posts shared within a room. Supports filtering by tab (REFLECTIONS, DISCUSSIONS) and sorting (LATEST, POPULAR).","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Posts per page (max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"tab","required":false,"in":"query","description":"Filter posts by content type","schema":{"enum":["reflections","saved","public","members_only"],"type":"string"}}],"responses":{"200":{"description":"Room posts with pagination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}},"404":{"description":"Room not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/{groupId}/join":{"post":{"operationId":"RoomsController_joinRoom","summary":"Join a group","description":"Join a public group as a member. For private groups, an invitation is required. Returns whether the join was successful.","parameters":[{"name":"groupId","required":true,"in":"path","description":"Unique numeric group ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully joined the group","content":{"application/json":{"schema":{"type":"object","properties":{"joined":{"type":"boolean","example":true}}},"example":{"joined":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"Group is private - invitation required"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/{groupId}/leave":{"post":{"operationId":"RoomsController_leaveGroup","summary":"Leave a group","description":"Leave a group the user is currently a member of. Owners cannot leave - they must transfer ownership first.","parameters":[{"name":"groupId","required":true,"in":"path","description":"Unique numeric group ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully left the group","content":{"application/json":{"schema":{"type":"object","properties":{"left":{"type":"boolean","example":true}}},"example":{"left":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"Owner cannot leave - transfer ownership first"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/{pageId}/follow":{"post":{"operationId":"RoomsController_followPage","summary":"Follow a page","description":"Follow an organizational page to see their posts in your feed. Pages represent verified organizations or scholars.","parameters":[{"name":"pageId","required":true,"in":"path","description":"Unique numeric page ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully followed the page","content":{"application/json":{"schema":{"type":"object","properties":{"followed":{"type":"boolean","example":true}}},"example":{"followed":true}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/{pageId}/unfollow":{"post":{"operationId":"RoomsController_unfollowPage","summary":"Unfollow a page","description":"Stop following a page. Their posts will no longer appear in your personalized feed.","parameters":[{"name":"pageId","required":true,"in":"path","description":"Unique numeric page ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully unfollowed the page","content":{"application/json":{"schema":{"type":"object","properties":{"unfollowed":{"type":"boolean","example":true}}},"example":{"unfollowed":true}}}},"401":{"description":"User not authenticated"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/rooms/{roomId}/posts/{postId}/privacy":{"patch":{"operationId":"RoomsController_updatePostPrivacy","summary":"Update post privacy in room","description":"Change the visibility of a post within a room. Toggle between public (visible outside room) and private (members only). Only admins can modify.","parameters":[{"name":"roomId","required":true,"in":"path","description":"Unique numeric room ID","schema":{"type":"number"}},{"name":"postId","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Privacy setting with isPublic boolean","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomPostUpdatePrivacyDto"},"example":{"isPublic":true}}}},"responses":{"200":{"description":"Post privacy updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostSerialized"},"example":{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to modify post privacy"},"404":{"description":"Room or post not found"}},"tags":["Rooms"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/feed":{"get":{"operationId":"PostsController_feed","summary":"Get posts feed","description":"Retrieve a paginated feed of Quran Reflect posts, including reflections and lessons. Supports filtering by authors, tags, Quran references, groups, pages, and post types. Response items include engagement metadata such as `likesCount`, `commentsCount`, and `recentComment` when available. Use the dedicated comment endpoints to retrieve comment objects and totals. For ayah-by-ayah reads, use `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`, and use `filter[postTypeIds]=1` for reflections or `filter[postTypeIds]=2` for lessons.","parameters":[{"name":"tab","required":false,"in":"query","description":"Feed tab type. `feed` shows personalized content, `trending` shows explore, and `following` shows posts from followed users.","schema":{"type":"string","enum":["newest","latest","following","draft","favorite","most_popular","only_room_members","public","feed","trending","popular"]}},{"name":"languages","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of language IDs to filter posts by reflection language, for example `languages=1,2`.","schema":{"type":"array","items":{"type":"number"},"example":[1,2]}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1).","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20).","schema":{"minimum":1,"default":20,"type":"number"}},{"name":"filter[verifiedOnly]","required":false,"in":"query","description":"Whether to limit the feed to verified contributors. Public ayah-by-ayah reads typically combine this with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.","schema":{"type":"boolean","default":false,"example":true}},{"name":"filter[referencesOperator]","required":false,"in":"query","description":"Operator applied to multiple Quran reference filters.","schema":{"type":"string","enum":["OR","AND"]}},{"name":"filter[tagsOperator]","required":false,"in":"query","description":"Operator applied to multiple tag filters.","schema":{"type":"string","enum":["OR","AND"]}},{"name":"filter[postTypeIds]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated Quran Reflect post type IDs. Use `1` for reflections and `2` for lessons.","schema":{"type":"array","items":{"type":"number"},"example":[1,2]}},{"name":"filter[pages]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of page subdomains to include.","schema":{"type":"array","items":{"type":"string"},"example":["quran-reflections","khutbahapp"]}},{"name":"filter[groups]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of group URLs to include.","schema":{"type":"array","items":{"type":"string"},"example":["my-group","ramadan-circle"]}},{"name":"filter[references][0][to]","required":false,"in":"query","description":"Ending ayah number for reference filter index `0`. For a single ayah, use the same value as `from`.","schema":{"type":"number","minimum":1,"example":255}},{"name":"filter[references][0][from]","required":false,"in":"query","description":"Starting ayah number for reference filter index `0`. Pair with the matching `chapterId` and `to` values.","schema":{"type":"number","minimum":1,"example":255}},{"name":"filter[references][0][chapterId]","required":false,"in":"query","description":"Reference filter example for index `0`. Use additional indices such as `filter[references][1][chapterId]` for more references.","schema":{"type":"number","minimum":1,"example":2}},{"name":"filter[tags]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of tag values to include.","schema":{"type":"array","items":{"type":"string"},"example":["ramadan","patience"]}},{"name":"filter[authors]","required":false,"in":"query","style":"form","explode":false,"description":"Comma-separated list of author identifiers to include.","schema":{"type":"array","items":{"type":"string"},"example":["user-1","user-2"]}}],"responses":{"200":{"description":"Feed retrieved successfully with paginated posts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/{postId}/related":{"get":{"operationId":"PostsController_getRelatedPosts","summary":"Get related posts","description":"Retrieve posts related to a given post by matching its Quran references with OR logic. Results are filtered by language preferences and ordered by popularity, excluding the source post.","parameters":[{"name":"postId","required":true,"in":"path","description":"Source post ID used for related-post matching","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 8, max: 8)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Related posts retrieved successfully with pagination metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}},"404":{"description":"Source post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/my-posts":{"get":{"operationId":"PostsController_getLoggedinUserPosts","summary":"Get current user posts","description":"Retrieve posts created by the currently authenticated user. Supports filtering by tab (MY_REFLECTIONS, SAVED, DRAFTS), sorting options, and post type filtering.","parameters":[{"name":"tab","required":false,"in":"query","description":"Profile tab filter (default: my_reflections)","schema":{"enum":["my_reflections","saved","notes","mentions"],"type":"string"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order for posts (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20, max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"postTypeIds","required":false,"in":"query","description":"Array of post type IDs to filter by","schema":{"type":"array","items":{"type":"number"}}}],"responses":{"200":{"description":"User posts retrieved successfully with pagination metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/{id}/liked":{"get":{"operationId":"PostsController_getLikedState","summary":"Get post liked state","description":"Returns whether the authenticated user currently likes the post. This lightweight endpoint avoids loading the full post payload for simple like-state checks.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to check liked state for","schema":{"type":"number"}}],"responses":{"200":{"description":"Like state retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true when the post is liked by the current user"}}},"example":{"liked":true}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/{id}":{"get":{"operationId":"PostsController_findOne","summary":"Get post by ID","description":"Retrieve a specific post by its unique numeric ID. Returns the full post with author details, tags, references, room information, and engagement metrics. Admins can view additional moderation details.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Post found and returned with all associated data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostSerialized"},"example":{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}}}},"404":{"description":"Post not found or has been deleted"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]},"delete":{"operationId":"PostsController_delete","summary":"Delete post","description":"Soft-delete a post by marking it as removed. Only the post author or admins can delete posts. Related engagement counts (likes, comments, saves) update asynchronously via background jobs, so metrics may briefly lag.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to delete","schema":{"type":"number"}}],"responses":{"200":{"description":"Post deletion accepted and queued for processing","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}},"example":{"success":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to delete this post"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]},"patch":{"operationId":"PostsController_edit","summary":"Edit post","description":"Update an existing post. Only the post author or admins can edit. Supports updating body, references, mentions, draft status, and room visibility settings.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to update","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Partial post data to update - only include fields to change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePostDto"},"example":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":1,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":1,"postAsAuthorId":"string","publishedAt":"2026-04-02T00:00:00.000Z"}}}},"responses":{"200":{"description":"Post updated successfully with the updated post data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCreatedResponse"},"example":{"data":{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"},"success":true}}}},"401":{"description":"User not authenticated"},"403":{"description":"User not authorized to edit this post"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/viewed/{id}":{"get":{"operationId":"PostsController_viewTracking","summary":"Track post view","description":"Record that a post has been viewed by the current user (if authenticated). Used for analytics and engagement tracking. Does not require authentication but will track user-specific views when logged in.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"View tracked successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}},"example":{"success":true}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts":{"post":{"operationId":"PostsController_create","summary":"Create post","description":"Create a new post (reflection) with Quran references. Posts can be public, drafts, or associated with a room (group/page). Supports user mentions and multiple Quran verse references. Minimum body length is 6 characters.","parameters":[],"requestBody":{"required":true,"description":"Post creation payload containing the post object with body, references, mentions, and visibility settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePostBodyDto"},"example":{"post":{"roomPostStatus":0,"body":"string","draft":true,"references":[{"chapterId":1,"from":0,"to":0}],"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}],"roomId":1,"postAsAuthorId":"string","publishedAt":"2026-04-02T00:00:00.000Z"}}}}},"responses":{"201":{"description":"Post created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCreatedResponse"},"example":{"data":{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"},"success":true}}}},"400":{"description":"Invalid post data - body too short, invalid references, or invalid room post status"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/{id}/report":{"post":{"operationId":"PostsController_reportAbuse","summary":"Report post abuse","description":"Report a post for moderation review. Provide a reason for the report to help moderators evaluate the content. Multiple reports on the same post may trigger automatic review.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to report","schema":{"type":"number"}}],"requestBody":{"required":true,"description":"Report details including reason for flagging the content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportAbuseBodyDto"},"example":{"report":{"abuse":"string","comments":""}}}}},"responses":{"200":{"description":"Report submitted successfully for moderation review","content":{"application/json":{"schema":{"type":"object","properties":{"reported":{"type":"boolean","example":true}}},"example":{"reported":true}}}},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/user-posts/{id}":{"get":{"operationId":"PostsController_getUserPost","summary":"Get user posts","description":"Retrieve public posts created by a specific user. If viewing own posts while authenticated, returns all posts including drafts. Supports sorting and filtering by post type.","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the user whose posts to retrieve","schema":{"type":"string"}},{"name":"sortBy","required":false,"in":"query","description":"Sort order for posts (default: latest)","schema":{"enum":["latest","popular"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of posts per page (default: 20, max: 20)","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number for pagination (default: 1)","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"postTypeIds","required":false,"in":"query","description":"Array of post type IDs to filter by","schema":{"type":"array","items":{"type":"number"}}}],"responses":{"200":{"description":"User posts retrieved with pagination metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/{id}/toggle-like":{"post":{"operationId":"PostsController_toggleLike","summary":"Toggle post like","description":"Toggle like status for a post. If already liked, removes the like. If not liked, adds a like. Updates the post like count and triggers notifications.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to like/unlike","schema":{"type":"number"}}],"responses":{"200":{"description":"Like status toggled - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true if now liked, false if now unliked"}}},"example":{"liked":true}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/{id}/toggle-save":{"post":{"operationId":"PostsController_toggleSave","summary":"Toggle post save","description":"Toggle save/bookmark status for a post. Saved posts appear in the SAVED tab of the user profile for easy access later.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID to save/unsave","schema":{"type":"number"}}],"responses":{"200":{"description":"Save status toggled - returns new state","content":{"application/json":{"schema":{"type":"object","properties":{"saved":{"type":"boolean","description":"true if now saved, false if now unsaved"}}},"example":{"saved":true}}}},"401":{"description":"User not authenticated"},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/{id}/comments":{"get":{"operationId":"PostsController_getComments","summary":"Get post comments","description":"Retrieve paginated top-level comments for a post. Use the replies endpoint to get nested replies for specific comments.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"Comments retrieved with pagination metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCommentsResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"comments":[{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]}]}}}},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/{id}/all-comments":{"get":{"operationId":"PostsController_getAllComment","summary":"Get all post comments","description":"Retrieve all comments for a post in a single request without pagination. Useful for displaying full comment threads or export scenarios.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric post ID","schema":{"type":"number"}}],"responses":{"200":{"description":"All comments returned with total count","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostAllCommentsResponse"},"example":{"comments":[{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]}],"total":"10 // works also with swagger setup"}}}},"404":{"description":"Post not found"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/export/pdf":{"post":{"operationId":"PostsController_exportMultiplePosts","summary":"Export posts as PDF","description":"Generate a downloadable PDF document containing selected posts with their full content, Quran references, and author information. Ayah translations are rendered according to user language preferences.","parameters":[],"requestBody":{"required":true,"description":"Array of post IDs to include in the PDF export (minimum 1)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportPostsDto"},"example":{"ids":[1,2,3]}}}},"responses":{"200":{"description":"PDF file generated and returned as binary attachment","content":{"application/pdf":{"schema":{"type":"string","format":"binary"},"example":"string"}}},"400":{"description":"Invalid request - empty or invalid post IDs array"},"401":{"description":"User not authenticated"},"404":{"description":"No accessible posts found for the given IDs"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/count-within-range":{"get":{"operationId":"PostsController_getMyPostsCountWithinRange","summary":"Get posts count within range","description":"Count how many posts the current user has written for verses within a specified Quran verse range. Useful for reading goals and progress tracking.","parameters":[{"name":"from","required":true,"in":"query","description":"Start verse key in format chapter:verse (e.g., \"2:1\")","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:1","type":"string"}},{"name":"to","required":true,"in":"query","description":"End verse key in format chapter:verse (e.g., \"2:286\")","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:286","type":"string"}}],"responses":{"200":{"description":"Count of posts within the specified verse range","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number","example":5}}},"example":{"count":5}}}},"400":{"description":"Invalid verse range - malformed keys or from > to"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/posts/by-verse/{verseKey}":{"get":{"operationId":"PostsController_getMyPostsByVerse","summary":"Get posts by verse","description":"Retrieve all posts written by the current user for a specific Quran verse. This endpoint requires a user-bound token and returns only the authenticated user's own posts. It is not part of the public `client_credentials`-compatible read subset; for public ayah-by-ayah reads, use `GET /v1/posts/feed` with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.","parameters":[{"name":"verseKey","required":true,"in":"path","description":"Verse key in format chapter:verse","schema":{"pattern":"VERSE_KEY_REGEX","example":"2:255","type":"string"}}],"responses":{"200":{"description":"User posts for the specified verse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedResponseDto"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"data":[{"tags":[{"language":"string","id":1,"name":"string"}],"references":[{"id":"string","from":1,"to":1,"chapterId":1}],"author":{},"recentComment":{"id":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"body":"string","createdAt":"2026-04-02T00:00:00.000Z"},"room":{"isAdmin":{},"isOwner":{},"isPublic":{},"id":1,"subdomain":"string","roomType":"string","verified":false,"name":"string","_group":"string"},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"isLiked":true,"isByFollowedUser":true,"isCommentedOn":true,"isSaved":true,"id":1,"authorId":"string","body":"string","discussionId":1,"draft":false,"createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","publishedAt":"2026-04-02T00:00:00.000Z","global":true,"toxicityScore":1,"reported":false,"views":1,"removed":false,"verified":false,"roomPostStatus":0,"hidden":false,"commentsCount":0,"likesCount":0,"viewsCount":0,"languageId":1,"languageName":"string","moderationStatus":1,"reviewedAt":"2026-04-02T00:00:00.000Z","featuredAt":"2026-04-02T00:00:00.000Z","estimatedReadingTime":0,"roomId":1,"postTypeId":1,"postTypeName":"string"}]}}}},"400":{"description":"Invalid verse key format"},"401":{"description":"User not authenticated"}},"tags":["Posts"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/tags":{"get":{"operationId":"TagsController_find","summary":"Search and retrieve tags","description":"Search for tags by query string. Returns paginated results matching the search term. Useful for tag autocomplete and discovery features.","parameters":[{"name":"query","required":false,"in":"query","description":"Search term","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"type":"number"}}],"responses":{"200":{"description":"Tags matching search query with pagination","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"example":[{"id":1,"name":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","rank":0,"languageId":1,"languageName":"string","postsCount":1,"commentsCount":1}]}}}},"tags":["Tags"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/comments":{"post":{"operationId":"CommentsController_create","summary":"Create a new comment","description":"Add a comment to a post or reply to an existing comment. Supports mentions and notifies the post author.","parameters":[],"requestBody":{"required":true,"description":"Comment with postId and optional parentId","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCommentBody"},"example":{"comment":{"body":"This is a thoughtful comment about the post","postId":123,"isPrivate":false,"parentId":456,"mentions":[{"marker":"{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}","userId":"string","displayName":"string"}]}}}}},"responses":{"201":{"description":"Comment created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCommentResponse"},"example":{"comment":{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]},"success":true}}}},"400":{"description":"Invalid comment - empty body or invalid postId"},"401":{"description":"User not authenticated"},"404":{"description":"Post or parent comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/comments/{id}/delete":{"get":{"operationId":"CommentsController_deleteComment","summary":"Delete a comment","description":"Soft-delete a comment and its direct replies. Only the comment owner, post owner, or admins can delete.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric comment ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Comment deleted","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean","example":true}}},"example":{"removed":true}}}},"400":{"description":"User not authorized to delete this comment"},"401":{"description":"User not authenticated"},"404":{"description":"The comment has already been deleted"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/comments/{id}/toggle-like":{"post":{"operationId":"CommentsController_toggleLike","summary":"Toggle like/unlike a comment","description":"Toggle like status. If liked, removes like. Notifies comment author on new likes.","parameters":[{"name":"id","required":true,"in":"path","description":"Unique numeric comment ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Like toggled","content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","description":"true if liked, false if unliked"}}},"example":{"liked":true}}}},"401":{"description":"User not authenticated"},"404":{"description":"Comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}},"/v1/comments/{id}/replies":{"get":{"operationId":"CommentsController_get","summary":"Get replies to a comment","description":"Retrieve paginated replies (nested comments) for a parent comment with author info.","parameters":[{"name":"id","required":true,"in":"path","description":"Parent comment ID","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return","schema":{"minimum":1,"maximum":20,"default":20,"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"minimum":1,"default":1,"type":"number"}}],"responses":{"200":{"description":"Comment replies with pagination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentRepliesResponse"},"example":{"total":10,"currentPage":1,"limit":10,"pages":1,"replies":[{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]}],"comment":{"id":1,"postId":1,"authorId":"string","parentId":1,"isPrivate":false,"body":"string","createdAt":"2026-04-02T00:00:00.000Z","updatedAt":"2026-04-02T00:00:00.000Z","toxicityScore":1,"repliesCount":0,"likesCount":0,"reported":false,"removed":false,"hidden":false,"languageId":1,"languageName":"string","moderationStatus":1,"author":{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1},"mentions":[{"postsCount":1,"avatarUrls":{"small":"string","medium":"string","large":"string"},"id":"string","username":"string","verified":false,"firstName":"string","lastName":"string","memberType":1,"locations":{},"followersCount":1,"displayName":"string"}],"tags":[{"language":"string","id":1,"name":"string","commentsCount":1}]}}}}},"404":{"description":"Parent comment not found"}},"tags":["Comments"],"servers":[{"url":"https://apis-prelive.quran.foundation/quran-reflect","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/quran-reflect","description":"Production Server"}]}}}} \ No newline at end of file +{ + "openapi": "3.0.0", + "info": { + "title": "User-related APIs", + "version": "1.0.0", + "description": "Quran.Foundation user-related APIs enable your app to seamlessly integrate with Quran.Foundation's user-centric features, providing access to personalized notes, bookmarks, goals, streaks, reading sessions, and more. This differentiates them from [content APIs](/docs/category/content-apis) that focus on non-user-specific resources like translations, tafsirs, and verses.\n\n ## How to get access \n\n We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). \n\n For web applications, the recommended integration pattern is backend token exchange plus backend or server-side proxy calls to User APIs. Your app can keep the user session in secure server storage or `httpOnly` cookies, while your backend injects `x-auth-token` and `x-client-id` on outbound requests to Quran.Foundation APIs.\n\n ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items before the item with id `xyz` \n\n The only possible combinations are `first + after` or `last + before`. They should not be used together" + }, + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/auth", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/auth", + "description": "Production Server" + } + ], + "components": { + "securitySchemes": { + "x-auth-token": { + "type": "apiKey", + "in": "header", + "name": "x-auth-token", + "description": "The JWT access token required for accessing the endpoints." + }, + "x-client-id": { + "type": "apiKey", + "in": "header", + "name": "x-client-id", + "description": "Your client id" + } + }, + "schemas": { + "NullableBookmark": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "cmoa3wqim00057z3fe30y0b3e" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "example": "2023-01-21T07:28:13.023Z" + }, + "type": { + "type": "string", + "example": "ayah" + }, + "key": { + "type": "integer", + "example": 1 + }, + "verseNumber": { + "type": "integer", + "nullable": true, + "example": 5 + }, + "group": { + "type": "string", + "example": "verses_6236" + }, + "isInDefaultCollection": { + "type": "boolean", + "example": true + }, + "isReading": { + "type": "boolean", + "nullable": true, + "example": false + }, + "collectionsCount": { + "type": "integer", + "description": "Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.", + "example": 1 + } + }, + "required": [ + "id", + "createdAt", + "type", + "key", + "group", + "isInDefaultCollection", + "isReading" + ], + "additionalProperties": false, + "nullable": true + }, + "RawBookmark": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "cmoa3wqiu00067z3fh6oieeiq" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "example": "2023-01-21T07:28:13.023Z" + }, + "bookmarkType": { + "oneOf": [ + { + "type": "string", + "example": "ayah" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "example": "ayah" + } + }, + "required": [ + "type" + ] + } + ] + }, + "key": { + "type": "integer", + "example": 1 + }, + "verseNumber": { + "type": "integer", + "nullable": true, + "example": 5 + }, + "bookmarkGroup": { + "oneOf": [ + { + "type": "string", + "example": "verses_6236" + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "verses_6236" + } + }, + "required": [ + "name" + ] + } + ] + }, + "isInDefaultCollection": { + "type": "boolean", + "example": true + }, + "isReading": { + "type": "boolean", + "nullable": true, + "example": false + } + }, + "required": [ + "id", + "createdAt", + "bookmarkType", + "key", + "bookmarkGroup", + "isInDefaultCollection", + "isReading" + ] + }, + "Bookmark": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "cmoa3wqim00057z3fe30y0b3e" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "example": "2023-01-21T07:28:13.023Z" + }, + "type": { + "type": "string", + "example": "ayah" + }, + "key": { + "type": "integer", + "example": 1 + }, + "verseNumber": { + "type": "integer", + "nullable": true, + "example": 5 + }, + "group": { + "type": "string", + "example": "verses_6236" + }, + "isInDefaultCollection": { + "type": "boolean", + "example": true + }, + "isReading": { + "type": "boolean", + "nullable": true, + "example": false + }, + "collectionsCount": { + "type": "integer", + "description": "Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.", + "example": 1 + } + }, + "required": [ + "id", + "createdAt", + "type", + "key", + "group", + "isInDefaultCollection", + "isReading" + ], + "additionalProperties": false + }, + "BookmarkWithCollectionsCount": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "cmoa3wqim00057z3fe30y0b3e" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "example": "2023-01-21T07:28:13.023Z" + }, + "type": { + "type": "string", + "example": "ayah" + }, + "key": { + "type": "integer", + "example": 1 + }, + "verseNumber": { + "type": "integer", + "nullable": true, + "example": 5 + }, + "group": { + "type": "string", + "example": "verses_6236" + }, + "isInDefaultCollection": { + "type": "boolean", + "example": true + }, + "isReading": { + "type": "boolean", + "nullable": true, + "example": false + }, + "collectionsCount": { + "type": "integer", + "description": "Total user-visible collection memberships for this bookmark, including Favorites when `isInDefaultCollection=true`.", + "example": 1 + } + }, + "required": [ + "id", + "createdAt", + "type", + "key", + "group", + "isInDefaultCollection", + "isReading", + "collectionsCount" + ], + "additionalProperties": false + }, + "Collection": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "cmoa3wqsk00087z3f5hp42h08" + }, + "name": { + "type": "string", + "example": "Woman in Quran" + }, + "slug": { + "type": "string", + "nullable": true, + "example": "woman-in-quran" + }, + "isPrivate": { + "type": "boolean", + "example": false + }, + "isDefault": { + "type": "boolean", + "example": false + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "nullable": true, + "example": "2023-01-21T07:28:13.023Z" + }, + "url": { + "type": "string", + "nullable": true, + "example": "cmnkcpmvc000814v9f5jtbsxf" + }, + "bookmarksCount": { + "type": "integer", + "example": 1 + }, + "resourcesCount": { + "type": "integer", + "example": 1 + }, + "count": { + "type": "integer", + "example": 1 + } + }, + "required": [ + "id", + "name", + "slug", + "isPrivate", + "isDefault", + "updatedAt" + ], + "additionalProperties": false + }, + "EstimatedGoalTimelineDay": { + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date-time", + "description": "The date of the estimated day", + "example": "2023-01-21T07:28:13.023Z" + }, + "amount": { + "oneOf": [ + { + "type": "string", + "example": "1:5-1:10" + }, + { + "type": "integer", + "minimum": 1, + "example": 600 + } + ], + "description": "The amount of the day's goal." + } + }, + "required": [ + "date", + "amount" + ], + "additionalProperties": false + }, + "EstimatedGoalTimeline": { + "type": "object", + "properties": { + "week": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EstimatedGoalTimelineDay" + } + } + }, + "additionalProperties": false + }, + "Preference": { + "type": "object", + "properties": { + "theme": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "auto", + "light", + "sepia", + "dark" + ], + "example": "auto" + } + }, + "additionalProperties": false + }, + "reading": { + "type": "object", + "properties": { + "readingPreference": { + "type": "string", + "enum": [ + "translation", + "reading", + "readingTranslation" + ], + "example": "translation" + }, + "selectedWordByWordLocale": { + "type": "string", + "enum": [ + "en", + "ur", + "id", + "bn", + "tr", + "fa", + "ru", + "hi", + "de", + "ta", + "inh", + "fr", + "sq", + "dv", + "zh", + "sd", + "ml" + ], + "example": "en" + }, + "wordClickFunctionality": { + "type": "string", + "enum": [ + "play-audio", + "no-audio" + ], + "example": "play-audio" + }, + "isReadingByRevelationOrder": { + "type": "boolean", + "example": true + }, + "wordByWordContentType": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "translation", + "transliteration" + ] + }, + "example": [ + "translation" + ] + }, + "wordByWordDisplay": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "tooltip", + "inline" + ] + }, + "example": [ + "tooltip" + ] + }, + "wordByWordTooltipContentType": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "translation", + "transliteration" + ] + }, + "example": [ + "translation" + ] + }, + "wordByWordInlineContentType": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "translation", + "transliteration" + ] + }, + "example": [] + }, + "selectedReadingTranslation": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "example": "131" + }, + "selectedReflectionLanguages": { + "type": "array", + "items": { + "type": "string", + "maxLength": 10 + }, + "minItems": 1 + }, + "selectedLessonLanguages": { + "type": "array", + "items": { + "type": "string", + "maxLength": 10 + }, + "minItems": 1 + } + }, + "required": [ + "readingPreference", + "selectedWordByWordLocale", + "wordClickFunctionality", + "selectedReadingTranslation" + ], + "additionalProperties": false + }, + "quranReaderStyles": { + "type": "object", + "properties": { + "tafsirFontScale": { + "type": "integer", + "minimum": 1, + "maximum": 10, + "example": 3 + }, + "quranTextFontScale": { + "type": "integer", + "minimum": 1, + "maximum": 10, + "example": 3 + }, + "translationFontScale": { + "type": "integer", + "minimum": 1, + "maximum": 10, + "example": 3 + }, + "wordByWordFontScale": { + "type": "integer", + "minimum": 1, + "maximum": 6, + "example": 3 + }, + "reflectionFontScale": { + "type": "integer", + "minimum": 1, + "maximum": 10, + "example": 3 + }, + "qnaFontScale": { + "type": "integer", + "minimum": 1, + "maximum": 10, + "example": 3 + }, + "lessonFontScale": { + "type": "integer", + "minimum": 1, + "maximum": 10, + "example": 3 + }, + "surahInfoFontScale": { + "type": "integer", + "minimum": 1, + "maximum": 10, + "example": 3 + }, + "hadithFontScale": { + "type": "integer", + "minimum": 1, + "maximum": 10, + "example": 3 + }, + "layersFontScale": { + "type": "integer", + "minimum": 1, + "maximum": 10, + "example": 3 + }, + "quranFont": { + "type": "string", + "enum": [ + "code_v1", + "code_v2", + "text_uthmani", + "text_indopak", + "qpc_uthmani_hafs", + "tajweed", + "tajweed_v4" + ], + "example": "code_v1" + }, + "mushafLines": { + "type": "string", + "enum": [ + "15_lines", + "16_lines" + ], + "example": "16_lines" + }, + "showTajweedRules": { + "type": "boolean", + "example": true + } + }, + "required": [ + "tafsirFontScale", + "quranTextFontScale", + "translationFontScale", + "wordByWordFontScale", + "reflectionFontScale", + "qnaFontScale", + "lessonFontScale", + "surahInfoFontScale", + "hadithFontScale", + "layersFontScale" + ], + "additionalProperties": false + }, + "translations": { + "type": "object", + "properties": { + "selectedTranslations": { + "type": "array", + "items": { + "type": "integer", + "example": 131 + } + } + }, + "additionalProperties": false + }, + "tafsirs": { + "type": "object", + "properties": { + "selectedTafsirs": { + "type": "array", + "items": { + "type": "string", + "example": "en-tafisr-ibn-kathir" + } + } + }, + "additionalProperties": false + }, + "audio": { + "type": "object", + "properties": { + "reciter": { + "type": "integer", + "example": 7 + }, + "playbackRate": { + "type": "integer", + "enum": [ + 0.25, + 0.5, + 0.75, + 1, + 1.25, + 1.5, + 1.75, + 2 + ], + "example": 1 + }, + "showTooltipWhenPlayingAudio": { + "type": "boolean", + "example": true + }, + "enableAutoScrolling": { + "type": "boolean", + "example": true + } + }, + "required": [ + "reciter" + ], + "additionalProperties": false + }, + "language": { + "type": "object", + "properties": { + "language": { + "type": "string", + "enum": [ + "en", + "ar", + "bn", + "fa", + "fr", + "id", + "it", + "nl", + "pt", + "ru", + "sq", + "th", + "tr", + "ur", + "zh", + "ms", + "es", + "sw", + "vi" + ] + } + }, + "additionalProperties": false + }, + "userHasCustomised": { + "type": "object", + "properties": { + "userHasCustomised": { + "type": "boolean", + "example": false + } + }, + "required": [ + "userHasCustomised" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "ReadingSession": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "cmoa3wrpk000h7z3f2t6a57dg" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "example": "2023-01-21T07:28:13.023Z" + }, + "chapterNumber": { + "type": "integer", + "example": 1 + }, + "verseNumber": { + "type": "integer", + "example": 5 + } + }, + "required": [ + "id", + "updatedAt" + ], + "additionalProperties": false + }, + "UserProfile": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "example": "2022-12-06T06:16:20.229Z" + }, + "email": { + "type": "string", + "example": "muhajir@quran.com" + }, + "firstName": { + "type": "string", + "example": "Muhammad" + }, + "lastName": { + "type": "string", + "example": "Muhajir" + }, + "photoUrl": { + "type": "string", + "example": "https://photos.quran.com/img/muhajir.jpg" + } + }, + "additionalProperties": false + }, + "EditProfileDto": { + "type": "object", + "properties": { + "languageId": { + "type": "number" + }, + "reflectionLanguages": { + "type": "array", + "items": { + "type": "string" + } + }, + "ayahLanguages": { + "type": "array", + "items": { + "type": "string" + } + }, + "customized": { + "type": "boolean" + }, + "hideFollowSuggestion": { + "type": "boolean", + "description": "Hide follow suggestion popup after liking a post" + }, + "showFollowFeaturedSuggestion": { + "type": "boolean", + "description": "Show featured follow suggestion popup on QR onboarding" + } + } + }, + "UserSerializedDto": { + "type": "object", + "properties": { + "avatarUrls": { + "type": "object", + "example": { + "small": "https://avatars.githubusercontent.com/u/12345678", + "medium": "https://avatars.githubusercontent.com/u/12345678", + "large": "https://avatars.githubusercontent.com/u/12345678" + } + }, + "createdAt": { + "type": "object", + "example": "2000-01-21 00:00:00" + }, + "joiningYear": { + "type": "number", + "example": 2025 + }, + "isPasswordSet": { + "type": "boolean", + "example": true + }, + "settings": { + "type": "object", + "properties": { + "ayahLanguages": { + "required": false, + "type": "array", + "items": { + "type": "number" + } + }, + "reflectionLanguages": { + "required": false, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "username": { + "type": "string" + }, + "id": { + "type": "string" + }, + "verified": { + "type": "boolean", + "default": false + }, + "postAs": { + "type": "boolean", + "default": false + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "postsCount": { + "type": "number", + "default": 0 + }, + "averageToxicity": { + "type": "number", + "default": 0 + }, + "languageId": { + "type": "number" + }, + "banned": { + "type": "boolean", + "default": false + }, + "memberType": { + "type": "number" + }, + "followersCount": { + "type": "number", + "default": 0 + }, + "likesCount": { + "type": "number", + "default": 0 + }, + "isAdmin": { + "type": "boolean", + "default": false + }, + "languageIsoCode": { + "type": "string", + "default": "en" + }, + "bio": { + "type": "string" + }, + "country": { + "type": "string" + }, + "followed": { + "type": "boolean" + } + }, + "required": [ + "avatarUrls", + "createdAt", + "joiningYear", + "settings", + "id" + ] + }, + "UpdateProfileDto": { + "type": "object", + "properties": { + "avatar": { + "type": "string", + "pattern": "/^data:image\\/[a-z]+;base64,/" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "bio": { + "type": "string", + "nullable": true + }, + "country": { + "type": "string", + "nullable": true + }, + "removeAvatar": { + "type": "boolean" + } + } + }, + "UpdateProfileBodyDto": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/UpdateProfileDto" + } + }, + "required": [ + "user" + ] + }, + "UserRoomDto": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "group": { + "type": "string" + }, + "public": { + "type": "boolean" + }, + "roomType": { + "type": "string" + }, + "verified": { + "type": "boolean" + }, + "subdomain": { + "type": "string" + }, + "description": { + "type": "string" + }, + "membersCount": { + "type": "number" + }, + "avatarUrl": { + "type": "object", + "properties": { + "small": { + "required": true, + "type": "string" + }, + "medium": { + "required": true, + "type": "string" + }, + "large": { + "required": true, + "type": "string" + } + } + } + }, + "required": [ + "id", + "name", + "group", + "public", + "roomType", + "verified", + "subdomain", + "description", + "membersCount", + "avatarUrl" + ] + }, + "UserRoomsResponse": { + "type": "object", + "properties": { + "total": { + "type": "number", + "example": 10 + }, + "currentPage": { + "type": "number", + "example": 1 + }, + "limit": { + "type": "number", + "example": 10 + }, + "pages": { + "type": "number", + "example": 1 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserRoomDto" + } + } + }, + "required": [ + "total", + "currentPage", + "limit", + "pages", + "data" + ] + }, + "UserSearchDto": { + "type": "object", + "properties": { + "avatarUrls": { + "type": "object", + "example": { + "small": "https://avatars.githubusercontent.com/u/12345678", + "medium": "https://avatars.githubusercontent.com/u/12345678", + "large": "https://avatars.githubusercontent.com/u/12345678" + } + }, + "createdAt": { + "type": "object", + "example": "2000-01-21 00:00:00" + }, + "joiningYear": { + "type": "number", + "example": 2025 + }, + "isPasswordSet": { + "type": "boolean", + "example": true + }, + "isFollowed": { + "type": "boolean", + "example": false + }, + "followed": { + "type": "boolean", + "example": false + }, + "settings": { + "type": "object", + "properties": { + "ayahLanguages": { + "required": false, + "type": "array", + "items": { + "type": "number" + } + }, + "reflectionLanguages": { + "required": false, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "username": { + "type": "string" + }, + "id": { + "type": "string" + }, + "verified": { + "type": "boolean", + "default": false + }, + "postAs": { + "type": "boolean", + "default": false + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "postsCount": { + "type": "number", + "default": 0 + }, + "averageToxicity": { + "type": "number", + "default": 0 + }, + "languageId": { + "type": "number" + }, + "banned": { + "type": "boolean", + "default": false + }, + "memberType": { + "type": "number" + }, + "followersCount": { + "type": "number", + "default": 0 + }, + "likesCount": { + "type": "number", + "default": 0 + }, + "isAdmin": { + "type": "boolean", + "default": false + }, + "languageIsoCode": { + "type": "string", + "default": "en" + }, + "bio": { + "type": "string" + }, + "country": { + "type": "string" + } + }, + "required": [ + "avatarUrls", + "createdAt", + "joiningYear", + "settings", + "id" + ] + }, + "UsersSearchResponse": { + "type": "object", + "properties": { + "total": { + "type": "number", + "example": 10 + }, + "currentPage": { + "type": "number", + "example": 1 + }, + "limit": { + "type": "number", + "example": 10 + }, + "pages": { + "type": "number", + "example": 1 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserSearchDto" + } + } + }, + "required": [ + "total", + "currentPage", + "limit", + "pages", + "data" + ] + }, + "ToggleFollowDto": { + "type": "object", + "properties": { + "action": { + "enum": [ + "follow", + "unfollow" + ], + "type": "string", + "description": "The intended action: follow or unfollow", + "example": "follow" + } + } + }, + "FeaturedUserDto": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "1f8d6f3f-2f57-4c3e-b7b5-5f6a9d7f7a55" + }, + "username": { + "type": "string", + "example": "example.user" + }, + "verified": { + "type": "boolean", + "example": true + }, + "firstName": { + "type": "string", + "example": "Example" + }, + "lastName": { + "type": "string", + "example": "User" + }, + "fullName": { + "type": "string", + "example": "Example User" + }, + "avatarUrls": { + "type": "object", + "example": { + "small": "https://avatars.githubusercontent.com/u/12345678", + "medium": "https://avatars.githubusercontent.com/u/12345678", + "large": "https://avatars.githubusercontent.com/u/12345678" + } + }, + "followersCount": { + "type": "number", + "example": 1200 + }, + "bio": { + "type": "string", + "example": "I write reflections on the Quran." + } + }, + "required": [ + "id", + "username", + "verified", + "firstName", + "lastName", + "fullName", + "avatarUrls", + "followersCount" + ] + }, + "FeaturedUsersResponseDto": { + "type": "object", + "properties": { + "total": { + "type": "number", + "example": 10 + }, + "currentPage": { + "type": "number", + "example": 1 + }, + "limit": { + "type": "number", + "example": 10 + }, + "pages": { + "type": "number", + "example": 1 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FeaturedUserDto" + } + } + }, + "required": [ + "total", + "currentPage", + "limit", + "pages", + "data" + ] + }, + "FailedFeaturedFollowItemDto": { + "type": "object", + "properties": { + "followeeId": { + "type": "string", + "example": "user-id-123" + }, + "reason": { + "type": "string", + "example": "FOLLOW_FAILED" + } + }, + "required": [ + "followeeId", + "reason" + ] + }, + "FollowFeaturedUsersResponseDto": { + "type": "object", + "properties": { + "requested": { + "type": "number", + "example": 9 + }, + "followed": { + "type": "number", + "example": 7 + }, + "skipped": { + "type": "number", + "example": 1 + }, + "failed": { + "type": "number", + "example": 1 + }, + "complete": { + "type": "boolean", + "example": true + }, + "failedItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FailedFeaturedFollowItemDto" + } + } + }, + "required": [ + "requested", + "followed", + "skipped", + "failed", + "complete" + ] + }, + "RoomAdminUpdateDto": { + "type": "object", + "properties": { + "roomId": { + "type": "number" + }, + "userId": { + "type": "string" + }, + "admin": { + "type": "boolean" + } + }, + "required": [ + "roomId", + "userId", + "admin" + ] + }, + "UpdateGroupDto": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "description": { + "type": "string", + "maxLength": 200 + }, + "url": { + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "removeAvatar": { + "type": "boolean" + }, + "avatar": { + "type": "string", + "pattern": "/^data:image\\/[a-z]+;base64,/" + }, + "country": { + "type": "string", + "nullable": true + }, + "public": { + "type": "boolean", + "nullable": true, + "default": null + } + }, + "required": [ + "id" + ] + }, + "UpdatePageDto": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "removeAvatar": { + "type": "boolean" + }, + "avatar": { + "type": "string", + "pattern": "/^data:image\\/[a-z]+;base64,/" + }, + "public": { + "type": "boolean", + "nullable": true, + "default": null + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "organizationWebsite": { + "type": "string" + }, + "country": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "MemberSerializedDto": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "user-1" + }, + "username": { + "type": "string", + "example": "member.username" + }, + "firstName": { + "type": "string", + "example": "Member" + }, + "lastName": { + "type": "string", + "example": "User" + }, + "verified": { + "type": "boolean", + "example": true + }, + "avatarUrls": { + "type": "object", + "example": { + "small": "https://avatars.quran.foundation/users/user-1/small.png", + "medium": "https://avatars.quran.foundation/users/user-1/medium.png", + "large": "https://avatars.quran.foundation/users/user-1/large.png" + } + }, + "isAdmin": { + "type": "boolean", + "example": false + }, + "isOwner": { + "type": "boolean", + "example": false + }, + "isFollowed": { + "type": "boolean", + "example": true + }, + "isActive": { + "type": "boolean", + "example": true + }, + "followersCount": { + "type": "number", + "example": 42 + } + }, + "required": [ + "id", + "username", + "firstName", + "lastName", + "verified", + "avatarUrls", + "isAdmin", + "isOwner", + "isFollowed", + "isActive", + "followersCount" + ] + }, + "RoomMembersResponseDto": { + "type": "object", + "properties": { + "total": { + "type": "number", + "example": 10 + }, + "currentPage": { + "type": "number", + "example": 1 + }, + "limit": { + "type": "number", + "example": 10 + }, + "pages": { + "type": "number", + "example": 1 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MemberSerializedDto" + } + } + }, + "required": [ + "total", + "currentPage", + "limit", + "pages", + "data" + ] + }, + "InviteUserDto": { + "type": "object", + "properties": { + "userIds": { + "type": "array", + "items": { + "type": "string" + } + }, + "emails": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "userIds", + "emails" + ] + }, + "RoomInviteUserResponseDto": { + "type": "object", + "properties": { + "invited": { + "type": "boolean", + "example": true + }, + "inviteStatus": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string" + } + ] + }, + "example": { + "user-123": true, + "user-456": "already_a_member" + } + } + }, + "required": [ + "invited", + "inviteStatus" + ] + }, + "RoomInviteAcceptedResponseDto": { + "type": "object", + "properties": { + "accepted": { + "type": "boolean", + "example": true + } + }, + "required": [ + "accepted" + ] + }, + "RoomInviteRejectedResponseDto": { + "type": "object", + "properties": { + "rejected": { + "type": "boolean", + "example": true + } + }, + "required": [ + "rejected" + ] + }, + "CreatePageDto": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "jobTitle": { + "type": "string" + }, + "contactNumber": { + "type": "string" + }, + "organizationName": { + "type": "string" + }, + "organizationWebsite": { + "type": "string" + }, + "purpose": { + "type": "string" + }, + "additionalDetails": { + "type": "string" + }, + "country": { + "type": "string" + }, + "url": { + "type": "string" + }, + "public": { + "type": "boolean" + } + }, + "required": [ + "name", + "jobTitle", + "contactNumber", + "organizationName", + "purpose", + "url" + ] + }, + "CreateGroupDto": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "description": { + "type": "string", + "maxLength": 200 + }, + "url": { + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "public": { + "type": "boolean" + } + }, + "required": [ + "name", + "url" + ] + }, + "RoomListItemDto": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "roomType": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "isVerified": { + "type": "boolean" + }, + "isPublic": { + "type": "boolean" + }, + "isOwner": { + "type": "boolean" + }, + "isAdmin": { + "type": "boolean" + }, + "ownerId": { + "type": "string" + }, + "postsCount": { + "type": "number" + }, + "membersCount": { + "type": "number" + }, + "url": { + "type": "string" + }, + "avatarUrls": { + "type": "object", + "properties": { + "thumb": { + "required": true, + "type": "string" + }, + "original": { + "required": true, + "type": "string" + } + } + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "isMember": { + "type": "boolean" + }, + "subdomain": { + "type": "string" + }, + "country": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "description", + "roomType", + "isActive", + "isVerified", + "isPublic", + "isOwner", + "isAdmin", + "ownerId", + "postsCount", + "membersCount", + "avatarUrls" + ] + }, + "RoomCreatedResponseDto": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "$ref": "#/components/schemas/RoomListItemDto" + } + }, + "required": [ + "success", + "data" + ] + }, + "PaginatedRoomsResponseDto": { + "type": "object", + "properties": { + "total": { + "type": "number", + "example": 10 + }, + "currentPage": { + "type": "number", + "example": 1 + }, + "limit": { + "type": "number", + "example": 10 + }, + "pages": { + "type": "number", + "example": 1 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RoomListItemDto" + } + } + }, + "required": [ + "total", + "currentPage", + "limit", + "pages", + "data" + ] + }, + "RoomProfileResponseDto": { + "type": "object", + "properties": { + "privateToken": { + "type": "string", + "example": "private-room-token" + }, + "mutualFollowers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserSerializedDto" + } + }, + "mutualFollowersCount": { + "type": "number", + "example": 2 + }, + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "roomType": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "isVerified": { + "type": "boolean" + }, + "isPublic": { + "type": "boolean" + }, + "isOwner": { + "type": "boolean" + }, + "isAdmin": { + "type": "boolean" + }, + "ownerId": { + "type": "string" + }, + "postsCount": { + "type": "number" + }, + "membersCount": { + "type": "number" + }, + "url": { + "type": "string" + }, + "avatarUrls": { + "type": "object", + "properties": { + "thumb": { + "required": true, + "type": "string" + }, + "original": { + "required": true, + "type": "string" + } + } + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "isMember": { + "type": "boolean" + }, + "subdomain": { + "type": "string" + }, + "country": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "description", + "roomType", + "isActive", + "isVerified", + "isPublic", + "isOwner", + "isAdmin", + "ownerId", + "postsCount", + "membersCount", + "avatarUrls" + ] + }, + "RoomAcceptByPrivateTokenResponseDto": { + "type": "object", + "properties": { + "roomId": { + "type": "number", + "example": 42 + }, + "success": { + "type": "boolean", + "example": true + }, + "isNewMember": { + "type": "boolean", + "example": true + } + }, + "required": [ + "roomId", + "success", + "isNewMember" + ] + }, + "PostTag": { + "type": "object", + "properties": { + "language": { + "type": "string" + }, + "id": { + "type": "number" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "PostReference": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "from": { + "type": "number" + }, + "to": { + "type": "number" + }, + "chapterId": { + "type": "number" + } + }, + "required": [ + "id" + ] + }, + "UserAuthor": { + "type": "object", + "properties": { + "postsCount": { + "type": "number" + }, + "avatarUrls": { + "type": "object", + "properties": { + "small": { + "required": true, + "type": "string" + }, + "medium": { + "required": true, + "type": "string" + }, + "large": { + "required": true, + "type": "string" + } + } + }, + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "verified": { + "type": "boolean", + "default": false + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "memberType": { + "type": "number" + } + }, + "required": [ + "avatarUrls", + "id" + ] + }, + "PostRecentComment": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "author": { + "$ref": "#/components/schemas/UserAuthor" + }, + "body": { + "type": "string" + }, + "createdAt": { + "format": "date-time", + "type": "string" + } + }, + "required": [ + "id", + "author", + "body", + "createdAt" + ] + }, + "PostRoom": { + "type": "object", + "properties": { + "isAdmin": { + "type": "object" + }, + "isOwner": { + "type": "object" + }, + "isPublic": { + "type": "object" + }, + "id": { + "type": "number" + }, + "subdomain": { + "type": "string" + }, + "roomType": { + "type": "string" + }, + "verified": { + "type": "boolean", + "default": false + }, + "name": { + "type": "string" + }, + "_group": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "UserWithMentionLocations": { + "type": "object", + "properties": { + "postsCount": { + "type": "number" + }, + "avatarUrls": { + "type": "object", + "properties": { + "small": { + "required": true, + "type": "string" + }, + "medium": { + "required": true, + "type": "string" + }, + "large": { + "required": true, + "type": "string" + } + } + }, + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "verified": { + "type": "boolean", + "default": false + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "memberType": { + "type": "number" + }, + "locations": { + "type": "object" + }, + "followersCount": { + "type": "number" + }, + "displayName": { + "type": "string" + } + }, + "required": [ + "avatarUrls", + "id", + "locations", + "followersCount" + ] + }, + "PostSerialized": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PostTag" + } + }, + "references": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PostReference" + } + }, + "author": { + "type": "object" + }, + "recentComment": { + "$ref": "#/components/schemas/PostRecentComment" + }, + "room": { + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/PostRoom" + } + ] + }, + "mentions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserWithMentionLocations" + } + }, + "isLiked": { + "type": "boolean" + }, + "isByFollowedUser": { + "type": "boolean" + }, + "isCommentedOn": { + "type": "boolean" + }, + "isSaved": { + "type": "boolean" + }, + "id": { + "type": "number" + }, + "authorId": { + "type": "string" + }, + "body": { + "type": "string" + }, + "discussionId": { + "type": "number" + }, + "draft": { + "type": "boolean", + "default": false + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "format": "date-time", + "type": "string" + }, + "publishedAt": { + "format": "date-time", + "type": "string" + }, + "global": { + "type": "boolean" + }, + "toxicityScore": { + "type": "number" + }, + "reported": { + "type": "boolean", + "default": false + }, + "views": { + "type": "number" + }, + "removed": { + "type": "boolean", + "default": false + }, + "verified": { + "type": "boolean", + "default": false + }, + "roomPostStatus": { + "description": "@description 0: OnlyMembers, 1: Publicly, 2: AsRoom", + "default": 0, + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "hidden": { + "type": "boolean", + "default": false + }, + "commentsCount": { + "type": "number", + "default": 0 + }, + "likesCount": { + "type": "number", + "default": 0 + }, + "viewsCount": { + "type": "number", + "default": 0 + }, + "languageId": { + "type": "number" + }, + "languageName": { + "type": "string" + }, + "moderationStatus": { + "description": "featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 30 + ], + "type": "number" + }, + "reviewedAt": { + "format": "date-time", + "type": "string" + }, + "featuredAt": { + "format": "date-time", + "type": "string" + }, + "estimatedReadingTime": { + "type": "number", + "default": 0 + }, + "roomId": { + "type": "number" + }, + "postTypeId": { + "type": "number" + }, + "postTypeName": { + "type": "string" + } + }, + "required": [ + "id", + "authorId", + "createdAt", + "updatedAt", + "commentsCount", + "roomId", + "postTypeId" + ] + }, + "FeedResponseDto": { + "type": "object", + "properties": { + "total": { + "type": "number", + "example": 10 + }, + "currentPage": { + "type": "number", + "example": 1 + }, + "limit": { + "type": "number", + "example": 10 + }, + "pages": { + "type": "number", + "example": 1 + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PostSerialized" + } + } + }, + "required": [ + "total", + "currentPage", + "limit", + "pages", + "data" + ] + }, + "RoomPostUpdatePrivacyDto": { + "type": "object", + "properties": { + "isPublic": { + "type": "boolean" + } + }, + "required": [ + "isPublic" + ] + }, + "ReferenceAttributes": { + "type": "object", + "properties": { + "chapterId": { + "type": "number", + "minimum": 1 + }, + "from": { + "type": "number", + "default": 0 + }, + "to": { + "type": "number", + "default": 0 + } + }, + "required": [ + "chapterId", + "from", + "to" + ] + }, + "UserMentionAttributes": { + "type": "object", + "properties": { + "marker": { + "type": "string", + "pattern": "/{{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}}/", + "example": "{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}" + }, + "userId": { + "type": "string" + }, + "displayName": { + "type": "string" + } + }, + "required": [ + "marker", + "userId", + "displayName" + ] + }, + "CreatePostDto": { + "type": "object", + "properties": { + "roomPostStatus": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number", + "description": "The room post status, defaults to publicly: 1. As Room: 0, Publicly: 1, Only Members: 2" + }, + "body": { + "type": "string", + "minLength": 6 + }, + "draft": { + "type": "boolean" + }, + "references": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReferenceAttributes" + } + }, + "mentions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserMentionAttributes" + } + }, + "roomId": { + "type": "number" + }, + "postAsAuthorId": { + "type": "string" + }, + "publishedAt": { + "format": "date-time", + "type": "string" + } + }, + "required": [ + "roomPostStatus", + "body", + "draft", + "references", + "mentions", + "roomId", + "postAsAuthorId", + "publishedAt" + ] + }, + "CreatePostBodyDto": { + "type": "object", + "properties": { + "post": { + "$ref": "#/components/schemas/CreatePostDto" + } + }, + "required": [ + "post" + ] + }, + "PostCreatedResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/PostSerialized" + }, + "success": { + "type": "boolean" + } + }, + "required": [ + "data", + "success" + ] + }, + "UpdatePostDto": { + "type": "object", + "properties": { + "roomPostStatus": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number", + "description": "The room post status, defaults to publicly: 1. As Room: 0, Publicly: 1, Only Members: 2" + }, + "body": { + "type": "string", + "minLength": 6 + }, + "draft": { + "type": "boolean" + }, + "references": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReferenceAttributes" + } + }, + "mentions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserMentionAttributes" + } + }, + "roomId": { + "type": "number" + }, + "postAsAuthorId": { + "type": "string" + }, + "publishedAt": { + "format": "date-time", + "type": "string" + } + } + }, + "ReportAbuseDto": { + "type": "object", + "properties": { + "abuse": { + "type": "string" + }, + "comments": { + "type": "string", + "default": "" + } + }, + "required": [ + "abuse", + "comments" + ] + }, + "ReportAbuseBodyDto": { + "type": "object", + "properties": { + "report": { + "$ref": "#/components/schemas/ReportAbuseDto" + } + }, + "required": [ + "report" + ] + }, + "CommentAuthor": { + "type": "object", + "properties": { + "postsCount": { + "type": "number" + }, + "avatarUrls": { + "type": "object", + "properties": { + "small": { + "required": true, + "type": "string" + }, + "medium": { + "required": true, + "type": "string" + }, + "large": { + "required": true, + "type": "string" + } + } + }, + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "verified": { + "type": "boolean", + "default": false + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "memberType": { + "type": "number" + } + }, + "required": [ + "avatarUrls", + "id" + ] + }, + "CommentTag": { + "type": "object", + "properties": { + "language": { + "type": "string" + }, + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "commentsCount": { + "type": "number" + } + }, + "required": [ + "id" + ] + }, + "Comment": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "postId": { + "type": "number" + }, + "authorId": { + "type": "string" + }, + "parentId": { + "type": "number" + }, + "isPrivate": { + "type": "boolean", + "default": false + }, + "body": { + "type": "string" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "format": "date-time", + "type": "string" + }, + "toxicityScore": { + "type": "number" + }, + "repliesCount": { + "type": "number", + "default": 0 + }, + "likesCount": { + "type": "number", + "default": 0 + }, + "reported": { + "type": "boolean", + "default": false + }, + "removed": { + "type": "boolean", + "default": false + }, + "hidden": { + "type": "boolean", + "default": false + }, + "languageId": { + "type": "number" + }, + "languageName": { + "type": "string" + }, + "moderationStatus": { + "type": "number" + }, + "author": { + "$ref": "#/components/schemas/CommentAuthor" + }, + "mentions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserWithMentionLocations" + } + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommentTag" + } + } + }, + "required": [ + "id", + "postId", + "authorId", + "parentId", + "isPrivate", + "body", + "createdAt", + "updatedAt" + ] + }, + "PostCommentsResponse": { + "type": "object", + "properties": { + "total": { + "type": "number", + "example": 10 + }, + "currentPage": { + "type": "number", + "example": 1 + }, + "limit": { + "type": "number", + "example": 10 + }, + "pages": { + "type": "number", + "example": 1 + }, + "comments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Comment" + } + } + }, + "required": [ + "total", + "currentPage", + "limit", + "pages", + "comments" + ] + }, + "PostAllCommentsResponse": { + "type": "object", + "properties": { + "comments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Comment" + } + }, + "total": { + "type": "number", + "example": "10 // works also with swagger setup" + } + }, + "required": [ + "comments", + "total" + ] + }, + "ExportPostsDto": { + "type": "object", + "properties": { + "ids": { + "description": "Array of post IDs to export", + "example": [ + 1, + 2, + 3 + ], + "minItems": 1, + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "ids" + ] + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "format": "date-time", + "type": "string" + }, + "rank": { + "type": "number", + "default": 0 + }, + "languageId": { + "type": "number" + }, + "languageName": { + "type": "string" + }, + "postsCount": { + "type": "number" + }, + "commentsCount": { + "type": "number" + } + }, + "required": [ + "id", + "createdAt", + "updatedAt" + ] + }, + "CreateCommentDto": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "Comment body text", + "example": "This is a thoughtful comment about the post", + "maxLength": 8000 + }, + "postId": { + "type": "number", + "description": "ID of the post this comment belongs to", + "example": 123 + }, + "isPrivate": { + "type": "boolean", + "default": false, + "description": "Whether the comment is private", + "example": false + }, + "parentId": { + "type": "number", + "description": "ID of the parent comment (for replies)", + "example": 456 + }, + "mentions": { + "description": "User mentions in the comment", + "type": "array", + "items": { + "$ref": "#/components/schemas/UserMentionAttributes" + } + } + }, + "required": [ + "body", + "postId", + "isPrivate" + ] + }, + "CreateCommentBody": { + "type": "object", + "properties": { + "comment": { + "description": "Comment details for creation", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCommentDto" + } + ] + } + }, + "required": [ + "comment" + ] + }, + "CreateCommentResponse": { + "type": "object", + "properties": { + "comment": { + "$ref": "#/components/schemas/Comment" + }, + "success": { + "type": "boolean" + } + }, + "required": [ + "comment", + "success" + ] + }, + "CommentRepliesResponse": { + "type": "object", + "properties": { + "total": { + "type": "number", + "example": 10 + }, + "currentPage": { + "type": "number", + "example": 1 + }, + "limit": { + "type": "number", + "example": 10 + }, + "pages": { + "type": "number", + "example": 1 + }, + "replies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Comment" + } + }, + "comment": { + "$ref": "#/components/schemas/Comment" + } + }, + "required": [ + "total", + "currentPage", + "limit", + "pages", + "replies", + "comment" + ] + } + }, + "responses": {} + }, + "security": [ + { + "x-auth-token": [], + "x-client-id": [] + } + ], + "paths": { + "/v1/collections": { + "post": { + "description": "Create a new collection under user's account.", + "tags": [ + "Collections" + ], + "summary": "Add collection", + "parameters": [ + { + "in": "query", + "name": "lastMutationAt", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control." + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the new collection to be created.", + "example": "Woman in Quran" + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "example": { + "name": "Woman in Quran" + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "$ref": "#/components/schemas/Collection" + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "id": "cmoa3wqsk00087z3f5hp42h08", + "name": "Woman in Quran", + "slug": "woman-in-quran", + "isPrivate": false, + "isDefault": false, + "updatedAt": "2023-01-21T07:28:13.023Z", + "url": "cmnkcpmvc000814v9f5jtbsxf", + "bookmarksCount": 1, + "resourcesCount": 1, + "count": 1 + } + } + } + }, + "headers": { + "X-Mutation-At": { + "description": "Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.", + "schema": { + "type": "string", + "example": "1731636500303" + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "409": { + "description": "Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "OutOfSyncError" + }, + "message": { + "type": "string", + "example": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + } + } + }, + "examples": { + "Out of sync": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + }, + "First sync - wrong lastMutationAt": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "First sync detected. Please use lastMutationAt=-1 for initial sync." + } + } + } + } + } + } + } + }, + "operationId": "authPostV1Collections" + }, + "get": { + "tags": [ + "Collections" + ], + "description": "List collections owned by the user. This api contains pagination. Read more about [pagination](/docs/user_related_apis_versioned/user-related-apis#pagination)", + "summary": "Get all collections", + "parameters": [ + { + "in": "query", + "name": "sortBy", + "schema": { + "type": "string", + "enum": [ + "recentlyUpdated", + "alphabetical" + ], + "description": "Sort the collections list either by the time they were updated at descendingly or alphabetically.", + "example": "recentlyUpdated" + }, + "description": "Sort the collections list either by the time they were updated at descendingly or alphabetically." + }, + { + "in": "query", + "name": "type", + "schema": { + "type": "string", + "enum": [ + "page", + "juz", + "surah", + "ayah" + ], + "description": "The bookmark type.", + "default": "ayah" + }, + "description": "The bookmark type." + }, + { + "in": "query", + "name": "last", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "description": "The number of items to be fetched. Should be used together with `before`", + "example": 10 + }, + "description": "The number of items to be fetched. Should be used together with `before`" + }, + { + "in": "query", + "name": "first", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of items to be fetched.", + "example": 10 + }, + "description": "The number of items to be fetched." + }, + { + "in": "query", + "name": "after", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`", + "example": "cmoa3wq0z00007z3fh1v9g30d" + }, + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`" + }, + { + "in": "query", + "name": "before", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`", + "example": "cmoa3wq1000017z3f9atfhuvw" + }, + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`" + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Collection" + } + }, + "pagination": { + "type": "object", + "properties": { + "startCursor": { + "type": "string", + "example": "cmoa3wq1000027z3fciij2440" + }, + "endCursor": { + "type": "string", + "example": "cmoa3wq1000037z3fhr8z3edp" + }, + "hasNextPage": { + "type": "boolean", + "example": true + }, + "hasPreviousPage": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": [ + { + "id": "cmoa3wqsk00087z3f5hp42h08", + "name": "Woman in Quran", + "slug": "woman-in-quran", + "isPrivate": false, + "isDefault": false, + "updatedAt": "2023-01-21T07:28:13.023Z", + "url": "cmnkcpmvc000814v9f5jtbsxf", + "bookmarksCount": 1, + "resourcesCount": 1, + "count": 1 + } + ], + "pagination": { + "startCursor": "cmoa3wq1000027z3fciij2440", + "endCursor": "cmoa3wq1000037z3fhr8z3edp", + "hasNextPage": true, + "hasPreviousPage": false + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1Collections" + } + }, + "/v1/collections/{collectionId}/bookmarks": { + "post": { + "description": "Add a bookmark to a collection. Use `collectionId=\"__default__\"` to add an ayah bookmark to the virtual Favorites collection used by Quran.com.", + "tags": [ + "Collections" + ], + "summary": "Add collection Bookmark", + "parameters": [ + { + "in": "path", + "name": "collectionId", + "schema": { + "type": "string", + "description": "The collection ID. Use `__default__` to add an ayah bookmark to the virtual Favorites collection used by Quran.com.", + "example": "cmoa3wqvw00097z3f9tk87gga" + }, + "required": true, + "description": "The collection ID. Use `__default__` to add an ayah bookmark to the virtual Favorites collection used by Quran.com." + }, + { + "in": "query", + "name": "lastMutationAt", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control." + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "key": { + "type": "integer", + "description": "The Surah number.", + "example": 2 + }, + "type": { + "type": "string", + "enum": [ + "ayah" + ], + "description": "The bookmark type.", + "default": "ayah" + }, + "verseNumber": { + "type": "integer", + "example": 3 + }, + "mushafId": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.", + "example": 4 + }, + "mushaf": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.", + "example": 4 + } + }, + "required": [ + "key", + "verseNumber" + ], + "additionalProperties": false, + "title": "Ayah" + }, + { + "type": "object", + "properties": { + "key": { + "type": "integer", + "description": "Surah, Juz or page number." + }, + "type": { + "type": "string", + "enum": [ + "juz", + "page", + "surah" + ], + "description": "The bookmark type.", + "example": "surah" + }, + "mushafId": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.", + "example": 4 + }, + "mushaf": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.", + "example": 4 + } + }, + "required": [ + "key" + ], + "additionalProperties": false, + "title": "Surah, Juz, Or Page" + } + ] + }, + "example": { + "key": 2, + "type": "ayah", + "verseNumber": 3, + "mushafId": 4, + "mushaf": 4 + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "message": { + "enum": [ + "collection bookmark added" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "message": "collection bookmark added" + } + } + } + }, + "headers": { + "X-Mutation-At": { + "description": "Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.", + "schema": { + "type": "string", + "example": "1731636500303" + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "409": { + "description": "Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "OutOfSyncError" + }, + "message": { + "type": "string", + "example": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + } + } + }, + "examples": { + "Out of sync": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + }, + "First sync - wrong lastMutationAt": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "First sync detected. Please use lastMutationAt=-1 for initial sync." + } + } + } + } + } + } + } + }, + "operationId": "authPostV1CollectionsByCollectionIdBookmarks" + }, + "delete": { + "description": "Delete a bookmark from a collection by bookmark details. Use `collectionId=\"__default__\"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan.", + "tags": [ + "Collections" + ], + "summary": "Delete collection bookmark by details", + "parameters": [ + { + "in": "path", + "name": "collectionId", + "schema": { + "type": "string", + "description": "The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection.", + "example": "cmoa3wr2h000f7z3ffr5fc0z1" + }, + "required": true, + "description": "The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection." + }, + { + "in": "query", + "name": "lastMutationAt", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object" + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": {} + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "key": { + "type": "integer", + "description": "Surah number", + "example": 2 + }, + "type": { + "type": "string", + "enum": [ + "ayah" + ], + "description": "The bookmark type.", + "default": "ayah" + }, + "verseNumber": { + "type": "integer", + "example": 3 + }, + "mushafId": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.", + "example": 4 + }, + "mushaf": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.", + "example": 4 + } + }, + "required": [ + "key", + "verseNumber" + ], + "additionalProperties": false, + "title": "Ayah" + }, + { + "type": "object", + "properties": { + "key": { + "type": "integer", + "description": "Surah, Juz or page number." + }, + "type": { + "type": "string", + "enum": [ + "juz", + "page", + "surah" + ], + "description": "The bookmark type.", + "example": "surah" + }, + "mushafId": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.", + "example": 4 + }, + "mushaf": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.", + "example": 4 + } + }, + "required": [ + "key" + ], + "additionalProperties": false, + "title": "Surah, Juz, Or Page" + }, + { + "type": "object", + "properties": { + "bookmarkId": { + "type": "string", + "description": "The Id of the bookmark to be deleted.", + "example": "cmoa3wr2h000e7z3fcxefa6rx" + } + }, + "required": [ + "bookmarkId" + ], + "additionalProperties": false, + "title": "Bookmark ID" + } + ], + "title": "input" + }, + "example": { + "key": 2, + "type": "ayah", + "verseNumber": 3, + "mushafId": 4, + "mushaf": 4 + } + } + } + }, + "operationId": "authDeleteV1CollectionsByCollectionIdBookmarks" + } + }, + "/v1/collections/{collectionId}": { + "delete": { + "description": "Delete a an existing collection.", + "tags": [ + "Collections" + ], + "summary": "Delete collection", + "parameters": [ + { + "in": "path", + "name": "collectionId", + "schema": { + "type": "string", + "description": "The Id of the collection to be deleted.", + "example": "cmoa3wqwh000a7z3f0d6y5mte" + }, + "required": true, + "description": "The Id of the collection to be deleted." + }, + { + "in": "query", + "name": "lastMutationAt", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "message": { + "enum": [ + "collection deleted" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "message": "collection deleted" + } + } + } + }, + "headers": { + "X-Mutation-At": { + "description": "Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.", + "schema": { + "type": "string", + "example": "1731636500303" + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "409": { + "description": "Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "OutOfSyncError" + }, + "message": { + "type": "string", + "example": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + } + } + }, + "examples": { + "Out of sync": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + }, + "First sync - wrong lastMutationAt": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "First sync detected. Please use lastMutationAt=-1 for initial sync." + } + } + } + } + } + } + } + }, + "operationId": "authDeleteV1CollectionsByCollectionId" + }, + "get": { + "description": "Get all resources that belong to an existing collection by collection id. Use `__default__` to fetch the virtual Favorites collection.", + "tags": [ + "Collections" + ], + "summary": "Get collection items by id", + "parameters": [ + { + "in": "path", + "name": "collectionId", + "schema": { + "type": "string", + "description": "Collection ID. Use `__default__` for the virtual Favorites collection.", + "example": "cmoa3wr17000d7z3f7ssph68y" + }, + "description": "Collection ID. Use `__default__` for the virtual Favorites collection." + }, + { + "in": "query", + "name": "sortBy", + "schema": { + "type": "string", + "enum": [ + "recentlyAdded", + "verseKey" + ], + "description": "Sort the collection items either by the time they were added at descendingly or by Ayah key." + }, + "description": "Sort the collection items either by the time they were added at descendingly or by Ayah key." + }, + { + "in": "query", + "name": "last", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "description": "The number of items to be fetched. Should be used together with `before`", + "example": 10 + }, + "description": "The number of items to be fetched. Should be used together with `before`" + }, + { + "in": "query", + "name": "first", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of items to be fetched.", + "example": 10 + }, + "description": "The number of items to be fetched." + }, + { + "in": "query", + "name": "after", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`", + "example": "cmoa3wq0z00007z3fh1v9g30d" + }, + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`" + }, + { + "in": "query", + "name": "before", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`", + "example": "cmoa3wq1000017z3f9atfhuvw" + }, + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`" + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "collection": { + "$ref": "#/components/schemas/Collection" + }, + "bookmarks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BookmarkWithCollectionsCount" + } + } + }, + "additionalProperties": false + }, + "pagination": { + "type": "object", + "properties": { + "startCursor": { + "type": "string", + "example": "cmoa3wq1000027z3fciij2440" + }, + "endCursor": { + "type": "string", + "example": "cmoa3wq1000037z3fhr8z3edp" + }, + "hasNextPage": { + "type": "boolean", + "example": true + }, + "hasPreviousPage": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "collection": { + "id": "cmoa3wqsk00087z3f5hp42h08", + "name": "Woman in Quran", + "slug": "woman-in-quran", + "isPrivate": false, + "isDefault": false, + "updatedAt": "2023-01-21T07:28:13.023Z", + "url": "cmnkcpmvc000814v9f5jtbsxf", + "bookmarksCount": 1, + "resourcesCount": 1, + "count": 1 + }, + "bookmarks": [ + { + "id": "cmoa3wqim00057z3fe30y0b3e", + "createdAt": "2023-01-21T07:28:13.023Z", + "type": "ayah", + "key": 1, + "verseNumber": 5, + "group": "verses_6236", + "isInDefaultCollection": true, + "isReading": false, + "collectionsCount": 1 + } + ] + }, + "pagination": { + "startCursor": "cmoa3wq1000027z3fciij2440", + "endCursor": "cmoa3wq1000037z3fhr8z3edp", + "hasNextPage": true, + "hasPreviousPage": false + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1CollectionsByCollectionId" + }, + "post": { + "description": "Update an existing collection.", + "tags": [ + "Collections" + ], + "summary": "Update collection", + "parameters": [ + { + "in": "path", + "name": "collectionId", + "schema": { + "type": "string", + "description": "The Id of the collection to be updated." + }, + "required": true, + "description": "The Id of the collection to be updated." + }, + { + "in": "query", + "name": "lastMutationAt", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control." + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The new name of the collection to be updated." + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "example": { + "name": "string" + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "message": { + "enum": [ + "collection renamed" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "message": "collection renamed" + } + } + } + }, + "headers": { + "X-Mutation-At": { + "description": "Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.", + "schema": { + "type": "string", + "example": "1731636500303" + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "409": { + "description": "Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "OutOfSyncError" + }, + "message": { + "type": "string", + "example": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + } + } + }, + "examples": { + "Out of sync": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + }, + "First sync - wrong lastMutationAt": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "First sync detected. Please use lastMutationAt=-1 for initial sync." + } + } + } + } + } + } + } + }, + "operationId": "authPostV1CollectionsByCollectionId" + } + }, + "/v1/collections/{collectionId}/bookmarks/{bookmarkId}": { + "delete": { + "description": "Delete a bookmark from a collection by bookmark ID. Use `collectionId=\"__default__\"` to remove a bookmark from the virtual Favorites collection. When successfully deleted, the bookmark itself is only detached from the collection unless it becomes an orphan.", + "tags": [ + "Collections" + ], + "summary": "Delete collection bookmark by id", + "parameters": [ + { + "in": "path", + "name": "collectionId", + "schema": { + "type": "string", + "description": "The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection.", + "example": "cmoa3wqxe000b7z3f6d6ia4ih" + }, + "required": true, + "description": "The collection ID. Use `__default__` to remove a bookmark from the virtual Favorites collection." + }, + { + "in": "path", + "name": "bookmarkId", + "schema": { + "type": "string", + "description": "The Id of the bookmark to be deleted.", + "example": "cmoa3wqxe000c7z3f61siesdm" + }, + "required": true, + "description": "The Id of the bookmark to be deleted." + }, + { + "in": "query", + "name": "lastMutationAt", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "message": { + "enum": [ + "collection bookmark deleted" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "message": "collection bookmark deleted" + } + } + } + }, + "headers": { + "X-Mutation-At": { + "description": "Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.", + "schema": { + "type": "string", + "example": "1731636500303" + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "409": { + "description": "Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "OutOfSyncError" + }, + "message": { + "type": "string", + "example": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + } + } + }, + "examples": { + "Out of sync": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + }, + "First sync - wrong lastMutationAt": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "First sync detected. Please use lastMutationAt=-1 for initial sync." + } + } + } + } + } + } + } + }, + "operationId": "authDeleteV1CollectionsByCollectionIdBookmarksByBookmarkId" + } + }, + "/v1/collections/all": { + "get": { + "description": "Get all existing collections along with resources that belong to them.", + "tags": [ + "Collections" + ], + "summary": "Get all collection items", + "parameters": [ + { + "in": "query", + "name": "sortBy", + "schema": { + "type": "string", + "enum": [ + "recentlyAdded", + "verseKey" + ], + "description": "Sort the collection items either by the time they were added at descendingly or alphabetically." + }, + "description": "Sort the collection items either by the time they were added at descendingly or alphabetically." + }, + { + "in": "query", + "name": "type", + "schema": { + "type": "string", + "enum": [ + "page", + "juz", + "surah", + "ayah" + ], + "description": "The bookmark type.", + "default": "ayah" + }, + "description": "The bookmark type." + }, + { + "in": "query", + "name": "last", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "description": "The number of items to be fetched. Should be used together with `before`", + "example": 10 + }, + "description": "The number of items to be fetched. Should be used together with `before`" + }, + { + "in": "query", + "name": "first", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of items to be fetched.", + "example": 10 + }, + "description": "The number of items to be fetched." + }, + { + "in": "query", + "name": "after", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`", + "example": "cmoa3wq0z00007z3fh1v9g30d" + }, + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`" + }, + { + "in": "query", + "name": "before", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`", + "example": "cmoa3wq1000017z3f9atfhuvw" + }, + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`" + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Bookmark" + } + }, + "pagination": { + "type": "object", + "properties": { + "startCursor": { + "type": "string", + "example": "cmoa3wq1000027z3fciij2440" + }, + "endCursor": { + "type": "string", + "example": "cmoa3wq1000037z3fhr8z3edp" + }, + "hasNextPage": { + "type": "boolean", + "example": true + }, + "hasPreviousPage": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": [ + { + "id": "cmoa3wqim00057z3fe30y0b3e", + "createdAt": "2023-01-21T07:28:13.023Z", + "type": "ayah", + "key": 1, + "verseNumber": 5, + "group": "verses_6236", + "isInDefaultCollection": true, + "isReading": false, + "collectionsCount": 1 + } + ], + "pagination": { + "startCursor": "cmoa3wq1000027z3fciij2440", + "endCursor": "cmoa3wq1000037z3fhr8z3edp", + "hasNextPage": true, + "hasPreviousPage": false + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1CollectionsAll" + } + }, + "/v1/bookmarks": { + "post": { + "description": "Add or update a bookmark by details. Omit `isReading` to create or update a regular standalone bookmark. Set `isReading=true` to set the user's singleton reading bookmark. Set `isReading=false` to unset the current reading bookmark; in that case the response `data` can be `null` if no reading bookmark was set. For Quran.com-style saved or favorite ayah bookmarks, use `POST /v1/collections/__default__/bookmarks`.", + "tags": [ + "Bookmarks" + ], + "summary": "Add user bookmark", + "parameters": [ + { + "in": "query", + "name": "lastMutationAt", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control." + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "key": { + "type": "integer", + "description": "The Surah number.", + "example": 2 + }, + "type": { + "type": "string", + "enum": [ + "ayah" + ], + "description": "The bookmark type.", + "default": "ayah" + }, + "verseNumber": { + "type": "integer", + "description": "The Ayah number to be added.", + "example": 3 + }, + "isReading": { + "type": "boolean", + "description": "Reading bookmark flag. Set `true` to set the user's current reading bookmark. Set `false` to unset the current reading bookmark. Omit this field to create or update a regular bookmark." + }, + "mushafId": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.", + "example": 4 + }, + "mushaf": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.", + "example": 4 + } + }, + "required": [ + "key", + "type", + "verseNumber" + ], + "additionalProperties": false, + "title": "Ayah" + }, + { + "type": "object", + "properties": { + "key": { + "type": "integer", + "description": "Surah, Juz or page number." + }, + "type": { + "type": "string", + "enum": [ + "juz", + "page", + "surah" + ], + "description": "The bookmark type.", + "example": "surah" + }, + "isReading": { + "type": "boolean", + "description": "Reading bookmark flag. Set `true` to set the user's current reading bookmark. Set `false` to unset the current reading bookmark. Omit this field to create or update a regular bookmark." + }, + "mushafId": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.", + "example": 4 + }, + "mushaf": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.", + "example": 4 + } + }, + "required": [ + "key", + "type" + ], + "additionalProperties": false, + "title": "Surah, Juz, Or page" + } + ] + }, + "example": { + "key": 2, + "type": "ayah", + "verseNumber": 3, + "isReading": true, + "mushafId": 4, + "mushaf": 4 + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "$ref": "#/components/schemas/NullableBookmark" + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "id": "cmoa3wqim00057z3fe30y0b3e", + "createdAt": "2023-01-21T07:28:13.023Z", + "type": "ayah", + "key": 1, + "verseNumber": 5, + "group": "verses_6236", + "isInDefaultCollection": true, + "isReading": false, + "collectionsCount": 1 + } + } + } + }, + "headers": { + "X-Mutation-At": { + "description": "Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.", + "schema": { + "type": "string", + "example": "1731636500303" + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "409": { + "description": "Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "OutOfSyncError" + }, + "message": { + "type": "string", + "example": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + } + } + }, + "examples": { + "Out of sync": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + }, + "First sync - wrong lastMutationAt": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "First sync detected. Please use lastMutationAt=-1 for initial sync." + } + } + } + } + } + } + } + }, + "operationId": "authPostV1Bookmarks" + }, + "get": { + "description": "Get all bookmarks. This includes bookmarks belonging to a collection.", + "tags": [ + "Bookmarks" + ], + "summary": "Get user bookmarks", + "parameters": [ + { + "in": "query", + "name": "type", + "schema": { + "type": "string", + "enum": [ + "page", + "juz", + "surah", + "ayah" + ], + "description": "The bookmark type.", + "default": "ayah" + }, + "required": false, + "description": "The bookmark type." + }, + { + "in": "query", + "name": "isReading", + "schema": { + "type": "boolean", + "description": "Whether to fetch only the reading bookmark" + }, + "required": false, + "description": "Whether to fetch only the reading bookmark" + }, + { + "in": "query", + "name": "key", + "schema": { + "type": "integer", + "description": "Filter by key (surah/juz/page number)" + }, + "required": false, + "description": "Filter by key (surah/juz/page number)" + }, + { + "in": "query", + "name": "mushafId", + "schema": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4", + "example": 4 + }, + "required": true, + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4" + }, + { + "in": "query", + "name": "last", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "description": "The number of items to be fetched. Should be used together with `before`", + "example": 10 + }, + "required": false, + "description": "The number of items to be fetched. Should be used together with `before`" + }, + { + "in": "query", + "name": "first", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of items to be fetched.", + "example": 10 + }, + "required": false, + "description": "The number of items to be fetched." + }, + { + "in": "query", + "name": "after", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`", + "example": "cmoa3wq0z00007z3fh1v9g30d" + }, + "required": false, + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`" + }, + { + "in": "query", + "name": "before", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`", + "example": "cmoa3wq1000017z3f9atfhuvw" + }, + "required": false, + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`" + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BookmarkWithCollectionsCount" + } + }, + "pagination": { + "type": "object", + "properties": { + "startCursor": { + "type": "string", + "example": "cmoa3wq1000027z3fciij2440" + }, + "endCursor": { + "type": "string", + "example": "cmoa3wq1000037z3fhr8z3edp" + }, + "hasNextPage": { + "type": "boolean", + "example": true + }, + "hasPreviousPage": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": [ + { + "id": "cmoa3wqim00057z3fe30y0b3e", + "createdAt": "2023-01-21T07:28:13.023Z", + "type": "ayah", + "key": 1, + "verseNumber": 5, + "group": "verses_6236", + "isInDefaultCollection": true, + "isReading": false, + "collectionsCount": 1 + } + ], + "pagination": { + "startCursor": "cmoa3wq1000027z3fciij2440", + "endCursor": "cmoa3wq1000037z3fhr8z3edp", + "hasNextPage": true, + "hasPreviousPage": false + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1Bookmarks" + } + }, + "/v1/bookmarks/{bookmarkId}": { + "delete": { + "description": "Delete a standalone bookmark by id. This endpoint fully removes orphan bookmarks only. If the bookmark belongs to the virtual Favorites collection or any custom collection, it is not removed; this endpoint only sets `isReading` to `false` and leaves the bookmark attached to those collections. To remove it from Favorites or a custom collection, use the corresponding collection delete endpoint instead.", + "tags": [ + "Bookmarks" + ], + "summary": "Delete Bookmark", + "parameters": [ + { + "in": "path", + "name": "bookmarkId", + "schema": { + "type": "string", + "description": "The id of the bookmark to be deleted.", + "example": "cmoa3wqk500077z3f018r4rzn" + }, + "required": true, + "description": "The id of the bookmark to be deleted." + }, + { + "in": "query", + "name": "lastMutationAt", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "message": { + "enum": [ + "bookmark deleted" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "message": "bookmark deleted" + } + } + } + }, + "headers": { + "X-Mutation-At": { + "description": "Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.", + "schema": { + "type": "string", + "example": "1731636500303" + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "409": { + "description": "Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "OutOfSyncError" + }, + "message": { + "type": "string", + "example": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + } + } + }, + "examples": { + "Out of sync": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + }, + "First sync - wrong lastMutationAt": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "First sync detected. Please use lastMutationAt=-1 for initial sync." + } + } + } + } + } + } + } + }, + "operationId": "authDeleteV1BookmarksByBookmarkId" + } + }, + "/v1/bookmarks/ayahs-range": { + "get": { + "description": "Get all bookmarks within a specific Ayahs range.", + "tags": [ + "Bookmarks" + ], + "summary": "Get bookmarks within a range of Ayahs", + "parameters": [ + { + "in": "query", + "name": "chapterNumber", + "schema": { + "type": "integer", + "description": "The number of the Surah that the Ayahs range belong to." + }, + "required": true, + "description": "The number of the Surah that the Ayahs range belong to." + }, + { + "in": "query", + "name": "rangeStartAyahNumber", + "schema": { + "type": "integer", + "description": "The Ayah number at which the range starts." + }, + "required": true, + "description": "The Ayah number at which the range starts." + }, + { + "in": "query", + "name": "rangeEndAyahNumber", + "schema": { + "type": "integer", + "description": "The Ayah number at which the range ends." + }, + "required": true, + "description": "The Ayah number at which the range ends." + }, + { + "in": "query", + "name": "mushafId", + "schema": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4", + "example": 4 + }, + "required": true, + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4" + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RawBookmark" + } + }, + "pagination": { + "type": "object", + "properties": { + "startCursor": { + "type": "string", + "example": "cmoa3wq1000027z3fciij2440" + }, + "endCursor": { + "type": "string", + "example": "cmoa3wq1000037z3fhr8z3edp" + }, + "hasNextPage": { + "type": "boolean", + "example": true + }, + "hasPreviousPage": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": [ + { + "id": "cmoa3wqiu00067z3fh6oieeiq", + "createdAt": "2023-01-21T07:28:13.023Z", + "bookmarkType": "ayah", + "key": 1, + "verseNumber": 5, + "bookmarkGroup": "verses_6236", + "isInDefaultCollection": true, + "isReading": false + } + ], + "pagination": { + "startCursor": "cmoa3wq1000027z3fciij2440", + "endCursor": "cmoa3wq1000037z3fhr8z3edp", + "hasNextPage": true, + "hasPreviousPage": false + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1BookmarksAyahsRange" + } + }, + "/v1/bookmarks/bookmark": { + "get": { + "description": "Get a bookmark by details", + "tags": [ + "Bookmarks" + ], + "summary": "Get bookmark", + "parameters": [ + { + "in": "query", + "name": "verseNumber", + "schema": { + "type": "integer", + "description": "The Ayah number of the bookmark" + }, + "description": "The Ayah number of the bookmark" + }, + { + "in": "query", + "name": "isReading", + "schema": { + "type": "boolean", + "description": "Whether to fetch the reading bookmark" + }, + "description": "Whether to fetch the reading bookmark" + }, + { + "in": "query", + "name": "key", + "schema": { + "type": "integer", + "oneOf": [ + {}, + { + "x-required": true + } + ], + "description": "Surah, Juz or page number.", + "example": 2 + }, + "description": "Surah, Juz or page number." + }, + { + "in": "query", + "name": "type", + "schema": { + "type": "string", + "enum": [ + "page", + "juz", + "surah", + "ayah" + ], + "oneOf": [ + {}, + { + "x-required": true + } + ], + "description": "The bookmark type.", + "default": "ayah" + }, + "description": "The bookmark type." + }, + { + "in": "query", + "name": "mushafId", + "schema": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name.", + "example": 4 + }, + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Preferred field name." + }, + { + "in": "query", + "name": "mushaf", + "schema": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`.", + "example": 4 + }, + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4 Legacy alias for `mushafId`." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "$ref": "#/components/schemas/Bookmark" + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "id": "cmoa3wqim00057z3fe30y0b3e", + "createdAt": "2023-01-21T07:28:13.023Z", + "type": "ayah", + "key": 1, + "verseNumber": 5, + "group": "verses_6236", + "isInDefaultCollection": true, + "isReading": false, + "collectionsCount": 1 + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1BookmarksBookmark" + } + }, + "/v1/bookmarks/collections": { + "get": { + "description": "Get named collection IDs for a bookmark by bookmark details. Pass `includeDefault=true` to also append `__default__` when the bookmark belongs to Favorites.", + "tags": [ + "Bookmarks" + ], + "summary": "Get bookmark collections", + "parameters": [ + { + "in": "query", + "name": "key", + "schema": { + "type": "number", + "format": "float", + "description": "Surah, Juz or page number." + }, + "required": true, + "description": "Surah, Juz or page number." + }, + { + "in": "query", + "name": "type", + "schema": { + "type": "string", + "enum": [ + "page", + "juz", + "surah", + "ayah" + ], + "description": "The bookmark type.", + "default": "ayah" + }, + "required": false, + "description": "The bookmark type." + }, + { + "in": "query", + "name": "includeDefault", + "schema": { + "type": "boolean", + "description": "When `true`, append `__default__` if the bookmark belongs to the virtual Favorites collection." + }, + "required": false, + "description": "When `true`, append `__default__` if the bookmark belongs to the virtual Favorites collection." + }, + { + "in": "query", + "name": "mushafId", + "schema": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4", + "example": 4 + }, + "required": true, + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4" + }, + { + "in": "query", + "name": "last", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "description": "The number of items to be fetched. Should be used together with `before`", + "example": 10 + }, + "required": false, + "description": "The number of items to be fetched. Should be used together with `before`" + }, + { + "in": "query", + "name": "first", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of items to be fetched.", + "example": 10 + }, + "required": false, + "description": "The number of items to be fetched." + }, + { + "in": "query", + "name": "after", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`", + "example": "cmoa3wq0z00007z3fh1v9g30d" + }, + "required": false, + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`" + }, + { + "in": "query", + "name": "before", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`", + "example": "cmoa3wq1000017z3f9atfhuvw" + }, + "required": false, + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`" + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "array", + "items": { + "type": "string", + "description": "Collection ID. When `includeDefault=true`, this array may also include `__default__`.", + "example": "cmnkcpmvc000814v9f5jtbsxf" + } + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": [ + "cmnkcpmvc000814v9f5jtbsxf" + ] + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1BookmarksCollections" + } + }, + "/v1/preferences": { + "post": { + "description": "Add or update one user preferences group like favorite Tafsirs or translations.", + "tags": [ + "Preferences" + ], + "summary": "Add or update preference", + "parameters": [ + { + "in": "query", + "name": "mushafId", + "schema": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4", + "example": 4 + }, + "required": true, + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "group": { + "type": "string", + "enum": [ + "tafsirs", + "translations", + "audio", + "theme", + "quranReaderStyles", + "reading", + "language", + "userHasCustomised" + ], + "description": "The preference group to be added or updated.", + "example": "tafsirs" + }, + "key": { + "type": "string", + "description": "The preference key to be added or updated.", + "example": "selectedTafsirs" + }, + "value": { + "description": "The preference value to be added or updated.", + "example": "[\"en-tafisr-ibn-kathir\"]" + } + }, + "required": [ + "group", + "key", + "value" + ], + "additionalProperties": false, + "oneOf": [ + { + "type": "object", + "properties": { + "key": { + "type": "string", + "enum": [ + "type" + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "key": { + "type": "string", + "enum": [ + "readingPreference", + "selectedWordByWordLocale", + "wordClickFunctionality", + "isReadingByRevelationOrder", + "wordByWordContentType", + "wordByWordDisplay", + "wordByWordTooltipContentType", + "wordByWordInlineContentType", + "selectedReadingTranslation", + "selectedReflectionLanguages", + "selectedLessonLanguages" + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "key": { + "type": "string", + "enum": [ + "tafsirFontScale", + "quranTextFontScale", + "translationFontScale", + "wordByWordFontScale", + "reflectionFontScale", + "qnaFontScale", + "lessonFontScale", + "surahInfoFontScale", + "hadithFontScale", + "layersFontScale", + "quranFont", + "mushafLines", + "showTajweedRules" + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "key": { + "type": "string", + "enum": [ + "selectedTranslations" + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "key": { + "type": "string", + "enum": [ + "selectedTafsirs" + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "key": { + "type": "string", + "enum": [ + "reciter", + "playbackRate", + "showTooltipWhenPlayingAudio", + "enableAutoScrolling", + "repeatSettings" + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "key": { + "type": "string", + "enum": [ + "language" + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "string", + "enum": [ + "en", + "ar", + "bn", + "fa", + "fr", + "id", + "it", + "nl", + "pt", + "ru", + "sq", + "th", + "tr", + "ur", + "zh", + "ms", + "es", + "sw", + "vi" + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "string", + "enum": [ + "auto", + "light", + "sepia", + "dark" + ], + "example": "auto" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "string", + "enum": [ + "translation", + "reading", + "readingTranslation" + ], + "example": "translation" + } + }, + "required": [ + "value" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "string", + "enum": [ + "en", + "ur", + "id", + "bn", + "tr", + "fa", + "ru", + "hi", + "de", + "ta", + "inh", + "fr", + "sq", + "dv", + "zh", + "sd", + "ml" + ], + "example": "en" + } + }, + "required": [ + "value" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "string", + "enum": [ + "play-audio", + "no-audio" + ], + "example": "play-audio" + } + }, + "required": [ + "value" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "boolean", + "example": true + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "translation", + "transliteration" + ] + }, + "example": [ + "translation" + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "tooltip", + "inline" + ] + }, + "example": [ + "tooltip" + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "translation", + "transliteration" + ] + }, + "example": [] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "string", + "enum": [ + "code_v1", + "code_v2", + "text_uthmani", + "text_indopak", + "qpc_uthmani_hafs", + "tajweed", + "tajweed_v4" + ], + "example": "code_v1" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "string", + "enum": [ + "15_lines", + "16_lines" + ], + "example": "16_lines" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "integer", + "minimum": 1, + "maximum": 10, + "example": 3 + } + }, + "required": [ + "value" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "integer", + "minimum": 1, + "maximum": 6, + "example": 3 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "integer", + "example": 131 + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string", + "example": "en-tafisr-ibn-kathir" + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "integer", + "enum": [ + 0.25, + 0.5, + 0.75, + 1, + 1.25, + 1.5, + 1.75, + 2 + ], + "example": 1 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "boolean", + "example": false + } + }, + "required": [ + "value" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "key": { + "type": "string", + "enum": [ + "userHasCustomised" + ] + } + }, + "required": [ + "key" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "example": "131" + } + }, + "required": [ + "value" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string", + "maxLength": 10 + }, + "minItems": 1 + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + ] + }, + "example": { + "key": "type" + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "message": { + "enum": [ + "preference updated" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "message": "preference updated" + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authPostV1Preferences" + }, + "get": { + "description": "Get all user preferences like theme, favorite reciter, default language etc.", + "tags": [ + "Preferences" + ], + "summary": "Get user preferences", + "parameters": [], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "$ref": "#/components/schemas/Preference" + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "theme": { + "type": "auto" + }, + "reading": { + "readingPreference": "translation", + "selectedWordByWordLocale": "en", + "wordClickFunctionality": "play-audio", + "isReadingByRevelationOrder": true, + "wordByWordContentType": [ + "translation" + ], + "wordByWordDisplay": [ + "tooltip" + ], + "wordByWordTooltipContentType": [ + "translation" + ], + "wordByWordInlineContentType": [], + "selectedReadingTranslation": "131", + "selectedReflectionLanguages": [ + "string" + ], + "selectedLessonLanguages": [ + "string" + ] + }, + "quranReaderStyles": { + "tafsirFontScale": 3, + "quranTextFontScale": 3, + "translationFontScale": 3, + "wordByWordFontScale": 3, + "reflectionFontScale": 3, + "qnaFontScale": 3, + "lessonFontScale": 3, + "surahInfoFontScale": 3, + "hadithFontScale": 3, + "layersFontScale": 3, + "quranFont": "code_v1", + "mushafLines": "16_lines", + "showTajweedRules": true + }, + "translations": { + "selectedTranslations": [ + 131 + ] + }, + "tafsirs": { + "selectedTafsirs": [ + "en-tafisr-ibn-kathir" + ] + }, + "audio": { + "reciter": 7, + "playbackRate": 1, + "showTooltipWhenPlayingAudio": true, + "enableAutoScrolling": true + }, + "language": { + "language": "en" + }, + "userHasCustomised": { + "userHasCustomised": false + } + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1Preferences" + } + }, + "/v1/preferences/bulk": { + "post": { + "description": "Add or update one or more user preferences groups like favorite Tafsirs and translations.", + "tags": [ + "Preferences" + ], + "summary": "Bulk add or update preferences", + "parameters": [ + { + "in": "query", + "name": "mushafId", + "schema": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4", + "example": 4 + }, + "required": true, + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Preference" + }, + "example": { + "theme": { + "type": "auto" + }, + "reading": { + "readingPreference": "translation", + "selectedWordByWordLocale": "en", + "wordClickFunctionality": "play-audio", + "isReadingByRevelationOrder": true, + "wordByWordContentType": [ + "translation" + ], + "wordByWordDisplay": [ + "tooltip" + ], + "wordByWordTooltipContentType": [ + "translation" + ], + "wordByWordInlineContentType": [], + "selectedReadingTranslation": "131", + "selectedReflectionLanguages": [ + "string" + ], + "selectedLessonLanguages": [ + "string" + ] + }, + "quranReaderStyles": { + "tafsirFontScale": 3, + "quranTextFontScale": 3, + "translationFontScale": 3, + "wordByWordFontScale": 3, + "reflectionFontScale": 3, + "qnaFontScale": 3, + "lessonFontScale": 3, + "surahInfoFontScale": 3, + "hadithFontScale": 3, + "layersFontScale": 3, + "quranFont": "code_v1", + "mushafLines": "16_lines", + "showTajweedRules": true + }, + "translations": { + "selectedTranslations": [ + 131 + ] + }, + "tafsirs": { + "selectedTafsirs": [ + "en-tafisr-ibn-kathir" + ] + }, + "audio": { + "reciter": 7, + "playbackRate": 1, + "showTooltipWhenPlayingAudio": true, + "enableAutoScrolling": true + }, + "language": { + "language": "en" + }, + "userHasCustomised": { + "userHasCustomised": false + } + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "message": { + "enum": [ + "preferences updated" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "message": "preferences updated" + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authPostV1PreferencesBulk" + } + }, + "/v1/reading-sessions": { + "post": { + "description": "Track the user's most recent reading location (Surah/Ayah) for \"Continue reading\" / \"Recently read\" UX.\n\nA new reading session will be created if the user does not have an existing one in the past 20 minutes; otherwise, the existing reading session will be updated with the latest read Ayah.\n\nFor streaks, goals, and calendar-style progress tracking, see [Reading Sessions vs Activity Days](/docs/user-related-apis/reading-sessions-vs-activity-days).", + "tags": [ + "Reading Sessions" + ], + "summary": "Add or update user reading session", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "chapterNumber": { + "type": "integer", + "minimum": 1, + "description": "The Surah number to be added to reading session.", + "example": 1 + }, + "verseNumber": { + "type": "integer", + "minimum": 1, + "description": "The Ayah number to be added to reading session.", + "example": 1 + } + }, + "required": [ + "chapterNumber", + "verseNumber" + ], + "additionalProperties": false + }, + "example": { + "chapterNumber": 1, + "verseNumber": 1 + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "message": { + "type": "string", + "enum": [ + "reading session created", + "reading session updated" + ], + "example": "reading session created" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "message": "reading session created" + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authPostV1ReadingSessions" + }, + "get": { + "description": "Get the user's reading sessions (most recent first). Reading sessions track recent Surah/Ayah locations for \"Continue reading\" / \"Recently read\". For streaks, goals, and calendar-style progress tracking, use Activity Days.", + "tags": [ + "Reading Sessions" + ], + "summary": "Get user reading sessions", + "parameters": [ + { + "in": "query", + "name": "last", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "description": "The number of items to be fetched. Should be used together with `before`", + "example": 10 + }, + "description": "The number of items to be fetched. Should be used together with `before`" + }, + { + "in": "query", + "name": "first", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of items to be fetched.", + "example": 10 + }, + "description": "The number of items to be fetched." + }, + { + "in": "query", + "name": "after", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`", + "example": "cmoa3wq0z00007z3fh1v9g30d" + }, + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`" + }, + { + "in": "query", + "name": "before", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`", + "example": "cmoa3wq1000017z3f9atfhuvw" + }, + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`" + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReadingSession" + } + }, + "pagination": { + "type": "object", + "properties": { + "startCursor": { + "type": "string", + "example": "cmoa3wq1000027z3fciij2440" + }, + "endCursor": { + "type": "string", + "example": "cmoa3wq1000037z3fhr8z3edp" + }, + "hasNextPage": { + "type": "boolean", + "example": true + }, + "hasPreviousPage": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": [ + { + "id": "cmoa3wrpk000h7z3f2t6a57dg", + "updatedAt": "2023-01-21T07:28:13.023Z", + "chapterNumber": 1, + "verseNumber": 5 + } + ], + "pagination": { + "startCursor": "cmoa3wq1000027z3fciij2440", + "endCursor": "cmoa3wq1000037z3fhr8z3edp", + "hasNextPage": true, + "hasPreviousPage": false + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1ReadingSessions" + } + }, + "/v1/goals/get-todays-plan": { + "get": { + "description": "Get today's goal plan.", + "tags": [ + "Goals" + ], + "summary": "Get today's goal plan", + "parameters": [ + { + "in": "query", + "name": "type", + "schema": { + "type": "string", + "enum": [ + "QURAN_TIME", + "QURAN_PAGES", + "QURAN_RANGE", + "COURSE", + "QURAN_READING_PROGRAM", + "RAMADAN_CHALLENGE" + ], + "description": "The type of the goal.", + "example": "QURAN_TIME" + }, + "required": true, + "description": "The type of the goal." + }, + { + "in": "header", + "name": "x-timezone", + "schema": { + "type": "string", + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.", + "example": "Asia/Saigon" + }, + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "hasGoal": { + "type": "boolean", + "description": "User has a goal.", + "example": false + } + }, + "required": [ + "hasGoal" + ], + "additionalProperties": false, + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The id of the activity day.", + "example": "cmoa3wq2b00047z3fbl4c6ew0" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "The date of the activity day.", + "example": "2023-09-31" + }, + "progress": { + "type": "number", + "format": "float", + "minimum": 0, + "maximum": 1, + "description": "The progress of the reading goal of that activity day (if the user has a reading goal on that day).", + "example": 0.695 + }, + "type": { + "type": "string", + "enum": [ + "QURAN", + "LESSON", + "QURAN_READING_PROGRAM" + ], + "description": "The type of the activity day", + "example": "QURAN" + }, + "ranges": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$", + "description": "a comma separated string of Ayah ranges e.g. 1:1-1:2", + "example": "1:1-1:2" + } + } + ], + "description": "The ranges read on that day (will be included only when the type is QURAN)", + "example": [ + "1:1-1:2" + ] + }, + "pagesRead": { + "oneOf": [ + { + "type": "number", + "format": "float" + } + ], + "description": "The number of pages read on that day (will be included only when the type is QURAN)", + "example": 1.637041020126048 + }, + "secondsRead": { + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of seconds spent reading on that day (will be included only when the type is QURAN)", + "example": 417 + }, + "versesRead": { + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of Ayahs read on that day (will be included only when the type is QURAN)", + "example": 24 + }, + "manuallyAddedSeconds": { + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of seconds spent reading that was manually input by the user and not auto-tracked (will be included only when the type is QURAN)", + "example": 24 + }, + "dailyTargetPages": { + "oneOf": [ + { + "type": "number", + "format": "float" + } + ], + "description": "The number of pages user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)", + "example": 1.637041020126048 + }, + "dailyTargetSeconds": { + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of seconds user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)", + "example": 5 + }, + "dailyTargetRanges": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$", + "description": "a comma separated string of Ayah ranges e.g. 1:1-1:2", + "example": "1:1-1:2" + } + } + ], + "description": "The range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)", + "example": [ + "1:1-1:2" + ] + }, + "remainingDailyTargetRanges": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$", + "description": "a comma separated string of Ayah ranges e.g. 1:1-1:2", + "example": "1:1-1:2" + } + } + ], + "description": "The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)", + "example": [ + "1:1-1:2" + ] + }, + "mushafId": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4", + "example": 4 + } + }, + "required": [ + "id", + "date", + "progress", + "type", + "mushafId" + ], + "additionalProperties": false, + "description": "The Mushaf used to read on that day (will be included only when the type is QURAN) \n\nThe id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4", + "title": "When user has a goal" + } + ] + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "id": "cmoa3wq2b00047z3fbl4c6ew0", + "date": "2023-09-31", + "progress": 0.695, + "type": "QURAN", + "ranges": [ + "1:1-1:2" + ], + "pagesRead": 1.637041020126048, + "secondsRead": 417, + "versesRead": 24, + "manuallyAddedSeconds": 24, + "dailyTargetPages": 1.637041020126048, + "dailyTargetSeconds": 5, + "dailyTargetRanges": [ + "1:1-1:2" + ], + "remainingDailyTargetRanges": [ + "1:1-1:2" + ], + "mushafId": 4 + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1GoalsGetTodaysPlan" + } + }, + "/v1/goals/{id}": { + "put": { + "description": "Update a goal", + "tags": [ + "Goals" + ], + "summary": "Update a goal", + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The id of the goal.", + "example": "cmoa3wr5c000g7z3fgv0y0rvo" + }, + "required": true, + "description": "The id of the goal." + }, + { + "in": "query", + "name": "mushafId", + "schema": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4", + "example": 4 + }, + "required": true, + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4" + }, + { + "in": "header", + "name": "x-timezone", + "schema": { + "type": "string", + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.", + "example": "Asia/Saigon" + }, + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks." + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "QURAN_TIME", + "QURAN_PAGES", + "QURAN_RANGE", + "COURSE", + "QURAN_READING_PROGRAM", + "RAMADAN_CHALLENGE" + ], + "description": "The type of the goal.", + "example": "QURAN_TIME" + }, + "amount": { + "oneOf": [ + { + "type": "string", + "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$", + "example": "1:5-1:10", + "x-required": true + }, + { + "type": "integer", + "minimum": 1, + "example": 600, + "x-required": true + } + ], + "description": "The amount of the goal. Depending on the goal type, the amount value and format will be different" + }, + "duration": { + "type": "integer", + "minimum": 1, + "description": "The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based." + }, + "category": { + "type": "string", + "enum": [ + "QURAN", + "COURSE", + "QURAN_READING_PROGRAM", + "RAMADAN_CHALLENGE" + ], + "description": "The category of the goal" + } + }, + "additionalProperties": false + }, + "example": { + "type": "QURAN_TIME", + "amount": "1:5-1:10", + "duration": 1, + "category": "QURAN" + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": {} + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authPutV1GoalsById" + }, + "delete": { + "description": "Delete a goal by id.", + "tags": [ + "Goals" + ], + "summary": "Delete a goal", + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The id of the goal.", + "example": "cmoa3wr5c000g7z3fgv0y0rvo" + }, + "required": true, + "description": "The id of the goal." + }, + { + "in": "query", + "name": "category", + "schema": { + "type": "string", + "enum": [ + "QURAN", + "COURSE", + "QURAN_READING_PROGRAM", + "RAMADAN_CHALLENGE" + ], + "description": "The category of the goal" + }, + "required": true, + "description": "The category of the goal" + }, + { + "in": "header", + "name": "x-timezone", + "schema": { + "type": "string", + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.", + "example": "Asia/Saigon" + }, + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "message": { + "enum": [ + "goal deleted" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "message": "goal deleted" + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authDeleteV1GoalsById" + } + }, + "/v1/goals": { + "post": { + "description": "Create a goal", + "tags": [ + "Goals" + ], + "summary": "Create a goal", + "parameters": [ + { + "in": "query", + "name": "mushafId", + "schema": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4", + "example": 4 + }, + "required": true, + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4" + }, + { + "in": "header", + "name": "x-timezone", + "schema": { + "type": "string", + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.", + "example": "Asia/Saigon" + }, + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks." + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "QURAN_TIME", + "QURAN_PAGES", + "QURAN_RANGE", + "COURSE", + "QURAN_READING_PROGRAM", + "RAMADAN_CHALLENGE" + ], + "description": "The type of the goal.", + "example": "QURAN_TIME" + }, + "amount": { + "oneOf": [ + { + "type": "string", + "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$", + "example": "1:5-1:10", + "x-required": true + }, + { + "type": "integer", + "minimum": 1, + "example": 600, + "x-required": true + } + ], + "description": "The amount of the goal. Depending on the goal type, the amount value and format will be different" + }, + "duration": { + "type": "integer", + "minimum": 1, + "description": "The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based." + }, + "category": { + "type": "string", + "enum": [ + "QURAN", + "COURSE", + "QURAN_READING_PROGRAM", + "RAMADAN_CHALLENGE" + ], + "description": "The category of the goal" + } + }, + "required": [ + "type", + "amount", + "category" + ], + "additionalProperties": false + }, + "example": { + "type": "QURAN_TIME", + "amount": "1:5-1:10", + "duration": 1, + "category": "QURAN" + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The id of the goal.", + "example": "cmoa3wr5c000g7z3fgv0y0rvo" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "id": "cmoa3wr5c000g7z3fgv0y0rvo" + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authPostV1Goals" + } + }, + "/v1/goals/estimate": { + "get": { + "description": "Generate a timeline up to a week of the minimum daily amount required to meet the goal.", + "tags": [ + "Goals" + ], + "summary": "Generate timeline estimation", + "parameters": [ + { + "in": "query", + "name": "type", + "schema": { + "type": "string", + "enum": [ + "QURAN_TIME", + "QURAN_PAGES", + "QURAN_RANGE", + "COURSE", + "QURAN_READING_PROGRAM", + "RAMADAN_CHALLENGE" + ], + "description": "The type of the goal.", + "example": "QURAN_TIME" + }, + "required": true, + "description": "The type of the goal." + }, + { + "in": "query", + "name": "amount", + "schema": { + "oneOf": [ + { + "type": "string", + "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$", + "example": "1:5-1:10", + "x-required": true + }, + { + "type": "integer", + "minimum": 1, + "example": 600, + "x-required": true + } + ], + "description": "The amount of the goal. Depending on the goal type, the amount value and format will be different" + }, + "required": true, + "description": "The amount of the goal. Depending on the goal type, the amount value and format will be different" + }, + { + "in": "query", + "name": "duration", + "schema": { + "type": "integer", + "minimum": 1, + "description": "The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based." + }, + "required": false, + "description": "The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based." + }, + { + "in": "query", + "name": "mushafId", + "schema": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4", + "example": 4 + }, + "required": true, + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4" + }, + { + "in": "header", + "name": "x-timezone", + "schema": { + "type": "string", + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.", + "example": "Asia/Saigon" + }, + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "$ref": "#/components/schemas/EstimatedGoalTimeline" + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "week": [ + { + "date": "2023-01-21T07:28:13.023Z", + "amount": "1:5-1:10" + } + ] + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1GoalsEstimate" + } + }, + "/v1/streaks": { + "get": { + "description": "Get user streaks.", + "tags": [ + "Streaks" + ], + "summary": "Get streaks", + "parameters": [ + { + "in": "query", + "name": "from", + "schema": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "The date after which any streaks would be returned (inclusive)", + "example": "2023-09-01" + }, + "description": "The date after which any streaks would be returned (inclusive)" + }, + { + "in": "query", + "name": "to", + "schema": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "The date before which any streaks would be returned (inclusive)", + "example": "2023-09-31" + }, + "description": "The date before which any streaks would be returned (inclusive)" + }, + { + "in": "query", + "name": "type", + "schema": { + "type": "string", + "enum": [ + "QURAN" + ], + "description": "The type of the streak", + "example": "QURAN" + }, + "description": "The type of the streak" + }, + { + "in": "query", + "name": "sortOrder", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "description": "The sorting order of `orderBy` field", + "example": "desc", + "default": "desc" + }, + "description": "The sorting order of `orderBy` field" + }, + { + "in": "query", + "name": "orderBy", + "schema": { + "type": "string", + "enum": [ + "startDate", + "days" + ], + "description": "Which field to order the streaks by", + "example": "startDate", + "default": "startDate" + }, + "description": "Which field to order the streaks by" + }, + { + "in": "query", + "name": "status", + "schema": { + "type": "string", + "enum": [ + "ACTIVE", + "BROKEN" + ], + "description": "The status of the streak.", + "example": "ACTIVE" + }, + "description": "The status of the streak." + }, + { + "in": "query", + "name": "last", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "description": "The number of items to be fetched. Should be used together with `before`", + "example": 10 + }, + "description": "The number of items to be fetched. Should be used together with `before`" + }, + { + "in": "query", + "name": "first", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of items to be fetched.", + "example": 10 + }, + "description": "The number of items to be fetched." + }, + { + "in": "query", + "name": "after", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`", + "example": "cmoa3wq0z00007z3fh1v9g30d" + }, + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`" + }, + { + "in": "query", + "name": "before", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`", + "example": "cmoa3wq1000017z3f9atfhuvw" + }, + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`" + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The id of the streak.", + "example": "cmoa3wrr2000i7z3fe8swbujv" + }, + "startDate": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "The date of the streak.", + "example": "2023-09-01" + }, + "endDate": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "The date of the streak.", + "example": "2023-09-31" + }, + "status": { + "type": "string", + "enum": [ + "ACTIVE", + "BROKEN" + ], + "description": "The status of the streak.", + "example": "ACTIVE" + }, + "days": { + "type": "integer", + "description": "The number of days the streak is/was active for.", + "example": 5 + } + }, + "required": [ + "id", + "startDate", + "endDate", + "status", + "days" + ], + "additionalProperties": false + } + }, + "pagination": { + "type": "object", + "properties": { + "startCursor": { + "type": "string", + "example": "cmoa3wq1000027z3fciij2440" + }, + "endCursor": { + "type": "string", + "example": "cmoa3wq1000037z3fhr8z3edp" + }, + "hasNextPage": { + "type": "boolean", + "example": true + }, + "hasPreviousPage": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": [ + { + "id": "cmoa3wrr2000i7z3fe8swbujv", + "startDate": "2023-09-01", + "endDate": "2023-09-31", + "status": "ACTIVE", + "days": 5 + } + ], + "pagination": { + "startCursor": "cmoa3wq1000027z3fciij2440", + "endCursor": "cmoa3wq1000037z3fhr8z3edp", + "hasNextPage": true, + "hasPreviousPage": false + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1Streaks" + } + }, + "/v1/streaks/current-streak-days": { + "get": { + "description": "Get current active streak days.", + "tags": [ + "Streaks" + ], + "summary": "Get current streak days", + "parameters": [ + { + "in": "query", + "name": "type", + "schema": { + "type": "string", + "enum": [ + "QURAN" + ], + "description": "The type of the streak", + "example": "QURAN" + }, + "required": true, + "description": "The type of the streak" + }, + { + "in": "header", + "name": "x-timezone", + "schema": { + "type": "string", + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.", + "example": "Asia/Saigon" + }, + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "days": { + "type": "integer", + "description": "The number of days the current streak is active for.", + "example": 5 + } + }, + "required": [ + "days" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "days": 5 + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1StreaksCurrentStreakDays" + } + }, + "/v1/activity-days": { + "post": { + "description": "Create or update a daily activity record (one per date per type). Activity Days power streaks, goals, and calendar-style progress.\n\nFor `type=QURAN`, provide `seconds`, `ranges`, and `mushafId`. You can optionally pass `date` (YYYY-MM-DD) to backfill activity for a past day (for example when the user manually adds time). This endpoint enqueues progress updates and uses the `x-timezone` header to interpret day boundaries and calculate streaks accurately.", + "tags": [ + "Activity Days" + ], + "summary": "Add/update activity day", + "parameters": [ + { + "in": "header", + "name": "x-timezone", + "schema": { + "type": "string", + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.", + "example": "Asia/Saigon" + }, + "description": "The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks." + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "The date of the activity day, can be today or a past date. If not passed, default to today", + "example": "2023-09-01" + }, + "type": { + "type": "string", + "enum": [ + "QURAN", + "LESSON", + "QURAN_READING_PROGRAM" + ], + "description": "The type of the activity day", + "example": "QURAN" + } + }, + "required": [ + "type" + ], + "additionalProperties": false, + "oneOf": [ + { + "type": "object", + "properties": { + "seconds": { + "type": "integer", + "minimum": 1, + "description": "Seconds spent reading the current request's ranges", + "example": 5 + }, + "ranges": { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$", + "description": "a comma separated string of Ayah ranges e.g. 1:1-1:2", + "example": "1:1-1:2" + }, + "description": "Current request's read range of Ayahs", + "example": [ + "1:5-1:10" + ] + }, + "mushafId": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4", + "example": 4 + } + }, + "required": [ + "seconds", + "ranges", + "mushafId" + ], + "additionalProperties": false, + "title": "QURAN" + } + ] + }, + "example": { + "seconds": 5, + "ranges": [ + "1:5-1:10" + ], + "mushafId": 4 + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object" + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": {} + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authPostV1ActivityDays" + }, + "get": { + "description": "Get the user's activity days (calendar/history). Use the `from`/`to` query params to filter by date range and `type` to filter by activity type.", + "tags": [ + "Activity Days" + ], + "summary": "Get activity days", + "parameters": [ + { + "in": "query", + "name": "from", + "schema": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "The start date of the activity days", + "example": "2023-09-01" + }, + "description": "The start date of the activity days" + }, + { + "in": "query", + "name": "to", + "schema": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "The last date of the activity days", + "example": "2023-09-31" + }, + "description": "The last date of the activity days" + }, + { + "in": "query", + "name": "dateOrderBy", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "description": "Order by activity day's date", + "example": "desc", + "default": "desc" + }, + "description": "Order by activity day's date" + }, + { + "in": "query", + "name": "type", + "schema": { + "type": "string", + "enum": [ + "QURAN", + "LESSON", + "QURAN_READING_PROGRAM" + ], + "description": "The type of the activity day", + "example": "QURAN" + }, + "description": "The type of the activity day" + }, + { + "in": "query", + "name": "last", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "description": "The number of items to be fetched. Should be used together with `before`", + "example": 10 + }, + "description": "The number of items to be fetched. Should be used together with `before`" + }, + { + "in": "query", + "name": "first", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of items to be fetched.", + "example": 10 + }, + "description": "The number of items to be fetched." + }, + { + "in": "query", + "name": "after", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`", + "example": "cmoa3wq0z00007z3fh1v9g30d" + }, + "description": "The cursor after which you want to get the next page of items. Should be used together with `first`" + }, + { + "in": "query", + "name": "before", + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + } + ], + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`", + "example": "cmoa3wq1000017z3f9atfhuvw" + }, + "description": "The cursor before which the previous page of items will be fetched. Should be used together with `last`" + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The id of the activity day.", + "example": "cmoa3wq2b00047z3fbl4c6ew0" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "The date of the activity day.", + "example": "2023-09-31" + }, + "progress": { + "type": "number", + "format": "float", + "minimum": 0, + "maximum": 1, + "description": "The progress of the reading goal of that activity day (if the user has a reading goal on that day).", + "example": 0.695 + }, + "type": { + "type": "string", + "enum": [ + "QURAN", + "LESSON", + "QURAN_READING_PROGRAM" + ], + "description": "The type of the activity day", + "example": "QURAN" + }, + "ranges": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$", + "description": "a comma separated string of Ayah ranges e.g. 1:1-1:2", + "example": "1:1-1:2" + } + } + ], + "description": "The ranges read on that day (will be included only when the type is QURAN)", + "example": [ + "1:1-1:2" + ] + }, + "pagesRead": { + "oneOf": [ + { + "type": "number", + "format": "float" + } + ], + "description": "The number of pages read on that day (will be included only when the type is QURAN)", + "example": 1.637041020126048 + }, + "secondsRead": { + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of seconds spent reading on that day (will be included only when the type is QURAN)", + "example": 417 + }, + "versesRead": { + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of Ayahs read on that day (will be included only when the type is QURAN)", + "example": 24 + }, + "manuallyAddedSeconds": { + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of seconds spent reading that was manually input by the user and not auto-tracked (will be included only when the type is QURAN)", + "example": 24 + }, + "dailyTargetPages": { + "oneOf": [ + { + "type": "number", + "format": "float" + } + ], + "description": "The number of pages user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)", + "example": 1.637041020126048 + }, + "dailyTargetSeconds": { + "oneOf": [ + { + "type": "integer" + } + ], + "description": "The number of seconds user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)", + "example": 5 + }, + "dailyTargetRanges": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$", + "description": "a comma separated string of Ayah ranges e.g. 1:1-1:2", + "example": "1:1-1:2" + } + } + ], + "description": "The range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)", + "example": [ + "1:1-1:2" + ] + }, + "remainingDailyTargetRanges": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$", + "description": "a comma separated string of Ayah ranges e.g. 1:1-1:2", + "example": "1:1-1:2" + } + } + ], + "description": "The remaining range of Ayahs user should read on that day to meet their goal's target if a goal was set (will be included only when the type is QURAN)", + "example": [ + "1:1-1:2" + ] + }, + "mushafId": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 11, + 19 + ], + "description": "The id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4", + "example": 4 + } + }, + "required": [ + "id", + "date", + "progress", + "type", + "mushafId" + ], + "additionalProperties": false, + "description": "The Mushaf used to read on that day (will be included only when the type is QURAN) \n\nThe id of the Mushaf being used. \n\n1 = QCFV2 \n\n 2 = QCFV1 \n\n 3 = Indopak \n\n 4 = UthmaniHafs \n\n 5 = KFGQPCHAFS \n\n 6 = Indopak15Lines \n\n 7 = Indopak16Lines \n\n 11 = Tajweeed \n\n 19 = QCFTajweedV4" + } + }, + "pagination": { + "type": "object", + "properties": { + "startCursor": { + "type": "string", + "example": "cmoa3wq1000027z3fciij2440" + }, + "endCursor": { + "type": "string", + "example": "cmoa3wq1000037z3fhr8z3edp" + }, + "hasNextPage": { + "type": "boolean", + "example": true + }, + "hasPreviousPage": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": [ + { + "id": "cmoa3wq2b00047z3fbl4c6ew0", + "date": "2023-09-31", + "progress": 0.695, + "type": "QURAN", + "ranges": [ + "1:1-1:2" + ], + "pagesRead": 1.637041020126048, + "secondsRead": 417, + "versesRead": 24, + "manuallyAddedSeconds": 24, + "dailyTargetPages": 1.637041020126048, + "dailyTargetSeconds": 5, + "dailyTargetRanges": [ + "1:1-1:2" + ], + "remainingDailyTargetRanges": [ + "1:1-1:2" + ], + "mushafId": 4 + } + ], + "pagination": { + "startCursor": "cmoa3wq1000027z3fciij2440", + "endCursor": "cmoa3wq1000037z3fhr8z3edp", + "hasNextPage": true, + "hasPreviousPage": false + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1ActivityDays" + } + }, + "/v1/activity-days/estimate-reading-time": { + "get": { + "description": "Estimate the number of seconds it would take to read a range. We estimate it based on the average reading speed we have collected on quran.com.", + "tags": [ + "Activity Days" + ], + "summary": "Estimate reading time", + "parameters": [ + { + "in": "query", + "name": "ranges", + "schema": { + "type": "string", + "pattern": "^(\\d+:\\d+-\\d+:\\d+(?:,\\d+:\\d+-\\d+:\\d+)*)$", + "description": "a comma separated string of Ayah ranges e.g. 1:1-1:2", + "example": "1:1-1:2" + }, + "required": true, + "description": "a comma separated string of Ayah ranges e.g. 1:1-1:2" + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "seconds": { + "type": "integer", + "description": "The number of seconds it would take on average to read the range of Ayahs.", + "example": 66.8 + } + }, + "required": [ + "seconds" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "seconds": 66.8 + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1ActivityDaysEstimateReadingTime" + } + }, + "/v1/users/profile": { + "patch": { + "operationId": "UsersController_editProfile", + "summary": "Edit user profile", + "description": "Partially update the authenticated user settings and preferences like notification settings, privacy options, and display preferences.", + "parameters": [], + "requestBody": { + "required": true, + "description": "Settings fields to update - only include fields you want to change", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditProfileDto" + }, + "example": { + "languageId": 1, + "reflectionLanguages": [ + "string" + ], + "ayahLanguages": [ + "string" + ], + "customized": true, + "hideFollowSuggestion": true, + "showFollowFeaturedSuggestion": true + } + } + } + }, + "responses": { + "200": { + "description": "Settings updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + }, + "example": { + "success": true + } + } + } + }, + "400": { + "description": "Invalid settings data" + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Users" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + }, + "get": { + "operationId": "UsersController_profile", + "summary": "Get user profile", + "description": "Retrieve the complete profile of the authenticated user including personal info, settings, statistics, and connected accounts.", + "parameters": [ + { + "name": "qdc", + "required": false, + "in": "query", + "description": "Include Quran.com (QDC) connected account data", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Full user profile with all data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSerializedDto" + }, + "example": { + "avatarUrls": { + "small": "https://avatars.githubusercontent.com/u/12345678", + "medium": "https://avatars.githubusercontent.com/u/12345678", + "large": "https://avatars.githubusercontent.com/u/12345678" + }, + "createdAt": "2000-01-21 00:00:00", + "joiningYear": 2025, + "isPasswordSet": true, + "settings": { + "ayahLanguages": [ + 1 + ], + "reflectionLanguages": [ + 1 + ] + }, + "username": "string", + "id": "string", + "verified": false, + "postAs": false, + "firstName": "string", + "lastName": "string", + "postsCount": 0, + "averageToxicity": 0, + "languageId": 1, + "banned": false, + "memberType": 1, + "followersCount": 0, + "likesCount": 0, + "isAdmin": false, + "languageIsoCode": "en", + "bio": "string", + "country": "string", + "followed": true + } + } + } + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Users" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + }, + "put": { + "operationId": "UsersController_updateProfile", + "summary": "Update user profile", + "description": "Update user profile information including name, bio, username, avatar, and social links. Validates username uniqueness.", + "parameters": [], + "requestBody": { + "required": true, + "description": "Profile fields to update wrapped in a user object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateProfileBodyDto" + }, + "example": { + "user": { + "avatar": "string", + "firstName": "string", + "lastName": "string", + "bio": "string", + "country": "string", + "removeAvatar": true + } + } + } + } + }, + "responses": { + "200": { + "description": "Profile updated and returned with new values", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSerializedDto" + }, + "example": { + "avatarUrls": { + "small": "https://avatars.githubusercontent.com/u/12345678", + "medium": "https://avatars.githubusercontent.com/u/12345678", + "large": "https://avatars.githubusercontent.com/u/12345678" + }, + "createdAt": "2000-01-21 00:00:00", + "joiningYear": 2025, + "isPasswordSet": true, + "settings": { + "ayahLanguages": [ + 1 + ], + "reflectionLanguages": [ + 1 + ] + }, + "username": "string", + "id": "string", + "verified": false, + "postAs": false, + "firstName": "string", + "lastName": "string", + "postsCount": 0, + "averageToxicity": 0, + "languageId": 1, + "banned": false, + "memberType": 1, + "followersCount": 0, + "likesCount": 0, + "isAdmin": false, + "languageIsoCode": "en", + "bio": "string", + "country": "string", + "followed": true + } + } + } + }, + "400": { + "description": "Invalid profile data or username taken" + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Users" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/notes": { + "get": { + "tags": [ + "Notes" + ], + "description": "List notes owned by the user. This API contains pagination. Read more about [pagination](/#pagination)", + "summary": "Get all notes", + "parameters": [ + { + "in": "query", + "name": "cursor", + "schema": { + "type": "string", + "description": "A cursor for pagination, used to fetch the next set of results.", + "example": "cursor123" + }, + "description": "A cursor for pagination, used to fetch the next set of results." + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "number", + "format": "float", + "minimum": 1, + "maximum": 50, + "description": "The maximum number of notes to return, defaults to 20.", + "example": 20, + "default": 20 + }, + "description": "The maximum number of notes to return, defaults to 20." + }, + { + "in": "query", + "name": "sortBy", + "schema": { + "type": "string", + "enum": [ + "newest", + "oldest" + ], + "description": "The sorting order of the notes, defaults to newest first.", + "example": "newest", + "default": "newest" + }, + "description": "The sorting order of the notes, defaults to newest first." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the note.", + "example": "asdasdqwe1231" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The creation date of the note.", + "example": "2023-01-21T07:28:13.023Z" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "description": "The last update date of the note.", + "example": "2023-01-22T07:28:13.023Z" + }, + "body": { + "type": "string", + "minLength": 6, + "maxLength": 10000, + "description": "The main content of the note, must be between the specified minimum and maximum length.", + "example": "This is a sample note body." + }, + "source": { + "type": "string", + "description": "The source of the note.", + "example": "we23412312weq" + }, + "attachedEntities": { + "type": "array", + "items": { + "type": "object", + "properties": { + "entityId": { + "type": "string", + "description": "The unique identifier for the attached entity.", + "example": "entity123" + }, + "entityType": { + "type": "string", + "enum": [ + "reflection" + ], + "description": "The type of the attached entity, must be one of the predefined NoteEntityType values.", + "example": "reflection" + }, + "entityMetadata": { + "type": "object", + "properties": {}, + "description": "Additional metadata for the attached entity.", + "example": { + "key": "value" + } + } + }, + "required": [ + "entityId", + "entityType" + ], + "additionalProperties": false + }, + "description": "An array of attached entities associated with the note." + }, + "ranges": { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$" + }, + "description": "An array of verse ranges associated with the note.", + "example": [ + "2:255-2:257" + ] + } + }, + "required": [ + "id", + "createdAt", + "updatedAt", + "body" + ], + "additionalProperties": false + } + }, + "pagination": { + "type": "object", + "properties": { + "startCursor": { + "type": "string", + "example": "cmoa3wq1000027z3fciij2440" + }, + "endCursor": { + "type": "string", + "example": "cmoa3wq1000037z3fhr8z3edp" + }, + "hasNextPage": { + "type": "boolean", + "example": true + }, + "hasPreviousPage": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": [ + { + "id": "asdasdqwe1231", + "createdAt": "2023-01-21T07:28:13.023Z", + "updatedAt": "2023-01-22T07:28:13.023Z", + "body": "This is a sample note body.", + "source": "we23412312weq", + "attachedEntities": [ + { + "entityId": "entity123", + "entityType": "reflection", + "entityMetadata": { + "key": "value" + } + } + ], + "ranges": [ + "2:255-2:257" + ] + } + ], + "pagination": { + "startCursor": "cmoa3wq1000027z3fciij2440", + "endCursor": "cmoa3wq1000037z3fhr8z3edp", + "hasNextPage": true, + "hasPreviousPage": false + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1Notes" + }, + "post": { + "tags": [ + "Notes" + ], + "description": "Add a new note.", + "summary": "Add note", + "parameters": [ + { + "in": "query", + "name": "lastMutationAt", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control." + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "minLength": 6, + "maxLength": 10000, + "description": "The main content of the note, must be between the specified minimum and maximum length.", + "example": "This is a sample note body." + }, + "saveToQR": { + "type": "boolean", + "description": "Indicates whether the note should be saved to the QuranReflect.", + "example": true + }, + "attachedEntity": { + "type": "object", + "properties": { + "entityId": { + "type": "string", + "description": "The unique identifier for the attached entity.", + "example": "entity123" + }, + "entityType": { + "type": "string", + "enum": [ + "reflection" + ], + "description": "The type of the attached entity, must be one of the predefined NoteEntityType values.", + "example": "reflection" + }, + "entityMetadata": { + "type": "object", + "properties": {}, + "description": "Additional metadata for the attached entity.", + "example": { + "key": "value" + } + } + }, + "required": [ + "entityId", + "entityType" + ], + "additionalProperties": false + }, + "ranges": { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$" + }, + "description": "An array of verse ranges associated with the note.", + "example": [ + "2:255-2:257" + ] + } + }, + "required": [ + "body", + "saveToQR" + ], + "additionalProperties": false + }, + "example": { + "body": "This is a sample note body.", + "saveToQR": true, + "attachedEntity": { + "entityId": "entity123", + "entityType": "reflection", + "entityMetadata": { + "key": "value" + } + }, + "ranges": [ + "2:255-2:257" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the note.", + "example": "asdasdqwe1231" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The creation date of the note.", + "example": "2023-01-21T07:28:13.023Z" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "description": "The last update date of the note.", + "example": "2023-01-22T07:28:13.023Z" + }, + "body": { + "type": "string", + "minLength": 6, + "maxLength": 10000, + "description": "The main content of the note, must be between the specified minimum and maximum length.", + "example": "This is a sample note body." + }, + "source": { + "type": "string", + "description": "The source of the note.", + "example": "we23412312weq" + }, + "attachedEntities": { + "type": "array", + "items": { + "type": "object", + "properties": { + "entityId": { + "type": "string", + "description": "The unique identifier for the attached entity.", + "example": "entity123" + }, + "entityType": { + "type": "string", + "enum": [ + "reflection" + ], + "description": "The type of the attached entity, must be one of the predefined NoteEntityType values.", + "example": "reflection" + }, + "entityMetadata": { + "type": "object", + "properties": {}, + "description": "Additional metadata for the attached entity.", + "example": { + "key": "value" + } + } + }, + "required": [ + "entityId", + "entityType" + ], + "additionalProperties": false + }, + "description": "An array of attached entities associated with the note." + }, + "ranges": { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$" + }, + "description": "An array of verse ranges associated with the note.", + "example": [ + "2:255-2:257" + ] + } + }, + "required": [ + "id", + "createdAt", + "updatedAt", + "body" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "id": "asdasdqwe1231", + "createdAt": "2023-01-21T07:28:13.023Z", + "updatedAt": "2023-01-22T07:28:13.023Z", + "body": "This is a sample note body.", + "source": "we23412312weq", + "attachedEntities": [ + { + "entityId": "entity123", + "entityType": "reflection", + "entityMetadata": { + "key": "value" + } + } + ], + "ranges": [ + "2:255-2:257" + ] + } + } + } + }, + "headers": { + "X-Mutation-At": { + "description": "Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.", + "schema": { + "type": "string", + "example": "1731636500303" + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "409": { + "description": "Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "OutOfSyncError" + }, + "message": { + "type": "string", + "example": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + } + } + }, + "examples": { + "Out of sync": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + }, + "First sync - wrong lastMutationAt": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "First sync detected. Please use lastMutationAt=-1 for initial sync." + } + } + } + } + } + } + } + }, + "operationId": "authPostV1Notes" + } + }, + "/v1/notes/by-verse/{verseKey}": { + "get": { + "tags": [ + "Notes" + ], + "description": "Retrieve notes by a specific verse.", + "summary": "Get notes by verse", + "parameters": [ + { + "in": "query", + "name": "verseKey", + "schema": { + "type": "string", + "pattern": "^(\\d+):(\\d+)$", + "description": "The verse key for which notes are being requested.", + "example": "2:255" + }, + "required": true, + "description": "The verse key for which notes are being requested." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the note.", + "example": "asdasdqwe1231" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The creation date of the note.", + "example": "2023-01-21T07:28:13.023Z" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "description": "The last update date of the note.", + "example": "2023-01-22T07:28:13.023Z" + }, + "body": { + "type": "string", + "minLength": 6, + "maxLength": 10000, + "description": "The main content of the note, must be between the specified minimum and maximum length.", + "example": "This is a sample note body." + }, + "source": { + "type": "string", + "description": "The source of the note.", + "example": "we23412312weq" + }, + "attachedEntities": { + "type": "array", + "items": { + "type": "object", + "properties": { + "entityId": { + "type": "string", + "description": "The unique identifier for the attached entity.", + "example": "entity123" + }, + "entityType": { + "type": "string", + "enum": [ + "reflection" + ], + "description": "The type of the attached entity, must be one of the predefined NoteEntityType values.", + "example": "reflection" + }, + "entityMetadata": { + "type": "object", + "properties": {}, + "description": "Additional metadata for the attached entity.", + "example": { + "key": "value" + } + } + }, + "required": [ + "entityId", + "entityType" + ], + "additionalProperties": false + }, + "description": "An array of attached entities associated with the note." + }, + "ranges": { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$" + }, + "description": "An array of verse ranges associated with the note.", + "example": [ + "2:255-2:257" + ] + } + }, + "required": [ + "id", + "createdAt", + "updatedAt", + "body" + ], + "additionalProperties": false + } + }, + "pagination": { + "type": "object", + "properties": { + "startCursor": { + "type": "string", + "example": "cmoa3wq1000027z3fciij2440" + }, + "endCursor": { + "type": "string", + "example": "cmoa3wq1000037z3fhr8z3edp" + }, + "hasNextPage": { + "type": "boolean", + "example": true + }, + "hasPreviousPage": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": [ + { + "id": "asdasdqwe1231", + "createdAt": "2023-01-21T07:28:13.023Z", + "updatedAt": "2023-01-22T07:28:13.023Z", + "body": "This is a sample note body.", + "source": "we23412312weq", + "attachedEntities": [ + { + "entityId": "entity123", + "entityType": "reflection", + "entityMetadata": { + "key": "value" + } + } + ], + "ranges": [ + "2:255-2:257" + ] + } + ], + "pagination": { + "startCursor": "cmoa3wq1000027z3fciij2440", + "endCursor": "cmoa3wq1000037z3fhr8z3edp", + "hasNextPage": true, + "hasPreviousPage": false + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1NotesByVerseByVerseKey" + } + }, + "/v1/notes/by-attached-entity": { + "get": { + "tags": [ + "Notes" + ], + "description": "Retrieve notes by attached entity.", + "summary": "Get notes by attached entity", + "parameters": [ + { + "in": "query", + "name": "entityId", + "schema": { + "type": "string", + "description": "The unique identifier for the attached entity.", + "example": "entity123" + }, + "required": true, + "description": "The unique identifier for the attached entity." + }, + { + "in": "query", + "name": "entityType", + "schema": { + "type": "string", + "enum": [ + "reflection" + ], + "description": "The type of the attached entity, must be one of the predefined NoteEntityType values.", + "example": "reflection" + }, + "required": true, + "description": "The type of the attached entity, must be one of the predefined NoteEntityType values." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the note.", + "example": "asdasdqwe1231" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The creation date of the note.", + "example": "2023-01-21T07:28:13.023Z" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "description": "The last update date of the note.", + "example": "2023-01-22T07:28:13.023Z" + }, + "body": { + "type": "string", + "minLength": 6, + "maxLength": 10000, + "description": "The main content of the note, must be between the specified minimum and maximum length.", + "example": "This is a sample note body." + }, + "source": { + "type": "string", + "description": "The source of the note.", + "example": "we23412312weq" + }, + "attachedEntities": { + "type": "array", + "items": { + "type": "object", + "properties": { + "entityId": { + "type": "string", + "description": "The unique identifier for the attached entity.", + "example": "entity123" + }, + "entityType": { + "type": "string", + "enum": [ + "reflection" + ], + "description": "The type of the attached entity, must be one of the predefined NoteEntityType values.", + "example": "reflection" + }, + "entityMetadata": { + "type": "object", + "properties": {}, + "description": "Additional metadata for the attached entity.", + "example": { + "key": "value" + } + } + }, + "required": [ + "entityId", + "entityType" + ], + "additionalProperties": false + }, + "description": "An array of attached entities associated with the note." + }, + "ranges": { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$" + }, + "description": "An array of verse ranges associated with the note.", + "example": [ + "2:255-2:257" + ] + } + }, + "required": [ + "id", + "createdAt", + "updatedAt", + "body" + ], + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": [ + { + "id": "asdasdqwe1231", + "createdAt": "2023-01-21T07:28:13.023Z", + "updatedAt": "2023-01-22T07:28:13.023Z", + "body": "This is a sample note body.", + "source": "we23412312weq", + "attachedEntities": [ + { + "entityId": "entity123", + "entityType": "reflection", + "entityMetadata": { + "key": "value" + } + } + ], + "ranges": [ + "2:255-2:257" + ] + } + ] + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1NotesByAttachedEntity" + } + }, + "/v1/notes/count-within-range": { + "get": { + "tags": [ + "Notes" + ], + "description": "Get the count of notes within a range of verses.", + "summary": "Get notes count within verse range", + "parameters": [ + { + "in": "query", + "name": "from", + "schema": { + "type": "string", + "pattern": "^(\\d+):(\\d+)$", + "description": "The starting verse key of the range.", + "example": "2:12" + }, + "required": true, + "description": "The starting verse key of the range." + }, + { + "in": "query", + "name": "to", + "schema": { + "type": "string", + "pattern": "^(\\d+):(\\d+)$", + "description": "The ending verse key of the range.", + "example": "2:18" + }, + "required": true, + "description": "The ending verse key of the range." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": {}, + "additionalProperties": { + "type": "integer", + "minimum": 1 + }, + "description": "A map of verse keys to note counts, where each key is a verse key and each value is an integer count of notes.", + "example": { + "1:2": 5, + "1:3": 1, + "1:4": 1 + } + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "1:2": 5, + "1:3": 1, + "1:4": 1 + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1NotesCountWithinRange" + } + }, + "/v1/notes/by-range": { + "get": { + "tags": [ + "Notes" + ], + "description": "Retrieve notes by a range of verses.", + "summary": "Get notes by verse range", + "parameters": [ + { + "in": "query", + "name": "from", + "schema": { + "type": "string", + "pattern": "^(\\d+):(\\d+)$", + "description": "The starting verse key of the range.", + "example": "2:12" + }, + "required": true, + "description": "The starting verse key of the range." + }, + { + "in": "query", + "name": "to", + "schema": { + "type": "string", + "pattern": "^(\\d+):(\\d+)$", + "description": "The ending verse key of the range.", + "example": "2:18" + }, + "required": true, + "description": "The ending verse key of the range." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the note.", + "example": "asdasdqwe1231" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The creation date of the note.", + "example": "2023-01-21T07:28:13.023Z" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "description": "The last update date of the note.", + "example": "2023-01-22T07:28:13.023Z" + }, + "body": { + "type": "string", + "minLength": 6, + "maxLength": 10000, + "description": "The main content of the note, must be between the specified minimum and maximum length.", + "example": "This is a sample note body." + }, + "source": { + "type": "string", + "description": "The source of the note.", + "example": "we23412312weq" + }, + "attachedEntities": { + "type": "array", + "items": { + "type": "object", + "properties": { + "entityId": { + "type": "string", + "description": "The unique identifier for the attached entity.", + "example": "entity123" + }, + "entityType": { + "type": "string", + "enum": [ + "reflection" + ], + "description": "The type of the attached entity, must be one of the predefined NoteEntityType values.", + "example": "reflection" + }, + "entityMetadata": { + "type": "object", + "properties": {}, + "description": "Additional metadata for the attached entity.", + "example": { + "key": "value" + } + } + }, + "required": [ + "entityId", + "entityType" + ], + "additionalProperties": false + }, + "description": "An array of attached entities associated with the note." + }, + "ranges": { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$" + }, + "description": "An array of verse ranges associated with the note.", + "example": [ + "2:255-2:257" + ] + } + }, + "required": [ + "id", + "createdAt", + "updatedAt", + "body" + ], + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": [ + { + "id": "asdasdqwe1231", + "createdAt": "2023-01-21T07:28:13.023Z", + "updatedAt": "2023-01-22T07:28:13.023Z", + "body": "This is a sample note body.", + "source": "we23412312weq", + "attachedEntities": [ + { + "entityId": "entity123", + "entityType": "reflection", + "entityMetadata": { + "key": "value" + } + } + ], + "ranges": [ + "2:255-2:257" + ] + } + ] + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1NotesByRange" + } + }, + "/v1/notes/{noteId}": { + "get": { + "tags": [ + "Notes" + ], + "description": "Retrieve a note by its ID.", + "summary": "Get note by ID", + "parameters": [ + { + "in": "query", + "name": "withAttachedEntities", + "schema": { + "type": "boolean", + "description": "Specifies whether to include attached entities in the response, defaults to true.", + "example": true, + "default": true + }, + "description": "Specifies whether to include attached entities in the response, defaults to true." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the note.", + "example": "asdasdqwe1231" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The creation date of the note.", + "example": "2023-01-21T07:28:13.023Z" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "description": "The last update date of the note.", + "example": "2023-01-22T07:28:13.023Z" + }, + "body": { + "type": "string", + "minLength": 6, + "maxLength": 10000, + "description": "The main content of the note, must be between the specified minimum and maximum length.", + "example": "This is a sample note body." + }, + "source": { + "type": "string", + "description": "The source of the note.", + "example": "we23412312weq" + }, + "attachedEntities": { + "type": "array", + "items": { + "type": "object", + "properties": { + "entityId": { + "type": "string", + "description": "The unique identifier for the attached entity.", + "example": "entity123" + }, + "entityType": { + "type": "string", + "enum": [ + "reflection" + ], + "description": "The type of the attached entity, must be one of the predefined NoteEntityType values.", + "example": "reflection" + }, + "entityMetadata": { + "type": "object", + "properties": {}, + "description": "Additional metadata for the attached entity.", + "example": { + "key": "value" + } + } + }, + "required": [ + "entityId", + "entityType" + ], + "additionalProperties": false + }, + "description": "An array of attached entities associated with the note." + }, + "ranges": { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$" + }, + "description": "An array of verse ranges associated with the note.", + "example": [ + "2:255-2:257" + ] + } + }, + "required": [ + "id", + "createdAt", + "updatedAt", + "body" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "id": "asdasdqwe1231", + "createdAt": "2023-01-21T07:28:13.023Z", + "updatedAt": "2023-01-22T07:28:13.023Z", + "body": "This is a sample note body.", + "source": "we23412312weq", + "attachedEntities": [ + { + "entityId": "entity123", + "entityType": "reflection", + "entityMetadata": { + "key": "value" + } + } + ], + "ranges": [ + "2:255-2:257" + ] + } + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + }, + "operationId": "authGetV1NotesByNoteId" + }, + "patch": { + "tags": [ + "Notes" + ], + "description": "Update a note by its ID.", + "summary": "Update note by ID", + "parameters": [ + { + "in": "path", + "name": "noteId", + "schema": { + "type": "string", + "description": "The unique identifier of the note to be retrieved or manipulated.", + "example": "asda12312312" + }, + "required": true, + "description": "The unique identifier of the note to be retrieved or manipulated." + }, + { + "in": "query", + "name": "lastMutationAt", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control." + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "minLength": 6, + "maxLength": 10000, + "description": "The main content of the note, must be between the specified minimum and maximum length.", + "example": "This is a sample note body." + }, + "saveToQR": { + "type": "boolean", + "description": "Indicates whether the updated note should be saved to the QuranReflect, defaults to false.", + "example": false, + "default": false + } + }, + "required": [ + "body" + ], + "additionalProperties": false + }, + "example": { + "body": "This is a sample note body.", + "saveToQR": false + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the note.", + "example": "asdasdqwe1231" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The creation date of the note.", + "example": "2023-01-21T07:28:13.023Z" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "description": "The last update date of the note.", + "example": "2023-01-22T07:28:13.023Z" + }, + "body": { + "type": "string", + "minLength": 6, + "maxLength": 10000, + "description": "The main content of the note, must be between the specified minimum and maximum length.", + "example": "This is a sample note body." + }, + "source": { + "type": "string", + "description": "The source of the note.", + "example": "we23412312weq" + }, + "attachedEntities": { + "type": "array", + "items": { + "type": "object", + "properties": { + "entityId": { + "type": "string", + "description": "The unique identifier for the attached entity.", + "example": "entity123" + }, + "entityType": { + "type": "string", + "enum": [ + "reflection" + ], + "description": "The type of the attached entity, must be one of the predefined NoteEntityType values.", + "example": "reflection" + }, + "entityMetadata": { + "type": "object", + "properties": {}, + "description": "Additional metadata for the attached entity.", + "example": { + "key": "value" + } + } + }, + "required": [ + "entityId", + "entityType" + ], + "additionalProperties": false + }, + "description": "An array of attached entities associated with the note." + }, + "ranges": { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$" + }, + "description": "An array of verse ranges associated with the note.", + "example": [ + "2:255-2:257" + ] + } + }, + "required": [ + "id", + "createdAt", + "updatedAt", + "body" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "id": "asdasdqwe1231", + "createdAt": "2023-01-21T07:28:13.023Z", + "updatedAt": "2023-01-22T07:28:13.023Z", + "body": "This is a sample note body.", + "source": "we23412312weq", + "attachedEntities": [ + { + "entityId": "entity123", + "entityType": "reflection", + "entityMetadata": { + "key": "value" + } + } + ], + "ranges": [ + "2:255-2:257" + ] + } + } + } + }, + "headers": { + "X-Mutation-At": { + "description": "Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.", + "schema": { + "type": "string", + "example": "1731636500303" + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "409": { + "description": "Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "OutOfSyncError" + }, + "message": { + "type": "string", + "example": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + } + } + }, + "examples": { + "Out of sync": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + }, + "First sync - wrong lastMutationAt": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "First sync detected. Please use lastMutationAt=-1 for initial sync." + } + } + } + } + } + } + } + }, + "operationId": "authPatchV1NotesByNoteId" + }, + "delete": { + "tags": [ + "Notes" + ], + "description": "Delete a note by its ID.", + "summary": "Delete note by ID", + "parameters": [ + { + "in": "path", + "name": "noteId", + "schema": { + "type": "string", + "description": "The ID of the note to delete." + }, + "required": true, + "description": "The ID of the note to delete." + }, + { + "in": "query", + "name": "lastMutationAt", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "success": true + } + } + } + }, + "headers": { + "X-Mutation-At": { + "description": "Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.", + "schema": { + "type": "string", + "example": "1731636500303" + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "409": { + "description": "Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "OutOfSyncError" + }, + "message": { + "type": "string", + "example": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + } + } + }, + "examples": { + "Out of sync": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + }, + "First sync - wrong lastMutationAt": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "First sync detected. Please use lastMutationAt=-1 for initial sync." + } + } + } + } + } + } + } + }, + "operationId": "authDeleteV1NotesByNoteId" + } + }, + "/v1/notes/{noteId}/publish": { + "post": { + "tags": [ + "Notes" + ], + "description": "Publish a note to QR.", + "summary": "Publish note", + "parameters": [ + { + "in": "path", + "name": "noteId", + "schema": { + "type": "string", + "description": "The unique identifier of the note to be retrieved or manipulated.", + "example": "asda12312312" + }, + "required": true, + "description": "The unique identifier of the note to be retrieved or manipulated." + }, + { + "in": "query", + "name": "lastMutationAt", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp of the last mutation that was applied on the server. Required for any data modification operation to ensure concurrency control." + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "minLength": 6, + "maxLength": 10000, + "description": "The main content of the note, must be between the specified minimum and maximum length.", + "example": "This is a sample note body." + }, + "ranges": { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$" + }, + "description": "An array of verse ranges associated with the note.", + "example": [ + "2:112-2:115" + ] + } + }, + "required": [ + "body" + ], + "additionalProperties": false + }, + "example": { + "body": "This is a sample note body.", + "ranges": [ + "2:112-2:115" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "postId": { + "type": "number", + "format": "float" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Response object indicating the success of the note publishing operation and the optional post ID if successful.", + "example": { + "success": true, + "postId": 123 + } + } + }, + "additionalProperties": false + }, + "example": { + "success": true, + "data": { + "success": true, + "postId": 123 + } + } + } + }, + "headers": { + "X-Mutation-At": { + "description": "Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.", + "schema": { + "type": "string", + "example": "1731636500303" + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "409": { + "description": "Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "OutOfSyncError" + }, + "message": { + "type": "string", + "example": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + } + } + }, + "examples": { + "Out of sync": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + }, + "First sync - wrong lastMutationAt": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "First sync detected. Please use lastMutationAt=-1 for initial sync." + } + } + } + } + } + } + } + }, + "operationId": "authPostV1NotesByNoteIdPublish" + } + }, + "/v1/users/my-rooms": { + "get": { + "operationId": "UsersController_rooms", + "summary": "Get logged-in user rooms", + "description": "Retrieve all rooms (groups and pages) the authenticated user is a member of. Supports filtering by name and pagination.", + "parameters": [ + { + "name": "name", + "required": false, + "in": "query", + "description": "Filter rooms by name", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number (default: 1)", + "schema": { + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Rooms per page (default: 10)", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "User rooms with pagination metadata", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserRoomsResponse" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "id": 1, + "name": "string", + "group": "string", + "public": true, + "roomType": "string", + "verified": true, + "subdomain": "string", + "description": "string", + "membersCount": 1, + "avatarUrl": { + "small": "string", + "medium": "string", + "large": "string" + } + } + ] + } + } + } + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Users" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/users/search": { + "get": { + "operationId": "UsersController_search", + "summary": "Search for users", + "description": "Search users by name or username. Supports mentioning in posts, finding users for room invites, and general discovery. Results can be scoped to specific contexts.", + "parameters": [ + { + "name": "query", + "required": false, + "in": "query", + "description": "Search term for name/username", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Results per page (default: 10)", + "schema": { + "type": "number" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number (default: 1)", + "schema": { + "type": "number" + } + }, + { + "name": "all", + "required": false, + "in": "query", + "description": "Search all users (not just followed)", + "schema": { + "type": "boolean" + } + }, + { + "name": "postingAs", + "required": false, + "in": "query", + "description": "Filter for posting-as feature", + "schema": { + "type": "boolean" + } + }, + { + "name": "postingAsUserId", + "required": false, + "in": "query", + "description": "User ID for posting-as context", + "schema": { + "type": "string" + } + }, + { + "name": "roomId", + "required": false, + "in": "query", + "description": "Room ID for scoped search", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Matching users with pagination", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsersSearchResponse" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "avatarUrls": { + "small": "https://avatars.githubusercontent.com/u/12345678", + "medium": "https://avatars.githubusercontent.com/u/12345678", + "large": "https://avatars.githubusercontent.com/u/12345678" + }, + "createdAt": "2000-01-21 00:00:00", + "joiningYear": 2025, + "isPasswordSet": true, + "isFollowed": false, + "followed": false, + "settings": { + "ayahLanguages": [ + 1 + ], + "reflectionLanguages": [ + 1 + ] + }, + "username": "string", + "id": "string", + "verified": false, + "postAs": false, + "firstName": "string", + "lastName": "string", + "postsCount": 0, + "averageToxicity": 0, + "languageId": 1, + "banned": false, + "memberType": 1, + "followersCount": 0, + "likesCount": 0, + "isAdmin": false, + "languageIsoCode": "en", + "bio": "string", + "country": "string" + } + ] + } + } + } + } + }, + "tags": [ + "Users" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/users/{followeeId}/toggle-follow": { + "post": { + "operationId": "UsersController_toggleFollow", + "summary": "Toggle follow/unfollow a user", + "description": "Follow or unfollow another user. When following, their posts will appear in your FOLLOWING feed. Can optionally specify action to force follow/unfollow.", + "parameters": [ + { + "name": "followeeId", + "required": true, + "in": "path", + "description": "UUID of the user to follow/unfollow", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": false, + "description": "Optional: specify \"follow\" or \"unfollow\" action explicitly", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToggleFollowDto" + }, + "example": { + "action": "follow" + } + } + } + }, + "responses": { + "200": { + "description": "Follow status changed - returns new state", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "followed": { + "type": "boolean", + "description": "true if now following" + } + } + }, + "example": { + "followed": true + } + } + } + }, + "400": { + "description": "Cannot follow yourself or action already in desired state" + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Users" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/users/{followerId}/remove-follower": { + "post": { + "operationId": "UsersController_removeFollower", + "summary": "Remove a follower", + "description": "Remove a user from your followers list. They will no longer see you as followed and won't receive notifications about your activity.", + "parameters": [ + { + "name": "followerId", + "required": true, + "in": "path", + "description": "UUID of the follower to remove", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Follower removed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "removed": { + "type": "boolean", + "example": true + } + } + }, + "example": { + "removed": true + } + } + } + }, + "400": { + "description": "Invalid follower id or follower relationship doesn't exist" + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Users" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/users/{id}": { + "get": { + "operationId": "UsersController_getUserProfile", + "summary": "Get user profile by id or username", + "description": "Retrieve a user profile by either UUID or username. If viewing your own profile, returns full data; otherwise returns public profile with follow relationship status.", + "parameters": [ + { + "name": "id", + "required": false, + "in": "path", + "description": "UUID of the user", + "schema": { + "type": "string" + } + }, + { + "name": "username", + "required": false, + "in": "path", + "description": "Username of the user (case-insensitive)", + "schema": { + "type": "string" + } + }, + { + "name": "qdc", + "required": false, + "in": "query", + "description": "Include Quran.com connected account data", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Own profile with full data including settings", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSerializedDto" + }, + "example": { + "avatarUrls": { + "small": "https://avatars.githubusercontent.com/u/12345678", + "medium": "https://avatars.githubusercontent.com/u/12345678", + "large": "https://avatars.githubusercontent.com/u/12345678" + }, + "createdAt": "2000-01-21 00:00:00", + "joiningYear": 2025, + "isPasswordSet": true, + "settings": { + "ayahLanguages": [ + 1 + ], + "reflectionLanguages": [ + 1 + ] + }, + "username": "string", + "id": "string", + "verified": false, + "postAs": false, + "firstName": "string", + "lastName": "string", + "postsCount": 0, + "averageToxicity": 0, + "languageId": 1, + "banned": false, + "memberType": 1, + "followersCount": 0, + "likesCount": 0, + "isAdmin": false, + "languageIsoCode": "en", + "bio": "string", + "country": "string", + "followed": true + } + } + } + }, + "404": { + "description": "User not found" + } + }, + "tags": [ + "Users" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/users/{username}/profile": { + "get": { + "operationId": "UsersController_getUserProfile", + "summary": "Get user profile by id or username", + "description": "Retrieve a user profile by either UUID or username. If viewing your own profile, returns full data; otherwise returns public profile with follow relationship status.", + "parameters": [ + { + "name": "id", + "required": false, + "in": "path", + "description": "UUID of the user", + "schema": { + "type": "string" + } + }, + { + "name": "username", + "required": false, + "in": "path", + "description": "Username of the user (case-insensitive)", + "schema": { + "type": "string" + } + }, + { + "name": "qdc", + "required": false, + "in": "query", + "description": "Include Quran.com connected account data", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Own profile with full data including settings", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSerializedDto" + }, + "example": { + "avatarUrls": { + "small": "https://avatars.githubusercontent.com/u/12345678", + "medium": "https://avatars.githubusercontent.com/u/12345678", + "large": "https://avatars.githubusercontent.com/u/12345678" + }, + "createdAt": "2000-01-21 00:00:00", + "joiningYear": 2025, + "isPasswordSet": true, + "settings": { + "ayahLanguages": [ + 1 + ], + "reflectionLanguages": [ + 1 + ] + }, + "username": "string", + "id": "string", + "verified": false, + "postAs": false, + "firstName": "string", + "lastName": "string", + "postsCount": 0, + "averageToxicity": 0, + "languageId": 1, + "banned": false, + "memberType": 1, + "followersCount": 0, + "likesCount": 0, + "isAdmin": false, + "languageIsoCode": "en", + "bio": "string", + "country": "string", + "followed": true + } + } + } + }, + "404": { + "description": "User not found" + } + }, + "tags": [ + "Users" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/users/{id}/followers": { + "get": { + "operationId": "UsersController_getUserFollowers", + "summary": "Get user followers", + "description": "Retrieve a paginated list of users who follow the specified user. Includes follow relationship to the viewer if authenticated.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "UUID of the user", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Results per page (default: 10)", + "schema": { + "minimum": 1, + "maximum": 20, + "default": 20, + "type": "number" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number (default: 1)", + "schema": { + "minimum": 1, + "default": 1, + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "List of followers with pagination", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsersSearchResponse" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "avatarUrls": { + "small": "https://avatars.githubusercontent.com/u/12345678", + "medium": "https://avatars.githubusercontent.com/u/12345678", + "large": "https://avatars.githubusercontent.com/u/12345678" + }, + "createdAt": "2000-01-21 00:00:00", + "joiningYear": 2025, + "isPasswordSet": true, + "isFollowed": false, + "followed": false, + "settings": { + "ayahLanguages": [ + 1 + ], + "reflectionLanguages": [ + 1 + ] + }, + "username": "string", + "id": "string", + "verified": false, + "postAs": false, + "firstName": "string", + "lastName": "string", + "postsCount": 0, + "averageToxicity": 0, + "languageId": 1, + "banned": false, + "memberType": 1, + "followersCount": 0, + "likesCount": 0, + "isAdmin": false, + "languageIsoCode": "en", + "bio": "string", + "country": "string" + } + ] + } + } + } + }, + "404": { + "description": "User not found" + } + }, + "tags": [ + "Users" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/users/{id}/following": { + "get": { + "operationId": "UsersController_getUserFollowing", + "summary": "Get users followed by user", + "description": "Retrieve a paginated list of users that the specified user follows. Includes follow relationship to the viewer if authenticated.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "UUID of the user", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Results per page (default: 10)", + "schema": { + "minimum": 1, + "maximum": 20, + "default": 20, + "type": "number" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number (default: 1)", + "schema": { + "minimum": 1, + "default": 1, + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "List of followed users with pagination", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsersSearchResponse" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "avatarUrls": { + "small": "https://avatars.githubusercontent.com/u/12345678", + "medium": "https://avatars.githubusercontent.com/u/12345678", + "large": "https://avatars.githubusercontent.com/u/12345678" + }, + "createdAt": "2000-01-21 00:00:00", + "joiningYear": 2025, + "isPasswordSet": true, + "isFollowed": false, + "followed": false, + "settings": { + "ayahLanguages": [ + 1 + ], + "reflectionLanguages": [ + 1 + ] + }, + "username": "string", + "id": "string", + "verified": false, + "postAs": false, + "firstName": "string", + "lastName": "string", + "postsCount": 0, + "averageToxicity": 0, + "languageId": 1, + "banned": false, + "memberType": 1, + "followersCount": 0, + "likesCount": 0, + "isAdmin": false, + "languageIsoCode": "en", + "bio": "string", + "country": "string" + } + ] + } + } + } + }, + "404": { + "description": "User not found" + } + }, + "tags": [ + "Users" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/admins-access": { + "post": { + "operationId": "RoomsController_adminsAccess", + "summary": "Update room admin access", + "description": "Grant or revoke admin privileges for a user in a room. Only room owners or existing admins can modify admin access.", + "parameters": [], + "requestBody": { + "required": true, + "description": "Contains roomId, userId, and admin boolean to grant/revoke access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoomAdminUpdateDto" + }, + "example": { + "roomId": 1, + "userId": "string", + "admin": true + } + } + } + }, + "responses": { + "200": { + "description": "Admin access updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + }, + "example": { + "success": true + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "403": { + "description": "User not authorized to modify admin access" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/groups": { + "patch": { + "operationId": "RoomsController_updateGroup", + "summary": "Update a group", + "description": "Update group properties like name, description, URL, avatar, country, or public visibility. Only group admins/owners can update.", + "parameters": [], + "requestBody": { + "required": true, + "description": "Group fields to update - all fields optional except id", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateGroupDto" + }, + "example": { + "id": 1, + "name": "string", + "description": "string", + "url": "string", + "removeAvatar": true, + "avatar": "string", + "country": "string", + "public": null + } + } + } + }, + "responses": { + "200": { + "description": "Group updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "room": { + "type": "object" + } + } + }, + "example": { + "success": true, + "room": {} + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "403": { + "description": "User not authorized to update this group" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + }, + "post": { + "operationId": "RoomsController_createNewGroup", + "summary": "Create a new group", + "description": "Create a new community group for sharing reflections. Groups can be public or private, and the creator becomes the owner.", + "parameters": [], + "requestBody": { + "required": true, + "description": "Group creation details including name, description, URL, and visibility", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateGroupDto" + }, + "example": { + "name": "string", + "description": "string", + "url": "string", + "public": true + } + } + } + }, + "responses": { + "201": { + "description": "Group created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoomCreatedResponseDto" + }, + "example": { + "success": true, + "data": { + "id": 1, + "name": "string", + "description": "string", + "roomType": "string", + "isActive": true, + "isVerified": true, + "isPublic": true, + "isOwner": true, + "isAdmin": true, + "ownerId": "string", + "postsCount": 1, + "membersCount": 1, + "url": "string", + "avatarUrls": { + "thumb": "string", + "original": "string" + }, + "createdAt": "2026-04-02T00:00:00.000Z", + "isMember": true, + "subdomain": "string", + "country": "string" + } + } + } + } + }, + "400": { + "description": "Invalid group data or URL already taken" + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/pages": { + "patch": { + "operationId": "RoomsController_updatePage", + "summary": "Update a page", + "description": "Update page properties like name, description, contact info, organization details, or visibility. Only page admins/owners can update.", + "parameters": [], + "requestBody": { + "required": true, + "description": "Page fields to update - all fields optional except id", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePageDto" + }, + "example": { + "id": 1, + "removeAvatar": true, + "avatar": "string", + "public": null, + "name": "string", + "description": "string", + "organizationWebsite": "string", + "country": "string", + "url": "string" + } + } + } + }, + "responses": { + "200": { + "description": "Page updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "room": { + "type": "object" + } + } + }, + "example": { + "success": true, + "room": {} + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "403": { + "description": "User not authorized to update this page" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + }, + "post": { + "operationId": "RoomsController_createNewPage", + "summary": "Create a new page", + "description": "Submit a request to create a new organizational page. Pages require admin approval and include organization details, contact info, and purpose statement.", + "parameters": [], + "requestBody": { + "required": true, + "description": "Page creation details including name, description, URL, organization info, and purpose", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePageDto" + }, + "example": { + "name": "string", + "description": "string", + "jobTitle": "string", + "contactNumber": "string", + "organizationName": "string", + "organizationWebsite": "string", + "purpose": "string", + "additionalDetails": "string", + "country": "string", + "url": "string", + "public": true + } + } + } + }, + "responses": { + "201": { + "description": "Page request submitted for admin review", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "data": { + "type": "object" + }, + "message": { + "type": "string" + } + } + }, + "example": { + "success": true, + "data": {}, + "message": "string" + } + } + } + }, + "400": { + "description": "Invalid page data or URL already taken" + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/{id}/members": { + "get": { + "operationId": "RoomsController_getRoomMembers", + "summary": "Get room members", + "description": "Retrieve paginated list of members in a room (group or page). Returns user profiles with their roles.", + "parameters": [ + { + "name": "limit", + "required": false, + "in": "query", + "description": "Members per page (default: 10)", + "schema": { + "type": "number" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number (default: 1)", + "schema": { + "type": "number" + } + }, + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric room ID", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Room members retrieved with pagination", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoomMembersResponseDto" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "id": "user-1", + "username": "member.username", + "firstName": "Member", + "lastName": "User", + "verified": true, + "avatarUrls": { + "small": "https://avatars.quran.foundation/users/user-1/small.png", + "medium": "https://avatars.quran.foundation/users/user-1/medium.png", + "large": "https://avatars.quran.foundation/users/user-1/large.png" + }, + "isAdmin": false, + "isOwner": false, + "isFollowed": true, + "isActive": true, + "followersCount": 42 + } + ] + } + } + } + }, + "404": { + "description": "Room not found" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/{id}/invite": { + "post": { + "operationId": "RoomsController_inviteUserToRoom", + "summary": "Invite user to room", + "description": "Send an invitation to a user to join the room. User will receive a notification/email with an invite link. Only admins can invite.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric room ID", + "schema": { + "type": "number" + } + } + ], + "requestBody": { + "required": true, + "description": "User identification for invitation (email or userId)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InviteUserDto" + }, + "example": { + "userIds": [ + "string" + ], + "emails": [ + "string" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Invitation sent successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoomInviteUserResponseDto" + }, + "example": { + "invited": true, + "inviteStatus": { + "user-123": true, + "user-456": "already_a_member" + } + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "403": { + "description": "User not authorized to invite members" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/{id}/accept-invite": { + "get": { + "operationId": "RoomsController_acceptInvite", + "summary": "Accept room invite", + "description": "Accept an invitation to join a room using the token from the invite link. Adds user as member.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric room ID", + "schema": { + "type": "number" + } + }, + { + "name": "token", + "required": true, + "in": "query", + "description": "Invitation token from invite link", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Invitation accepted - user is now a member", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoomInviteAcceptedResponseDto" + }, + "example": { + "accepted": true + } + } + } + }, + "400": { + "description": "Invalid or expired token" + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/{id}/reject-invite": { + "get": { + "operationId": "RoomsController_rejectInvite", + "summary": "Reject room invite", + "description": "Decline an invitation to join a room. Invalidates the invite token.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric room ID", + "schema": { + "type": "number" + } + }, + { + "name": "token", + "required": true, + "in": "query", + "description": "Invitation token from invite link", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Invitation rejected", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoomInviteRejectedResponseDto" + }, + "example": { + "rejected": true + } + } + } + }, + "400": { + "description": "Invalid or expired token" + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/{id}/members/{userId}": { + "delete": { + "operationId": "RoomsController_removeMember", + "summary": "Remove member from room", + "description": "Remove a user from a room (group or page). Only admins can remove other members. Users can remove themselves.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric room ID", + "schema": { + "type": "number" + } + }, + { + "name": "userId", + "required": true, + "in": "path", + "description": "UUID of the user to remove", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Member removed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + }, + "example": { + "success": true + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "403": { + "description": "User not authorized to remove this member" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/joined-rooms": { + "get": { + "operationId": "RoomsController_getRooms", + "summary": "Get joined or managed rooms", + "description": "Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-rooms). Supports search and pagination.", + "parameters": [ + { + "name": "query", + "required": false, + "in": "query", + "description": "Search query for room names", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number (default: 1)", + "schema": { + "minimum": 1, + "default": 1, + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Rooms per page (default: 5)", + "schema": { + "minimum": 1, + "maximum": 5, + "default": 5, + "type": "number" + } + }, + { + "name": "sortBy", + "required": false, + "in": "query", + "description": "Sort order (default: NAME_ASC)", + "schema": { + "enum": [ + "NAME_ASC", + "NAME_DESC", + "LATEST_ACTIVITY" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Rooms retrieved with pagination", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedRoomsResponseDto" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "id": 1, + "name": "string", + "description": "string", + "roomType": "string", + "isActive": true, + "isVerified": true, + "isPublic": true, + "isOwner": true, + "isAdmin": true, + "ownerId": "string", + "postsCount": 1, + "membersCount": 1, + "url": "string", + "avatarUrls": { + "thumb": "string", + "original": "string" + }, + "createdAt": "2026-04-02T00:00:00.000Z", + "isMember": true, + "subdomain": "string", + "country": "string" + } + ] + } + } + } + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/managed-rooms": { + "get": { + "operationId": "RoomsController_getRooms", + "summary": "Get joined or managed rooms", + "description": "Retrieve rooms the user has joined (joined-rooms) or manages as admin (managed-rooms). Supports search and pagination.", + "parameters": [ + { + "name": "query", + "required": false, + "in": "query", + "description": "Search query for room names", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number (default: 1)", + "schema": { + "minimum": 1, + "default": 1, + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Rooms per page (default: 5)", + "schema": { + "minimum": 1, + "maximum": 5, + "default": 5, + "type": "number" + } + }, + { + "name": "sortBy", + "required": false, + "in": "query", + "description": "Sort order (default: NAME_ASC)", + "schema": { + "enum": [ + "NAME_ASC", + "NAME_DESC", + "LATEST_ACTIVITY" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Rooms retrieved with pagination", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedRoomsResponseDto" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "id": 1, + "name": "string", + "description": "string", + "roomType": "string", + "isActive": true, + "isVerified": true, + "isPublic": true, + "isOwner": true, + "isAdmin": true, + "ownerId": "string", + "postsCount": 1, + "membersCount": 1, + "url": "string", + "avatarUrls": { + "thumb": "string", + "original": "string" + }, + "createdAt": "2026-04-02T00:00:00.000Z", + "isMember": true, + "subdomain": "string", + "country": "string" + } + ] + } + } + } + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/search": { + "get": { + "operationId": "RoomsController_searchRooms", + "summary": "Search rooms", + "description": "Search for public groups and pages by name or description. Results can be filtered by room type.", + "parameters": [ + { + "name": "query", + "required": false, + "in": "query", + "description": "Search term for room name/description", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number (default: 1)", + "schema": { + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Results per page (default: 10)", + "schema": { + "type": "number" + } + }, + { + "name": "roomType", + "required": false, + "in": "query", + "description": "Filter by room type: GROUP or PAGE", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Matching rooms with pagination", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedRoomsResponseDto" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "id": 1, + "name": "string", + "description": "string", + "roomType": "string", + "isActive": true, + "isVerified": true, + "isPublic": true, + "isOwner": true, + "isAdmin": true, + "ownerId": "string", + "postsCount": 1, + "membersCount": 1, + "url": "string", + "avatarUrls": { + "thumb": "string", + "original": "string" + }, + "createdAt": "2026-04-02T00:00:00.000Z", + "isMember": true, + "subdomain": "string", + "country": "string" + } + ] + } + } + } + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/group/{url}": { + "get": { + "operationId": "RoomsController_getRoomProfile", + "summary": "Get room profile by URL or subdomain", + "description": "Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Returns room details, member counts, and relationship status.", + "parameters": [ + { + "name": "url", + "required": false, + "in": "path", + "description": "Group URL identifier (lowercase)", + "schema": { + "type": "string" + } + }, + { + "name": "subdomain", + "required": false, + "in": "path", + "description": "Page subdomain identifier (lowercase)", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Room profile with details and membership info", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoomProfileResponseDto" + }, + "example": { + "privateToken": "private-room-token", + "mutualFollowers": [ + { + "avatarUrls": { + "small": "https://avatars.githubusercontent.com/u/12345678", + "medium": "https://avatars.githubusercontent.com/u/12345678", + "large": "https://avatars.githubusercontent.com/u/12345678" + }, + "createdAt": "2000-01-21 00:00:00", + "joiningYear": 2025, + "isPasswordSet": true, + "settings": { + "ayahLanguages": [ + 1 + ], + "reflectionLanguages": [ + 1 + ] + }, + "username": "string", + "id": "string", + "verified": false, + "postAs": false, + "firstName": "string", + "lastName": "string", + "postsCount": 0, + "averageToxicity": 0, + "languageId": 1, + "banned": false, + "memberType": 1, + "followersCount": 0, + "likesCount": 0, + "isAdmin": false, + "languageIsoCode": "en", + "bio": "string", + "country": "string", + "followed": true + } + ], + "mutualFollowersCount": 2, + "id": 1, + "name": "string", + "description": "string", + "roomType": "string", + "isActive": true, + "isVerified": true, + "isPublic": true, + "isOwner": true, + "isAdmin": true, + "ownerId": "string", + "postsCount": 1, + "membersCount": 1, + "url": "string", + "avatarUrls": { + "thumb": "string", + "original": "string" + }, + "createdAt": "2026-04-02T00:00:00.000Z", + "isMember": true, + "subdomain": "string", + "country": "string" + } + } + } + }, + "404": { + "description": "Room not found" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/page/{subdomain}": { + "get": { + "operationId": "RoomsController_getRoomProfile", + "summary": "Get room profile by URL or subdomain", + "description": "Retrieve a room profile by its unique URL (for groups) or subdomain (for pages). Returns room details, member counts, and relationship status.", + "parameters": [ + { + "name": "url", + "required": false, + "in": "path", + "description": "Group URL identifier (lowercase)", + "schema": { + "type": "string" + } + }, + { + "name": "subdomain", + "required": false, + "in": "path", + "description": "Page subdomain identifier (lowercase)", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Room profile with details and membership info", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoomProfileResponseDto" + }, + "example": { + "privateToken": "private-room-token", + "mutualFollowers": [ + { + "avatarUrls": { + "small": "https://avatars.githubusercontent.com/u/12345678", + "medium": "https://avatars.githubusercontent.com/u/12345678", + "large": "https://avatars.githubusercontent.com/u/12345678" + }, + "createdAt": "2000-01-21 00:00:00", + "joiningYear": 2025, + "isPasswordSet": true, + "settings": { + "ayahLanguages": [ + 1 + ], + "reflectionLanguages": [ + 1 + ] + }, + "username": "string", + "id": "string", + "verified": false, + "postAs": false, + "firstName": "string", + "lastName": "string", + "postsCount": 0, + "averageToxicity": 0, + "languageId": 1, + "banned": false, + "memberType": 1, + "followersCount": 0, + "likesCount": 0, + "isAdmin": false, + "languageIsoCode": "en", + "bio": "string", + "country": "string", + "followed": true + } + ], + "mutualFollowersCount": 2, + "id": 1, + "name": "string", + "description": "string", + "roomType": "string", + "isActive": true, + "isVerified": true, + "isPublic": true, + "isOwner": true, + "isAdmin": true, + "ownerId": "string", + "postsCount": 1, + "membersCount": 1, + "url": "string", + "avatarUrls": { + "thumb": "string", + "original": "string" + }, + "createdAt": "2026-04-02T00:00:00.000Z", + "isMember": true, + "subdomain": "string", + "country": "string" + } + } + } + }, + "404": { + "description": "Room not found" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/group/{url}/accept/{token}": { + "get": { + "operationId": "RoomsController_acceptByPrivateToken", + "summary": "Accept room invite by private token", + "description": "Accept an invitation using a private room URL with embedded token. Alternative to the /accept-invite endpoint for direct link access.", + "parameters": [ + { + "name": "url", + "required": false, + "in": "path", + "description": "Group URL identifier", + "schema": { + "type": "string" + } + }, + { + "name": "subdomain", + "required": false, + "in": "path", + "description": "Page subdomain identifier", + "schema": { + "type": "string" + } + }, + { + "name": "token", + "required": true, + "in": "path", + "description": "Private invitation token", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Invitation accepted - user added to room", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoomAcceptByPrivateTokenResponseDto" + }, + "example": { + "roomId": 42, + "success": true, + "isNewMember": true + } + } + } + }, + "400": { + "description": "Invalid or expired token" + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/page/{subdomain}/accept/{token}": { + "get": { + "operationId": "RoomsController_acceptByPrivateToken", + "summary": "Accept room invite by private token", + "description": "Accept an invitation using a private room URL with embedded token. Alternative to the /accept-invite endpoint for direct link access.", + "parameters": [ + { + "name": "url", + "required": false, + "in": "path", + "description": "Group URL identifier", + "schema": { + "type": "string" + } + }, + { + "name": "subdomain", + "required": false, + "in": "path", + "description": "Page subdomain identifier", + "schema": { + "type": "string" + } + }, + { + "name": "token", + "required": true, + "in": "path", + "description": "Private invitation token", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Invitation accepted - user added to room", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoomAcceptByPrivateTokenResponseDto" + }, + "example": { + "roomId": 42, + "success": true, + "isNewMember": true + } + } + } + }, + "400": { + "description": "Invalid or expired token" + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/{id}": { + "get": { + "operationId": "RoomsController_getRoomProfileById", + "summary": "Get room profile by ID", + "description": "Retrieve a room profile by its unique numeric ID. Returns room details, member counts, and relationship status for the current user.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric room ID", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Room profile retrieved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoomProfileResponseDto" + }, + "example": { + "privateToken": "private-room-token", + "mutualFollowers": [ + { + "avatarUrls": { + "small": "https://avatars.githubusercontent.com/u/12345678", + "medium": "https://avatars.githubusercontent.com/u/12345678", + "large": "https://avatars.githubusercontent.com/u/12345678" + }, + "createdAt": "2000-01-21 00:00:00", + "joiningYear": 2025, + "isPasswordSet": true, + "settings": { + "ayahLanguages": [ + 1 + ], + "reflectionLanguages": [ + 1 + ] + }, + "username": "string", + "id": "string", + "verified": false, + "postAs": false, + "firstName": "string", + "lastName": "string", + "postsCount": 0, + "averageToxicity": 0, + "languageId": 1, + "banned": false, + "memberType": 1, + "followersCount": 0, + "likesCount": 0, + "isAdmin": false, + "languageIsoCode": "en", + "bio": "string", + "country": "string", + "followed": true + } + ], + "mutualFollowersCount": 2, + "id": 1, + "name": "string", + "description": "string", + "roomType": "string", + "isActive": true, + "isVerified": true, + "isPublic": true, + "isOwner": true, + "isAdmin": true, + "ownerId": "string", + "postsCount": 1, + "membersCount": 1, + "url": "string", + "avatarUrls": { + "thumb": "string", + "original": "string" + }, + "createdAt": "2026-04-02T00:00:00.000Z", + "isMember": true, + "subdomain": "string", + "country": "string" + } + } + } + }, + "404": { + "description": "Room not found" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/{id}/posts": { + "get": { + "operationId": "RoomsController_getRoomPosts", + "summary": "Get room posts", + "description": "Retrieve paginated posts shared within a room. Supports filtering by tab (REFLECTIONS, DISCUSSIONS) and sorting (LATEST, POPULAR).", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric room ID", + "schema": { + "type": "number" + } + }, + { + "name": "sortBy", + "required": false, + "in": "query", + "description": "Sort order (default: latest)", + "schema": { + "enum": [ + "latest", + "popular" + ], + "type": "string" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Posts per page (max: 20)", + "schema": { + "minimum": 1, + "maximum": 20, + "default": 20, + "type": "number" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number (default: 1)", + "schema": { + "minimum": 1, + "default": 1, + "type": "number" + } + }, + { + "name": "tab", + "required": false, + "in": "query", + "description": "Filter posts by content type", + "schema": { + "enum": [ + "reflections", + "saved", + "public", + "members_only" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Room posts with pagination", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedResponseDto" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "tags": [ + { + "language": "string", + "id": 1, + "name": "string" + } + ], + "references": [ + { + "id": "string", + "from": 1, + "to": 1, + "chapterId": 1 + } + ], + "author": {}, + "recentComment": { + "id": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z" + }, + "room": { + "isAdmin": {}, + "isOwner": {}, + "isPublic": {}, + "id": 1, + "subdomain": "string", + "roomType": "string", + "verified": false, + "name": "string", + "_group": "string" + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "isLiked": true, + "isByFollowedUser": true, + "isCommentedOn": true, + "isSaved": true, + "id": 1, + "authorId": "string", + "body": "string", + "discussionId": 1, + "draft": false, + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "publishedAt": "2026-04-02T00:00:00.000Z", + "global": true, + "toxicityScore": 1, + "reported": false, + "views": 1, + "removed": false, + "verified": false, + "roomPostStatus": 0, + "hidden": false, + "commentsCount": 0, + "likesCount": 0, + "viewsCount": 0, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "reviewedAt": "2026-04-02T00:00:00.000Z", + "featuredAt": "2026-04-02T00:00:00.000Z", + "estimatedReadingTime": 0, + "roomId": 1, + "postTypeId": 1, + "postTypeName": "string" + } + ] + } + } + } + }, + "404": { + "description": "Room not found" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/{groupId}/join": { + "post": { + "operationId": "RoomsController_joinRoom", + "summary": "Join a group", + "description": "Join a public group as a member. For private groups, an invitation is required. Returns whether the join was successful.", + "parameters": [ + { + "name": "groupId", + "required": true, + "in": "path", + "description": "Unique numeric group ID", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Successfully joined the group", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "joined": { + "type": "boolean", + "example": true + } + } + }, + "example": { + "joined": true + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "403": { + "description": "Group is private - invitation required" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/{groupId}/leave": { + "post": { + "operationId": "RoomsController_leaveGroup", + "summary": "Leave a group", + "description": "Leave a group the user is currently a member of. Owners cannot leave - they must transfer ownership first.", + "parameters": [ + { + "name": "groupId", + "required": true, + "in": "path", + "description": "Unique numeric group ID", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Successfully left the group", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "left": { + "type": "boolean", + "example": true + } + } + }, + "example": { + "left": true + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "403": { + "description": "Owner cannot leave - transfer ownership first" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/{pageId}/follow": { + "post": { + "operationId": "RoomsController_followPage", + "summary": "Follow a page", + "description": "Follow an organizational page to see their posts in your feed. Pages represent verified organizations or scholars.", + "parameters": [ + { + "name": "pageId", + "required": true, + "in": "path", + "description": "Unique numeric page ID", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Successfully followed the page", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "followed": { + "type": "boolean", + "example": true + } + } + }, + "example": { + "followed": true + } + } + } + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/{pageId}/unfollow": { + "post": { + "operationId": "RoomsController_unfollowPage", + "summary": "Unfollow a page", + "description": "Stop following a page. Their posts will no longer appear in your personalized feed.", + "parameters": [ + { + "name": "pageId", + "required": true, + "in": "path", + "description": "Unique numeric page ID", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Successfully unfollowed the page", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "unfollowed": { + "type": "boolean", + "example": true + } + } + }, + "example": { + "unfollowed": true + } + } + } + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/rooms/{roomId}/posts/{postId}/privacy": { + "patch": { + "operationId": "RoomsController_updatePostPrivacy", + "summary": "Update post privacy in room", + "description": "Change the visibility of a post within a room. Toggle between public (visible outside room) and private (members only). Only admins can modify.", + "parameters": [ + { + "name": "roomId", + "required": true, + "in": "path", + "description": "Unique numeric room ID", + "schema": { + "type": "number" + } + }, + { + "name": "postId", + "required": true, + "in": "path", + "description": "Unique numeric post ID", + "schema": { + "type": "number" + } + } + ], + "requestBody": { + "required": true, + "description": "Privacy setting with isPublic boolean", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoomPostUpdatePrivacyDto" + }, + "example": { + "isPublic": true + } + } + } + }, + "responses": { + "200": { + "description": "Post privacy updated successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostSerialized" + }, + "example": { + "tags": [ + { + "language": "string", + "id": 1, + "name": "string" + } + ], + "references": [ + { + "id": "string", + "from": 1, + "to": 1, + "chapterId": 1 + } + ], + "author": {}, + "recentComment": { + "id": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z" + }, + "room": { + "isAdmin": {}, + "isOwner": {}, + "isPublic": {}, + "id": 1, + "subdomain": "string", + "roomType": "string", + "verified": false, + "name": "string", + "_group": "string" + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "isLiked": true, + "isByFollowedUser": true, + "isCommentedOn": true, + "isSaved": true, + "id": 1, + "authorId": "string", + "body": "string", + "discussionId": 1, + "draft": false, + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "publishedAt": "2026-04-02T00:00:00.000Z", + "global": true, + "toxicityScore": 1, + "reported": false, + "views": 1, + "removed": false, + "verified": false, + "roomPostStatus": 0, + "hidden": false, + "commentsCount": 0, + "likesCount": 0, + "viewsCount": 0, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "reviewedAt": "2026-04-02T00:00:00.000Z", + "featuredAt": "2026-04-02T00:00:00.000Z", + "estimatedReadingTime": 0, + "roomId": 1, + "postTypeId": 1, + "postTypeName": "string" + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "403": { + "description": "User not authorized to modify post privacy" + }, + "404": { + "description": "Room or post not found" + } + }, + "tags": [ + "Rooms" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/feed": { + "get": { + "operationId": "PostsController_feed", + "summary": "Get posts feed", + "description": "Retrieve a paginated feed of Quran Reflect posts, including reflections and lessons. Supports filtering by authors, tags, Quran references, groups, pages, and post types. Response items include engagement metadata such as `likesCount`, `commentsCount`, and `recentComment` when available. Use the dedicated comment endpoints to retrieve comment objects and totals. For ayah-by-ayah reads, use `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`, and use `filter[postTypeIds]=1` for reflections or `filter[postTypeIds]=2` for lessons.", + "parameters": [ + { + "name": "tab", + "required": false, + "in": "query", + "description": "Feed tab type. `feed` shows personalized content, `trending` shows explore, and `following` shows posts from followed users.", + "schema": { + "type": "string", + "enum": [ + "newest", + "latest", + "following", + "draft", + "favorite", + "most_popular", + "only_room_members", + "public", + "feed", + "trending", + "popular" + ] + } + }, + { + "name": "languages", + "required": false, + "in": "query", + "style": "form", + "explode": false, + "description": "Comma-separated list of language IDs to filter posts by reflection language, for example `languages=1,2`.", + "schema": { + "type": "array", + "items": { + "type": "number" + }, + "example": [ + 1, + 2 + ] + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number for pagination (default: 1).", + "schema": { + "minimum": 1, + "default": 1, + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Number of posts per page (default: 20).", + "schema": { + "minimum": 1, + "default": 20, + "type": "number" + } + }, + { + "name": "filter[verifiedOnly]", + "required": false, + "in": "query", + "description": "Whether to limit the feed to verified contributors. Public ayah-by-ayah reads typically combine this with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.", + "schema": { + "type": "boolean", + "default": false, + "example": true + } + }, + { + "name": "filter[referencesOperator]", + "required": false, + "in": "query", + "description": "Operator applied to multiple Quran reference filters.", + "schema": { + "type": "string", + "enum": [ + "OR", + "AND" + ] + } + }, + { + "name": "filter[tagsOperator]", + "required": false, + "in": "query", + "description": "Operator applied to multiple tag filters.", + "schema": { + "type": "string", + "enum": [ + "OR", + "AND" + ] + } + }, + { + "name": "filter[postTypeIds]", + "required": false, + "in": "query", + "style": "form", + "explode": false, + "description": "Comma-separated Quran Reflect post type IDs. Use `1` for reflections and `2` for lessons.", + "schema": { + "type": "array", + "items": { + "type": "number" + }, + "example": [ + 1, + 2 + ] + } + }, + { + "name": "filter[pages]", + "required": false, + "in": "query", + "style": "form", + "explode": false, + "description": "Comma-separated list of page subdomains to include.", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "quran-reflections", + "khutbahapp" + ] + } + }, + { + "name": "filter[groups]", + "required": false, + "in": "query", + "style": "form", + "explode": false, + "description": "Comma-separated list of group URLs to include.", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "my-group", + "ramadan-circle" + ] + } + }, + { + "name": "filter[references][0][to]", + "required": false, + "in": "query", + "description": "Ending ayah number for reference filter index `0`. For a single ayah, use the same value as `from`.", + "schema": { + "type": "number", + "minimum": 1, + "example": 255 + } + }, + { + "name": "filter[references][0][from]", + "required": false, + "in": "query", + "description": "Starting ayah number for reference filter index `0`. Pair with the matching `chapterId` and `to` values.", + "schema": { + "type": "number", + "minimum": 1, + "example": 255 + } + }, + { + "name": "filter[references][0][chapterId]", + "required": false, + "in": "query", + "description": "Reference filter example for index `0`. Use additional indices such as `filter[references][1][chapterId]` for more references.", + "schema": { + "type": "number", + "minimum": 1, + "example": 2 + } + }, + { + "name": "filter[tags]", + "required": false, + "in": "query", + "style": "form", + "explode": false, + "description": "Comma-separated list of tag values to include.", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "ramadan", + "patience" + ] + } + }, + { + "name": "filter[authors]", + "required": false, + "in": "query", + "style": "form", + "explode": false, + "description": "Comma-separated list of author identifiers to include.", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "user-1", + "user-2" + ] + } + } + ], + "responses": { + "200": { + "description": "Feed retrieved successfully with paginated posts", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedResponseDto" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "tags": [ + { + "language": "string", + "id": 1, + "name": "string" + } + ], + "references": [ + { + "id": "string", + "from": 1, + "to": 1, + "chapterId": 1 + } + ], + "author": {}, + "recentComment": { + "id": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z" + }, + "room": { + "isAdmin": {}, + "isOwner": {}, + "isPublic": {}, + "id": 1, + "subdomain": "string", + "roomType": "string", + "verified": false, + "name": "string", + "_group": "string" + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "isLiked": true, + "isByFollowedUser": true, + "isCommentedOn": true, + "isSaved": true, + "id": 1, + "authorId": "string", + "body": "string", + "discussionId": 1, + "draft": false, + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "publishedAt": "2026-04-02T00:00:00.000Z", + "global": true, + "toxicityScore": 1, + "reported": false, + "views": 1, + "removed": false, + "verified": false, + "roomPostStatus": 0, + "hidden": false, + "commentsCount": 0, + "likesCount": 0, + "viewsCount": 0, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "reviewedAt": "2026-04-02T00:00:00.000Z", + "featuredAt": "2026-04-02T00:00:00.000Z", + "estimatedReadingTime": 0, + "roomId": 1, + "postTypeId": 1, + "postTypeName": "string" + } + ] + } + } + } + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/{postId}/related": { + "get": { + "operationId": "PostsController_getRelatedPosts", + "summary": "Get related posts", + "description": "Retrieve posts related to a given post by matching its Quran references with OR logic. Results are filtered by language preferences and ordered by popularity, excluding the source post.", + "parameters": [ + { + "name": "postId", + "required": true, + "in": "path", + "description": "Source post ID used for related-post matching", + "schema": { + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Number of posts per page (default: 8, max: 8)", + "schema": { + "type": "number" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number for pagination (default: 1)", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Related posts retrieved successfully with pagination metadata", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedResponseDto" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "tags": [ + { + "language": "string", + "id": 1, + "name": "string" + } + ], + "references": [ + { + "id": "string", + "from": 1, + "to": 1, + "chapterId": 1 + } + ], + "author": {}, + "recentComment": { + "id": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z" + }, + "room": { + "isAdmin": {}, + "isOwner": {}, + "isPublic": {}, + "id": 1, + "subdomain": "string", + "roomType": "string", + "verified": false, + "name": "string", + "_group": "string" + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "isLiked": true, + "isByFollowedUser": true, + "isCommentedOn": true, + "isSaved": true, + "id": 1, + "authorId": "string", + "body": "string", + "discussionId": 1, + "draft": false, + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "publishedAt": "2026-04-02T00:00:00.000Z", + "global": true, + "toxicityScore": 1, + "reported": false, + "views": 1, + "removed": false, + "verified": false, + "roomPostStatus": 0, + "hidden": false, + "commentsCount": 0, + "likesCount": 0, + "viewsCount": 0, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "reviewedAt": "2026-04-02T00:00:00.000Z", + "featuredAt": "2026-04-02T00:00:00.000Z", + "estimatedReadingTime": 0, + "roomId": 1, + "postTypeId": 1, + "postTypeName": "string" + } + ] + } + } + } + }, + "404": { + "description": "Source post not found" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/my-posts": { + "get": { + "operationId": "PostsController_getLoggedinUserPosts", + "summary": "Get current user posts", + "description": "Retrieve posts created by the currently authenticated user. Supports filtering by tab (MY_REFLECTIONS, SAVED, DRAFTS), sorting options, and post type filtering.", + "parameters": [ + { + "name": "tab", + "required": false, + "in": "query", + "description": "Profile tab filter (default: my_reflections)", + "schema": { + "enum": [ + "my_reflections", + "saved", + "notes", + "mentions" + ], + "type": "string" + } + }, + { + "name": "sortBy", + "required": false, + "in": "query", + "description": "Sort order for posts (default: latest)", + "schema": { + "enum": [ + "latest", + "popular" + ], + "type": "string" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Number of posts per page (default: 20, max: 20)", + "schema": { + "minimum": 1, + "maximum": 20, + "default": 20, + "type": "number" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number for pagination (default: 1)", + "schema": { + "minimum": 1, + "default": 1, + "type": "number" + } + }, + { + "name": "postTypeIds", + "required": false, + "in": "query", + "description": "Array of post type IDs to filter by", + "schema": { + "type": "array", + "items": { + "type": "number" + } + } + } + ], + "responses": { + "200": { + "description": "User posts retrieved successfully with pagination metadata", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedResponseDto" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "tags": [ + { + "language": "string", + "id": 1, + "name": "string" + } + ], + "references": [ + { + "id": "string", + "from": 1, + "to": 1, + "chapterId": 1 + } + ], + "author": {}, + "recentComment": { + "id": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z" + }, + "room": { + "isAdmin": {}, + "isOwner": {}, + "isPublic": {}, + "id": 1, + "subdomain": "string", + "roomType": "string", + "verified": false, + "name": "string", + "_group": "string" + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "isLiked": true, + "isByFollowedUser": true, + "isCommentedOn": true, + "isSaved": true, + "id": 1, + "authorId": "string", + "body": "string", + "discussionId": 1, + "draft": false, + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "publishedAt": "2026-04-02T00:00:00.000Z", + "global": true, + "toxicityScore": 1, + "reported": false, + "views": 1, + "removed": false, + "verified": false, + "roomPostStatus": 0, + "hidden": false, + "commentsCount": 0, + "likesCount": 0, + "viewsCount": 0, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "reviewedAt": "2026-04-02T00:00:00.000Z", + "featuredAt": "2026-04-02T00:00:00.000Z", + "estimatedReadingTime": 0, + "roomId": 1, + "postTypeId": 1, + "postTypeName": "string" + } + ] + } + } + } + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/{id}/liked": { + "get": { + "operationId": "PostsController_getLikedState", + "summary": "Get post liked state", + "description": "Returns whether the authenticated user currently likes the post. This lightweight endpoint avoids loading the full post payload for simple like-state checks.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric post ID to check liked state for", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Like state retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "liked": { + "type": "boolean", + "description": "true when the post is liked by the current user" + } + } + }, + "example": { + "liked": true + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "404": { + "description": "Post not found" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/{id}": { + "get": { + "operationId": "PostsController_findOne", + "summary": "Get post by ID", + "description": "Retrieve a specific post by its unique numeric ID. Returns the full post with author details, tags, references, room information, and engagement metrics. Admins can view additional moderation details.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric post ID", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Post found and returned with all associated data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostSerialized" + }, + "example": { + "tags": [ + { + "language": "string", + "id": 1, + "name": "string" + } + ], + "references": [ + { + "id": "string", + "from": 1, + "to": 1, + "chapterId": 1 + } + ], + "author": {}, + "recentComment": { + "id": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z" + }, + "room": { + "isAdmin": {}, + "isOwner": {}, + "isPublic": {}, + "id": 1, + "subdomain": "string", + "roomType": "string", + "verified": false, + "name": "string", + "_group": "string" + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "isLiked": true, + "isByFollowedUser": true, + "isCommentedOn": true, + "isSaved": true, + "id": 1, + "authorId": "string", + "body": "string", + "discussionId": 1, + "draft": false, + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "publishedAt": "2026-04-02T00:00:00.000Z", + "global": true, + "toxicityScore": 1, + "reported": false, + "views": 1, + "removed": false, + "verified": false, + "roomPostStatus": 0, + "hidden": false, + "commentsCount": 0, + "likesCount": 0, + "viewsCount": 0, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "reviewedAt": "2026-04-02T00:00:00.000Z", + "featuredAt": "2026-04-02T00:00:00.000Z", + "estimatedReadingTime": 0, + "roomId": 1, + "postTypeId": 1, + "postTypeName": "string" + } + } + } + }, + "404": { + "description": "Post not found or has been deleted" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + }, + "delete": { + "operationId": "PostsController_delete", + "summary": "Delete post", + "description": "Soft-delete a post by marking it as removed. Only the post author or admins can delete posts. Related engagement counts (likes, comments, saves) update asynchronously via background jobs, so metrics may briefly lag.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric post ID to delete", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Post deletion accepted and queued for processing", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + }, + "example": { + "success": true + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "403": { + "description": "User not authorized to delete this post" + }, + "404": { + "description": "Post not found" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + }, + "patch": { + "operationId": "PostsController_edit", + "summary": "Edit post", + "description": "Update an existing post. Only the post author or admins can edit. Supports updating body, references, mentions, draft status, and room visibility settings.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric post ID to update", + "schema": { + "type": "number" + } + } + ], + "requestBody": { + "required": true, + "description": "Partial post data to update - only include fields to change", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePostDto" + }, + "example": { + "roomPostStatus": 0, + "body": "string", + "draft": true, + "references": [ + { + "chapterId": 1, + "from": 0, + "to": 0 + } + ], + "mentions": [ + { + "marker": "{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}", + "userId": "string", + "displayName": "string" + } + ], + "roomId": 1, + "postAsAuthorId": "string", + "publishedAt": "2026-04-02T00:00:00.000Z" + } + } + } + }, + "responses": { + "200": { + "description": "Post updated successfully with the updated post data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostCreatedResponse" + }, + "example": { + "data": { + "tags": [ + { + "language": "string", + "id": 1, + "name": "string" + } + ], + "references": [ + { + "id": "string", + "from": 1, + "to": 1, + "chapterId": 1 + } + ], + "author": {}, + "recentComment": { + "id": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z" + }, + "room": { + "isAdmin": {}, + "isOwner": {}, + "isPublic": {}, + "id": 1, + "subdomain": "string", + "roomType": "string", + "verified": false, + "name": "string", + "_group": "string" + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "isLiked": true, + "isByFollowedUser": true, + "isCommentedOn": true, + "isSaved": true, + "id": 1, + "authorId": "string", + "body": "string", + "discussionId": 1, + "draft": false, + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "publishedAt": "2026-04-02T00:00:00.000Z", + "global": true, + "toxicityScore": 1, + "reported": false, + "views": 1, + "removed": false, + "verified": false, + "roomPostStatus": 0, + "hidden": false, + "commentsCount": 0, + "likesCount": 0, + "viewsCount": 0, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "reviewedAt": "2026-04-02T00:00:00.000Z", + "featuredAt": "2026-04-02T00:00:00.000Z", + "estimatedReadingTime": 0, + "roomId": 1, + "postTypeId": 1, + "postTypeName": "string" + }, + "success": true + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "403": { + "description": "User not authorized to edit this post" + }, + "404": { + "description": "Post not found" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/viewed/{id}": { + "get": { + "operationId": "PostsController_viewTracking", + "summary": "Track post view", + "description": "Record that a post has been viewed by the current user (if authenticated). Used for analytics and engagement tracking. Does not require authentication but will track user-specific views when logged in.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric post ID", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "View tracked successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + }, + "example": { + "success": true + } + } + } + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts": { + "post": { + "operationId": "PostsController_create", + "summary": "Create post", + "description": "Create a new post (reflection) with Quran references. Posts can be public, drafts, or associated with a room (group/page). Supports user mentions and multiple Quran verse references. Minimum body length is 6 characters.", + "parameters": [], + "requestBody": { + "required": true, + "description": "Post creation payload containing the post object with body, references, mentions, and visibility settings", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePostBodyDto" + }, + "example": { + "post": { + "roomPostStatus": 0, + "body": "string", + "draft": true, + "references": [ + { + "chapterId": 1, + "from": 0, + "to": 0 + } + ], + "mentions": [ + { + "marker": "{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}", + "userId": "string", + "displayName": "string" + } + ], + "roomId": 1, + "postAsAuthorId": "string", + "publishedAt": "2026-04-02T00:00:00.000Z" + } + } + } + } + }, + "responses": { + "201": { + "description": "Post created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostCreatedResponse" + }, + "example": { + "data": { + "tags": [ + { + "language": "string", + "id": 1, + "name": "string" + } + ], + "references": [ + { + "id": "string", + "from": 1, + "to": 1, + "chapterId": 1 + } + ], + "author": {}, + "recentComment": { + "id": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z" + }, + "room": { + "isAdmin": {}, + "isOwner": {}, + "isPublic": {}, + "id": 1, + "subdomain": "string", + "roomType": "string", + "verified": false, + "name": "string", + "_group": "string" + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "isLiked": true, + "isByFollowedUser": true, + "isCommentedOn": true, + "isSaved": true, + "id": 1, + "authorId": "string", + "body": "string", + "discussionId": 1, + "draft": false, + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "publishedAt": "2026-04-02T00:00:00.000Z", + "global": true, + "toxicityScore": 1, + "reported": false, + "views": 1, + "removed": false, + "verified": false, + "roomPostStatus": 0, + "hidden": false, + "commentsCount": 0, + "likesCount": 0, + "viewsCount": 0, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "reviewedAt": "2026-04-02T00:00:00.000Z", + "featuredAt": "2026-04-02T00:00:00.000Z", + "estimatedReadingTime": 0, + "roomId": 1, + "postTypeId": 1, + "postTypeName": "string" + }, + "success": true + } + } + } + }, + "400": { + "description": "Invalid post data - body too short, invalid references, or invalid room post status" + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/{id}/report": { + "post": { + "operationId": "PostsController_reportAbuse", + "summary": "Report post abuse", + "description": "Report a post for moderation review. Provide a reason for the report to help moderators evaluate the content. Multiple reports on the same post may trigger automatic review.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric post ID to report", + "schema": { + "type": "number" + } + } + ], + "requestBody": { + "required": true, + "description": "Report details including reason for flagging the content", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportAbuseBodyDto" + }, + "example": { + "report": { + "abuse": "string", + "comments": "" + } + } + } + } + }, + "responses": { + "200": { + "description": "Report submitted successfully for moderation review", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reported": { + "type": "boolean", + "example": true + } + } + }, + "example": { + "reported": true + } + } + } + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/user-posts/{id}": { + "get": { + "operationId": "PostsController_getUserPost", + "summary": "Get user posts", + "description": "Retrieve public posts created by a specific user. If viewing own posts while authenticated, returns all posts including drafts. Supports sorting and filtering by post type.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "UUID of the user whose posts to retrieve", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "required": false, + "in": "query", + "description": "Sort order for posts (default: latest)", + "schema": { + "enum": [ + "latest", + "popular" + ], + "type": "string" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Number of posts per page (default: 20, max: 20)", + "schema": { + "minimum": 1, + "maximum": 20, + "default": 20, + "type": "number" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number for pagination (default: 1)", + "schema": { + "minimum": 1, + "default": 1, + "type": "number" + } + }, + { + "name": "postTypeIds", + "required": false, + "in": "query", + "description": "Array of post type IDs to filter by", + "schema": { + "type": "array", + "items": { + "type": "number" + } + } + } + ], + "responses": { + "200": { + "description": "User posts retrieved with pagination metadata", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedResponseDto" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "tags": [ + { + "language": "string", + "id": 1, + "name": "string" + } + ], + "references": [ + { + "id": "string", + "from": 1, + "to": 1, + "chapterId": 1 + } + ], + "author": {}, + "recentComment": { + "id": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z" + }, + "room": { + "isAdmin": {}, + "isOwner": {}, + "isPublic": {}, + "id": 1, + "subdomain": "string", + "roomType": "string", + "verified": false, + "name": "string", + "_group": "string" + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "isLiked": true, + "isByFollowedUser": true, + "isCommentedOn": true, + "isSaved": true, + "id": 1, + "authorId": "string", + "body": "string", + "discussionId": 1, + "draft": false, + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "publishedAt": "2026-04-02T00:00:00.000Z", + "global": true, + "toxicityScore": 1, + "reported": false, + "views": 1, + "removed": false, + "verified": false, + "roomPostStatus": 0, + "hidden": false, + "commentsCount": 0, + "likesCount": 0, + "viewsCount": 0, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "reviewedAt": "2026-04-02T00:00:00.000Z", + "featuredAt": "2026-04-02T00:00:00.000Z", + "estimatedReadingTime": 0, + "roomId": 1, + "postTypeId": 1, + "postTypeName": "string" + } + ] + } + } + } + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/{id}/toggle-like": { + "post": { + "operationId": "PostsController_toggleLike", + "summary": "Toggle post like", + "description": "Toggle like status for a post. If already liked, removes the like. If not liked, adds a like. Updates the post like count and triggers notifications.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric post ID to like/unlike", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Like status toggled - returns new state", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "liked": { + "type": "boolean", + "description": "true if now liked, false if now unliked" + } + } + }, + "example": { + "liked": true + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "404": { + "description": "Post not found" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/{id}/toggle-save": { + "post": { + "operationId": "PostsController_toggleSave", + "summary": "Toggle post save", + "description": "Toggle save/bookmark status for a post. Saved posts appear in the SAVED tab of the user profile for easy access later.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric post ID to save/unsave", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Save status toggled - returns new state", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "saved": { + "type": "boolean", + "description": "true if now saved, false if now unsaved" + } + } + }, + "example": { + "saved": true + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "404": { + "description": "Post not found" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/{id}/comments": { + "get": { + "operationId": "PostsController_getComments", + "summary": "Get post comments", + "description": "Retrieve paginated top-level comments for a post. Use the replies endpoint to get nested replies for specific comments.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric post ID", + "schema": { + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Number of results to return", + "schema": { + "minimum": 1, + "maximum": 20, + "default": 20, + "type": "number" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number", + "schema": { + "minimum": 1, + "default": 1, + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Comments retrieved with pagination metadata", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostCommentsResponse" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "comments": [ + { + "id": 1, + "postId": 1, + "authorId": "string", + "parentId": 1, + "isPrivate": false, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "toxicityScore": 1, + "repliesCount": 0, + "likesCount": 0, + "reported": false, + "removed": false, + "hidden": false, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "tags": [ + { + "language": "string", + "id": 1, + "name": "string", + "commentsCount": 1 + } + ] + } + ] + } + } + } + }, + "404": { + "description": "Post not found" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/{id}/all-comments": { + "get": { + "operationId": "PostsController_getAllComment", + "summary": "Get all post comments", + "description": "Retrieve all comments for a post in a single request without pagination. Useful for displaying full comment threads or export scenarios.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric post ID", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "All comments returned with total count", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostAllCommentsResponse" + }, + "example": { + "comments": [ + { + "id": 1, + "postId": 1, + "authorId": "string", + "parentId": 1, + "isPrivate": false, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "toxicityScore": 1, + "repliesCount": 0, + "likesCount": 0, + "reported": false, + "removed": false, + "hidden": false, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "tags": [ + { + "language": "string", + "id": 1, + "name": "string", + "commentsCount": 1 + } + ] + } + ], + "total": "10 // works also with swagger setup" + } + } + } + }, + "404": { + "description": "Post not found" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/export/pdf": { + "post": { + "operationId": "PostsController_exportMultiplePosts", + "summary": "Export posts as PDF", + "description": "Generate a downloadable PDF document containing selected posts with their full content, Quran references, and author information. Ayah translations are rendered according to user language preferences.", + "parameters": [], + "requestBody": { + "required": true, + "description": "Array of post IDs to include in the PDF export (minimum 1)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExportPostsDto" + }, + "example": { + "ids": [ + 1, + 2, + 3 + ] + } + } + } + }, + "responses": { + "200": { + "description": "PDF file generated and returned as binary attachment", + "content": { + "application/pdf": { + "schema": { + "type": "string", + "format": "binary" + }, + "example": "string" + } + } + }, + "400": { + "description": "Invalid request - empty or invalid post IDs array" + }, + "401": { + "description": "User not authenticated" + }, + "404": { + "description": "No accessible posts found for the given IDs" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/count-within-range": { + "get": { + "operationId": "PostsController_getMyPostsCountWithinRange", + "summary": "Get posts count within range", + "description": "Count how many posts the current user has written for verses within a specified Quran verse range. Useful for reading goals and progress tracking.", + "parameters": [ + { + "name": "from", + "required": true, + "in": "query", + "description": "Start verse key in format chapter:verse (e.g., \"2:1\")", + "schema": { + "pattern": "VERSE_KEY_REGEX", + "example": "2:1", + "type": "string" + } + }, + { + "name": "to", + "required": true, + "in": "query", + "description": "End verse key in format chapter:verse (e.g., \"2:286\")", + "schema": { + "pattern": "VERSE_KEY_REGEX", + "example": "2:286", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Count of posts within the specified verse range", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "count": { + "type": "number", + "example": 5 + } + } + }, + "example": { + "count": 5 + } + } + } + }, + "400": { + "description": "Invalid verse range - malformed keys or from > to" + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/posts/by-verse/{verseKey}": { + "get": { + "operationId": "PostsController_getMyPostsByVerse", + "summary": "Get posts by verse", + "description": "Retrieve all posts written by the current user for a specific Quran verse. This endpoint requires a user-bound token and returns only the authenticated user's own posts. It is not part of the public `client_credentials`-compatible read subset; for public ayah-by-ayah reads, use `GET /v1/posts/feed` with indexed reference filters such as `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`.", + "parameters": [ + { + "name": "verseKey", + "required": true, + "in": "path", + "description": "Verse key in format chapter:verse", + "schema": { + "pattern": "VERSE_KEY_REGEX", + "example": "2:255", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "User posts for the specified verse", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedResponseDto" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "data": [ + { + "tags": [ + { + "language": "string", + "id": 1, + "name": "string" + } + ], + "references": [ + { + "id": "string", + "from": 1, + "to": 1, + "chapterId": 1 + } + ], + "author": {}, + "recentComment": { + "id": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z" + }, + "room": { + "isAdmin": {}, + "isOwner": {}, + "isPublic": {}, + "id": 1, + "subdomain": "string", + "roomType": "string", + "verified": false, + "name": "string", + "_group": "string" + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "isLiked": true, + "isByFollowedUser": true, + "isCommentedOn": true, + "isSaved": true, + "id": 1, + "authorId": "string", + "body": "string", + "discussionId": 1, + "draft": false, + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "publishedAt": "2026-04-02T00:00:00.000Z", + "global": true, + "toxicityScore": 1, + "reported": false, + "views": 1, + "removed": false, + "verified": false, + "roomPostStatus": 0, + "hidden": false, + "commentsCount": 0, + "likesCount": 0, + "viewsCount": 0, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "reviewedAt": "2026-04-02T00:00:00.000Z", + "featuredAt": "2026-04-02T00:00:00.000Z", + "estimatedReadingTime": 0, + "roomId": 1, + "postTypeId": 1, + "postTypeName": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid verse key format" + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Posts" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/tags": { + "get": { + "operationId": "TagsController_find", + "summary": "Search and retrieve tags", + "description": "Search for tags by query string. Returns paginated results matching the search term. Useful for tag autocomplete and discovery features.", + "parameters": [ + { + "name": "query", + "required": false, + "in": "query", + "description": "Search term", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Number of results to return", + "schema": { + "type": "number" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Tags matching search query with pagination", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tag" + } + }, + "example": [ + { + "id": 1, + "name": "string", + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "rank": 0, + "languageId": 1, + "languageName": "string", + "postsCount": 1, + "commentsCount": 1 + } + ] + } + } + } + }, + "tags": [ + "Tags" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/comments": { + "post": { + "operationId": "CommentsController_create", + "summary": "Create a new comment", + "description": "Add a comment to a post or reply to an existing comment. Supports mentions and notifies the post author.", + "parameters": [], + "requestBody": { + "required": true, + "description": "Comment with postId and optional parentId", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCommentBody" + }, + "example": { + "comment": { + "body": "This is a thoughtful comment about the post", + "postId": 123, + "isPrivate": false, + "parentId": 456, + "mentions": [ + { + "marker": "{{9e639c0f-e02f-c32f-b0ae-e0d8c8d80b2d}}", + "userId": "string", + "displayName": "string" + } + ] + } + } + } + } + }, + "responses": { + "201": { + "description": "Comment created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCommentResponse" + }, + "example": { + "comment": { + "id": 1, + "postId": 1, + "authorId": "string", + "parentId": 1, + "isPrivate": false, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "toxicityScore": 1, + "repliesCount": 0, + "likesCount": 0, + "reported": false, + "removed": false, + "hidden": false, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "tags": [ + { + "language": "string", + "id": 1, + "name": "string", + "commentsCount": 1 + } + ] + }, + "success": true + } + } + } + }, + "400": { + "description": "Invalid comment - empty body or invalid postId" + }, + "401": { + "description": "User not authenticated" + }, + "404": { + "description": "Post or parent comment not found" + } + }, + "tags": [ + "Comments" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/comments/{id}/delete": { + "get": { + "operationId": "CommentsController_deleteComment", + "summary": "Delete a comment", + "description": "Soft-delete a comment and its direct replies. Only the comment owner, post owner, or admins can delete.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric comment ID", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Comment deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "removed": { + "type": "boolean", + "example": true + } + } + }, + "example": { + "removed": true + } + } + } + }, + "400": { + "description": "User not authorized to delete this comment" + }, + "401": { + "description": "User not authenticated" + }, + "404": { + "description": "The comment has already been deleted" + } + }, + "tags": [ + "Comments" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/comments/{id}/toggle-like": { + "post": { + "operationId": "CommentsController_toggleLike", + "summary": "Toggle like/unlike a comment", + "description": "Toggle like status. If liked, removes like. Notifies comment author on new likes.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Unique numeric comment ID", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Like toggled", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "liked": { + "type": "boolean", + "description": "true if liked, false if unliked" + } + } + }, + "example": { + "liked": true + } + } + } + }, + "401": { + "description": "User not authenticated" + }, + "404": { + "description": "Comment not found" + } + }, + "tags": [ + "Comments" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/comments/{id}/replies": { + "get": { + "operationId": "CommentsController_get", + "summary": "Get replies to a comment", + "description": "Retrieve paginated replies (nested comments) for a parent comment with author info.", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Parent comment ID", + "schema": { + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "Number of results to return", + "schema": { + "minimum": 1, + "maximum": 20, + "default": 20, + "type": "number" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "Page number", + "schema": { + "minimum": 1, + "default": 1, + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Comment replies with pagination", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommentRepliesResponse" + }, + "example": { + "total": 10, + "currentPage": 1, + "limit": 10, + "pages": 1, + "replies": [ + { + "id": 1, + "postId": 1, + "authorId": "string", + "parentId": 1, + "isPrivate": false, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "toxicityScore": 1, + "repliesCount": 0, + "likesCount": 0, + "reported": false, + "removed": false, + "hidden": false, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "tags": [ + { + "language": "string", + "id": 1, + "name": "string", + "commentsCount": 1 + } + ] + } + ], + "comment": { + "id": 1, + "postId": 1, + "authorId": "string", + "parentId": 1, + "isPrivate": false, + "body": "string", + "createdAt": "2026-04-02T00:00:00.000Z", + "updatedAt": "2026-04-02T00:00:00.000Z", + "toxicityScore": 1, + "repliesCount": 0, + "likesCount": 0, + "reported": false, + "removed": false, + "hidden": false, + "languageId": 1, + "languageName": "string", + "moderationStatus": 1, + "author": { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1 + }, + "mentions": [ + { + "postsCount": 1, + "avatarUrls": { + "small": "string", + "medium": "string", + "large": "string" + }, + "id": "string", + "username": "string", + "verified": false, + "firstName": "string", + "lastName": "string", + "memberType": 1, + "locations": {}, + "followersCount": 1, + "displayName": "string" + } + ], + "tags": [ + { + "language": "string", + "id": 1, + "name": "string", + "commentsCount": 1 + } + ] + } + } + } + } + }, + "404": { + "description": "Parent comment not found" + } + }, + "tags": [ + "Comments" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + }, + "/v1/sync": { + "get": { + "description": "Get list of mutations that were applied to resources after a certain point in time.", + "tags": [ + "Sync" + ], + "summary": "Get mutations", + "parameters": [ + { + "in": "query", + "name": "mutationsSince", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp to get mutations since.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp to get mutations since." + }, + { + "in": "query", + "name": "resources", + "schema": { + "type": "string", + "description": "Comma-separated list of resources to filter mutations by (e.g. \"BOOKMARK,COLLECTION,COLLECTION_BOOKMARK,NOTE\"). If not provided, all accessible resources will be returned.", + "example": "BOOKMARK,COLLECTION,COLLECTION_BOOKMARK" + }, + "required": false, + "description": "Comma-separated list of resources to filter mutations by (e.g. \"BOOKMARK,COLLECTION,COLLECTION_BOOKMARK,NOTE\"). If not provided, all accessible resources will be returned." + }, + { + "in": "query", + "name": "metadataOnly", + "schema": { + "type": "boolean", + "description": "When true, returns only the lastMutationAt timestamp without fetching actual mutations. This is significantly faster (single DB query vs multiple joins) and ideal for: 1) Checking if new data exists before performing a full sync, 2) Implementing periodic background polling to detect changes, 3) Recovering the current lastMutationAt if the client missed the X-Mutation-At header from a previous successful mutation response. Response will only contain { lastMutationAt: number }.", + "example": true, + "default": false + }, + "required": false, + "description": "When true, returns only the lastMutationAt timestamp without fetching actual mutations. This is significantly faster (single DB query vs multiple joins) and ideal for: 1) Checking if new data exists before performing a full sync, 2) Implementing periodic background polling to detect changes, 3) Recovering the current lastMutationAt if the client missed the X-Mutation-At header from a previous successful mutation response. Response will only contain { lastMutationAt: number }." + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "number", + "format": "float", + "minimum": 1, + "maximum": 1000, + "description": "Maximum number of mutations to return per page (1-1000).", + "example": 100, + "default": 100 + }, + "required": false, + "description": "Maximum number of mutations to return per page (1-1000)." + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "number", + "format": "float", + "minimum": 1, + "description": "Page number (1-based).", + "example": 1, + "default": 1 + }, + "required": false, + "description": "Page number (1-based)." + } + ], + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "mutations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "CREATE", + "UPDATE", + "DELETE" + ], + "description": "The type of the mutation", + "example": "CREATE" + }, + "resource": { + "type": "string", + "enum": [ + "BOOKMARK", + "COLLECTION", + "COLLECTION_BOOKMARK", + "NOTE" + ], + "description": "The resource the mutation was applied to.", + "example": "BOOKMARK" + }, + "resourceId": { + "type": "string", + "description": "The id of the resource the mutation was applied to. Will not be present for resources that use composite keys (e.g. COLLECTION_BOOKMARK uses data.collection and data.bookmark instead).", + "example": "lqc794i0qnxq4pdlfanfbd2r" + }, + "data": { + "type": "object", + "properties": {}, + "description": "The latest version of the data of the resource that was mutated. Will be empty when the mutation is a delete.", + "example": { + "bookmarkType": "ayah", + "bookmarkGroup": "verses_6236", + "key": 6, + "verseNumber": 3 + } + }, + "timestamp": { + "type": "number", + "format": "float", + "description": "Unix timestamp when the latest mutation of the resource occurred", + "example": 1731636500303 + } + }, + "required": [ + "type", + "resource", + "timestamp" + ], + "additionalProperties": false, + "description": "Represents a single mutation/change to a resource" + }, + "description": "Array of mutations that occurred after lastMutationAt. Will be omitted when metadataOnly is set to true.", + "example": [ + { + "type": "CREATE", + "resource": "BOOKMARK", + "resourceId": "u54maufl0ftmarp73ei0hg64", + "data": { + "bookmarkType": "ayah", + "bookmarkGroup": "verses_6236", + "key": 6, + "verseNumber": 3 + }, + "timestamp": 1769340915572 + }, + { + "type": "UPDATE", + "resource": "COLLECTION", + "resourceId": "na6orcv0pbcomiphmkv0yhma", + "data": { + "name": "New collection!", + "slug": "new-collection", + "isPrivate": true + }, + "timestamp": 1769340915572 + }, + { + "type": "CREATE", + "resource": "COLLECTION_BOOKMARK", + "data": { + "collection": "na6orcv0pbcomiphmkv0yhma", + "bookmark": "u54maufl0ftmarp73ei0hg64" + }, + "timestamp": 1769340915575 + }, + { + "type": "DELETE", + "resource": "NOTE", + "resourceId": "his2lubkxxr3l102nqptmnur", + "data": {}, + "timestamp": 1769341113173 + } + ] + }, + "page": { + "type": "number", + "format": "float", + "description": "Current page number", + "example": 1 + }, + "limit": { + "type": "number", + "format": "float", + "description": "Items per page", + "example": 100 + }, + "total": { + "type": "number", + "format": "float", + "description": "Total number of mutations", + "example": 150 + }, + "hasMore": { + "type": "boolean", + "description": "Whether more pages exist", + "example": true + }, + "lastMutationAt": { + "type": "number", + "format": "float", + "description": "Timestamp of the latest mutation. This should be used for subsequent sync requests. If metadataOnly is true, this will be the only field returned.", + "example": 1731636500303 + } + }, + "required": [ + "lastMutationAt" + ], + "additionalProperties": false, + "description": "Response schema for get mutations endpoint" + } + }, + "additionalProperties": false + } + } + }, + "headers": { + "X-Mutation-At": { + "description": "Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.", + "schema": { + "type": "string", + "example": "1731636500303" + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "409": { + "description": "Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "OutOfSyncError" + }, + "message": { + "type": "string", + "example": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + } + } + }, + "examples": { + "Out of sync": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + }, + "First sync - wrong lastMutationAt": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "First sync detected. Please use lastMutationAt=-1 for initial sync." + } + } + } + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request was well-formed but was unable to be followed due to semantic errors" + }, + "type": { + "type": "string", + "example": "unprocessable_entity" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + } + }, + "post": { + "description": "An endpoint to sync local mutations to the server.", + "tags": [ + "Sync" + ], + "summary": "Sync local mutations", + "parameters": [ + { + "in": "query", + "name": "lastMutationAt", + "schema": { + "type": "number", + "format": "float", + "description": "The timestamp of the last mutation that was applied on the server. The value needs to match the latest value from get mutations endpoint, otherwise, the request will be rejected.", + "example": 1731636500303 + }, + "required": true, + "description": "The timestamp of the last mutation that was applied on the server. The value needs to match the latest value from get mutations endpoint, otherwise, the request will be rejected." + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "mutations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "CREATE", + "UPDATE", + "DELETE" + ], + "description": "The type of the mutation", + "example": "CREATE" + }, + "resource": { + "type": "string", + "enum": [ + "BOOKMARK", + "COLLECTION", + "COLLECTION_BOOKMARK", + "NOTE" + ], + "description": "Resource the mutation applies to.", + "example": "BOOKMARK" + }, + "resourceId": { + "type": "string", + "description": "Server's ID for finding the resource during update/delete operations.", + "example": "lqc794i0qnxq4pdlfanfbd2r" + }, + "data": { + "type": "object", + "properties": {}, + "description": "Resource data. Format depends on resource type.", + "example": { + "bookmarkType": "ayah", + "bookmarkGroup": "verses_6236", + "key": 6, + "verseNumber": 3 + } + } + }, + "required": [ + "type", + "resource" + ], + "additionalProperties": false, + "description": "Represents a single mutation/change to a resource" + } + } + }, + "required": [ + "mutations" + ], + "additionalProperties": false + } + } + } + }, + "responses": { + "200": { + "description": "Request has been handled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "mutations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "CREATE", + "UPDATE", + "DELETE" + ], + "description": "The type of the mutation", + "example": "CREATE" + }, + "resource": { + "type": "string", + "enum": [ + "BOOKMARK", + "COLLECTION", + "COLLECTION_BOOKMARK", + "NOTE" + ], + "description": "The resource the mutation was applied to.", + "example": "BOOKMARK" + }, + "resourceId": { + "type": "string", + "description": "The id of the resource the mutation was applied to. Will not be present for resources that use composite keys (e.g. COLLECTION_BOOKMARK uses data.collection and data.bookmark instead).", + "example": "lqc794i0qnxq4pdlfanfbd2r" + }, + "data": { + "type": "object", + "properties": {}, + "description": "The latest version of the data of the resource that was mutated. Will be empty when the mutation is a delete.", + "example": { + "bookmarkType": "ayah", + "bookmarkGroup": "verses_6236", + "key": 6, + "verseNumber": 3 + } + }, + "timestamp": { + "type": "number", + "format": "float", + "description": "Unix timestamp when the latest mutation of the resource occurred", + "example": 1731636500303 + } + }, + "required": [ + "type", + "resource", + "timestamp" + ], + "additionalProperties": false, + "description": "Represents a single mutation/change to a resource" + }, + "description": "Array of mutations that were successfully applied on the server.", + "example": [ + { + "type": "CREATE", + "resource": "BOOKMARK", + "resourceId": "u54maufl0ftmarp73ei0hg64", + "data": { + "bookmarkType": "ayah", + "bookmarkGroup": "verses_6236", + "key": 6, + "verseNumber": 3 + }, + "timestamp": 1769340915572 + }, + { + "type": "UPDATE", + "resource": "COLLECTION", + "resourceId": "na6orcv0pbcomiphmkv0yhma", + "data": { + "name": "New collection!", + "slug": "new-collection", + "isPrivate": true + }, + "timestamp": 1769340915572 + }, + { + "type": "CREATE", + "resource": "COLLECTION_BOOKMARK", + "data": { + "collection": "na6orcv0pbcomiphmkv0yhma", + "bookmark": "u54maufl0ftmarp73ei0hg64" + }, + "timestamp": 1769340915575 + }, + { + "type": "DELETE", + "resource": "NOTE", + "resourceId": "his2lubkxxr3l102nqptmnur", + "data": {}, + "timestamp": 1769341113173 + } + ] + }, + "page": { + "type": "number", + "format": "float", + "description": "Current page number", + "example": 1 + }, + "limit": { + "type": "number", + "format": "float", + "description": "Items per page", + "example": 100 + }, + "total": { + "type": "number", + "format": "float", + "description": "Total number of mutations", + "example": 150 + }, + "hasMore": { + "type": "boolean", + "description": "Whether more pages exist", + "example": true + }, + "lastMutationAt": { + "type": "number", + "format": "float", + "description": "Timestamp of the latest mutation that was applied on the server. This should be used for subsequent sync requests.", + "example": 1731636500303 + } + }, + "required": [ + "lastMutationAt" + ], + "additionalProperties": false, + "description": "Response schema for post mutations endpoint" + } + }, + "additionalProperties": false + } + } + }, + "headers": { + "X-Mutation-At": { + "description": "Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.", + "schema": { + "type": "string", + "example": "1731636500303" + } + } + } + }, + "400": { + "description": "The request is missing required parameters or is invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request is missing required headers or is invalid" + }, + "type": { + "type": "string", + "example": "invalid_request" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "401": { + "description": "The request is unauthorized.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The request requires user authentication" + }, + "type": { + "type": "string", + "example": "unauthorized" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "403": { + "description": "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.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server understood the request, but refuses to authorize it" + }, + "type": { + "type": "string", + "example": "forbidden" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "404": { + "description": "Not Found. The resource being accessed does not exist.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The requested resource could not be found" + }, + "type": { + "type": "string", + "example": "not_found" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "409": { + "description": "Out of Sync Error. The client lastMutationAt does not match server state. Client must re-sync data before retrying this operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "OutOfSyncError" + }, + "message": { + "type": "string", + "example": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + } + } + }, + "examples": { + "Out of sync": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "Invalid lastMutationAt, please re-sync your data and try again." + } + } + }, + "First sync - wrong lastMutationAt": { + "value": { + "success": false, + "error": { + "code": "OutOfSyncError", + "message": "First sync detected. Please use lastMutationAt=-1 for initial sync." + } + } + } + } + } + } + }, + "422": { + "description": "Validation Error. The request includes one or more invalid params.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "ValidationError" + }, + "message": { + "type": "string", + "example": "Invalid mutations" + } + } + } + } + }, + "examples": { + "Invalid mutations format": { + "value": { + "success": false, + "error": { + "code": "ValidationError", + "message": "Invalid mutations" + } + } + }, + "Too many mutations": { + "value": { + "success": false, + "error": { + "code": "ValidationError", + "message": "Mutations must not exceed 100" + } + } + }, + "Missing resource": { + "value": { + "success": false, + "error": { + "code": "ValidationError", + "message": "Missing resource at mutation[0]" + } + } + }, + "Invalid resource": { + "value": { + "success": false, + "error": { + "code": "ValidationError", + "message": "Invalid resource: \"invalidResource\" at mutation[0]" + } + } + }, + "Missing mutation type": { + "value": { + "success": false, + "error": { + "code": "ValidationError", + "message": "Missing mutation type at mutation[0]" + } + } + }, + "Invalid mutation type": { + "value": { + "success": false, + "error": { + "code": "ValidationError", + "message": "Invalid mutation type: \"invalidType\" at mutation[0]" + } + } + }, + "Missing resourceId": { + "value": { + "success": false, + "error": { + "code": "ValidationError", + "message": "Missing resourceId at mutation[0]" + } + } + }, + "Invalid resourceId type": { + "value": { + "success": false, + "error": { + "code": "ValidationError", + "message": "Invalid resourceId at mutation[0]" + } + } + }, + "Missing data": { + "value": { + "success": false, + "error": { + "code": "ValidationError", + "message": "Missing data at mutation[0]" + } + } + } + } + } + } + }, + "429": { + "description": "Too many requests, please try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Too many requests, please try again later" + }, + "type": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "500": { + "description": "Server Error. Something went wrong, try again later.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server encountered an internal error and was unable to complete your request" + }, + "type": { + "type": "string", + "example": "internal_server_error" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "502": { + "description": "Invalid response from the upstream server", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and received an invalid response from the upstream server" + }, + "type": { + "type": "string", + "example": "bad_gateway" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance" + }, + "type": { + "type": "string", + "example": "service_unavailable" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + }, + "504": { + "description": "The server did not receive a timely response from the upstream server.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server" + }, + "type": { + "type": "string", + "example": "gateway_timeout" + }, + "success": { + "type": "boolean", + "example": false + } + }, + "additionalProperties": false + } + } + } + } + } + } + }, + "/v1/users": { + "delete": { + "operationId": "UsersController_deleteAccount", + "summary": "Delete user account permanently", + "description": "Permanently delete the authenticated user account and all associated data from QuranReflect and Quran.com. This action is irreversible. The user is immediately banned to prevent further actions, then all data is deleted in the background. All posts, comments, likes, preferences, and memberships will be removed. If the user owns rooms, posts by other members will be converted to global posts.", + "parameters": [], + "responses": { + "200": { + "description": "Account deletion initiated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "message": { + "type": "string", + "example": "Account deletion initiated successfully" + } + } + } + } + } + }, + "401": { + "description": "User not authenticated" + } + }, + "tags": [ + "Users" + ], + "servers": [ + { + "url": "https://apis-prelive.quran.foundation/quran-reflect", + "description": "Pre-production Server" + }, + { + "url": "https://apis.quran.foundation/quran-reflect", + "description": "Production Server" + } + ] + } + } + } +} diff --git a/sidebars.js b/sidebars.js index 5c10c0e0..dff88f2e 100644 --- a/sidebars.js +++ b/sidebars.js @@ -466,6 +466,7 @@ const buildTutorialsSidebarItems = () => [ collapsed: false, items: [ "tutorials/oidc/getting-started-with-oauth2", + "tutorials/oidc/user-apis-quickstart", "tutorials/oidc/openid-connect", "tutorials/oidc/example-integration", "tutorials/oidc/client-setup", @@ -580,6 +581,7 @@ const sidebars = { ], tutorialsSidebar: [ + "tutorials/faq", ...buildTutorialsSidebarItems(), ],