Tags API
Manage tags for organizing nodes and files.
Endpoints
POST /tags
POST Create a new tag.
curl -X POST "https://api.ofself.ai/api/v1/tags" \
-H "X-API-Key: your-key" \
-H "X-User-ID: user-123" \
-H "Content-Type: application/json" \
-d '{
"name": "Work",
"color": "#3B82F6"
}'
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Tag name |
color | string | No | Hex color code |
Response: 201 Created
{
"id": "tag_work123",
"name": "Work",
"color": "#3B82F6",
"owner_id": "user_123",
"created_at": "2024-01-15T10:30:00Z"
}
GET /tags
GET List all tags.
curl -X GET "https://api.ofself.ai/api/v1/tags" \
-H "X-API-Key: your-key" \
-H "X-User-ID: user-123"
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
search | string | Search tag names |
page | integer | Page number |
per_page | integer | Items per page |
GET /tags/:tag_id
GET Get a single tag.
curl -X GET "https://api.ofself.ai/api/v1/tags/tag_work" \
-H "X-API-Key: your-key" \
-H "X-User-ID: user-123"
PUT /tags/:tag_id
PUT Update a tag.
curl -X PUT "https://api.ofself.ai/api/v1/tags/tag_work" \
-H "X-API-Key: your-key" \
-H "X-User-ID: user-123" \
-H "Content-Type: application/json" \
-d '{
"name": "Work Projects",
"color": "#22C55E"
}'
DELETE /tags/:tag_id
DELETE Delete a tag.
curl -X DELETE "https://api.ofself.ai/api/v1/tags/tag_work" \
-H "X-API-Key: your-key" \
-H "X-User-ID: user-123"
Note: This removes the tag but doesn't delete nodes with this tag.
GET /tags/:tag_id/nodes
GET Get all nodes with a specific tag.
curl -X GET "https://api.ofself.ai/api/v1/tags/tag_work/nodes" \
-H "X-API-Key: your-key" \
-H "X-User-ID: user-123"
GET /tags/:tag_id/files
GET Get all files with a specific tag.
curl -X GET "https://api.ofself.ai/api/v1/tags/tag_work/files" \
-H "X-API-Key: your-key" \
-H "X-User-ID: user-123"