> ## Documentation Index
> Fetch the complete documentation index at: https://myco-29fc6df6-sweetmantech-myc-3925-docs-document-the-apiar.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Catalogs

> Create new catalogs or link existing catalogs to an account. If catalog_id is provided, links the existing catalog. If name is provided without catalog_id, creates a new catalog. If both are provided, catalog_id takes priority.

<Note>
  If `catalog_id` is provided, the existing catalog is linked to the account. If `name` is provided without `catalog_id`, a new catalog is created. If both are provided, `catalog_id` takes priority.
</Note>


## OpenAPI

````yaml post /api/catalogs
openapi: 3.1.0
info:
  title: Recoup API
  description: >-
    API documentation for the Recoup platform - an AI agent platform for the
    music industry
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://recoup-api.vercel.app
security:
  - apiKeyAuth: []
paths:
  /api/catalogs:
    post:
      description: >-
        Create new catalogs or link existing catalogs to an account. If
        catalog_id is provided, links the existing catalog. If name is provided
        without catalog_id, creates a new catalog. If both are provided,
        catalog_id takes priority.
      requestBody:
        description: Array of catalogs to create or link
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCatalogsRequest'
      responses:
        '200':
          description: Catalogs created or linked successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CatalogsResponse'
        '400':
          description: Bad request - invalid parameters or catalog_id not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CatalogsErrorResponse'
      servers:
        - url: https://api.recoupable.com
components:
  schemas:
    CreateCatalogsRequest:
      type: object
      required:
        - catalogs
      properties:
        catalogs:
          type: array
          items:
            $ref: '#/components/schemas/CreateCatalogInput'
          description: Array of catalog inputs for bulk create/link operations
    CatalogsResponse:
      type: object
      description: Response containing catalogs data
      properties:
        status:
          type: string
          enum:
            - success
            - error
          description: Status of the request
        catalogs:
          type: array
          items:
            $ref: '#/components/schemas/Catalog'
          description: Array of catalog objects
        error:
          type: string
          description: Error message (only present if status is 'error')
    CatalogsErrorResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - error
          description: Status of the request
        error:
          type: string
          description: Error message describing what went wrong
    CreateCatalogInput:
      type: object
      required:
        - account_id
      properties:
        account_id:
          type: string
          format: uuid
          description: The account to associate the catalog with
        name:
          type: string
          description: Catalog name to create if catalog_id is omitted
        catalog_id:
          type: string
          format: uuid
          description: Existing catalog ID to link to the account
    Catalog:
      type: object
      description: A catalog with its metadata
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the catalog
        name:
          type: string
          description: Name of the catalog
        created_at:
          type: string
          format: date-time
          description: ISO timestamp of when the catalog was created
        updated_at:
          type: string
          format: date-time
          description: ISO timestamp of when the catalog was last updated
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Recoup API key. [Learn more](/quickstart#api-keys).

````