> ## Documentation Index
> Fetch the complete documentation index at: https://www.tella.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Add a source to the library

> Saves an uploaded source to the library so it can be listed and reused later, both here and in the editor's media panels. Create the source via `POST /v1/sources` and upload the bytes first, then pass its `sourceId`. Without this a source is only reachable through the clips that already reference it.



## OpenAPI

````yaml /openapi.json post /v1/library
openapi: 3.0.3
info:
  description: >-
    The Tella Public API allows you to programmatically access your videos and
    playlists, including transcripts, chapters, and thumbnails.


    ## Authentication


    All requests require a Bearer token in the Authorization header:

    ```

    Authorization: Bearer tella_pk_xxxxx...

    ```


    API keys can be generated in your Tella workspace settings.


    ## Rate Limiting


    The API is rate-limited to 100 requests per minute per organization.

    Rate limit information is returned in response headers:

    - `X-RateLimit-Limit`: Maximum requests per window

    - `X-RateLimit-Remaining`: Remaining requests in current window

    - `X-RateLimit-Reset`: Unix timestamp when the window resets
  title: Tella Public API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.tella.com
security: []
tags:
  - description: Video operations
    name: Videos
  - description: Sections of a video
    name: Clips
  - description: Playlist operations
    name: Playlists
  - description: Sidebar groups for organizing playlists
    name: Playlist Groups
  - description: Tags for categorizing and filtering videos
    name: Tags
  - description: Personal, workspace, and default video backgrounds
    name: Backgrounds
  - description: >-
      Reusable media saved to a workspace — the same items the editor's media
      panels show
    name: Library
  - description: Webhook endpoint management
    name: Webhooks
