diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..3714262
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,3 @@
+[*.json]
+indent_style = space
+indent_size = 2
\ No newline at end of file
diff --git a/openAPI/oauth2-apis/v1.json b/openAPI/oauth2-apis/v1.json
index 85c8979..a1603f2 100644
--- a/openAPI/oauth2-apis/v1.json
+++ b/openAPI/oauth2-apis/v1.json
@@ -77,7 +77,7 @@
"type": "array"
},
"client_id": {
- "description": "ID is aclient identifier for the OAuth 2.0 client that\nrequested this token.",
+ "description": "ID is a client identifier for the OAuth 2.0 client that\nrequested this token.",
"type": "string"
},
"exp": {
diff --git a/openAPI/user-related-apis/v1.json b/openAPI/user-related-apis/v1.json
index 86d71b3..9111d96 100644
--- a/openAPI/user-related-apis/v1.json
+++ b/openAPI/user-related-apis/v1.json
@@ -1 +1,19663 @@
-{"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 ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items 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":{"Bookmark":{"type":"object","properties":{"id":{"type":"string","example":"cmeswve9a0005d294cyz4auth"},"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"}},"required":["id","createdAt","type","key"],"additionalProperties":false},"Collection":{"type":"object","properties":{"id":{"type":"string","example":"cmeswvedh0007d294csure4n1"},"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},"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},"Room":{"type":"object","properties":{"id":{"type":"integer","description":"The id of the room.","example":123},"name":{"type":"string","description":"The name of the room.","example":"My Halaqa"},"description":{"type":"string","description":"The description of the room.","example":"This is our Halaqa's group."},"public":{"type":"boolean","description":"Whether the group is public or not.","example":false},"active":{"type":"boolean","description":"Whether the group is active or not.","example":true},"verified":{"type":"boolean","description":"Whether the group is verified or not. Will be `true` if it's a page.","example":true},"subdomain":{"type":"string","description":"The subdomain of the page. Will be empty when it is a group.","example":"my-page"},"roomType":{"type":"string","enum":["page","group"],"description":"The type of the group","example":"page"},"group":{"type":"string","description":"The group slug. Will be empty when it is a page.","example":"my-halaqa"},"avatar":{"type":"string","description":"The avatar of the group.","example":"/avatars/original/missing.png"},"link":{"type":"string","description":"The link of the group/page. Will contain only the base domain when it is a page.","example":"https://quranreflect.com/groups/my-room123"},"membersCount":{"type":"integer","description":"The number of members.","example":5},"postsCount":{"type":"integer","description":"The number of posts.","example":""},"currentUserIsAdmin":{"type":"boolean","description":"Whether the current user is an admin or not.","example":true}},"required":["id","name","description","public","active","verified","subdomain","roomType","group","avatar","link","membersCount","postsCount","currentUserIsAdmin"],"additionalProperties":false},"PostReference":{"type":"object","properties":{"surahId":{"type":"integer","minimum":1,"maximum":114,"description":"The Surah number","example":1},"fromAyah":{"type":"integer","minimum":1,"maximum":286,"nullable":true,"description":"The start of the range of Ayah(s) in a Surah that the post relates to. \n\n If it's a single Ayah,`fromAyah` and `toAyah` should have the same value. \n\n If the post belongs to the entire Surah, `fromAyah` and `toAyah` should be left empty","example":5},"toAyah":{"type":"integer","minimum":1,"maximum":286,"nullable":true,"description":"The end of the range of Ayah(s) in a Surah that the post relates to. \n\n If it's a single Ayah,`fromAyah` and `toAyah` should have the same value. \n\n If the post belongs to the entire Surah, `fromAyah` and `toAyah` should be left empty","example":6},"isSurah":{"type":"boolean","description":"Whether the post belongs to the entire Surah.","default":false}},"required":["surahId"],"additionalProperties":false},"Author":{"type":"object","properties":{"id":{"type":"integer","description":"The id of the author of the comment.","example":135},"username":{"type":"string","description":"The username of the author of the comment.","example":"amer"},"firstName":{"type":"string","description":"The first name of the author of the comment.","example":"Amer"},"lastName":{"type":"string","description":"The first name of the author of the comment.","example":"Abbas"},"displayName":{"type":"string","description":"The display name of the author of the comment.","example":"A Abbas"},"verified":{"type":"boolean","description":"Whether the comment's author has been verified.","example":true},"profileImage":{"type":"string","nullable":true,"description":"The profile image of the author of the comment. Will be `null` if it's empty","example":"//s3.amazonaws.com/qreflect-bucket/events/banner/en/avatars/15514/medium.png?1655384045"},"followed":{"type":"boolean","description":"Whether the current user is following the author of the comment or not.","example":true}},"required":["id","username","firstName","lastName","displayName","verified","profileImage","followed"],"additionalProperties":false,"description":"Details about the author."},"Comment":{"type":"object","properties":{"id":{"type":"integer","description":"The id of the comment.","example":135},"createdAt":{"type":"string","description":"The creation date of the comment.","example":"2018-06-27T14:49:10.000Z"},"hidden":{"type":"boolean","description":"Whether the comment is hidden.","example":false},"body":{"type":"string","description":"The body of the comment.","example":"Ma shaa Allah Lahawla walaquwata illa billah"},"parentId":{"type":"integer","nullable":true,"description":"The parent comment's id. Will be `null` if this comment does not have a parent.","example":135},"author":{"$ref":"#/components/schemas/Author"}},"required":["id","createdAt","hidden","body","parentId"],"additionalProperties":false},"PostTag":{"type":"object","properties":{"id":{"type":"integer","description":"The Id of the tag","example":1},"name":{"type":"string","description":"The name of the tag.","example":"PodTafseer"},"language":{"type":"string","description":"The language of the tag.","example":"ENGLISH"}},"required":["id","name","language"],"additionalProperties":false},"RoomPostStatus":{"type":"string","enum":["as_room","publicly","only_members"],"description":"The room post status.","example":"as_room"},"Post":{"type":"object","properties":{"id":{"type":"integer","description":"The ID of the post.","example":123},"body":{"type":"string","description":"The body of the post.","example":"This is a reflection example!"},"likes":{"type":"integer","description":"The number of likes.","example":5},"isPrivate":{"type":"boolean","description":"Whether the post should be publicly viewed or not.","example":false,"default":false},"publishedAt":{"type":"string","description":"The date the post was published at. Format of the date is `MMMM dd, yyyy HH:mm`","example":"March 03, 2023 05:45"},"createdAt":{"type":"string","description":"The date the post was created at. Format of the date is `MMMM dd, yyyy HH:mm`","example":"March 03, 2023 05:45"},"lastUpdated":{"type":"string","description":"The date the post was last updated. Format of the date is `MMMM dd, yyyy HH:mm`","example":"March 03, 2023 05:45"},"author":{"$ref":"#/components/schemas/Author"},"language":{"type":"string","description":"The language of the post.","example":"ENGLISH"},"liked":{"type":"boolean","description":"Whether the post was liked by the current user or not.","example":false,"default":false},"saved":{"type":"boolean","description":"Whether the post was saved by the current user or not.","example":false,"default":false},"verified":{"type":"boolean","description":"Whether the post is verified or not.","example":false,"default":false},"hidden":{"type":"boolean","description":"Whether the post is hidden or not.","example":false,"default":false},"views":{"type":"integer","description":"The number of views.","example":5},"global":{"type":"boolean","description":"Whether the post is global or not. A post inside a room can be set to global and becomes visible to everyone.","example":false,"default":false},"editable":{"type":"boolean","description":"Whether the post is editable or not. It will be `true` if the post belongs to the current user.","example":false,"default":false},"deletable":{"type":"boolean","description":"Whether the post is deletable or not. It will be `true` if the post belongs to the current user.","example":false,"default":false},"reportable":{"type":"boolean","description":"Whether the current user can report the post or not.","example":false,"default":false},"restorable":{"type":"boolean","description":"Whether the current user can restore the post after it was deleted or not.","example":false,"default":false},"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"},"description":"List of comments that belong to the post."},"commentsCount":{"type":"integer","description":"The number of comments the post has. This includes private comments.","example":5},"publicCommentsCount":{"type":"integer","description":"The number of public comments the post has.","example":5},"roomId":{"type":"integer","nullable":true,"description":"The Id of the room the post belongs to.","example":123},"group":{"type":"string","nullable":true,"description":"The name of the group the post belongs to. Will be `null` it the post does not belong to a group.","example":"Muslim American Society"},"groupLink":{"type":"string","nullable":true,"description":"The link to the group the post belongs to. Will be `null` it the post does not belong to a group.","example":"Muslim American Society"},"postTitle":{"type":"string","description":"A social-media sharable title of the post.","example":"Osama Sayed's Reflection on Surah Al-Aadiyaat:8"},"references":{"type":"array","items":{"$ref":"#/components/schemas/PostReference"},"example":[{"surahId":2},{"surahId":5,"fromAyah":6,"toAyah":8},{"surahId":114,"fromAyah":2,"toAyah":2}]},"tags":{"type":"array","items":{"$ref":"#/components/schemas/PostTag"},"description":"List of tags the post belongs to. If `tags` not passed with update post API, existing references of the post will be removed.","example":[{"id":1698,"name":"PodTafseer","language":"ENGLISH"}]},"roomPostStatus":{"$ref":"#/components/schemas/RoomPostStatus"},"estimatedReadingTime":{"type":"number","format":"float","description":"The average number of milliseconds it takes to read the post. It can be `0` if the value could not be estimated.","example":55018.9}},"required":["id","body","likes","isPrivate","publishedAt","createdAt","lastUpdated","language","liked","saved","verified","hidden","views","global","editable","deletable","reportable","restorable","commentsCount","publicCommentsCount","roomId","group","groupLink","postTitle","roomPostStatus","estimatedReadingTime"],"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"],"example":"translation"},"selectedWordByWordLocale":{"type":"string","enum":["en","ur","id","bn","tr","fa","ru","hi","de","ta","inh","fr"],"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"]}},"required":["readingPreference","selectedWordByWordLocale","wordClickFunctionality","wordByWordContentType","wordByWordDisplay"],"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},"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"}},"required":["tafsirFontScale","quranTextFontScale","translationFontScale","wordByWordFontScale"],"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"]}},"additionalProperties":false}},"additionalProperties":false},"ReadingSession":{"type":"object","properties":{"id":{"type":"string","example":"cmeswvfm5000ed2949sbdfdfc"},"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},"Notification":{"type":"object","properties":{"id":{"type":"integer","description":"The notification Id.","example":6446043},"body":{"type":"string","description":"The notification body. Might contain HTML.","example":"Mohammad Elshinawy added a new reflection."},"avatarUrl":{"type":"string","description":"The Avatar url of the user the notification is related to.","example":"//s3.amazonaws.com/qreflect-bucket/events/banner/en/avatars/80/medium.png?1590842297"},"createdAt":{"type":"string","description":"The creation date of the notification.","example":"2023-02-18T16:43:19.000Z"},"postUrl":{"type":"string","description":"The post URL the notification is related to.","example":"https://quranreflect.com/posts/17052"}},"required":["id","body","avatarUrl","createdAt","postUrl"],"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},"NotificationSettings":{"type":"object","properties":{"emailsDisabled":{"type":"boolean","description":"Disable Email Notifications","example":false},"followNotification":{"type":"boolean","description":"User receives an email when someone follows the user","example":false},"followedUserAddedPostNotification":{"type":"boolean","description":"User receives an email when someone the user follows adds a new post.","example":false},"postCommentedNotification":{"type":"boolean","description":"Receive email when someone comments on the user's post.","example":false},"postLikedNotification":{"type":"boolean","description":"Receive email when someone likes the user's post.","example":false},"mentionNotification":{"type":"boolean","description":"User receives an email when someone mentions the user in a post or comment.","example":false},"addedPostInGroupNotification":{"type":"boolean","description":"User receives an email when someone in a group the user is in creates a new post.","example":false},"followPushNotification":{"type":"boolean","description":"User receives a notification when someone follows the user.","example":false},"followedUserAddedPostPushNotification":{"type":"boolean","description":"User receives a notification when someone that the user follows adds a new post.","example":false},"postCommentedPushNotification":{"type":"boolean","description":"User receives a notification when someone comments on the user's post.","example":false},"postLikedPushNotification":{"type":"boolean","description":"User receives a notification when someone likes the user's post.","example":false},"mentionPushNotification":{"type":"boolean","description":"User receives a notification when someone mentions the user in a post or comment.","example":false},"addedPostInGroupPushNotification":{"type":"boolean","description":"User receives a notification when someone in a group the user is in creates a new post.","example":false}},"additionalProperties":false}},"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}}}},"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}}}},"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}}}}}},"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":"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":"cmeswvdwi0000d2943c444xrw"},"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":"cmeswvdwj0001d294emyig7ux"},"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":"cmeswvdwj0002d294b1t5djyb"},"endCursor":{"type":"string","example":"cmeswvdwj0003d29414082uyd"},"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}}}}}}},"/v1/collections/{collectionId}/bookmarks":{"post":{"description":"Add a bookmark to an existing collection.","tags":["Collections"],"summary":"Add collection Bookmark","parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be added.","example":"cmeswvei10008d294atxfhryv"},"required":true,"description":"The Id of the collection to be added."}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"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},"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","example":4}},"required":["key","verseNumber","mushaf"],"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"},"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","example":4}},"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}}}}}}},"/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":"cmeswveib0009d294hspb3wiv"},"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}}}}}},"get":{"description":"Get all resources that belong to an existing collection by collection id.","tags":["Collections"],"summary":"Get collection items by id","parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","example":"cmeswvejx000cd2940jxl90rm"}},{"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":"cmeswvdwi0000d2943c444xrw"},"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":"cmeswvdwj0001d294emyig7ux"},"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/Bookmark"}}},"additionalProperties":false},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmeswvdwj0002d294b1t5djyb"},"endCursor":{"type":"string","example":"cmeswvdwj0003d29414082uyd"},"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}}}}}},"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}}}},"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}}}}}}},"/v1/collections/{collectionId}/bookmarks/{bookmarkId}":{"delete":{"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"],"summary":"Delete collection bookmark by id","parameters":[{"in":"path","name":"collectionId","schema":{"type":"string","description":"The Id of the collection to be deleted.","example":"cmeswveis000ad294fobr1pgm"},"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":"cmeswveis000bd29490udbmsq"},"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}}}}}}},"/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":"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":"cmeswvdwi0000d2943c444xrw"},"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":"cmeswvdwj0001d294emyig7ux"},"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":"cmeswvdwj0002d294b1t5djyb"},"endCursor":{"type":"string","example":"cmeswvdwj0003d29414082uyd"},"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}}}}}}},"/v1/bookmarks/":{"post":{"description":"Add a bookmark by details.","tags":["Bookmarks"],"summary":"Add user bookmark","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"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},"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","example":4}},"required":["key","verseNumber","mushaf"],"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"},"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","example":4}},"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":{"$ref":"#/components/schemas/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}}}}}},"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":"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":"cmeswvdwi0000d2943c444xrw"},"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":"cmeswvdwj0001d294emyig7ux"},"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/Bookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmeswvdwj0002d294b1t5djyb"},"endCursor":{"type":"string","example":"cmeswvdwj0003d29414082uyd"},"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}}}}}}},"/v1/bookmarks/{bookmarkId}":{"delete":{"description":"Delete a bookmark by id.","tags":["Bookmarks"],"summary":"Delete Bookmark","parameters":[{"in":"path","name":"bookmarkId","schema":{"type":"string","description":"The id of the bookmark to be deleted.","example":"cmeswve9m0006d2941eho5c80"},"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}}}}}}},"/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/Bookmark"}},"pagination":{"type":"object","properties":{"startCursor":{"type":"string","example":"cmeswvdwj0002d294b1t5djyb"},"endCursor":{"type":"string","example":"cmeswvdwj0003d29414082uyd"},"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}}}}}}},"/v1/bookmarks/bookmark":{"get":{"description":"Get a bookmark by details","tags":["Bookmarks"],"summary":"Get bookmark","parameters":[{"in":"query","name":"key","schema":{"type":"integer","description":"Surah, Juz or page number.","example":2},"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":"verseNumber","schema":{"type":"integer","description":"The Ayah number of the bookmark"},"required":false,"description":"The Ayah number of the bookmark"},{"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":{"$ref":"#/components/schemas/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}}}}}}},"/v1/bookmarks/collections":{"get":{"description":"Get all collections that a bookmark belongs to by bookmark details.","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":"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":"cmeswvdwi0000d2943c444xrw"},"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":"cmeswvdwj0001d294emyig7ux"},"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/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}}}}}}},"/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"],"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","properties":{"key":{"type":"string","enum":["type"]}},"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","enum":["readingPreference","selectedWordByWordLocale","wordClickFunctionality","isReadingByRevelationOrder","wordByWordContentType","wordByWordDisplay"]}},"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","enum":["tafsirFontScale","quranTextFontScale","translationFontScale","wordByWordFontScale","quranFont","mushafLines"]}},"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"]}},"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"],"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"],"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"]}},"required":["value"],"additionalProperties":false},{"type":"object","properties":{"value":{"type":"array","items":{"type":"string","enum":["tooltip","inline"]},"example":["tooltip"]}},"required":["value"],"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}]}}}},"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}}}}}},"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}}}},"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}}}}}}},"/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"}}}},"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}}}}}}},"/v1/reading-sessions/":{"post":{"description":"Create or update an existing reading session. Reading session is used to keep track of recently read Ayahs. 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.","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."},"verseNumber":{"type":"integer","minimum":1,"description":"The Ayah number to be added to reading session."}},"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":{"enum":["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}}}}}},"get":{"description":"Get all existing reading sessions.","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":"cmeswvdwi0000d2943c444xrw"},"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":"cmeswvdwj0001d294emyig7ux"},"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":"cmeswvdwj0002d294b1t5djyb"},"endCursor":{"type":"string","example":"cmeswvdwj0003d29414082uyd"},"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}}}}}}},"/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"],"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":"cmeswvdxx0004d294hpjdc7un"},"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}}}}}}},"/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":"cmeswvesr000dd294e5u7h75y"},"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"],"description":"The type of the goal.","example":"QURAN_TIME"},"amount":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10"},{"type":"integer","minimum":1,"example":600}],"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"],"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}}}}}},"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":"cmeswvesr000dd294e5u7h75y"},"required":true,"description":"The id of the goal."},{"in":"query","name":"category","schema":{"type":"string","enum":["QURAN","COURSE","QURAN_READING_PROGRAM"],"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}}}}}}},"/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"],"description":"The type of the goal.","example":"QURAN_TIME"},"amount":{"oneOf":[{"type":"string","pattern":"^(\\d+):(\\d+)-(\\d+):(\\d+)$","example":"1:5-1:10"},{"type":"integer","minimum":1,"example":600}],"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"],"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":"cmeswvesr000dd294e5u7h75y"}},"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}}}}}}},"/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"],"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"},{"type":"integer","minimum":1,"example":600}],"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}}}},"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}}}}}}},"/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":"cmeswvdwi0000d2943c444xrw"},"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":"cmeswvdwj0001d294emyig7ux"},"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":"cmeswvfn7000fd29412xt2gxq"},"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":"cmeswvdwj0002d294b1t5djyb"},"endCursor":{"type":"string","example":"cmeswvdwj0003d29414082uyd"},"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}}}}}}},"/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":"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}}}}}}},"/v1/activity-days/":{"post":{"description":"Add or update an activity day.","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"}]}}}},"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}}}}}},"get":{"description":"Get user activity days.","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":"cmeswvdwi0000d2943c444xrw"},"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":"cmeswvdwj0001d294emyig7ux"},"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":"cmeswvdxx0004d294hpjdc7un"},"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":"cmeswvdwj0002d294b1t5djyb"},"endCursor":{"type":"string","example":"cmeswvdwj0003d29414082uyd"},"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}}}}}}},"/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}}}},"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}}}}}}},"/v1/users/profile":{"get":{"description":"Get user profile.","tags":["Users"],"summary":"Get User Profile","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/UserProfile"}},"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}}}}}},"put":{"description":"Update user profile.","tags":["Users"],"summary":"Update user profile","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","description":"The first name of the user.","example":"Amer"},"lastName":{"type":"string","description":"The last name of the user.","example":"Abbas"}},"required":["firstName","lastName"],"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":["User has been updated successfully."]}},"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}}}}}}},"/v1/users/{username}/toggleFollow":{"post":{"description":"Toggle following a user.","tags":["Users"],"summary":"Toggle following a user","parameters":[{"in":"path","name":"username","schema":{"type":"string","description":"The username of the user to be followed/un-followed.","example":"amerabbas"},"required":true,"description":"The username of the user to be followed/un-followed."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{},"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":{"followed":{"type":"boolean","description":"Whether the user is now followed or not.","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}}}}}}},"/v1/users/passwordResetEmail":{"post":{"description":"Send reset password email.","tags":["Users"],"summary":"Send reset password email","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"The email to send the reset password email to.","example":"test@gmail.com"}},"required":["email"],"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}}}}}}},"/v1/users/confirmationEmail":{"post":{"description":"Send account confirmation email.","tags":["Users"],"summary":"Send account confirmation email","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"The email to send the confirmation email to.","example":"test@gmail.com"}},"required":["email"],"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}}}}}}},"/v1/users/{username}/registerAndroidDevice":{"post":{"description":"Register Android device.","tags":["Users"],"summary":"Register Android device","parameters":[{"in":"path","name":"username","schema":{"type":"string","description":"The username of the user.","example":"amerabbas"},"required":true,"description":"The username of the user."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"registrationId":{"type":"string","description":"The Android device registration id of the user.","example":"cTpvB--yRgio45nWa971dO:APA91bHGyLZNS3PPSQmGFHV6CuuU1_nBz-eXqojEmN9qMfgcBQHqvUF8C09Ya50-aOOwYRVJIbTpy8mZ4LTiqcWlRZuIshdtvmcZ6u1w7XUqelf48EOmG3f6SH1HCha8G924Px9tiScm"}},"required":["registrationId"],"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":["Android device added successfully"]}},"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}}}}}}},"/v1/users/notifications":{"get":{"description":"Get user notifications.","tags":["Users"],"summary":"Get user notifications","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":{"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}},"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}}}}}}},"/v1/users/notifications/{settingId}":{"put":{"description":"Update user notification settings.","tags":["Users"],"summary":"Update user notification settings","parameters":[{"in":"path","name":"settingId","schema":{"type":"string","description":"The id of the notification settings to be updated.","example":2159},"required":true,"description":"The id of the notification settings to be updated."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettings"}}}},"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":["Notification settings have been updated successfully"]}},"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}}}}}}},"/v1/posts/":{"post":{"description":"Add a post.","tags":["Posts"],"summary":"Add a post","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"body":{"type":"string","description":"The body of the post.","example":"I love Allah and his messenger."},"roomId":{"type":"integer","description":"The Id of the room the post will be posted in.","example":123},"isPrivate":{"type":"boolean","description":"Whether the post should be posted as a private note.","example":false,"default":false},"tagIds":{"type":"array","items":{"type":"integer"},"description":"The Ids of the tags the post is attached to","example":[432]},"references":{"type":"array","items":{"$ref":"#/components/schemas/PostReference"},"description":"The Surahs/Ayahs the post relates to.","example":[{"surahId":2},{"surahId":5,"fromAyah":6,"toAyah":8},{"surahId":114,"fromAyah":2,"toAyah":2}]}},"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":{"message":{"enum":["Post created successfully"]},"postId":{"enum":[1235]}},"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}}}}}},"get":{"description":"Get list of posts.","tags":["Posts"],"summary":"Get posts","parameters":[{"in":"query","name":"exactAyah","schema":{"type":"boolean","description":"Get posts of an exact Ayah only and not of range of Ayahs (the default behavior).","example":true,"default":false},"description":"Get posts of an exact Ayah only and not of range of Ayahs (the default behavior)."},{"in":"query","name":"languages","schema":{"type":"string","description":"Comma-separated language iso codes, to fetch posts in a specific language(s).","example":"en,ar"},"description":"Comma-separated language iso codes, to fetch posts in a specific language(s)."},{"in":"query","name":"scholarsPosts","schema":{"type":"boolean","description":"Include posts of scholars","example":true},"description":"Include posts of scholars"},{"in":"query","name":"authorIds","schema":{"type":"array","items":{"type":"integer"},"description":"The Ids of the authors of the posts","example":[111312]},"description":"The Ids of the authors of the posts"},{"in":"query","name":"studentsOfKnowledgePosts","schema":{"type":"boolean","description":"Include posts of students of knowledge","example":true},"description":"Include posts of students of knowledge"},{"in":"query","name":"verified","schema":{"type":"boolean","description":"Include verified posts","example":true},"description":"Include verified posts"},{"in":"query","name":"approved","schema":{"type":"boolean","description":"Include approved posts","example":true},"description":"Include approved posts"},{"in":"query","name":"updatedSince","schema":{"type":"string","description":"Get posts that are updated after the given date (inclusive).","example":"10-02-2015 05:05:06 PM"},"description":"Get posts that are updated after the given date (inclusive)."},{"in":"query","name":"filters","schema":{"type":"object","properties":{"tagIds":{"type":"array","items":{"type":"integer"},"description":"The Ids of the tags the post is attached to","example":[432]},"postTypeIds":{"type":"array","items":{"type":"integer"},"description":"The Ids of the types the post is attached to","example":[1]},"tagsOperation":{"type":"string","enum":["OR","AND"],"description":"**`OR`** = Will get posts that match **any** of the passed filters \n\n **`AND`** = Will get posts that match **all** of the passed filters","example":"OR"},"references":{"type":"array","items":{"$ref":"#/components/schemas/PostReference"},"description":"The Surahs/Ayahs the post relates to.","example":[{"surahId":2},{"surahId":5,"fromAyah":6,"toAyah":8},{"surahId":114,"fromAyah":2,"toAyah":2}]},"referencesOperation":{"type":"string","enum":["OR","AND"],"description":"**`OR`** = Will get posts that match **any** of the passed filters \n\n **`AND`** = Will get posts that match **all** of the passed filters","example":"OR"}},"additionalProperties":false,"description":"Further customize the results, you can fetch posts of specific members, post that have specific tags, post for specific surah, ayah range or single ayah etc."},"description":"Further customize the results, you can fetch posts of specific members, post that have specific tags, post for specific surah, ayah range or single ayah etc."},{"in":"query","name":"tab","schema":{"type":"string","enum":["newest","following","draft","favorite","most_popular","only_room_members","public","feed"],"description":"**`newest`** = Recent posts will be at the top. \n\n **`following`** = Get posts of authors the current user is following. \n\n **`draft`** = Get current user's private posts. \n\n **`favorite`** = Get current user's favorite posts. \n\n **`most_popular`** = Get most popular posts. \n\n **`only_room_members`** = Get posts that are posted by current room members. \n\n **`public`** = Include public posts of private rooms. \n\n **`feed`** = When passed, this will ignore most passed filters and send `verified` posts (if `verified` = `true`), posts by scholars and student of knowledge, verified posts, posts from author the user is following.","example":"most_popular","default":"most_popular"},"description":"**`newest`** = Recent posts will be at the top. \n\n **`following`** = Get posts of authors the current user is following. \n\n **`draft`** = Get current user's private posts. \n\n **`favorite`** = Get current user's favorite posts. \n\n **`most_popular`** = Get most popular posts. \n\n **`only_room_members`** = Get posts that are posted by current room members. \n\n **`public`** = Include public posts of private rooms. \n\n **`feed`** = When passed, this will ignore most passed filters and send `verified` posts (if `verified` = `true`), posts by scholars and student of knowledge, verified posts, posts from author the user is following."},{"in":"query","name":"feed","schema":{"type":"boolean","description":"Include only trusted posts and posts by author the user is following.","example":false},"description":"Include only trusted posts and posts by author the user is following."},{"in":"query","name":"page","schema":{"type":"integer","description":"The current post page. Each page will have 25 posts by default. `pages` response field will have the total number of pages."},"description":"The current post page. Each page will have 25 posts by default. `pages` response field will have the total number of pages."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"posts":{"type":"array","items":{"$ref":"#/components/schemas/Post"},"description":"List of posts"},"pages":{"type":"integer","description":"Number of pages matching the queried posts"}},"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}}}}}}},"/v1/posts/{postId}":{"get":{"description":"Get a post.","tags":["Posts"],"summary":"Get a post","parameters":[{"in":"path","name":"postId","schema":{"type":"string","description":"The id of the post.","example":1234},"required":true,"description":"The id of the post."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/Post"}},"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}}}}}},"put":{"description":"Update a post.","tags":["Posts"],"summary":"Update a post","parameters":[{"in":"path","name":"postId","schema":{"type":"string","description":"The id of the comment to be updated.","example":1234},"required":true,"description":"The id of the comment to be updated."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","description":"The body of the post.","example":"I love Allah and his messenger."},"roomId":{"type":"integer","description":"The Id of the room the post will be posted in.","example":123},"isPrivate":{"type":"boolean","description":"Whether the post should be posted as a private note.","example":false,"default":false},"tagIds":{"type":"array","items":{"type":"integer"},"description":"The Ids of the tags the post is attached to","example":[432]},"references":{"type":"array","items":{"$ref":"#/components/schemas/PostReference"},"description":"The Surahs/Ayahs the post relates to. If `references` is not passed with update post API, existing references of the post will be removed.","example":[{"surahId":2},{"surahId":5,"fromAyah":6,"toAyah":8},{"surahId":114,"fromAyah":2,"toAyah":2}]}},"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":{"message":{"enum":["Post was updated successfully"]}},"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}}}}}},"delete":{"description":"Delete a post.","tags":["Posts"],"summary":"Delete a post","parameters":[{"in":"path","name":"postId","schema":{"type":"string","description":"The id of the post to be deleted.","example":1234},"required":true,"description":"The id of the post 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":["Post was removed successfully"]}},"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}}}}}}},"/v1/posts/toggleLike/{postId}":{"post":{"description":"Toggle like a post.","tags":["Posts"],"summary":"Toggle like a post","parameters":[{"in":"path","name":"postId","schema":{"type":"string","description":"The id of the post.","example":1234},"required":true,"description":"The id of the post."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{},"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":{"liked":{"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}}}}}}},"/v1/posts/{postId}/comments":{"get":{"description":"Get all comments of a specific post.","tags":["Posts"],"summary":"Get post's comments","parameters":[{"in":"path","name":"postId","schema":{"type":"string","description":"The id of the post.","example":1234},"required":true,"description":"The id of the post."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"},"description":"List of comments that belong to the post."}},"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}}}}}}},"/v1/posts/toggleSave/{postId}":{"post":{"description":"Toggle save a post.","tags":["Posts"],"summary":"Toggle save a post","parameters":[{"in":"path","name":"postId","schema":{"type":"string","description":"The id of the post.","example":1234},"required":true,"description":"The id of the post."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{},"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":{"saved":{"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}}}}}}},"/v1/posts/report/{postId}":{"post":{"description":"Report a post.","tags":["Posts"],"summary":"Report a post","parameters":[{"in":"path","name":"postId","schema":{"type":"string","description":"The id of the post.","example":1234},"required":true,"description":"The id of the post."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"abuse":{"type":"string","enum":["Offensive language","Inappropriate content","Other"],"description":"The report abuse type","example":"Inappropriate content"},"comment":{"type":"string","description":"Report description/details.","example":"Very inappropriate!"}},"required":["abuse","comment"],"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":["Post was reported successfully"]}},"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}}}}}}},"/v1/posts/view/{postId}":{"post":{"description":"Log a post view.","tags":["Posts"],"summary":"Log a post view","parameters":[{"in":"path","name":"postId","schema":{"type":"string","description":"The id of the post.","example":1234},"required":true,"description":"The id of the post."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{},"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"}},"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}}}}}}},"/v1/comments/":{"post":{"description":"Add a comment.","tags":["Comments"],"summary":"Add a comment","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"body":{"type":"string","description":"The body of the comment.","example":"Amazing post mashAllah!"},"postId":{"type":"integer","description":"The ID of the post the comment will be added to.","example":123},"isPrivate":{"type":"boolean","description":"Whether the comment should be publicly viewed or not.","example":false,"default":false}},"required":["body","postId"],"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":["Comment created successfully"]}},"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}}}}}}},"/v1/comments/{commentId}":{"put":{"description":"Update a comment.","tags":["Comments"],"summary":"Update a comment","parameters":[{"in":"path","name":"commentId","schema":{"type":"string","description":"The id of the comment to be updated.","example":1234},"required":true,"description":"The id of the comment to be updated."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","description":"The updated body of the comment.","example":"Amazing post mashAllah!!"}},"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":{"message":{"enum":["Comment was updated successfully"]}},"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}}}}}},"delete":{"description":"Delete a comment.","tags":["Comments"],"summary":"Delete a comment","parameters":[{"in":"path","name":"commentId","schema":{"type":"string","description":"The id of the comment to be deleted.","example":1234},"required":true,"description":"The id of the comment 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":["Comment was removed successfully"]}},"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}}}}}}},"/v1/groups/":{"get":{"description":"Get all groups","tags":["Groups"],"summary":"Get user groups","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":{"pages":{"type":"array","items":{"$ref":"#/components/schemas/Room"},"description":"List of user pages."},"groups":{"type":"array","items":{"$ref":"#/components/schemas/Room"},"description":"List of user groups."}},"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}}}}}}},"/v1/groups/{groupId}":{"get":{"description":"Get group settings.","tags":["Groups"],"summary":"Get group settings","parameters":[{"in":"path","name":"groupId","schema":{"type":"string","description":"The id of the group.","example":1234},"required":true,"description":"The id of the group."}],"responses":{"200":{"description":"Request has been handled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/Room"}},"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}}}}}}},"/v1/groups/{groupId}/assignAsAdmin":{"put":{"description":"Assign user as a group admin.","tags":["Groups"],"summary":"Assign user as a group admin","parameters":[{"in":"path","name":"groupId","schema":{"type":"string","description":"The id of the group.","example":1234},"required":true,"description":"The id of the group."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","description":"The ID of the user being assigned as an admin.","example":153}},"required":["userId"],"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":["User has been assigned as an admin successfully."]}},"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}}}}}}},"/v1/groups/{groupId}/inviteUser":{"put":{"description":"Invite user to group.","tags":["Groups"],"summary":"Invite user to group","parameters":[{"in":"path","name":"groupId","schema":{"type":"string","description":"The id of the group.","example":1234},"required":true,"description":"The id of the group."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","description":"The ID of the user being invited to group.","example":153},"email":{"type":"string","description":"The email of the user being invited to group.","example":"amer@quran.com"}},"additionalProperties":false,"description":"Invite user by `userId` or `email`. Only one of them should be passed."}}}},"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":["User has been invited successfully."]}},"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}}}}}}},"/v1/groups/{groupId}/removeUser":{"put":{"description":"Remove user from group.","tags":["Groups"],"summary":"Remove user from group","parameters":[{"in":"path","name":"groupId","schema":{"type":"string","description":"The id of the group.","example":1234},"required":true,"description":"The id of the group."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","description":"The ID of the user being removed from group.","example":153}},"required":["userId"],"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":["User has been removed successfully."]}},"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}}}}}}},"/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":"cmeswvdwj0002d294b1t5djyb"},"endCursor":{"type":"string","example":"cmeswvdwj0003d29414082uyd"},"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}}}}}},"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}}}},"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}}}}}}},"/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":"cmeswvdwj0002d294b1t5djyb"},"endCursor":{"type":"string","example":"cmeswvdwj0003d29414082uyd"},"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}}}}}}},"/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}}}},"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}}}}}}},"/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}}}},"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}}}}}}},"/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}}}},"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}}}}}}},"/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}}}},"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}}}}}},"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}}}},"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}}}}}},"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}}}},"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}}}}}}},"/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}}}},"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}}}}}}}}}
\ 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 ## Pagination \n\n We are using cursor based pagination. The pagination query params consist of `first`,`after`, `before` and `last`. \n\n Example \n - `first: 10` will give you first 10 items \n - `first: 10, after: xyz` will give you first 10 items after the item with id `xyz` \n - `last: 10` will give you the last 10 items \n - `last: 10, before: xyz` will give you the last 10 items 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": {
+ "Bookmark": {
+ "type": "object",
+ "properties": {
+ "id": { "type": "string", "example": "cmeswve9a0005d294cyz4auth" },
+ "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" }
+ },
+ "required": ["id", "createdAt", "type", "key"],
+ "additionalProperties": false
+ },
+ "Collection": {
+ "type": "object",
+ "properties": {
+ "id": { "type": "string", "example": "cmeswvedh0007d294csure4n1" },
+ "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
+ },
+ "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
+ },
+ "Room": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The id of the room.",
+ "example": 123
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the room.",
+ "example": "My Halaqa"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the room.",
+ "example": "This is our Halaqa's group."
+ },
+ "public": {
+ "type": "boolean",
+ "description": "Whether the group is public or not.",
+ "example": false
+ },
+ "active": {
+ "type": "boolean",
+ "description": "Whether the group is active or not.",
+ "example": true
+ },
+ "verified": {
+ "type": "boolean",
+ "description": "Whether the group is verified or not. Will be `true` if it's a page.",
+ "example": true
+ },
+ "subdomain": {
+ "type": "string",
+ "description": "The subdomain of the page. Will be empty when it is a group.",
+ "example": "my-page"
+ },
+ "roomType": {
+ "type": "string",
+ "enum": ["page", "group"],
+ "description": "The type of the group",
+ "example": "page"
+ },
+ "group": {
+ "type": "string",
+ "description": "The group slug. Will be empty when it is a page.",
+ "example": "my-halaqa"
+ },
+ "avatar": {
+ "type": "string",
+ "description": "The avatar of the group.",
+ "example": "/avatars/original/missing.png"
+ },
+ "link": {
+ "type": "string",
+ "description": "The link of the group/page. Will contain only the base domain when it is a page.",
+ "example": "https://quranreflect.com/groups/my-room123"
+ },
+ "membersCount": {
+ "type": "integer",
+ "description": "The number of members.",
+ "example": 5
+ },
+ "postsCount": {
+ "type": "integer",
+ "description": "The number of posts.",
+ "example": ""
+ },
+ "currentUserIsAdmin": {
+ "type": "boolean",
+ "description": "Whether the current user is an admin or not.",
+ "example": true
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "description",
+ "public",
+ "active",
+ "verified",
+ "subdomain",
+ "roomType",
+ "group",
+ "avatar",
+ "link",
+ "membersCount",
+ "postsCount",
+ "currentUserIsAdmin"
+ ],
+ "additionalProperties": false
+ },
+ "PostReference": {
+ "type": "object",
+ "properties": {
+ "surahId": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 114,
+ "description": "The Surah number",
+ "example": 1
+ },
+ "fromAyah": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 286,
+ "nullable": true,
+ "description": "The start of the range of Ayah(s) in a Surah that the post relates to. \n\n If it's a single Ayah,`fromAyah` and `toAyah` should have the same value. \n\n If the post belongs to the entire Surah, `fromAyah` and `toAyah` should be left empty",
+ "example": 5
+ },
+ "toAyah": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 286,
+ "nullable": true,
+ "description": "The end of the range of Ayah(s) in a Surah that the post relates to. \n\n If it's a single Ayah,`fromAyah` and `toAyah` should have the same value. \n\n If the post belongs to the entire Surah, `fromAyah` and `toAyah` should be left empty",
+ "example": 6
+ },
+ "isSurah": {
+ "type": "boolean",
+ "description": "Whether the post belongs to the entire Surah.",
+ "default": false
+ }
+ },
+ "required": ["surahId"],
+ "additionalProperties": false
+ },
+ "Author": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The id of the author of the comment.",
+ "example": 135
+ },
+ "username": {
+ "type": "string",
+ "description": "The username of the author of the comment.",
+ "example": "amer"
+ },
+ "firstName": {
+ "type": "string",
+ "description": "The first name of the author of the comment.",
+ "example": "Amer"
+ },
+ "lastName": {
+ "type": "string",
+ "description": "The first name of the author of the comment.",
+ "example": "Abbas"
+ },
+ "displayName": {
+ "type": "string",
+ "description": "The display name of the author of the comment.",
+ "example": "A Abbas"
+ },
+ "verified": {
+ "type": "boolean",
+ "description": "Whether the comment's author has been verified.",
+ "example": true
+ },
+ "profileImage": {
+ "type": "string",
+ "nullable": true,
+ "description": "The profile image of the author of the comment. Will be `null` if it's empty",
+ "example": "//s3.amazonaws.com/qreflect-bucket/events/banner/en/avatars/15514/medium.png?1655384045"
+ },
+ "followed": {
+ "type": "boolean",
+ "description": "Whether the current user is following the author of the comment or not.",
+ "example": true
+ }
+ },
+ "required": [
+ "id",
+ "username",
+ "firstName",
+ "lastName",
+ "displayName",
+ "verified",
+ "profileImage",
+ "followed"
+ ],
+ "additionalProperties": false,
+ "description": "Details about the author."
+ },
+ "Comment": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The id of the comment.",
+ "example": 135
+ },
+ "createdAt": {
+ "type": "string",
+ "description": "The creation date of the comment.",
+ "example": "2018-06-27T14:49:10.000Z"
+ },
+ "hidden": {
+ "type": "boolean",
+ "description": "Whether the comment is hidden.",
+ "example": false
+ },
+ "body": {
+ "type": "string",
+ "description": "The body of the comment.",
+ "example": "Ma shaa Allah Lahawla walaquwata illa billah"
+ },
+ "parentId": {
+ "type": "integer",
+ "nullable": true,
+ "description": "The parent comment's id. Will be `null` if this comment does not have a parent.",
+ "example": 135
+ },
+ "author": { "$ref": "#/components/schemas/Author" }
+ },
+ "required": ["id", "createdAt", "hidden", "body", "parentId"],
+ "additionalProperties": false
+ },
+ "PostTag": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The Id of the tag",
+ "example": 1
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the tag.",
+ "example": "PodTafseer"
+ },
+ "language": {
+ "type": "string",
+ "description": "The language of the tag.",
+ "example": "ENGLISH"
+ }
+ },
+ "required": ["id", "name", "language"],
+ "additionalProperties": false
+ },
+ "RoomPostStatus": {
+ "type": "string",
+ "enum": ["as_room", "publicly", "only_members"],
+ "description": "The room post status.",
+ "example": "as_room"
+ },
+ "Post": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The ID of the post.",
+ "example": 123
+ },
+ "body": {
+ "type": "string",
+ "description": "The body of the post.",
+ "example": "This is a reflection example!"
+ },
+ "likes": {
+ "type": "integer",
+ "description": "The number of likes.",
+ "example": 5
+ },
+ "isPrivate": {
+ "type": "boolean",
+ "description": "Whether the post should be publicly viewed or not.",
+ "example": false,
+ "default": false
+ },
+ "publishedAt": {
+ "type": "string",
+ "description": "The date the post was published at. Format of the date is `MMMM dd, yyyy HH:mm`",
+ "example": "March 03, 2023 05:45"
+ },
+ "createdAt": {
+ "type": "string",
+ "description": "The date the post was created at. Format of the date is `MMMM dd, yyyy HH:mm`",
+ "example": "March 03, 2023 05:45"
+ },
+ "lastUpdated": {
+ "type": "string",
+ "description": "The date the post was last updated. Format of the date is `MMMM dd, yyyy HH:mm`",
+ "example": "March 03, 2023 05:45"
+ },
+ "author": { "$ref": "#/components/schemas/Author" },
+ "language": {
+ "type": "string",
+ "description": "The language of the post.",
+ "example": "ENGLISH"
+ },
+ "liked": {
+ "type": "boolean",
+ "description": "Whether the post was liked by the current user or not.",
+ "example": false,
+ "default": false
+ },
+ "saved": {
+ "type": "boolean",
+ "description": "Whether the post was saved by the current user or not.",
+ "example": false,
+ "default": false
+ },
+ "verified": {
+ "type": "boolean",
+ "description": "Whether the post is verified or not.",
+ "example": false,
+ "default": false
+ },
+ "hidden": {
+ "type": "boolean",
+ "description": "Whether the post is hidden or not.",
+ "example": false,
+ "default": false
+ },
+ "views": {
+ "type": "integer",
+ "description": "The number of views.",
+ "example": 5
+ },
+ "global": {
+ "type": "boolean",
+ "description": "Whether the post is global or not. A post inside a room can be set to global and becomes visible to everyone.",
+ "example": false,
+ "default": false
+ },
+ "editable": {
+ "type": "boolean",
+ "description": "Whether the post is editable or not. It will be `true` if the post belongs to the current user.",
+ "example": false,
+ "default": false
+ },
+ "deletable": {
+ "type": "boolean",
+ "description": "Whether the post is deletable or not. It will be `true` if the post belongs to the current user.",
+ "example": false,
+ "default": false
+ },
+ "reportable": {
+ "type": "boolean",
+ "description": "Whether the current user can report the post or not.",
+ "example": false,
+ "default": false
+ },
+ "restorable": {
+ "type": "boolean",
+ "description": "Whether the current user can restore the post after it was deleted or not.",
+ "example": false,
+ "default": false
+ },
+ "comments": {
+ "type": "array",
+ "items": { "$ref": "#/components/schemas/Comment" },
+ "description": "List of comments that belong to the post."
+ },
+ "commentsCount": {
+ "type": "integer",
+ "description": "The number of comments the post has. This includes private comments.",
+ "example": 5
+ },
+ "publicCommentsCount": {
+ "type": "integer",
+ "description": "The number of public comments the post has.",
+ "example": 5
+ },
+ "roomId": {
+ "type": "integer",
+ "nullable": true,
+ "description": "The Id of the room the post belongs to.",
+ "example": 123
+ },
+ "group": {
+ "type": "string",
+ "nullable": true,
+ "description": "The name of the group the post belongs to. Will be `null` it the post does not belong to a group.",
+ "example": "Muslim American Society"
+ },
+ "groupLink": {
+ "type": "string",
+ "nullable": true,
+ "description": "The link to the group the post belongs to. Will be `null` it the post does not belong to a group.",
+ "example": "Muslim American Society"
+ },
+ "postTitle": {
+ "type": "string",
+ "description": "A social-media sharable title of the post.",
+ "example": "Osama Sayed's Reflection on Surah Al-Aadiyaat:8"
+ },
+ "references": {
+ "type": "array",
+ "items": { "$ref": "#/components/schemas/PostReference" },
+ "example": [
+ { "surahId": 2 },
+ { "surahId": 5, "fromAyah": 6, "toAyah": 8 },
+ { "surahId": 114, "fromAyah": 2, "toAyah": 2 }
+ ]
+ },
+ "tags": {
+ "type": "array",
+ "items": { "$ref": "#/components/schemas/PostTag" },
+ "description": "List of tags the post belongs to. If `tags` not passed with update post API, existing references of the post will be removed.",
+ "example": [
+ { "id": 1698, "name": "PodTafseer", "language": "ENGLISH" }
+ ]
+ },
+ "roomPostStatus": { "$ref": "#/components/schemas/RoomPostStatus" },
+ "estimatedReadingTime": {
+ "type": "number",
+ "format": "float",
+ "description": "The average number of milliseconds it takes to read the post. It can be `0` if the value could not be estimated.",
+ "example": 55018.9
+ }
+ },
+ "required": [
+ "id",
+ "body",
+ "likes",
+ "isPrivate",
+ "publishedAt",
+ "createdAt",
+ "lastUpdated",
+ "language",
+ "liked",
+ "saved",
+ "verified",
+ "hidden",
+ "views",
+ "global",
+ "editable",
+ "deletable",
+ "reportable",
+ "restorable",
+ "commentsCount",
+ "publicCommentsCount",
+ "roomId",
+ "group",
+ "groupLink",
+ "postTitle",
+ "roomPostStatus",
+ "estimatedReadingTime"
+ ],
+ "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"],
+ "example": "translation"
+ },
+ "selectedWordByWordLocale": {
+ "type": "string",
+ "enum": [
+ "en",
+ "ur",
+ "id",
+ "bn",
+ "tr",
+ "fa",
+ "ru",
+ "hi",
+ "de",
+ "ta",
+ "inh",
+ "fr"
+ ],
+ "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"]
+ }
+ },
+ "required": [
+ "readingPreference",
+ "selectedWordByWordLocale",
+ "wordClickFunctionality",
+ "wordByWordContentType",
+ "wordByWordDisplay"
+ ],
+ "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
+ },
+ "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"
+ }
+ },
+ "required": [
+ "tafsirFontScale",
+ "quranTextFontScale",
+ "translationFontScale",
+ "wordByWordFontScale"
+ ],
+ "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"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "ReadingSession": {
+ "type": "object",
+ "properties": {
+ "id": { "type": "string", "example": "cmeswvfm5000ed2949sbdfdfc" },
+ "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
+ },
+ "Notification": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The notification Id.",
+ "example": 6446043
+ },
+ "body": {
+ "type": "string",
+ "description": "The notification body. Might contain HTML.",
+ "example": "Mohammad Elshinawy added a new reflection."
+ },
+ "avatarUrl": {
+ "type": "string",
+ "description": "The Avatar url of the user the notification is related to.",
+ "example": "//s3.amazonaws.com/qreflect-bucket/events/banner/en/avatars/80/medium.png?1590842297"
+ },
+ "createdAt": {
+ "type": "string",
+ "description": "The creation date of the notification.",
+ "example": "2023-02-18T16:43:19.000Z"
+ },
+ "postUrl": {
+ "type": "string",
+ "description": "The post URL the notification is related to.",
+ "example": "https://quranreflect.com/posts/17052"
+ }
+ },
+ "required": ["id", "body", "avatarUrl", "createdAt", "postUrl"],
+ "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
+ },
+ "NotificationSettings": {
+ "type": "object",
+ "properties": {
+ "emailsDisabled": {
+ "type": "boolean",
+ "description": "Disable Email Notifications",
+ "example": false
+ },
+ "followNotification": {
+ "type": "boolean",
+ "description": "User receives an email when someone follows the user",
+ "example": false
+ },
+ "followedUserAddedPostNotification": {
+ "type": "boolean",
+ "description": "User receives an email when someone the user follows adds a new post.",
+ "example": false
+ },
+ "postCommentedNotification": {
+ "type": "boolean",
+ "description": "Receive email when someone comments on the user's post.",
+ "example": false
+ },
+ "postLikedNotification": {
+ "type": "boolean",
+ "description": "Receive email when someone likes the user's post.",
+ "example": false
+ },
+ "mentionNotification": {
+ "type": "boolean",
+ "description": "User receives an email when someone mentions the user in a post or comment.",
+ "example": false
+ },
+ "addedPostInGroupNotification": {
+ "type": "boolean",
+ "description": "User receives an email when someone in a group the user is in creates a new post.",
+ "example": false
+ },
+ "followPushNotification": {
+ "type": "boolean",
+ "description": "User receives a notification when someone follows the user.",
+ "example": false
+ },
+ "followedUserAddedPostPushNotification": {
+ "type": "boolean",
+ "description": "User receives a notification when someone that the user follows adds a new post.",
+ "example": false
+ },
+ "postCommentedPushNotification": {
+ "type": "boolean",
+ "description": "User receives a notification when someone comments on the user's post.",
+ "example": false
+ },
+ "postLikedPushNotification": {
+ "type": "boolean",
+ "description": "User receives a notification when someone likes the user's post.",
+ "example": false
+ },
+ "mentionPushNotification": {
+ "type": "boolean",
+ "description": "User receives a notification when someone mentions the user in a post or comment.",
+ "example": false
+ },
+ "addedPostInGroupPushNotification": {
+ "type": "boolean",
+ "description": "User receives a notification when someone in a group the user is in creates a new post.",
+ "example": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "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": "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": "cmeswvdwi0000d2943c444xrw"
+ },
+ "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": "cmeswvdwj0001d294emyig7ux"
+ },
+ "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": "cmeswvdwj0002d294b1t5djyb"
+ },
+ "endCursor": {
+ "type": "string",
+ "example": "cmeswvdwj0003d29414082uyd"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/collections/{collectionId}/bookmarks": {
+ "post": {
+ "description": "Add a bookmark to an existing collection.",
+ "tags": ["Collections"],
+ "summary": "Add collection Bookmark",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "collectionId",
+ "schema": {
+ "type": "string",
+ "description": "The Id of the collection to be added.",
+ "example": "cmeswvei10008d294atxfhryv"
+ },
+ "required": true,
+ "description": "The Id of the collection to be added."
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "anyOf": [
+ {
+ "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 },
+ "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",
+ "example": 4
+ }
+ },
+ "required": ["key", "verseNumber", "mushaf"],
+ "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"
+ },
+ "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",
+ "example": 4
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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": "cmeswveib0009d294hspb3wiv"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "get": {
+ "description": "Get all resources that belong to an existing collection by collection id.",
+ "tags": ["Collections"],
+ "summary": "Get collection items by id",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "collectionId",
+ "schema": {
+ "type": "string",
+ "example": "cmeswvejx000cd2940jxl90rm"
+ }
+ },
+ {
+ "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": "cmeswvdwi0000d2943c444xrw"
+ },
+ "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": "cmeswvdwj0001d294emyig7ux"
+ },
+ "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/Bookmark" }
+ }
+ },
+ "additionalProperties": false
+ },
+ "pagination": {
+ "type": "object",
+ "properties": {
+ "startCursor": {
+ "type": "string",
+ "example": "cmeswvdwj0002d294b1t5djyb"
+ },
+ "endCursor": {
+ "type": "string",
+ "example": "cmeswvdwj0003d29414082uyd"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/collections/{collectionId}/bookmarks/{bookmarkId}": {
+ "delete": {
+ "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"],
+ "summary": "Delete collection bookmark by id",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "collectionId",
+ "schema": {
+ "type": "string",
+ "description": "The Id of the collection to be deleted.",
+ "example": "cmeswveis000ad294fobr1pgm"
+ },
+ "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": "cmeswveis000bd29490udbmsq"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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": "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": "cmeswvdwi0000d2943c444xrw"
+ },
+ "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": "cmeswvdwj0001d294emyig7ux"
+ },
+ "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": "cmeswvdwj0002d294b1t5djyb"
+ },
+ "endCursor": {
+ "type": "string",
+ "example": "cmeswvdwj0003d29414082uyd"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/bookmarks/": {
+ "post": {
+ "description": "Add a bookmark by details.",
+ "tags": ["Bookmarks"],
+ "summary": "Add user bookmark",
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "anyOf": [
+ {
+ "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
+ },
+ "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",
+ "example": 4
+ }
+ },
+ "required": ["key", "verseNumber", "mushaf"],
+ "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"
+ },
+ "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",
+ "example": 4
+ }
+ },
+ "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": { "$ref": "#/components/schemas/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
+ }
+ }
+ }
+ }
+ }
+ },
+ "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": "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": "cmeswvdwi0000d2943c444xrw"
+ },
+ "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": "cmeswvdwj0001d294emyig7ux"
+ },
+ "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/Bookmark" }
+ },
+ "pagination": {
+ "type": "object",
+ "properties": {
+ "startCursor": {
+ "type": "string",
+ "example": "cmeswvdwj0002d294b1t5djyb"
+ },
+ "endCursor": {
+ "type": "string",
+ "example": "cmeswvdwj0003d29414082uyd"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/bookmarks/{bookmarkId}": {
+ "delete": {
+ "description": "Delete a bookmark by id.",
+ "tags": ["Bookmarks"],
+ "summary": "Delete Bookmark",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "bookmarkId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the bookmark to be deleted.",
+ "example": "cmeswve9m0006d2941eho5c80"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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/Bookmark" }
+ },
+ "pagination": {
+ "type": "object",
+ "properties": {
+ "startCursor": {
+ "type": "string",
+ "example": "cmeswvdwj0002d294b1t5djyb"
+ },
+ "endCursor": {
+ "type": "string",
+ "example": "cmeswvdwj0003d29414082uyd"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/bookmarks/bookmark": {
+ "get": {
+ "description": "Get a bookmark by details",
+ "tags": ["Bookmarks"],
+ "summary": "Get bookmark",
+ "parameters": [
+ {
+ "in": "query",
+ "name": "key",
+ "schema": {
+ "type": "integer",
+ "description": "Surah, Juz or page number.",
+ "example": 2
+ },
+ "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": "verseNumber",
+ "schema": {
+ "type": "integer",
+ "description": "The Ayah number of the bookmark"
+ },
+ "required": false,
+ "description": "The Ayah number of the bookmark"
+ },
+ {
+ "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": { "$ref": "#/components/schemas/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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/bookmarks/collections": {
+ "get": {
+ "description": "Get all collections that a bookmark belongs to by bookmark details.",
+ "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": "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": "cmeswvdwi0000d2943c444xrw"
+ },
+ "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": "cmeswvdwj0001d294emyig7ux"
+ },
+ "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/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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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"
+ ],
+ "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",
+ "properties": {
+ "key": { "type": "string", "enum": ["type"] }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string",
+ "enum": [
+ "readingPreference",
+ "selectedWordByWordLocale",
+ "wordClickFunctionality",
+ "isReadingByRevelationOrder",
+ "wordByWordContentType",
+ "wordByWordDisplay"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string",
+ "enum": [
+ "tafsirFontScale",
+ "quranTextFontScale",
+ "translationFontScale",
+ "wordByWordFontScale",
+ "quranFont",
+ "mushafLines"
+ ]
+ }
+ },
+ "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"
+ ]
+ }
+ },
+ "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"],
+ "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"
+ ],
+ "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"]
+ }
+ },
+ "required": ["value"],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["tooltip", "inline"]
+ },
+ "example": ["tooltip"]
+ }
+ },
+ "required": ["value"],
+ "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
+ }
+ ]
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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" }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/reading-sessions/": {
+ "post": {
+ "description": "Create or update an existing reading session. Reading session is used to keep track of recently read Ayahs. 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.",
+ "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."
+ },
+ "verseNumber": {
+ "type": "integer",
+ "minimum": 1,
+ "description": "The Ayah number to be added to reading session."
+ }
+ },
+ "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": { "enum": ["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
+ }
+ }
+ }
+ }
+ }
+ },
+ "get": {
+ "description": "Get all existing reading sessions.",
+ "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": "cmeswvdwi0000d2943c444xrw"
+ },
+ "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": "cmeswvdwj0001d294emyig7ux"
+ },
+ "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": "cmeswvdwj0002d294b1t5djyb"
+ },
+ "endCursor": {
+ "type": "string",
+ "example": "cmeswvdwj0003d29414082uyd"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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"
+ ],
+ "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": "cmeswvdxx0004d294hpjdc7un"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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": "cmeswvesr000dd294e5u7h75y"
+ },
+ "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"
+ ],
+ "description": "The type of the goal.",
+ "example": "QURAN_TIME"
+ },
+ "amount": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$",
+ "example": "1:5-1:10"
+ },
+ { "type": "integer", "minimum": 1, "example": 600 }
+ ],
+ "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"],
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "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": "cmeswvesr000dd294e5u7h75y"
+ },
+ "required": true,
+ "description": "The id of the goal."
+ },
+ {
+ "in": "query",
+ "name": "category",
+ "schema": {
+ "type": "string",
+ "enum": ["QURAN", "COURSE", "QURAN_READING_PROGRAM"],
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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"
+ ],
+ "description": "The type of the goal.",
+ "example": "QURAN_TIME"
+ },
+ "amount": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^(\\d+):(\\d+)-(\\d+):(\\d+)$",
+ "example": "1:5-1:10"
+ },
+ { "type": "integer", "minimum": 1, "example": 600 }
+ ],
+ "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"],
+ "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": "cmeswvesr000dd294e5u7h75y"
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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"
+ ],
+ "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"
+ },
+ { "type": "integer", "minimum": 1, "example": 600 }
+ ],
+ "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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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": "cmeswvdwi0000d2943c444xrw"
+ },
+ "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": "cmeswvdwj0001d294emyig7ux"
+ },
+ "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": "cmeswvfn7000fd29412xt2gxq"
+ },
+ "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": "cmeswvdwj0002d294b1t5djyb"
+ },
+ "endCursor": {
+ "type": "string",
+ "example": "cmeswvdwj0003d29414082uyd"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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": "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/activity-days/": {
+ "post": {
+ "description": "Add or update an activity day.",
+ "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"
+ }
+ ]
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "get": {
+ "description": "Get user activity days.",
+ "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": "cmeswvdwi0000d2943c444xrw"
+ },
+ "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": "cmeswvdwj0001d294emyig7ux"
+ },
+ "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": "cmeswvdxx0004d294hpjdc7un"
+ },
+ "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": "cmeswvdwj0002d294b1t5djyb"
+ },
+ "endCursor": {
+ "type": "string",
+ "example": "cmeswvdwj0003d29414082uyd"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/users/profile": {
+ "get": {
+ "description": "Get user profile.",
+ "tags": ["Users"],
+ "summary": "Get User Profile",
+ "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/UserProfile" }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "put": {
+ "description": "Update user profile.",
+ "tags": ["Users"],
+ "summary": "Update user profile",
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "firstName": {
+ "type": "string",
+ "description": "The first name of the user.",
+ "example": "Amer"
+ },
+ "lastName": {
+ "type": "string",
+ "description": "The last name of the user.",
+ "example": "Abbas"
+ }
+ },
+ "required": ["firstName", "lastName"],
+ "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": ["User has been updated successfully."]
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/users/{username}/toggleFollow": {
+ "post": {
+ "description": "Toggle following a user.",
+ "tags": ["Users"],
+ "summary": "Toggle following a user",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "username",
+ "schema": {
+ "type": "string",
+ "description": "The username of the user to be followed/un-followed.",
+ "example": "amerabbas"
+ },
+ "required": true,
+ "description": "The username of the user to be followed/un-followed."
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {},
+ "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": {
+ "followed": {
+ "type": "boolean",
+ "description": "Whether the user is now followed or not.",
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/users/passwordResetEmail": {
+ "post": {
+ "description": "Send reset password email.",
+ "tags": ["Users"],
+ "summary": "Send reset password email",
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string",
+ "format": "email",
+ "description": "The email to send the reset password email to.",
+ "example": "test@gmail.com"
+ }
+ },
+ "required": ["email"],
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/users/confirmationEmail": {
+ "post": {
+ "description": "Send account confirmation email.",
+ "tags": ["Users"],
+ "summary": "Send account confirmation email",
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "email": {
+ "type": "string",
+ "format": "email",
+ "description": "The email to send the confirmation email to.",
+ "example": "test@gmail.com"
+ }
+ },
+ "required": ["email"],
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/users/{username}/registerAndroidDevice": {
+ "post": {
+ "description": "Register Android device.",
+ "tags": ["Users"],
+ "summary": "Register Android device",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "username",
+ "schema": {
+ "type": "string",
+ "description": "The username of the user.",
+ "example": "amerabbas"
+ },
+ "required": true,
+ "description": "The username of the user."
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "registrationId": {
+ "type": "string",
+ "description": "The Android device registration id of the user.",
+ "example": "cTpvB--yRgio45nWa971dO:APA91bHGyLZNS3PPSQmGFHV6CuuU1_nBz-eXqojEmN9qMfgcBQHqvUF8C09Ya50-aOOwYRVJIbTpy8mZ4LTiqcWlRZuIshdtvmcZ6u1w7XUqelf48EOmG3f6SH1HCha8G924Px9tiScm"
+ }
+ },
+ "required": ["registrationId"],
+ "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": ["Android device added successfully"]
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/users/notifications": {
+ "get": {
+ "description": "Get user notifications.",
+ "tags": ["Users"],
+ "summary": "Get user notifications",
+ "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": {
+ "notifications": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Notification"
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/users/notifications/{settingId}": {
+ "put": {
+ "description": "Update user notification settings.",
+ "tags": ["Users"],
+ "summary": "Update user notification settings",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "settingId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the notification settings to be updated.",
+ "example": 2159
+ },
+ "required": true,
+ "description": "The id of the notification settings to be updated."
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": { "$ref": "#/components/schemas/NotificationSettings" }
+ }
+ }
+ },
+ "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": [
+ "Notification settings have been updated successfully"
+ ]
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/posts/": {
+ "post": {
+ "description": "Add a post.",
+ "tags": ["Posts"],
+ "summary": "Add a post",
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "body": {
+ "type": "string",
+ "description": "The body of the post.",
+ "example": "I love Allah and his messenger."
+ },
+ "roomId": {
+ "type": "integer",
+ "description": "The Id of the room the post will be posted in.",
+ "example": 123
+ },
+ "isPrivate": {
+ "type": "boolean",
+ "description": "Whether the post should be posted as a private note.",
+ "example": false,
+ "default": false
+ },
+ "tagIds": {
+ "type": "array",
+ "items": { "type": "integer" },
+ "description": "The Ids of the tags the post is attached to",
+ "example": [432]
+ },
+ "references": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/PostReference"
+ },
+ "description": "The Surahs/Ayahs the post relates to.",
+ "example": [
+ { "surahId": 2 },
+ { "surahId": 5, "fromAyah": 6, "toAyah": 8 },
+ { "surahId": 114, "fromAyah": 2, "toAyah": 2 }
+ ]
+ }
+ },
+ "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": {
+ "message": { "enum": ["Post created successfully"] },
+ "postId": { "enum": [1235] }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "get": {
+ "description": "Get list of posts.",
+ "tags": ["Posts"],
+ "summary": "Get posts",
+ "parameters": [
+ {
+ "in": "query",
+ "name": "exactAyah",
+ "schema": {
+ "type": "boolean",
+ "description": "Get posts of an exact Ayah only and not of range of Ayahs (the default behavior).",
+ "example": true,
+ "default": false
+ },
+ "description": "Get posts of an exact Ayah only and not of range of Ayahs (the default behavior)."
+ },
+ {
+ "in": "query",
+ "name": "languages",
+ "schema": {
+ "type": "string",
+ "description": "Comma-separated language iso codes, to fetch posts in a specific language(s).",
+ "example": "en,ar"
+ },
+ "description": "Comma-separated language iso codes, to fetch posts in a specific language(s)."
+ },
+ {
+ "in": "query",
+ "name": "scholarsPosts",
+ "schema": {
+ "type": "boolean",
+ "description": "Include posts of scholars",
+ "example": true
+ },
+ "description": "Include posts of scholars"
+ },
+ {
+ "in": "query",
+ "name": "authorIds",
+ "schema": {
+ "type": "array",
+ "items": { "type": "integer" },
+ "description": "The Ids of the authors of the posts",
+ "example": [111312]
+ },
+ "description": "The Ids of the authors of the posts"
+ },
+ {
+ "in": "query",
+ "name": "studentsOfKnowledgePosts",
+ "schema": {
+ "type": "boolean",
+ "description": "Include posts of students of knowledge",
+ "example": true
+ },
+ "description": "Include posts of students of knowledge"
+ },
+ {
+ "in": "query",
+ "name": "verified",
+ "schema": {
+ "type": "boolean",
+ "description": "Include verified posts",
+ "example": true
+ },
+ "description": "Include verified posts"
+ },
+ {
+ "in": "query",
+ "name": "approved",
+ "schema": {
+ "type": "boolean",
+ "description": "Include approved posts",
+ "example": true
+ },
+ "description": "Include approved posts"
+ },
+ {
+ "in": "query",
+ "name": "updatedSince",
+ "schema": {
+ "type": "string",
+ "description": "Get posts that are updated after the given date (inclusive).",
+ "example": "10-02-2015 05:05:06 PM"
+ },
+ "description": "Get posts that are updated after the given date (inclusive)."
+ },
+ {
+ "in": "query",
+ "name": "filters",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "tagIds": {
+ "type": "array",
+ "items": { "type": "integer" },
+ "description": "The Ids of the tags the post is attached to",
+ "example": [432]
+ },
+ "postTypeIds": {
+ "type": "array",
+ "items": { "type": "integer" },
+ "description": "The Ids of the types the post is attached to",
+ "example": [1]
+ },
+ "tagsOperation": {
+ "type": "string",
+ "enum": ["OR", "AND"],
+ "description": "**`OR`** = Will get posts that match **any** of the passed filters \n\n **`AND`** = Will get posts that match **all** of the passed filters",
+ "example": "OR"
+ },
+ "references": {
+ "type": "array",
+ "items": { "$ref": "#/components/schemas/PostReference" },
+ "description": "The Surahs/Ayahs the post relates to.",
+ "example": [
+ { "surahId": 2 },
+ { "surahId": 5, "fromAyah": 6, "toAyah": 8 },
+ { "surahId": 114, "fromAyah": 2, "toAyah": 2 }
+ ]
+ },
+ "referencesOperation": {
+ "type": "string",
+ "enum": ["OR", "AND"],
+ "description": "**`OR`** = Will get posts that match **any** of the passed filters \n\n **`AND`** = Will get posts that match **all** of the passed filters",
+ "example": "OR"
+ }
+ },
+ "additionalProperties": false,
+ "description": "Further customize the results, you can fetch posts of specific members, post that have specific tags, post for specific surah, ayah range or single ayah etc."
+ },
+ "description": "Further customize the results, you can fetch posts of specific members, post that have specific tags, post for specific surah, ayah range or single ayah etc."
+ },
+ {
+ "in": "query",
+ "name": "tab",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "newest",
+ "following",
+ "draft",
+ "favorite",
+ "most_popular",
+ "only_room_members",
+ "public",
+ "feed"
+ ],
+ "description": "**`newest`** = Recent posts will be at the top. \n\n **`following`** = Get posts of authors the current user is following. \n\n **`draft`** = Get current user's private posts. \n\n **`favorite`** = Get current user's favorite posts. \n\n **`most_popular`** = Get most popular posts. \n\n **`only_room_members`** = Get posts that are posted by current room members. \n\n **`public`** = Include public posts of private rooms. \n\n **`feed`** = When passed, this will ignore most passed filters and send `verified` posts (if `verified` = `true`), posts by scholars and student of knowledge, verified posts, posts from author the user is following.",
+ "example": "most_popular",
+ "default": "most_popular"
+ },
+ "description": "**`newest`** = Recent posts will be at the top. \n\n **`following`** = Get posts of authors the current user is following. \n\n **`draft`** = Get current user's private posts. \n\n **`favorite`** = Get current user's favorite posts. \n\n **`most_popular`** = Get most popular posts. \n\n **`only_room_members`** = Get posts that are posted by current room members. \n\n **`public`** = Include public posts of private rooms. \n\n **`feed`** = When passed, this will ignore most passed filters and send `verified` posts (if `verified` = `true`), posts by scholars and student of knowledge, verified posts, posts from author the user is following."
+ },
+ {
+ "in": "query",
+ "name": "feed",
+ "schema": {
+ "type": "boolean",
+ "description": "Include only trusted posts and posts by author the user is following.",
+ "example": false
+ },
+ "description": "Include only trusted posts and posts by author the user is following."
+ },
+ {
+ "in": "query",
+ "name": "page",
+ "schema": {
+ "type": "integer",
+ "description": "The current post page. Each page will have 25 posts by default. `pages` response field will have the total number of pages."
+ },
+ "description": "The current post page. Each page will have 25 posts by default. `pages` response field will have the total number of pages."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Request has been handled successfully.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": { "type": "boolean", "example": true },
+ "data": {
+ "type": "object",
+ "properties": {
+ "posts": {
+ "type": "array",
+ "items": { "$ref": "#/components/schemas/Post" },
+ "description": "List of posts"
+ },
+ "pages": {
+ "type": "integer",
+ "description": "Number of pages matching the queried posts"
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/posts/{postId}": {
+ "get": {
+ "description": "Get a post.",
+ "tags": ["Posts"],
+ "summary": "Get a post",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "postId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the post.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the post."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Request has been handled successfully.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": { "type": "boolean", "example": true },
+ "data": { "$ref": "#/components/schemas/Post" }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "put": {
+ "description": "Update a post.",
+ "tags": ["Posts"],
+ "summary": "Update a post",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "postId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the comment to be updated.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the comment to be updated."
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "body": {
+ "type": "string",
+ "description": "The body of the post.",
+ "example": "I love Allah and his messenger."
+ },
+ "roomId": {
+ "type": "integer",
+ "description": "The Id of the room the post will be posted in.",
+ "example": 123
+ },
+ "isPrivate": {
+ "type": "boolean",
+ "description": "Whether the post should be posted as a private note.",
+ "example": false,
+ "default": false
+ },
+ "tagIds": {
+ "type": "array",
+ "items": { "type": "integer" },
+ "description": "The Ids of the tags the post is attached to",
+ "example": [432]
+ },
+ "references": {
+ "type": "array",
+ "items": { "$ref": "#/components/schemas/PostReference" },
+ "description": "The Surahs/Ayahs the post relates to. If `references` is not passed with update post API, existing references of the post will be removed.",
+ "example": [
+ { "surahId": 2 },
+ { "surahId": 5, "fromAyah": 6, "toAyah": 8 },
+ { "surahId": 114, "fromAyah": 2, "toAyah": 2 }
+ ]
+ }
+ },
+ "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": {
+ "message": { "enum": ["Post was updated successfully"] }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "description": "Delete a post.",
+ "tags": ["Posts"],
+ "summary": "Delete a post",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "postId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the post to be deleted.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the post 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": ["Post was removed successfully"] }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/posts/toggleLike/{postId}": {
+ "post": {
+ "description": "Toggle like a post.",
+ "tags": ["Posts"],
+ "summary": "Toggle like a post",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "postId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the post.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the post."
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {},
+ "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": { "liked": { "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/posts/{postId}/comments": {
+ "get": {
+ "description": "Get all comments of a specific post.",
+ "tags": ["Posts"],
+ "summary": "Get post's comments",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "postId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the post.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the post."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Request has been handled successfully.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": { "type": "boolean", "example": true },
+ "data": {
+ "type": "object",
+ "properties": {
+ "comments": {
+ "type": "array",
+ "items": { "$ref": "#/components/schemas/Comment" },
+ "description": "List of comments that belong to the post."
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/posts/toggleSave/{postId}": {
+ "post": {
+ "description": "Toggle save a post.",
+ "tags": ["Posts"],
+ "summary": "Toggle save a post",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "postId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the post.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the post."
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {},
+ "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": { "saved": { "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/posts/report/{postId}": {
+ "post": {
+ "description": "Report a post.",
+ "tags": ["Posts"],
+ "summary": "Report a post",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "postId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the post.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the post."
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "abuse": {
+ "type": "string",
+ "enum": [
+ "Offensive language",
+ "Inappropriate content",
+ "Other"
+ ],
+ "description": "The report abuse type",
+ "example": "Inappropriate content"
+ },
+ "comment": {
+ "type": "string",
+ "description": "Report description/details.",
+ "example": "Very inappropriate!"
+ }
+ },
+ "required": ["abuse", "comment"],
+ "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": ["Post was reported successfully"]
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/posts/view/{postId}": {
+ "post": {
+ "description": "Log a post view.",
+ "tags": ["Posts"],
+ "summary": "Log a post view",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "postId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the post.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the post."
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {},
+ "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" } },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/comments/": {
+ "post": {
+ "description": "Add a comment.",
+ "tags": ["Comments"],
+ "summary": "Add a comment",
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "body": {
+ "type": "string",
+ "description": "The body of the comment.",
+ "example": "Amazing post mashAllah!"
+ },
+ "postId": {
+ "type": "integer",
+ "description": "The ID of the post the comment will be added to.",
+ "example": 123
+ },
+ "isPrivate": {
+ "type": "boolean",
+ "description": "Whether the comment should be publicly viewed or not.",
+ "example": false,
+ "default": false
+ }
+ },
+ "required": ["body", "postId"],
+ "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": ["Comment created successfully"] }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/comments/{commentId}": {
+ "put": {
+ "description": "Update a comment.",
+ "tags": ["Comments"],
+ "summary": "Update a comment",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "commentId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the comment to be updated.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the comment to be updated."
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "body": {
+ "type": "string",
+ "description": "The updated body of the comment.",
+ "example": "Amazing post mashAllah!!"
+ }
+ },
+ "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": {
+ "message": {
+ "enum": ["Comment was updated successfully"]
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "description": "Delete a comment.",
+ "tags": ["Comments"],
+ "summary": "Delete a comment",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "commentId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the comment to be deleted.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the comment 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": ["Comment was removed successfully"]
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/groups/": {
+ "get": {
+ "description": "Get all groups",
+ "tags": ["Groups"],
+ "summary": "Get user groups",
+ "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": {
+ "pages": {
+ "type": "array",
+ "items": { "$ref": "#/components/schemas/Room" },
+ "description": "List of user pages."
+ },
+ "groups": {
+ "type": "array",
+ "items": { "$ref": "#/components/schemas/Room" },
+ "description": "List of user groups."
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/groups/{groupId}": {
+ "get": {
+ "description": "Get group settings.",
+ "tags": ["Groups"],
+ "summary": "Get group settings",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "groupId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the group.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the group."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Request has been handled successfully.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": { "type": "boolean", "example": true },
+ "data": { "$ref": "#/components/schemas/Room" }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/groups/{groupId}/assignAsAdmin": {
+ "put": {
+ "description": "Assign user as a group admin.",
+ "tags": ["Groups"],
+ "summary": "Assign user as a group admin",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "groupId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the group.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the group."
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "userId": {
+ "type": "integer",
+ "description": "The ID of the user being assigned as an admin.",
+ "example": 153
+ }
+ },
+ "required": ["userId"],
+ "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": [
+ "User has been assigned as an admin successfully."
+ ]
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/groups/{groupId}/inviteUser": {
+ "put": {
+ "description": "Invite user to group.",
+ "tags": ["Groups"],
+ "summary": "Invite user to group",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "groupId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the group.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the group."
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "userId": {
+ "type": "integer",
+ "description": "The ID of the user being invited to group.",
+ "example": 153
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the user being invited to group.",
+ "example": "amer@quran.com"
+ }
+ },
+ "additionalProperties": false,
+ "description": "Invite user by `userId` or `email`. Only one of them should be passed."
+ }
+ }
+ }
+ },
+ "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": ["User has been invited successfully."]
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/groups/{groupId}/removeUser": {
+ "put": {
+ "description": "Remove user from group.",
+ "tags": ["Groups"],
+ "summary": "Remove user from group",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "groupId",
+ "schema": {
+ "type": "string",
+ "description": "The id of the group.",
+ "example": 1234
+ },
+ "required": true,
+ "description": "The id of the group."
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "userId": {
+ "type": "integer",
+ "description": "The ID of the user being removed from group.",
+ "example": 153
+ }
+ },
+ "required": ["userId"],
+ "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": ["User has been removed successfully."]
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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": "cmeswvdwj0002d294b1t5djyb"
+ },
+ "endCursor": {
+ "type": "string",
+ "example": "cmeswvdwj0003d29414082uyd"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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": "cmeswvdwj0002d294b1t5djyb"
+ },
+ "endCursor": {
+ "type": "string",
+ "example": "cmeswvdwj0003d29414082uyd"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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
+ }
+ }
+ }
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}