> ## 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.

# List album-asset link records

> Returns paginated *link* records (lightweight join rows between albums and assets) describing which assets are in which albums — each row contains `album_id` + `asset_id` + link timestamps, not the full asset or album metadata. Use this when you specifically need the junction records (for sync or change tracking).

**For most use cases you want a different tool:** use `list_assets` with `album_id` to get the full asset metadata for a specific album; use `list_albums` with `asset_id` to find which albums contain an asset.

**Pagination** is cursor-based: when `has_more` is true, pass the `id` of the last album-asset in `data` as `starting_after_id` to fetch the next page.



## OpenAPI

````yaml https://api.gumnut.ai/openapi.json get /api/album-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/album-assets:
    get:
      tags:
        - album-assets
      summary: List album-asset link records
      description: >-
        Returns paginated *link* records (lightweight join rows between albums
        and assets) describing which assets are in which albums — each row
        contains `album_id` + `asset_id` + link timestamps, not the full asset
        or album metadata. Use this when you specifically need the junction
        records (for sync or change tracking).


        **For most use cases you want a different tool:** use `list_assets` with
        `album_id` to get the full asset metadata for a specific album; use
        `list_albums` with `asset_id` to find which albums contain an asset.


        **Pagination** is cursor-based: when `has_more` is true, pass the `id`
        of the last album-asset in `data` as `starting_after_id` to fetch the
        next page.
      operationId: list_album_assets
      parameters:
        - name: album_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Return only link records for this album ID. Equivalent to 'list
              the assets in this album' — in most cases prefer `list_assets`
              with `album_id` to get the asset metadata directly instead of the
              lightweight link records.
            title: Album Id
          description: >-
            Return only link records for this album ID. Equivalent to 'list the
            assets in this album' — in most cases prefer `list_assets` with
            `album_id` to get the asset metadata directly instead of the
            lightweight link records.
        - name: asset_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Return only link records for this asset ID. Equivalent to 'which
              albums contain this asset' — in most cases prefer `list_albums`
              with `asset_id` to get the album metadata directly.
            title: Asset Id
          description: >-
            Return only link records for this asset ID. Equivalent to 'which
            albums contain this asset' — in most cases prefer `list_albums` with
            `asset_id` to get the album metadata directly.
        - name: ids
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: >-
              Look up specific album-asset link records by ID (max 200). The ID
              has the `album_asset_` prefix. Accepts multiple `ids=` query
              params or a single comma-delimited value (e.g.,
              `ids=album_asset_1,album_asset_2`).
            title: Ids
          description: >-
            Look up specific album-asset link records by ID (max 200). The ID
            has the `album_asset_` prefix. Accepts multiple `ids=` query params
            or a single comma-delimited value (e.g.,
            `ids=album_asset_1,album_asset_2`).
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            description: Maximum number of link records per page (1–200). Defaults to 20.
            default: 20
            title: Limit
          description: Maximum number of link records per page (1–200). Defaults to 20.
        - name: starting_after_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Cursor for pagination. Pass the `id` of the last album-asset in
              the previous response's `data` to fetch the next page. Omit for
              the first page.
            title: Starting After Id
          description: >-
            Cursor for pagination. Pass the `id` of the last album-asset in the
            previous response's `data` to fetch the next page. Omit for the
            first page.
        - name: library_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Library to list from. Optional if the user has a single library;
              required when they have multiple.
            title: Library Id
          description: >-
            Library to list from. Optional if the user has a single library;
            required when they have multiple.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAlbumAssetsResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PaginatedAlbumAssetsResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/AlbumAssetResponse'
          type: array
          title: Data
          description: List of album-asset links
        has_more:
          type: boolean
          title: Has More
          description: >-
            True if there are more album-asset links after this page. Pass the
            last album-asset's `id` as `starting_after_id` to fetch the next
            page.
      type: object
      required:
        - data
        - has_more
      title: PaginatedAlbumAssetsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AlbumAssetResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique album_asset identifier with 'album_asset_' prefix
        album_id:
          type: string
          title: Album Id
          description: ID of the album
        asset_id:
          type: string
          title: Asset Id
          description: ID of the asset
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When this link was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: When this link was last updated
      type: object
      required:
        - id
        - album_id
        - asset_id
        - created_at
        - updated_at
      title: AlbumAssetResponse
      description: Represents a link between an album and an asset.
    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

````