Phraseanet Baskets API

User-curated working sets of records.

Documentation

Specifications

Other Resources

OpenAPI Specification

phraseanet-baskets-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Phraseanet API (v1) Account Baskets API
  description: Phraseanet is an open-source (GPL-v3) Digital Asset Management (DAM) platform by Alchemy. This document models the documented Phraseanet REST API v1, which is secured with OAuth2 and covers records, databoxes and collections, metadata, search, stories, baskets, and feeds. Phraseanet is self-hosted, so the API is served from each organization's own instance - there is no single public shared endpoint. Replace the server host with your Phraseanet instance. All responses are wrapped in an object with `meta` and `response` fields and are JSON by default. A newer API v3 is published on SwaggerHub (alchemy-fr/phraseanet.api.v3). Endpoints here are grounded in the public v1 route documentation; request and response bodies are honestly modeled and should be confirmed against your Phraseanet version.
  version: 1.5.0
  contact:
    name: Alchemy - Phraseanet
    url: https://www.phraseanet.com/
  license:
    name: GPL-3.0
    url: https://github.com/alchemy-fr/Phraseanet/blob/4.1/LICENSE
servers:
- url: https://{host}/api/v1
  description: Phraseanet instance (self-hosted)
  variables:
    host:
      default: your-phraseanet-instance
      description: Hostname of your Phraseanet installation.
security:
- oauth2: []
- oauthTokenParam: []
tags:
- name: Baskets
  description: User-curated working sets of records.
paths:
  /baskets/list:
    get:
      operationId: listBaskets
      tags:
      - Baskets
      summary: List baskets
      description: Returns the baskets owned by or shared with the authenticated user.
      responses:
        '200':
          description: A list of baskets.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
  /baskets/add:
    post:
      operationId: addBasket
      tags:
      - Baskets
      summary: Create a basket
      description: Creates a new basket, optionally seeded with records.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
      responses:
        '200':
          description: The created basket.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
  /baskets/{basket_id}/content:
    get:
      operationId: getBasketContent
      tags:
      - Baskets
      summary: Get basket content
      description: Returns the records contained in a basket.
      parameters:
      - $ref: '#/components/parameters/BasketId'
      responses:
        '200':
          description: The basket content.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
  /baskets/{basket_id}/setname:
    post:
      operationId: setBasketName
      tags:
      - Baskets
      summary: Rename a basket
      description: Sets the name of a basket.
      parameters:
      - $ref: '#/components/parameters/BasketId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
      responses:
        '200':
          description: The updated basket.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
  /baskets/{basket_id}/setdescription:
    post:
      operationId: setBasketDescription
      tags:
      - Baskets
      summary: Set basket description
      description: Sets the description of a basket.
      parameters:
      - $ref: '#/components/parameters/BasketId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                description:
                  type: string
      responses:
        '200':
          description: The updated basket.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
  /baskets/{basket_id}/delete:
    post:
      operationId: deleteBasket
      tags:
      - Baskets
      summary: Delete a basket
      description: Deletes a basket.
      parameters:
      - $ref: '#/components/parameters/BasketId'
      responses:
        '200':
          description: Deletion result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
components:
  parameters:
    BasketId:
      name: basket_id
      in: path
      required: true
      description: The basket identifier.
      schema:
        type: integer
  schemas:
    Meta:
      type: object
      description: Response envelope metadata.
      properties:
        api_version:
          type: string
        request:
          type: string
        response_time:
          type: string
        http_code:
          type: integer
        error_type:
          type: string
          nullable: true
        error_message:
          type: string
          nullable: true
    Envelope:
      type: object
      description: Standard Phraseanet response wrapper. Every response contains a meta object and a response payload.
      properties:
        meta:
          $ref: '#/components/schemas/Meta'
        response:
          type: object
          description: The endpoint-specific payload.
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth2. Register an application in Phraseanet to obtain a client id and secret.
      flows:
        authorizationCode:
          authorizationUrl: https://your-phraseanet-instance/api/oauthv2/authorize
          tokenUrl: https://your-phraseanet-instance/api/oauthv2/token
          scopes: {}
    oauthTokenParam:
      type: apiKey
      in: query
      name: oauth_token
      description: OAuth2 access token passed as the oauth_token query parameter.