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

# Create Catalog

> Create a new catalog in your workspace

## Authorization

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication. Format: `Bearer qwoty_your_token`
</ParamField>

## Request Body

<ParamField body="name" type="string" required>
  Catalog name
</ParamField>

<ParamField body="api_name" type="string">
  API identifier (auto-generated if not provided)
</ParamField>

<ParamField body="reference" type="string">
  Internal reference
</ParamField>

<ParamField body="description" type="string">
  Catalog description
</ParamField>

<ParamField body="is_active" type="boolean" default="true">
  Active status
</ParamField>

<ParamField body="id_crm" type="string">
  External CRM ID
</ParamField>

<ParamField body="id_erp" type="string">
  External ERP ID
</ParamField>

<ParamField body="id_accounting" type="string">
  External accounting ID
</ParamField>

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://qwoty.app/api/catalogs \
    -H "Authorization: Bearer qwoty_your_token" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Premium Products",
      "description": "Catalog for premium tier products",
      "reference": "CAT-002",
      "is_active": true
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://qwoty.app/api/catalogs', {
    method: 'POST',
    headers: {
      Authorization: 'Bearer qwoty_your_token',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      name: 'Premium Products',
      description: 'Catalog for premium tier products',
      reference: 'CAT-002',
      is_active: true,
    }),
  })

  const data = await response.json()
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://qwoty.app/api/catalogs',
      headers={
          'Authorization': 'Bearer qwoty_your_token',
          'Content-Type': 'application/json'
      },
      json={
          'name': 'Premium Products',
          'description': 'Catalog for premium tier products',
          'reference': 'CAT-002',
          'is_active': True
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="data" type="object">
  The created catalog object with all fields
</ResponseField>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "data": {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "name": "Premium Products",
      "api_name": "premium_products",
      "reference": "CAT-002",
      "description": "Catalog for premium tier products",
      "is_active": true,
      "id_crm": null,
      "id_erp": null,
      "id_accounting": null,
      "created_at": "2024-12-21T10:30:00Z",
      "updated_at": "2024-12-21T10:30:00Z"
    }
  }
  ```
</ResponseExample>

## Error Responses

<ResponseExample>
  ```json Validation Error theme={null}
  {
    "success": false,
    "error": "Validation error",
    "details": {
      "name": "Name is required"
    }
  }
  ```

  ```json Unauthorized theme={null}
  {
    "success": false,
    "error": "Invalid API token"
  }
  ```
</ResponseExample>
