define.wtf
API Reference

Collections

Create and manage curated collections of acronyms

Collections API

Collections are curated groups of acronyms. Teams use collections for onboarding, department-specific glossaries, project-scoped terminology, or any thematic grouping.

List Collections

GET /api/v1/collections

Returns all public collections in your workspace, with counts of items in each.

Query Parameters

ParameterTypeRequiredDefaultDescription
include_unpublishedbooleanNofalseInclude private collections (admin only)

Response

{
  "success": true,
  "data": [
    {
      "id": "col_abc123",
      "name": "Engineering Onboarding",
      "description": "Essential acronyms for new engineers",
      "isPublic": true,
      "isOnboarding": true,
      "itemCount": 15,
      "creator": {
        "name": "Alice Chen",
        "avatarUrl": "https://avatar.example.com/alice.jpg"
      },
      "createdAt": "2024-01-10T10:00:00Z",
      "updatedAt": "2024-01-20T14:30:00Z"
    },
    {
      "id": "col_def456",
      "name": "Sales Glossary",
      "description": "Sales and customer success terms",
      "isPublic": true,
      "isOnboarding": false,
      "itemCount": 8,
      "creator": {
        "name": "Bob Smith",
        "avatarUrl": "https://avatar.example.com/bob.jpg"
      },
      "createdAt": "2024-01-15T09:45:00Z",
      "updatedAt": "2024-01-15T09:45:00Z"
    }
  ]
}

Response Fields

FieldTypeDescription
idstringUnique collection ID (prefixed col_)
namestringDisplay name
descriptionstring | nullOptional description
isPublicbooleanVisible to all workspace members
isOnboardingbooleanHighlighted for new user onboarding
itemCountnumberNumber of acronyms in collection
creator.namestringName of creator
creator.avatarUrlstring | nullAvatar URL of creator
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 update timestamp

Examples

List public collections:

curl https://engineering.define.wtf/api/v1/collections \
  -H "Cookie: next-auth.session-token=YOUR_TOKEN"

List including private collections (admin only):

curl "https://engineering.define.wtf/api/v1/collections?include_unpublished=true" \
  -H "Cookie: next-auth.session-token=YOUR_TOKEN"

Create Collection

POST /api/v1/collections

Creates a new collection with optional initial items.

Request Body

{
  "name": "Marketing Fundamentals",
  "description": "Core marketing acronyms and concepts",
  "isPublic": true,
  "isOnboarding": false,
  "items": [
    {
      "acronymId": "acr_001",
      "sortOrder": 0
    },
    {
      "acronymId": "acr_002",
      "sortOrder": 1
    }
  ]
}

Body Parameters

FieldTypeRequiredMax LengthDescription
namestringYes200Collection name
descriptionstringNo1000Optional description
isPublicbooleanNo (default: false)Visible to all members
isOnboardingbooleanNo (default: false)Highlight for new users
itemsarrayNoInitial acronym items
items[].acronymIdstringAcronym ID
items[].sortOrdernumberPosition in collection (0-indexed)

Response

Returns 201 Created:

{
  "success": true,
  "data": {
    "id": "col_ghi789",
    "name": "Marketing Fundamentals",
    "description": "Core marketing acronyms and concepts",
    "isPublic": true,
    "isOnboarding": false,
    "itemCount": 2,
    "creator": {
      "name": "Carol Davis",
      "avatarUrl": "https://avatar.example.com/carol.jpg"
    },
    "createdAt": "2024-01-21T18:00:00Z",
    "updatedAt": "2024-01-21T18:00:00Z"
  }
}

Permissions

  • collection:create required

Examples

Create simple collection:

curl -X POST https://engineering.define.wtf/api/v1/collections \
  -H "Cookie: next-auth.session-token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Marketing Fundamentals",
    "description": "Core marketing acronyms and concepts",
    "isPublic": true
  }'

Create with initial items:

curl -X POST https://engineering.define.wtf/api/v1/collections \
  -H "Cookie: next-auth.session-token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Engineering Onboarding",
    "description": "Must-know acronyms for new engineers",
    "isPublic": true,
    "isOnboarding": true,
    "items": [
      {"acronymId": "acr_abc123", "sortOrder": 0},
      {"acronymId": "acr_def456", "sortOrder": 1},
      {"acronymId": "acr_ghi789", "sortOrder": 2}
    ]
  }'

Update Collection

PATCH /api/v1/collections/{id}

Updates collection metadata.

Parameters

ParameterTypeRequiredDescription
idstringYesCollection ID (e.g., col_abc123)

Request Body

{
  "name": "Marketing Essentials",
  "description": "Essential marketing acronyms",
  "isPublic": true,
  "isOnboarding": false
}

Body Parameters

FieldTypeDescription
namestringNew name
descriptionstringNew description
isPublicbooleanUpdate visibility
isOnboardingbooleanUpdate onboarding flag

Response

Returns 200 OK:

{
  "success": true,
  "data": {
    "id": "col_ghi789",
    "name": "Marketing Essentials",
    "description": "Essential marketing acronyms",
    "isPublic": true,
    "isOnboarding": false,
    "itemCount": 2,
    "updatedAt": "2024-01-21T18:15:00Z"
  }
}

