Skip to main content

Tags API Reference

Create, read, update, and delete tags via the API.

Endpoints Overview

MethodEndpointDescription
GET/v1/tagsList all tags
POST/v1/tagsCreate a tag
GET/v1/tags/{id}Get a tag
PUT/v1/tags/{id}Update a tag
DELETE/v1/tags/{id}Delete a tag
GET/v1/tags/{id}/qrGet QR code

List Tags

Retrieve all tags for the authenticated user.

Request

GET /v1/tags

Query Parameters

ParameterTypeDescription
limitintegerItems per page (max 100, default 20)
offsetintegerSkip items (default 0)
folderstringFilter by folder ID
sortstringSort by: created, updated, title
orderstringOrder: asc, desc

Example

curl https://api.tagd-ai.com/v1/tags?limit=10&sort=updated&order=desc \
-H "Authorization: Bearer YOUR_API_KEY"

Response

{
"success": true,
"data": [
{
"id": "abc123",
"short_id": "a7Bx9k",
"title": "My First Tag",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T14:22:00Z",
"permissions": {
"read": "public",
"write": "owner"
}
}
],
"pagination": {
"total": 45,
"limit": 10,
"offset": 0,
"has_more": true
}
}

Create Tag

Create a new tag.

Request

POST /v1/tags
Content-Type: application/json

Body Parameters

ParameterTypeRequiredDescription
titlestringYesTag title
contentarrayNoContent blocks
folder_idstringNoFolder to place tag in
permissionsobjectNoRead/write permissions

Content Block Types

{
"content": [
{
"type": "text",
"content": "Hello world",
"format": {
"bold": false,
"italic": false
}
},
{
"type": "heading",
"content": "Section Title",
"level": 2
},
{
"type": "callout",
"content": "Important note",
"style": "warning"
}
]
}

Example

curl -X POST https://api.tagd-ai.com/v1/tags \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Product Info",
"content": [
{
"type": "text",
"content": "Model X-500 specifications"
}
],
"permissions": {
"read": "public",
"write": "owner"
}
}'

Response

{
"success": true,
"data": {
"id": "def456",
"short_id": "b8Cy0m",
"title": "Product Info",
"content": [...],
"created_at": "2024-01-15T15:00:00Z",
"qr_url": "https://tagd-ai.com/qr/b8Cy0m.png"
}
}

Get Tag

Retrieve a specific tag by ID.

Request

GET /v1/tags/{id}

Path Parameters

ParameterDescription
idTag ID or short ID

Example

curl https://api.tagd-ai.com/v1/tags/abc123 \
-H "Authorization: Bearer YOUR_API_KEY"

Response

{
"success": true,
"data": {
"id": "abc123",
"short_id": "a7Bx9k",
"title": "My Tag",
"content": [
{
"id": "block_1",
"type": "text",
"content": "Hello world"
}
],
"permissions": {
"read": "public",
"write": "owner"
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T14:22:00Z",
"owner": {
"id": "user_123",
"email": "[email protected]"
}
}
}

Update Tag

Update an existing tag.

Request

PUT /v1/tags/{id}
Content-Type: application/json

Body Parameters

ParameterTypeDescription
titlestringNew title
contentarrayUpdated content blocks
permissionsobjectUpdated permissions

Example

curl -X PUT https://api.tagd-ai.com/v1/tags/abc123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Title",
"content": [
{
"type": "text",
"content": "Updated content"
}
]
}'

Response

{
"success": true,
"data": {
"id": "abc123",
"short_id": "a7Bx9k",
"title": "Updated Title",
"content": [...],
"updated_at": "2024-01-15T16:00:00Z"
}
}

Delete Tag

Permanently delete a tag.

Request

DELETE /v1/tags/{id}

Example

curl -X DELETE https://api.tagd-ai.com/v1/tags/abc123 \
-H "Authorization: Bearer YOUR_API_KEY"

Response

{
"success": true,
"message": "Tag deleted successfully"
}

Get QR Code

Retrieve the QR code for a tag.

Request

GET /v1/tags/{id}/qr

Query Parameters

ParameterTypeDefaultDescription
formatstringpngFormat: png, svg
sizeinteger512Size in pixels
colorstring000000Foreground color (hex)
backgroundstringffffffBackground color (hex)

Example

curl "https://api.tagd-ai.com/v1/tags/abc123/qr?format=svg&size=1024" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o qr-code.svg

Response

Binary image data (PNG or SVG).

Batch Operations

Create Multiple Tags

POST /v1/tags/batch
Content-Type: application/json
{
"tags": [
{"title": "Tag 1", "content": [...]},
{"title": "Tag 2", "content": [...]},
{"title": "Tag 3", "content": [...]}
]
}

Response

{
"success": true,
"data": {
"created": 3,
"tags": [
{"id": "abc1", "short_id": "a1b2c3"},
{"id": "abc2", "short_id": "d4e5f6"},
{"id": "abc3", "short_id": "g7h8i9"}
]
}
}

Error Responses

400 Bad Request

{
"success": false,
"error": {
"code": "validation_error",
"message": "Title is required",
"field": "title"
}
}

404 Not Found

{
"success": false,
"error": {
"code": "not_found",
"message": "Tag not found"
}
}

403 Forbidden

{
"success": false,
"error": {
"code": "forbidden",
"message": "You don't have permission to edit this tag"
}
}

Next Steps