openapi: 3.0.3 info: title: Gallery-Archivist API version: 1.0.0 description: A tool for archiving online galleries paths: /api/auth/logout/: post: operationId: auth_logout_create tags: - auth requestBody: content: application/json: schema: $ref: '#/components/schemas/Logout' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Logout' multipart/form-data: schema: $ref: '#/components/schemas/Logout' required: true security: - cookieAuth: [] - jwtAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Logout' description: '' /api/auth/token/: post: operationId: auth_token_create description: |- Takes a set of user credentials and returns an access and refresh JSON web token pair to prove the authentication of those credentials. tags: - auth requestBody: content: application/json: schema: $ref: '#/components/schemas/TokenObtainPair' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/TokenObtainPair' multipart/form-data: schema: $ref: '#/components/schemas/TokenObtainPair' required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/TokenObtainPair' description: '' /api/auth/token/refresh/: post: operationId: auth_token_refresh_create description: |- Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid. tags: - auth requestBody: content: application/json: schema: $ref: '#/components/schemas/TokenRefresh' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/TokenRefresh' multipart/form-data: schema: $ref: '#/components/schemas/TokenRefresh' required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/TokenRefresh' description: '' /api/creators/: get: operationId: creators_list tags: - creators security: - cookieAuth: [] - jwtAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/CreatorList' description: '' /api/creators/{creator_id}/: get: operationId: creators_retrieve parameters: - in: path name: creator_id schema: type: string required: true tags: - creators security: - cookieAuth: [] - jwtAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/CreatorDetails' description: '' /api/posts/: get: operationId: posts_list_all parameters: - name: page required: false in: query description: A page number within the paginated result set. schema: type: integer - name: page_size required: false in: query description: Number of results to return per page. schema: type: integer tags: - posts security: - cookieAuth: [] - jwtAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedPostPreviewList' description: '' /api/posts/{post_id}/: get: operationId: posts_retrieve_by_id parameters: - in: path name: post_id schema: type: string required: true tags: - posts security: - cookieAuth: [] - jwtAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Post' description: '' /api/posts/{source_site}/: get: operationId: posts_list_by_source parameters: - name: page required: false in: query description: A page number within the paginated result set. schema: type: integer - name: page_size required: false in: query description: Number of results to return per page. schema: type: integer - in: path name: source_site schema: type: string required: true tags: - posts security: - cookieAuth: [] - jwtAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedPostPreviewList' description: '' /api/posts/{source_site}/{creator_slug_or_id}/: get: operationId: posts_list_by_source_and_creator parameters: - in: path name: creator_slug_or_id schema: type: string required: true - name: page required: false in: query description: A page number within the paginated result set. schema: type: integer - name: page_size required: false in: query description: Number of results to return per page. schema: type: integer - in: path name: source_site schema: type: string required: true tags: - posts security: - cookieAuth: [] - jwtAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedPostPreviewList' description: '' /api/posts/{source_site}/{creator_slug_or_id}/{category}: get: operationId: posts_list_by_source_creator_and_category parameters: - in: path name: category schema: type: string required: true - in: path name: creator_slug_or_id schema: type: string required: true - name: page required: false in: query description: A page number within the paginated result set. schema: type: integer - name: page_size required: false in: query description: Number of results to return per page. schema: type: integer - in: path name: source_site schema: type: string required: true tags: - posts security: - cookieAuth: [] - jwtAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedPostPreviewList' description: '' /api/posts/{source_site}/{creator_slug_or_id}/{post_id}/: get: operationId: posts_retrieve_by_site_creator_id parameters: - in: path name: creator_slug_or_id schema: type: string required: true - in: path name: post_id schema: type: string required: true - in: path name: source_site schema: type: string required: true tags: - posts security: - cookieAuth: [] - jwtAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Post' description: '' /api/user/profile/: get: operationId: user_profile_retrieve description: Retrieve and update the authenticated user's profile. tags: - user security: - cookieAuth: [] - jwtAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/User' description: '' put: operationId: user_profile_update description: Retrieve and update the authenticated user's profile. tags: - user requestBody: content: application/json: schema: $ref: '#/components/schemas/User' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/User' multipart/form-data: schema: $ref: '#/components/schemas/User' required: true security: - cookieAuth: [] - jwtAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/User' description: '' patch: operationId: user_profile_partial_update description: Retrieve and update the authenticated user's profile. tags: - user requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedUser' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedUser' multipart/form-data: schema: $ref: '#/components/schemas/PatchedUser' security: - cookieAuth: [] - jwtAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/User' description: '' components: schemas: CreatorDetails: type: object properties: creator_id: type: string nullable: true maxLength: 128 slug: type: string maxLength: 64 name: type: string maxLength: 64 mature: type: boolean avatar_url: type: string nullable: true readOnly: true banner_url: type: string nullable: true readOnly: true description: type: array items: type: object additionalProperties: type: string readOnly: true date: type: object additionalProperties: type: string readOnly: true categories: type: array items: type: object additionalProperties: type: string readOnly: true required: - avatar_url - banner_url - categories - date - description - name - slug CreatorList: type: object properties: creator_id: type: string nullable: true maxLength: 128 source_site: type: string readOnly: true slug: type: string maxLength: 64 name: type: string maxLength: 64 mature: type: boolean date: type: object additionalProperties: type: string readOnly: true description: type: string nullable: true readOnly: true avatar_url: type: string nullable: true readOnly: true banner_url: type: string nullable: true readOnly: true required: - avatar_url - banner_url - date - description - name - slug - source_site Logout: type: object properties: refresh: type: string required: - refresh PaginatedPostPreviewList: type: object required: - count - results properties: count: type: integer example: 123 next: type: string nullable: true format: uri example: http://api.example.org/accounts/?page=4 previous: type: string nullable: true format: uri example: http://api.example.org/accounts/?page=2 results: type: array items: $ref: '#/components/schemas/PostPreview' PatchedUser: type: object properties: username: type: string description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. pattern: ^[\w.@+-]+$ maxLength: 150 email: type: string format: email title: Email address maxLength: 254 first_name: type: string maxLength: 150 last_name: type: string maxLength: 150 profile: $ref: '#/components/schemas/UserProfile' Post: type: object properties: post_id: type: string maxLength: 128 title: type: object additionalProperties: type: string nullable: true readOnly: true description: type: object additionalProperties: type: string readOnly: true source_site: type: object additionalProperties: type: string readOnly: true creator: type: object additionalProperties: type: string nullable: true readOnly: true date: type: object additionalProperties: type: string readOnly: true mature: type: boolean media: type: array items: type: object additionalProperties: type: string readOnly: true tags: type: array items: type: string readOnly: true required: - creator - date - description - media - post_id - source_site - tags - title PostPreview: type: object properties: post_id: type: string maxLength: 128 mature: type: boolean title: type: string nullable: true readOnly: true description: type: string nullable: true readOnly: true source_site: type: object additionalProperties: type: string readOnly: true category: type: array items: type: object additionalProperties: type: string readOnly: true creator: type: object additionalProperties: type: string nullable: true readOnly: true date: type: object additionalProperties: type: string readOnly: true media_count: type: integer readOnly: true media: type: array items: type: object additionalProperties: type: string readOnly: true tags: type: array items: type: string readOnly: true required: - category - creator - date - description - media - media_count - post_id - source_site - tags - title TokenObtainPair: type: object properties: username: type: string writeOnly: true password: type: string writeOnly: true access: type: string readOnly: true refresh: type: string readOnly: true required: - access - password - refresh - username TokenRefresh: type: object properties: access: type: string readOnly: true refresh: type: string writeOnly: true required: - access - refresh User: type: object properties: username: type: string description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. pattern: ^[\w.@+-]+$ maxLength: 150 email: type: string format: email title: Email address maxLength: 254 first_name: type: string maxLength: 150 last_name: type: string maxLength: 150 profile: $ref: '#/components/schemas/UserProfile' required: - profile - username UserProfile: type: object properties: show_mature: type: boolean securitySchemes: cookieAuth: type: apiKey in: cookie name: sessionid jwtAuth: type: http scheme: bearer bearerFormat: JWT