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

# Detach Tags

> Remove one or more tags from sources, transformations, destinations, and other catalog resources.

The detach endpoint removes the association between one or more existing tags and a set of resources. The tag itself is **not** deleted — only the links between the tag and the resources in the request body are removed. Tag names that do not exist in the organization are ignored silently.

The request body is identical to [Attach Tags](/platform-api/tags/attach): a list of tag `names` and one or more resource ID lists.

<Warning>
  The interactive API Playground on this page is generated from the OpenAPI schema and may only show the base `Tag` fields. The canonical request body is the one documented below (`names` plus the per-resource ID arrays), and the response is an **array** of tags, not a single object.
</Warning>

## Request body

| Parameter         | Type             | Required | Description                                                                  |
| ----------------- | ---------------- | -------- | ---------------------------------------------------------------------------- |
| `names`           | array of strings | Yes      | Tag names to detach. Names that don't exist in the organization are skipped. |
| `sources`         | array of UUIDs   | No       | Source IDs to untag.                                                         |
| `transformations` | array of UUIDs   | No       | Transformation IDs to untag (covers queries, notebooks, and histories).      |
| `destinations`    | array of UUIDs   | No       | Destination IDs to untag.                                                    |
| `visualizations`  | array of UUIDs   | No       | Visualization IDs to untag.                                                  |
| `layers`          | array of UUIDs   | No       | Layer IDs to untag.                                                          |
| `folders`         | array of UUIDs   | No       | Folder IDs to untag.                                                         |
| `tables`          | array of UUIDs   | No       | Table IDs to untag.                                                          |
| `volumes`         | array of UUIDs   | No       | Volume IDs to untag.                                                         |

<Warning>
  Unlike `attach`, the `detach` endpoint does not create tags on the fly. If a name in `names` is not already present in your organization it is simply skipped.
</Warning>

## Response

The endpoint returns the list of tags that were matched by `names` and from which the resources were detached.

```json theme={null}
[
  {
    "id": "6f2a9c4b-2a10-4e7f-9c54-d2a9b1d28b0e",
    "name": "marketing",
    "created_at": "2026-04-17T10:15:00.000000-03:00",
    "updated_at": "2026-04-17T11:02:00.000000-03:00"
  }
]
```

## Example: detach one tag from a single source

```bash theme={null}
curl --request POST \
  --url https://api.nekt.ai/api/v1/tags/detach/ \
  --header "x-api-key: YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "names": ["marketing"],
    "sources": ["d2c1b472-902c-477a-b300-e7c3fd72609b"]
  }'
```

## Example: detach multiple tags from one transformation

```bash theme={null}
curl --request POST \
  --url https://api.nekt.ai/api/v1/tags/detach/ \
  --header "x-api-key: YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "names": ["weekly-refresh", "owned-by-revops"],
    "transformations": ["a7b4f0d2-5c91-4e34-9c1f-7e3a5f1c9d02"]
  }'
```

## Example: batch detach tags across sources, transformations, and destinations

```bash theme={null}
curl --request POST \
  --url https://api.nekt.ai/api/v1/tags/detach/ \
  --header "x-api-key: YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "names": ["production"],
    "sources": [
      "d2c1b472-902c-477a-b300-e7c3fd72609b",
      "f3e4d5c6-b7a8-49e0-1f2a-3b4c5d6e7f80"
    ],
    "transformations": [
      "a7b4f0d2-5c91-4e34-9c1f-7e3a5f1c9d02",
      "b8c5e1e3-6d02-4f45-ad20-8f4b6e2d0e13"
    ],
    "destinations": [
      "e4d5c6b7-a8b9-40c1-d2e3-f4a5b6c7d8e9"
    ]
  }'
```

## Python example: remove a tag from every destination that currently carries it

```python theme={null}
import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.nekt.ai"

headers = {
    "x-api-key": API_KEY,
    "Content-Type": "application/json",
}

destinations = requests.get(
    f"{BASE_URL}/api/v1/destinations/",
    headers=headers,
    params={"expand[]": "tags"},
).json()

legacy_destination_ids = [
    d["id"]
    for d in destinations["results"]
    if any(tag["name"] == "legacy" for tag in d.get("tags", []))
]

requests.post(
    f"{BASE_URL}/api/v1/tags/detach/",
    headers=headers,
    json={
        "names": ["legacy"],
        "destinations": legacy_destination_ids,
    },
)
```

## Related

* [Attach Tags](/platform-api/tags/attach) — create the inverse association.
* [List Tags](/platform-api/tags/list) — confirm which tags currently exist.


## OpenAPI

````yaml POST /api/v1/tags/detach/
openapi: 3.0.3
info:
  title: Nekt API
  version: v1
  description: Nekt API Documentation
  contact:
    email: support@nekt.ai
servers:
  - url: https://api.nekt.ai
security: []
paths:
  /api/v1/tags/detach/:
    post:
      tags:
        - v1
      operationId: v1_tags_detach_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Tag'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Tag'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Tag'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Tag:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - id
        - name
        - updated_at
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'API Key authentication. Format: ''x-api-key: api_key'''

````