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

# Create tag

> Create a tag inside one tag group.

Creates a [`Tag`](/en/api-reference/tags#tag-object) inside one tag group.

<Note>
  Supported contract: create tags inside workspace-owned custom groups. For group-level routes, see [Tag groups](/en/api-reference/tag-groups).
</Note>

## Headers

<ParamField header="Authorization" type="string" required>
  Bearer token containing your Fini workspace API key. Format: `Bearer fini_...` The key needs `write` scope.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Path parameters

<ParamField path="id" type="string" required>
  Tag group ID that should own the new tag.
</ParamField>

## Body parameters

<ParamField body="tagName" type="string" required>
  Tag label.
</ParamField>

<ParamField body="tagDescription" type="string">
  Optional tag description or instruction text.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api-prod.usefini.com/v2/tag-groups/f770d0bb-d5ea-44e7-a92a-fcfa2d5a32d5/tags/public' \
    --header 'Authorization: Bearer fini_your_api_key' \
    --header 'Content-Type: application/json' \
    --data '{
      "tagName": "resolved_by_ai",
      "tagDescription": "Use when the assistant fully resolved the request."
    }'
  ```

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

  tag_group_id = "f770d0bb-d5ea-44e7-a92a-fcfa2d5a32d5"
  response = requests.post(
      f"https://api-prod.usefini.com/v2/tag-groups/{tag_group_id}/tags/public",
      headers={
          "Authorization": "Bearer fini_your_api_key",
          "Content-Type": "application/json",
      },
      json={
          "tagName": "resolved_by_ai",
          "tagDescription": "Use when the assistant fully resolved the request.",
      },
  )
  tag = response.json()
  ```

  ```javascript Node.js theme={null}
  const tagGroupId = "f770d0bb-d5ea-44e7-a92a-fcfa2d5a32d5";

  const response = await fetch(
    `https://api-prod.usefini.com/v2/tag-groups/${tagGroupId}/tags/public`,
    {
      method: "POST",
      headers: {
        Authorization: "Bearer fini_your_api_key",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        tagName: "resolved_by_ai",
        tagDescription: "Use when the assistant fully resolved the request.",
      }),
    }
  );
  const tag = await response.json();
  ```
</RequestExample>

## Response

Returns the created [`Tag`](/en/api-reference/tags#tag-object).

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "id": "0dc53764-a417-4a4f-b7f4-63149529f530",
    "createdAt": "2026-06-19T07:32:10.000Z",
    "tagGroupId": "f770d0bb-d5ea-44e7-a92a-fcfa2d5a32d5",
    "tagName": "resolved_by_ai",
    "tagDescription": "Use when the assistant fully resolved the request."
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "statusCode": 400,
    "message": [
      "tagName should not be empty"
    ],
    "error": "Bad Request"
  }
  ```
</ResponseExample>

<Note>
  Current controller behavior: unknown tag group IDs currently surface as `500 Internal Server Error` on this public route.
</Note>

## Errors

<AccordionGroup>
  <Accordion title="400 Bad Request" icon="circle-exclamation">
    The body is malformed or missing the required `tagName`.
  </Accordion>

  <Accordion title="401 Unauthorized" icon="lock">
    The API key is missing, malformed, revoked, or invalid.
  </Accordion>

  <Accordion title="403 Forbidden" icon="shield-halved">
    The API key does not include the `write` scope required for this route.
  </Accordion>

  <Accordion title="500 Internal Server Error" icon="triangle-exclamation">
    Fini failed while loading the group or creating the tag.
  </Accordion>
</AccordionGroup>
