Skip to main content

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:

FieldTypeRequiredDescription
namestringYesTag name
colorstringNoHex 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:

ParameterTypeDescription
searchstringSearch tag names
pageintegerPage number
per_pageintegerItems 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"