Example

curl -X PATCH https://engineering.define.wtf/api/v1/collections/col_ghi789 \
  -H "Cookie: next-auth.session-token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Marketing Essentials",
    "isOnboarding": false
  }'

Delete Collection

DELETE /api/v1/collections/{id}

Deletes a collection. The acronyms themselves remain; only the collection grouping is removed.

Parameters

ParameterTypeRequiredDescription
idstringYesCollection ID

Response

Returns 204 No Content (no response body).

Example

curl -X DELETE https://engineering.define.wtf/api/v1/collections/col_ghi789 \
  -H "Cookie: next-auth.session-token=YOUR_TOKEN"

Add Item to Collection

POST /api/v1/collections/{id}/items

Adds an acronym to a collection.

Parameters

ParameterTypeRequiredDescription
idstringYesCollection ID

Request Body

{
  "acronymId": "acr_new999",
  "sortOrder": 5
}

Body Parameters

FieldTypeRequiredDescription
acronymIdstringYesAcronym ID to add
sortOrdernumberNoPosition in collection

Response

Returns 201 Created:

{
  "success": true,
  "data": {
    "id": "item_xyz123",
    "collectionId": "col_ghi789",
    "acronymId": "acr_new999",
    "sortOrder": 5,
    "createdAt": "2024-01-21T18:30:00Z"
  }
}

Example

curl -X POST https://engineering.define.wtf/api/v1/collections/col_ghi789/items \
  -H "Cookie: next-auth.session-token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "acronymId": "acr_new999",
    "sortOrder": 5
  }'

Remove Item from Collection

DELETE /api/v1/collections/{id}/items/{itemId}

Removes an acronym from a collection.

Parameters

ParameterTypeRequiredDescription
idstringYesCollection ID
itemIdstringYesCollection item ID

Response

Returns 204 No Content (no response body).

Example

curl -X DELETE https://engineering.define.wtf/api/v1/collections/col_ghi789/items/item_xyz123 \
  -H "Cookie: next-auth.session-token=YOUR_TOKEN"

Reorder Collection Items

PATCH /api/v1/collections/{id}/reorder

Reorders items in a collection by providing a new sort order.

Parameters

ParameterTypeRequiredDescription
idstringYesCollection ID

Request Body

{
  "items": [
    {"itemId": "item_aaa111", "sortOrder": 0},
    {"itemId": "item_bbb222", "sortOrder": 1},
    {"itemId": "item_ccc333", "sortOrder": 2}
  ]
}

Body Parameters

FieldTypeRequiredDescription
itemsarrayYesArray of items with new sort orders
items[].itemIdstringYesItem ID
items[].sortOrdernumberYesNew position (0-indexed)

Response

Returns 200 OK:

{
  "success": true,
  "data": {
    "id": "col_ghi789",
    "itemsReordered": 3,
    "updatedAt": "2024-01-21T18:45:00Z"
  }
}

Example

curl -X PATCH https://engineering.define.wtf/api/v1/collections/col_ghi789/reorder \
  -H "Cookie: next-auth.session-token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {"itemId": "item_aaa111", "sortOrder": 0},
      {"itemId": "item_bbb222", "sortOrder": 1},
      {"itemId": "item_ccc333", "sortOrder": 2}
    ]
  }'

Onboarding Collections

Collections with isOnboarding: true are highlighted during new user onboarding. These are typically:

  • Core company acronyms everyone should know
  • Department-specific glossaries
  • Essential processes and frameworks

Admin-only collections (with isOnboarding: true and isPublic: false) are shown only to members of that admin group.

Example: Create Onboarding Collection

curl -X POST https://engineering.define.wtf/api/v1/collections \
  -H "Cookie: next-auth.session-token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Everyone Should Know",
    "description": "Core company acronyms for all new team members",
    "isPublic": true,
    "isOnboarding": true,
    "items": [
      {"acronymId": "acr_001", "sortOrder": 0},
      {"acronymId": "acr_002", "sortOrder": 1}
    ]
  }'

Error Responses

Collection not found (404):

{
  "success": false,
  "error": {
    "code": "COLLECTION_NOT_FOUND",
    "message": "Collection not found"
  }
}

Acronym not found (404):

{
  "success": false,
  "error": {
    "code": "ACRONYM_NOT_FOUND",
    "message": "Acronym not found"
  }
}

Profanity detected (400):

{
  "success": false,
  "error": {
    "code": "PROFANITY_DETECTED",
    "message": "Content contains inappropriate language",
    "details": {
      "fields": ["name"]
    }
  }
}

Insufficient permissions (403):

{
  "success": false,
  "error": {
    "code": "FORBIDDEN",
    "message": "You do not have permission to manage this collection"
  }
}

Collection Fields Reference

FieldTypeDescription
idstringUnique collection ID (prefixed col_)
namestringDisplay name (1-200 chars)
descriptionstring | nullOptional description (max 1000 chars)
isPublicbooleanVisible to all workspace members
isOnboardingbooleanHighlighted during new user onboarding
itemCountnumberNumber of acronyms in collection
creator.namestringCreator's display name
creator.avatarUrlstring | nullCreator's avatar URL
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 update timestamp