Skip to main content
POST
/
api
/
v1
/
tags
/
attach
cURL
curl --request POST \
  --url https://api.nekt.ai/api/v1/tags/attach/ \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "name": "<string>"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}
The attach endpoint associates one or more tags with a set of resources. It accepts a list of tag names — any name that does not yet exist in your organization is created on the fly, and any name that already exists is reused. Every resource list in the request body is then attached to every tag in names. This makes it possible to tag a single resource, apply several tags to a single resource, or apply tags to many resources in a single call.
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.

Request body

ParameterTypeRequiredDescription
namesarray of stringsYesTag names to attach. Tags that don’t exist are created automatically.
sourcesarray of UUIDsNoSource IDs to tag.
transformationsarray of UUIDsNoTransformation IDs to tag (covers queries, notebooks, and histories).
destinationsarray of UUIDsNoDestination IDs to tag.
visualizationsarray of UUIDsNoVisualization IDs to tag.
layersarray of UUIDsNoLayer IDs to tag.
foldersarray of UUIDsNoFolder IDs to tag.
tablesarray of UUIDsNoTable IDs to tag.
volumesarray of UUIDsNoVolume IDs to tag.
At least one resource list must contain at least one ID. Tag names provided in names but missing from the organization are created before the attachment happens.

Response

The endpoint returns the full list of tags that were attached — both the ones that already existed and the ones that were created during the call.
[
  {
    "id": "6f2a9c4b-2a10-4e7f-9c54-d2a9b1d28b0e",
    "name": "marketing",
    "created_at": "2026-04-17T10:15:00.000000-03:00",
    "updated_at": "2026-04-17T10:15:00.000000-03:00"
  }
]

Example: attach one tag to a single source

Use this pattern when you want to label an individual resource, for example marking a single Facebook Ads source as part of your marketing stack.
curl --request POST \
  --url https://api.nekt.ai/api/v1/tags/attach/ \
  --header "x-api-key: YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "names": ["marketing"],
    "sources": ["d2c1b472-902c-477a-b300-e7c3fd72609b"]
  }'

Example: attach multiple tags to one transformation

Multiple names in a single request attach every tag to every listed resource. Tags that do not yet exist are created before the attachment.
curl --request POST \
  --url https://api.nekt.ai/api/v1/tags/attach/ \
  --header "x-api-key: YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "names": ["marketing", "weekly-refresh", "owned-by-revops"],
    "transformations": ["a7b4f0d2-5c91-4e34-9c1f-7e3a5f1c9d02"]
  }'

Example: batch attach tags across sources, transformations, and destinations

A single request can target every resource type at once. Every tag in names is attached to every ID listed in the resource arrays.
curl --request POST \
  --url https://api.nekt.ai/api/v1/tags/attach/ \
  --header "x-api-key: YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "names": ["marketing", "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: tag every source that matches a pattern

The snippet below lists all sources, filters them by slug prefix, and attaches a tag to the whole batch in a single call.
import requests

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

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

sources = requests.get(f"{BASE_URL}/api/v1/sources/", headers=headers).json()
ads_source_ids = [s["id"] for s in sources["results"] if s["slug"].endswith("-ads")]

requests.post(
    f"{BASE_URL}/api/v1/tags/attach/",
    headers=headers,
    json={
        "names": ["ads"],
        "sources": ads_source_ids,
    },
)
  • Detach Tags — remove tags from the same resource types.
  • List Tags — browse existing tags in your organization.

Authorizations

x-api-key
string
header
required

API Key authentication. Format: 'x-api-key: api_key'

Body

name
string
required
Maximum string length: 255

Response

200 - application/json
id
string<uuid>
required
name
string
required
Maximum string length: 255
created_at
string<date-time>
required
updated_at
string<date-time>
required