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

# Create a library

> Creates a new, empty photo library for the authenticated user. A library is the top-level container for assets, albums, people, and faces — most users have exactly one. Only create a new library when the user explicitly asks for a separate container.



## OpenAPI

````yaml https://api.gumnut.ai/openapi.json post /api/libraries
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/libraries:
    post:
      tags:
        - libraries
      summary: Create a library
      description: >-
        Creates a new, empty photo library for the authenticated user. A library
        is the top-level container for assets, albums, people, and faces — most
        users have exactly one. Only create a new library when the user
        explicitly asks for a separate container.
      operationId: create_library
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LibraryCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LibraryCreate:
      properties:
        name:
          type: string
          maxLength: 255
          title: Name
          description: Display name for the new library. Required.
        description:
          anyOf:
            - type: string
              maxLength: 8192
            - type: 'null'
          title: Description
          description: Optional free-form description shown alongside the library name.
      type: object
      required:
        - name
      title: LibraryCreate
    LibraryResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique library identifier with 'lib_' prefix
        name:
          type: string
          title: Name
          description: Display name of the library
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description text for the library
        user_id:
          type: string
          title: User Id
          description: ID of the user who owns this library
        asset_count:
          type: integer
          title: Asset Count
          description: Total number of assets in this library
        storage_used_bytes:
          type: integer
          title: Storage Used Bytes
          description: Bytes of assets currently stored in this library
        storage_limit_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Storage Limit Bytes
          description: >-
            Maximum bytes this library may store, or null if no per-library
            limit applies
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When this library was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: When this library was last updated
      type: object
      required:
        - id
        - name
        - user_id
        - asset_count
        - storage_used_bytes
        - created_at
        - updated_at
      title: LibraryResponse
      description: Represents a user's photo library.
    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

````