Developers/API/Folders

Folders API

Organize your links into folders for better management.

GET/api/v1/folders

List all folders with link counts.

Scope: links:read

Request

curl https://trimlink.co/api/v1/folders \
  -H "Authorization: Bearer tk_live_your_api_key"

Response

200Response
{
  "success": true,
  "folders": [
    {
      "id": "folder_abc123",
      "name": "Marketing",
      "linkCount": 24,
      "createdAt": "2026-01-15T10:00:00Z"
    },
    {
      "id": "folder_def456",
      "name": "Sales",
      "linkCount": 12,
      "createdAt": "2026-01-20T14:30:00Z"
    }
  ]
}
POST/api/v1/folders

Create a new folder.

Scope: links:write

Parameters

NameTypeRequiredDescription
namestringYesFolder name (1-50 chars)

Request

curl -X POST https://trimlink.co/api/v1/folders \
  -H "Authorization: Bearer tk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "Marketing Campaigns"}'

Response

201Response
{
  "success": true,
  "folder": {
    "id": "folder_xyz789",
    "name": "Marketing Campaigns",
    "createdAt": "2026-01-31T12:00:00Z"
  }
}
PATCH/api/v1/folders/:id

Update a folder name.

Scope: links:write

Request

curl -X PATCH https://trimlink.co/api/v1/folders/folder_xyz789 \
  -H "Authorization: Bearer tk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "Campaigns 2026"}'

Response

200Response
{
  "success": true,
  "folder": {
    "id": "folder_xyz789",
    "name": "Campaigns 2026",
    "updatedAt": "2026-01-31T14:00:00Z"
  }
}
DELETE/api/v1/folders/:id

Delete a folder. Links in the folder are moved to uncategorized.

Scope: links:write

Request

curl -X DELETE https://trimlink.co/api/v1/folders/folder_xyz789 \
  -H "Authorization: Bearer tk_live_your_api_key"

Response

204 No Content