(GET) Get collections

Retrieve collections from your workspace. Filter by collection ID or list all collections with pagination.

Endpoint

GET /api/collections

Retrieve collections from your workspace. Filter by collection ID to get specific collections, or omit the filter to retrieve all collections with pagination support.

Use this endpoint to list your collections, verify collection existence before creating links, or build collection management interfaces.

Endpoint text
GET /api/collections

Authentication

Requires authentication with an API key that has the collectionsRead scope.

Query Parameters

ParameterTypeRequiredDescription
id (query)string (UUID)NoFilter by specific collection ID. Returns a single collection if found.
take (query)numberNoNumber of results to return (default: 50, min: 1, max: 10,000).
skip (query)numberNoNumber of results to skip for pagination (default: 0, min: 0).
sort (query)stringNoSort order by createdAt: "asc" for oldest first, "desc" for newest first (default: "desc").

Request Limits

The `take` parameter supports values from 1 to 10,000. Requests above 10,000 are rejected.

Examples

Request cURL
curl -X GET "https://hoko.to/api/collections?take=50&sort=desc" \
  -H "Authorization: Bearer <API_KEY>"
Request JavaScript
const response = await fetch("https://hoko.to/api/collections?take=50&sort=desc", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <API_KEY>"
  }
});
const collections = await response.json();
Response json
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Marketing Campaigns",
    "description": "All marketing links",
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T00:00:00Z"
  }
]