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

# Add existing assets to an album

> Adds one or more existing assets to the specified album. Assets must already be in the same library as the album (this tool does not upload new assets). Assets already in the album are silently skipped and returned separately as `duplicate_assets`; missing or different-library IDs are skipped and returned as `not_found_assets`. Idempotent: calling with the same IDs twice leaves the album in the same state.

Up to 200 ids per request; over-cap requests return 422.



## OpenAPI

````yaml https://api.gumnut.ai/openapi.json post /api/albums/{album_id}/assets
openapi: 3.1.0
info:
  title: Gumnut API
  description: API for using Gumnut to manage photos and videos
  version: 0.1.0
servers: []
security: []
paths:
  /api/albums/{album_id}/assets:
    post:
      tags:
        - albums
      summary: Add existing assets to an album
      description: >-
        Adds one or more existing assets to the specified album. Assets must
        already be in the same library as the album (this tool does not upload
        new assets). Assets already in the album are silently skipped and
        returned separately as `duplicate_assets`; missing or different-library
        IDs are skipped and returned as `not_found_assets`. Idempotent: calling
        with the same IDs twice leaves the album in the same state.


        Up to 200 ids per request; over-cap requests return 422.
      operationId: add_assets_to_album
      parameters:
        - name: album_id
          in: path
          required: true
          schema:
            type: string
            description: Album ID (with `album_` prefix) of the album to add the assets to.
            title: Album Id
          description: Album ID (with `album_` prefix) of the album to add the assets to.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlbumAssetAssociation'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddAssetsToAlbumResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AlbumAssetAssociation:
      properties:
        asset_ids:
          items:
            type: string
          type: array
          maxItems: 200
          title: Asset Ids
          description: >-
            Asset IDs (with `asset_` prefix) to associate with the album. Up to
            200 ids per request.
      type: object
      required:
        - asset_ids
      title: AlbumAssetAssociation
    AddAssetsToAlbumResponse:
      properties:
        added_assets:
          items:
            type: string
          type: array
          title: Added Assets
          description: Asset IDs newly added to the album by this call.
        duplicate_assets:
          items:
            type: string
          type: array
          title: Duplicate Assets
          description: >-
            Asset IDs that were already in the album and were skipped
            (idempotent no-op, not an error).
        not_found_assets:
          items:
            type: string
          type: array
          title: Not Found Assets
          description: >-
            Asset IDs that were skipped because they do not exist or do not
            belong to the album's library.
      type: object
      required:
        - added_assets
        - duplicate_assets
        - not_found_assets
      title: AddAssetsToAlbumResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````