openapi: 3.2.0 info: title: Pexafy Collections API x-refined-note: - x-logo differs across the merged source definitions and was not carried version: '1.0' description: 'Operations tagged collections across 2 of this provider''s published API definitions: pexafy-openapi-v1.3.0.json, pexafy-openapi.json. Each path carries the servers of the definition it was published in.' servers: - url: https://api.pexafy.com/api/v1 description: Production - url: https://api.pexafy.com description: Production tags: - name: collections description: Saved sets, owned by an API key. paths: /collections: get: operationId: listCollections tags: - collections summary: Collections owned by the calling key responses: '200': description: Your collections. content: application/json: schema: $ref: '#/components/schemas/CollectionListEnvelope' '401': description: The API key is missing, malformed or revoked. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: unauthenticated message: The API key is missing, malformed or revoked. request_id: req_01J8Z3 '429': description: Too many requests, or the plan quota is exhausted. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: rate_limited message: Too many requests, or the plan quota is exhausted. request_id: req_01J8Z3 security: - apiKey: [] post: operationId: createCollection tags: - collections summary: Create a collection requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CollectionInput' responses: '201': description: The created collection. content: application/json: schema: $ref: '#/components/schemas/CollectionEnvelope' '400': description: The request could not be parsed. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: bad_request message: The request could not be parsed. request_id: req_01J8Z3 '401': description: The API key is missing, malformed or revoked. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: unauthenticated message: The API key is missing, malformed or revoked. request_id: req_01J8Z3 '422': description: A parameter was rejected before the search ran. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: validation_failed message: A parameter was rejected before the search ran. request_id: req_01J8Z3 '429': description: Too many requests, or the plan quota is exhausted. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: rate_limited message: Too many requests, or the plan quota is exhausted. request_id: req_01J8Z3 security: - apiKey: [] servers: - url: https://api.pexafy.com/api/v1 description: Production /collections/{collection_id}: get: operationId: getCollection tags: - collections summary: One collection parameters: - name: collection_id in: path description: Collection id. schema: type: integer format: int64 required: true responses: '200': description: The collection. content: application/json: schema: $ref: '#/components/schemas/CollectionEnvelope' '401': description: The API key is missing, malformed or revoked. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: unauthenticated message: The API key is missing, malformed or revoked. request_id: req_01J8Z3 '403': description: The key is valid but lacks the scope for this call. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: forbidden message: The key is valid but lacks the scope for this call. request_id: req_01J8Z3 '404': description: No such resource. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: not_found message: No such resource. request_id: req_01J8Z3 '429': description: Too many requests, or the plan quota is exhausted. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: rate_limited message: Too many requests, or the plan quota is exhausted. request_id: req_01J8Z3 security: - apiKey: [] delete: operationId: deleteCollection tags: - collections summary: Delete a collection description: Deleting a collection does not delete anything else; the photos are not yours. parameters: - name: collection_id in: path description: Collection id. schema: type: integer format: int64 required: true responses: '204': description: Gone. '401': description: The API key is missing, malformed or revoked. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: unauthenticated message: The API key is missing, malformed or revoked. request_id: req_01J8Z3 '403': description: The key is valid but lacks the scope for this call. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: forbidden message: The key is valid but lacks the scope for this call. request_id: req_01J8Z3 '404': description: No such resource. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: not_found message: No such resource. request_id: req_01J8Z3 '429': description: Too many requests, or the plan quota is exhausted. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: rate_limited message: Too many requests, or the plan quota is exhausted. request_id: req_01J8Z3 security: - apiKey: [] servers: - url: https://api.pexafy.com/api/v1 description: Production /collections/{collection_id}/photos: post: operationId: addPhotoToCollection tags: - collections summary: Add a photo to a collection parameters: - name: collection_id in: path description: Collection id. schema: type: integer format: int64 required: true requestBody: required: true content: application/json: schema: type: object required: - photo_id properties: photo_id: type: string format: uuid example: photo_id: 0192f3a1-6c1e-7a3b-9f2d-4c8e1b5a7d20 responses: '201': description: The new membership. content: application/json: schema: $ref: '#/components/schemas/CollectionItemEnvelope' '200': description: The photo was already in the collection; adding it again is not an error. content: application/json: schema: $ref: '#/components/schemas/CollectionItemEnvelope' '401': description: The API key is missing, malformed or revoked. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: unauthenticated message: The API key is missing, malformed or revoked. request_id: req_01J8Z3 '403': description: The key is valid but lacks the scope for this call. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: forbidden message: The key is valid but lacks the scope for this call. request_id: req_01J8Z3 '404': description: No such resource. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: not_found message: No such resource. request_id: req_01J8Z3 '422': description: A parameter was rejected before the search ran. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: validation_failed message: A parameter was rejected before the search ran. request_id: req_01J8Z3 '429': description: Too many requests, or the plan quota is exhausted. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: rate_limited message: Too many requests, or the plan quota is exhausted. request_id: req_01J8Z3 security: - apiKey: [] servers: - url: https://api.pexafy.com/api/v1 description: Production /collections/{collection_id}/photos/{photo_id}: delete: operationId: removePhotoFromCollection tags: - collections summary: Remove a photo from a collection parameters: - name: collection_id in: path description: Collection id. schema: type: integer format: int64 required: true - name: photo_id in: path description: UUIDv7 of the photo. schema: type: string format: uuid required: true responses: '204': description: Gone. '401': description: The API key is missing, malformed or revoked. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: unauthenticated message: The API key is missing, malformed or revoked. request_id: req_01J8Z3 '403': description: The key is valid but lacks the scope for this call. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: forbidden message: The key is valid but lacks the scope for this call. request_id: req_01J8Z3 '404': description: No such resource. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: not_found message: No such resource. request_id: req_01J8Z3 '429': description: Too many requests, or the plan quota is exhausted. content: application/json: schema: $ref: '#/components/schemas/ErrorEnvelope' example: success: false error: code: rate_limited message: Too many requests, or the plan quota is exhausted. request_id: req_01J8Z3 security: - apiKey: [] servers: - url: https://api.pexafy.com/api/v1 description: Production /api/v1/collections: get: tags: - collections summary: List collections description: 'List all the collections (saved photo albums) that belong to your account, newest first. Each entry includes its `name`, `description`, `photos_count` and `cover_photo_id`. > A **collection** is a named group of photos you save to your account, like an album or a moodboard.' operationId: list_collections_api_v1_collections_get parameters: [] responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/CollectionListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - ApiKeyAuth: [] post: tags: - collections summary: Create a collection description: Create a new collection (a saved album of photos). Your plan may limit how many collections you can have; if you reach the limit you'll get a `403` asking you to upgrade. operationId: create_collection_api_v1_collections_post parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CollectionCreateBody' responses: '201': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/CollectionResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - ApiKeyAuth: [] servers: - url: https://api.pexafy.com description: Production /api/v1/collections/{collection_id}: get: tags: - collections summary: Get a collection description: Retrieve a single collection together with the photos it contains, the most recently added first. operationId: get_collection_api_v1_collections__collection_id__get parameters: - name: collection_id in: path required: true schema: type: integer title: Collection Id description: The collection's numeric identifier. responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/CollectionResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - ApiKeyAuth: [] delete: tags: - collections summary: Delete a collection description: Permanently delete a collection and remove every photo saved in it. This cannot be undone (the original photos in the library are not affected). operationId: delete_collection_api_v1_collections__collection_id__delete parameters: - name: collection_id in: path required: true schema: type: integer title: Collection Id description: The collection's numeric identifier. responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DeletedResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - ApiKeyAuth: [] servers: - url: https://api.pexafy.com description: Production /api/v1/collections/{collection_id}/photos: post: tags: - collections summary: Add a photo to a collection description: Save a photo into a collection. The photo automatically becomes the collection's cover if it is the first one added. Adding the same photo twice returns a `409`. operationId: add_photo_to_collection_api_v1_collections__collection_id__photos_post parameters: - name: collection_id in: path required: true schema: type: integer title: Collection Id description: The numeric identifier of the collection to add the photo to. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AddPhotoBody' responses: '201': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/CollectionItemResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - ApiKeyAuth: [] servers: - url: https://api.pexafy.com description: Production /api/v1/collections/{collection_id}/photos/{photo_id}: delete: tags: - collections summary: Remove a photo from a collection description: Remove a photo from a collection. If it was the cover, the most recently added remaining photo becomes the new cover. operationId: remove_photo_from_collection_api_v1_collections__collection_id__photos__photo_id__delete parameters: - name: collection_id in: path required: true schema: type: integer title: Collection Id description: The numeric identifier of the collection to remove the photo from. - name: photo_id in: path required: true schema: type: string title: Photo Id description: The Pexafy `photo_id` of the photo to remove from the collection. responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DeletedResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - ApiKeyAuth: [] servers: - url: https://api.pexafy.com description: Production components: schemas: Meta: type: object properties: request_id: type: string took_ms: type: number description: Server side time, excluding transfer. CollectionItemEnvelope: type: object required: - success - data properties: success: type: boolean data: $ref: '#/components/schemas/CollectionItem' meta: $ref: '#/components/schemas/Meta' example: success: true data: id: 5 photo_id: 0192f3a1-6c1e-7a3b-9f2d-4c8e1b5a7d20 ErrorEnvelope: type: object required: - success - error description: Every failure uses this shape, whatever the status code. properties: success: type: boolean enum: - false error: type: object required: - code - message properties: code: type: string description: 'Machine readable and stable across versions. Branch on this, not on the message. The set is extensible: treat an unrecognised code as a generic failure of its status class.' example: validation_failed message: type: string description: Human readable, not stable. request_id: type: string field: type: - string - 'null' description: Which parameter was rejected, when the failure is about one. CollectionInput: type: object required: - name description: 'What a client may set on a collection. Deliberately not the same component as Collection: sharing one would make every added response field an edit to the request contract as well.' properties: name: type: string minLength: 1 maxLength: 120 description: type: - string - 'null' maxLength: 2000 is_public: type: boolean default: false example: name: office interiors is_public: false CollectionEnvelope: type: object required: - success - data properties: success: type: boolean data: $ref: '#/components/schemas/Collection' meta: $ref: '#/components/schemas/Meta' example: success: true data: id: 8814 name: office interiors is_public: false photos_count: 37 CollectionItem: type: object required: - id - photo_id properties: id: type: integer format: int64 photo_id: type: string format: uuid photo_thumbnail_url: type: - string - 'null' format: uri photo_source: type: - string - 'null' photo_photographer: type: - string - 'null' added_at: type: string format: date-time example: id: 5 photo_id: 0192f3a1-6c1e-7a3b-9f2d-4c8e1b5a7d20 CollectionListEnvelope: type: object required: - success - data properties: success: type: boolean data: type: array items: $ref: '#/components/schemas/Collection' meta: $ref: '#/components/schemas/Meta' example: success: true data: - id: 8814 name: office interiors is_public: false photos_count: 37 Collection: type: object required: - id - name properties: id: type: integer format: int64 name: type: string maxLength: 120 description: type: - string - 'null' maxLength: 2000 is_public: type: boolean default: false cover_photo_id: type: - string - 'null' format: uuid photos_count: type: integer minimum: 0 created_at: type: string format: date-time updated_at: type: string format: date-time example: id: 8814 name: office interiors is_public: false photos_count: 37 Meta_2: type: object properties: request_id: type: string description: Unique id for this request (quote it in support tickets). took_ms: type: number description: Server processing time in milliseconds. CollectionResponse: type: object properties: success: type: boolean data: allOf: - $ref: '#/components/schemas/Collection_2' - type: object properties: photos: type: array items: $ref: '#/components/schemas/CollectionItem_2' meta: $ref: '#/components/schemas/Meta_2' error: anyOf: - $ref: '#/components/schemas/ApiError' - type: 'null' ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError CollectionItemResponse: type: object properties: success: type: boolean data: $ref: '#/components/schemas/CollectionItem_2' meta: $ref: '#/components/schemas/Meta_2' error: anyOf: - $ref: '#/components/schemas/ApiError' - type: 'null' CollectionCreateBody: properties: name: type: string maxLength: 255 minLength: 1 title: Name description: anyOf: - type: string maxLength: 1000 - type: 'null' title: Description is_public: type: boolean title: Is Public default: false type: object required: - name title: CollectionCreateBody ApiError: type: object properties: code: type: string description: Machine-readable error code (e.g. `MISSING_PARAMS`, `PHOTO_NOT_FOUND`). message: type: string description: Human-readable error message. request_id: type: string required: - code - message HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError AddPhotoBody: properties: photo_id: type: string maxLength: 255 minLength: 1 title: Photo Id photo_thumbnail_url: anyOf: - type: string maxLength: 2048 - type: 'null' title: Photo Thumbnail Url photo_source: anyOf: - type: string maxLength: 100 - type: 'null' title: Photo Source photo_photographer: anyOf: - type: string maxLength: 255 - type: 'null' title: Photo Photographer type: object required: - photo_id title: AddPhotoBody CollectionItem_2: type: object properties: id: type: integer photo_id: type: string photo_thumbnail_url: type: - string - 'null' photo_source: type: - string - 'null' photo_photographer: type: - string - 'null' added_at: type: string format: date-time CollectionListResponse: type: object properties: success: type: boolean data: type: array items: $ref: '#/components/schemas/Collection_2' meta: $ref: '#/components/schemas/Meta_2' error: anyOf: - $ref: '#/components/schemas/ApiError' - type: 'null' DeletedResponse: type: object properties: success: type: boolean data: type: object properties: deleted: type: boolean meta: $ref: '#/components/schemas/Meta_2' error: anyOf: - $ref: '#/components/schemas/ApiError' - type: 'null' Collection_2: type: object properties: id: type: integer name: type: string description: type: - string - 'null' is_public: type: boolean cover_photo_id: type: string created_at: type: string format: date-time updated_at: type: string format: date-time photos_count: type: integer securitySchemes: apiKey: type: http scheme: bearer description: Send the key as a bearer token. Keys carry scopes; a read scoped key gets a 403 on anything under /collections. ApiKeyAuth: type: apiKey in: header name: x-api-key description: 'Pass your Pexafy API key in this header. Get your API key at [pexafy.com/dashboard/api-keys/create](https://pexafy.com/dashboard/api-keys/create/).' x-refined-from: - pexafy-openapi-v1.3.0.json - pexafy-openapi.json