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

# Create Tag

> Create a new tag for organizing and segmenting contacts

Creates a new tag in your organization. Tags can then be assigned to contacts to enable filtering, segmentation, and targeted campaigns.

## Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication. Found in your dashboard under API settings.
</ParamField>

## Body

<ParamField body="name" type="string" required>
  The tag name. Must be unique within your organization.
</ParamField>

<ParamField body="color" type="string" required>
  Hex color code for the tag (e.g. `#FF5733`). Used for visual identification in the dashboard.
</ParamField>

<ParamField body="label" type="string">
  Optional display label for the tag. Useful when you want a human-friendly name different from the system name.
</ParamField>

## Response

<ResponseField name="id" type="string">
  Unique identifier of the created tag (UUID).
</ResponseField>

<ResponseField name="name" type="string">
  The tag name.
</ResponseField>

<ResponseField name="color" type="string">
  Hex color code of the tag.
</ResponseField>

<ResponseField name="label" type="string">
  Display label of the tag, if set.
</ResponseField>

<ResponseField name="organization_id" type="string">
  UUID of the organization that owns this tag.
</ResponseField>

<ResponseField name="created_at" type="string">
  Timestamp when the tag was created (ISO 8601).
</ResponseField>

## Error Codes

* `400 Bad Request` — Invalid or missing required fields
* `401 Unauthorized` — Invalid or missing API key
* `500 Internal Server Error` — Server-side error

## Code Examples

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.contactship.ai/v1/tags" \
    -H "x-api-key: your-api-key" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "hot-lead",
      "color": "#FF5733",
      "label": "Hot Lead"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.contactship.ai/v1/tags', {
    method: 'POST',
    headers: {
      'x-api-key': 'your-api-key',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      name: 'hot-lead',
      color: '#FF5733',
      label: 'Hot Lead',
    }),
  });
  const tag = await response.json();
  console.log(`Created tag: ${tag.id}`);
  ```

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

  response = requests.post(
      'https://api.contactship.ai/v1/tags',
      headers={'x-api-key': 'your-api-key'},
      json={
          'name': 'hot-lead',
          'color': '#FF5733',
          'label': 'Hot Lead',
      },
  )

  tag = response.json()
  print(f"Created tag: {tag['id']}")
  ```
</RequestExample>

<ResponseExample>
  ```json Example Response theme={null}
  {
    "id": "tag-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "hot-lead",
    "color": "#FF5733",
    "label": "Hot Lead",
    "organization_id": "org-f1e2d3c4-b5a6-7890-1234-567890abcdef",
    "created_at": "2026-04-05T12:00:00Z"
  }
  ```
</ResponseExample>