paths:
  /v1/library:
    post:
      tags:
        - Library
      summary: Add a source to the library
      description: >-
        Saves an uploaded source to the library so it can be listed and reused
        later, both here and in the editor's media panels. Create the source via
        `POST /v1/sources` and upload the bytes first, then pass its `sourceId`.
        Without this a source is only reachable through the clips that already
        reference it.
      operationId: createLibraryItem
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLibraryItemRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateLibraryItemResponse'
          description: Created
        '400':
          $ref: '#/components/responses/400ErrorResponse'
        '401':
          $ref: '#/components/responses/401ErrorResponse'
        '403':
          $ref: '#/components/responses/403ErrorResponse'
        '404':
          $ref: '#/components/responses/404ErrorResponse'
        '422':
          $ref: '#/components/responses/422ErrorResponse'
        '429':
          $ref: '#/components/responses/429ErrorResponse'
        '500':
          $ref: '#/components/responses/500ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateLibraryItemRequest:
      additionalProperties: false
      description: >-
        Save an uploaded source to the library so it can be listed and reused
        later
      properties:
        name:
          description: Display name shown in the library. Defaults to the item's type.
          example: Intro camera take
          maxLength: 255
          minLength: 1
          type: string
        scope:
          allOf:
            - $ref: '#/components/schemas/LibraryScope'
          description: >-
            Where to save the item (default: `private`). `workspace` shares it
            with everyone in the workspace and requires an owner or member role;
            viewers get a 403.
        sourceId:
          description: >-
            Source ID from `POST /v1/sources`, with the bytes already uploaded
            to its `uploadUrl`
          example: su_abc123def456
          type: string
        type:
          description: >-
            Expected item type. Optional — the type is taken from the source's
            own kind; supplying a value that disagrees is an error.
          enum:
            - image
            - video
            - sound-effect
          type: string
      required:
        - sourceId
      type: object
    CreateLibraryItemResponse:
      additionalProperties: false
      description: The newly created library item
      properties:
        item:
          $ref: '#/components/schemas/LibraryItem'
      required:
        - item
      type: object
    LibraryScope:
      description: >-
        Which library the item belongs to: `workspace` items are shared with
        everyone in the workspace, `private` items are only visible to their
        creator
      enum:
        - private
        - workspace
      example: private
      type: string
    LibraryItem:
      additionalProperties: false
      description: >-
        A reusable piece of media saved to a workspace's library — the same
        items the editor's media panels show
      properties:
        createdAt:
          description: ISO-8601 creation timestamp
          type: string
        dimensions:
          additionalProperties: false
          description: Pixel dimensions, for visual media
          properties:
            height:
              maximum: 9007199254740991
              minimum: -9007199254740991
              type: integer
            width:
              maximum: 9007199254740991
              minimum: -9007199254740991
              type: integer
          required:
            - width
            - height
          type: object
        durationMs:
          description: Duration in milliseconds, for time-based media
          example: 4200
          type: number
        id:
          description: Unique library item identifier
          example: media_abc123def456
          type: string
        name:
          description: Display name shown in the library
          example: Intro camera take
          type: string
        scope:
          $ref: '#/components/schemas/LibraryScope'
        sourceId:
          description: >-
            Source ID. Pass it anywhere a `sourceId` is accepted — clips,
            layouts, overlays, sound effects. Present for every item added
            through this API, including images. Absent for items added in the
            editor, which have no source, and for music and LUT items.
          example: su_abc123def456
          type: string
        type:
          $ref: '#/components/schemas/LibraryItemType'
        updatedAt:
          description: ISO-8601 update timestamp
          type: string
        url:
          description: >-
            Hosted media URL, for `image`, `music` and `lut` items. Images
            expose this alongside `sourceId`; use `sourceId` to place the image
            on a clip, since overlays and layout media do not accept URLs.
          type: string
      required:
        - id
        - type
        - name
        - scope
        - createdAt
        - updatedAt
      type: object
    ErrorResponse:
      additionalProperties: false
      description: Standard error response format
      properties:
        error:
          additionalProperties: false
          description: Error details
          properties:
            code:
              description: Machine-readable error code
              enum:
                - bad_request
                - unauthorized
                - forbidden
                - not_found
                - unprocessable_entity
                - rate_limit_exceeded
                - internal_server_error
              example: not_found
              type: string
            doc_url:
              description: Link to documentation for this error
              example: https://tella.tv/docs/api-reference/errors#not-found
              format: uri
              type: string
            message:
              description: Human-readable error message
              example: The requested resource was not found.
              type: string
          required:
            - code
            - message
            - doc_url
          type: object
      required:
        - error
      type: object
    LibraryItemType:
      description: The kind of media the item holds
      enum:
        - image
        - video
        - sound-effect
        - music
        - lut
      example: video
      type: string
  responses:
    400ErrorResponse:
      content:
        application/json:
          example:
            error:
              code: bad_request
              doc_url: https://tella.tv/docs/api-reference/errors#bad-request
              message: The request was malformed or contained invalid parameters.
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: The request was malformed or contained invalid parameters.
    401ErrorResponse:
      content:
        application/json:
          example:
            error:
              code: unauthorized
              doc_url: https://tella.tv/docs/api-reference/errors#unauthorized
              message: Authentication is required. Provide a valid API key.
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: Authentication is required. Provide a valid API key.
    403ErrorResponse:
      content:
        application/json:
          example:
            error:
              code: forbidden
              doc_url: https://tella.tv/docs/api-reference/errors#forbidden
              message: You don't have permission to access this resource.
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: You don't have permission to access this resource.
    404ErrorResponse:
      content:
        application/json:
          example:
            error:
              code: not_found
              doc_url: https://tella.tv/docs/api-reference/errors#not-found
              message: The requested resource was not found.
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: The requested resource was not found.
    422ErrorResponse:
      content:
        application/json:
          example:
            error:
              code: unprocessable_entity
              doc_url: https://tella.tv/docs/api-reference/errors#unprocessable-entity
              message: The request was well-formed but contained semantic errors.
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: The request was well-formed but contained semantic errors.
    429ErrorResponse:
      content:
        application/json:
          example:
            error:
              code: rate_limit_exceeded
              doc_url: https://tella.tv/docs/api-reference/errors#rate-limit-exceeded
              message: You have exceeded the rate limit. Please slow down.
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: You have exceeded the rate limit. Please slow down.
    500ErrorResponse:
      content:
        application/json:
          example:
            error:
              code: internal_server_error
              doc_url: https://tella.tv/docs/api-reference/errors#internal-server-error
              message: An unexpected error occurred on the server.
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: An unexpected error occurred on the server.
  securitySchemes:
    BearerAuth:
      description: API key obtained from your Tella account settings
      scheme: bearer
      type: http

````