Collections API

Organize debates into named collections. Share curated sets publicly or keep them private.

7 min read
Share

Collections are named groups of debates that you curate. Use them to organise your debates by topic, project, or team — and optionally share them publicly so others can browse your curated set without needing an account.

Base URL

All endpoints below are relative to https://api.askverdict.ai. Authenticate every write request with Authorization: Bearer <your_api_key>.


Endpoints

MethodPathAuthDescription
POST/api/collectionsRequiredCreate a collection
GET/api/collectionsRequiredList your collections
GET/api/collections/:idOptionalGet a collection with its items
PATCH/api/collections/:idRequired (owner)Update a collection
DELETE/api/collections/:idRequired (owner)Delete a collection
POST/api/collections/:id/itemsRequired (owner)Add a debate to a collection
DELETE/api/collections/:id/items/:debateIdRequired (owner)Remove a debate from a collection
PATCH/api/collections/:id/items/reorderRequired (owner)Reorder debates in a collection

POST /api/collections

POST/api/collections

Create a new collection. Collections are private by default — set isPublic: true to make the collection browsable by anyone with the URL.

Request Body

NameTypeRequiredDescription
namestringRequiredCollection name. 1–100 characters.
descriptionstringOptionalOptional description of the collection. Maximum 500 characters.
isPublicbooleanOptionalWhether the collection is publicly accessible. Default: false.

Example Requests

bash
curl -X POST https://api.askverdict.ai/api/collections \
  -H "Authorization: Bearer vrd_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Architecture Decisions 2026",
    "description": "Key engineering decisions debated by our platform team.",
    "isPublic": false
  }'

Response

Error Responses

StatusCodeDescription
400VALIDATION_ERRORName is empty, too long, or description exceeds 500 characters
401UNAUTHORIZEDMissing or invalid API key

GET /api/collections

GET/api/collections

List all collections owned by the authenticated user, ordered by creation date (newest first).

Example Requests

bash
curl "https://api.askverdict.ai/api/collections" \
  -H "Authorization: Bearer vrd_your_api_key"

Response


GET /api/collections/:id

GET/api/collections/:id

Retrieve a single collection with its full list of debates. Public collections are accessible without authentication. Private collections are only accessible to their owner.

Sharing public collections

Set isPublic: true on a collection and share the URL https://askverdict.ai/collections/:id. Anyone — including unauthenticated users — can browse the debates in the collection.

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe collection ID.

Example Requests

bash
# Public collection — no auth needed
curl "https://api.askverdict.ai/api/collections/col_8d1e5f2b"
 
# Private collection — owner only
curl "https://api.askverdict.ai/api/collections/col_4f2a9b3c" \
  -H "Authorization: Bearer vrd_your_api_key"

Response

Error Responses

StatusCodeDescription
403FORBIDDENCollection is private and you are not the owner
404NOT_FOUNDCollection not found

PATCH /api/collections/:id

PATCH/api/collections/:id

Update a collection's name, description, or visibility. All fields are optional — only the supplied fields are changed.

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe collection ID to update.

Request Body

NameTypeRequiredDescription
namestringOptionalNew collection name. 1–100 characters.
descriptionstring | nullOptionalNew description, or null to clear it. Maximum 500 characters.
isPublicbooleanOptionalChange collection visibility.

Example Requests

bash
# Make a collection public
curl -X PATCH "https://api.askverdict.ai/api/collections/col_4f2a9b3c" \
  -H "Authorization: Bearer vrd_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "isPublic": true }'

Response

Error Responses

StatusCodeDescription
400VALIDATION_ERRORField validation failed
403FORBIDDENYou are not the collection owner
404NOT_FOUNDCollection not found

DELETE /api/collections/:id

DELETE/api/collections/:id

Delete a collection. All collection-debate associations are removed. The debates themselves are not deleted.

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe collection ID to delete.

Example Request

bash
curl -X DELETE "https://api.askverdict.ai/api/collections/col_4f2a9b3c" \
  -H "Authorization: Bearer vrd_your_api_key"

Response


POST /api/collections/:id/items

POST/api/collections/:id/items

Add a debate to a collection. The debate is appended at the end. You must own both the collection and the debate.

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe collection ID.

Request Body

NameTypeRequiredDescription
debateIdstring (UUID)RequiredThe UUID of the debate to add.

Example Requests

bash
curl -X POST "https://api.askverdict.ai/api/collections/col_4f2a9b3c/items" \
  -H "Authorization: Bearer vrd_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "debateId": "d8a3f1c2-4e5b-6789-abcd-ef0123456789" }'

Response

Error Responses

StatusCodeDescription
400VALIDATION_ERRORdebateId is not a valid UUID
403FORBIDDENYou do not own the collection
404NOT_FOUNDCollection or debate not found
409CONFLICTDebate is already in this collection

DELETE /api/collections/:id/items/:debateId

DELETE/api/collections/:id/items/:debateId

Remove a debate from a collection. The debate itself is not deleted — only the collection membership is removed.

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe collection ID.
debateIdstring (UUID)RequiredThe debate UUID to remove from the collection.

Example Request

bash
curl -X DELETE "https://api.askverdict.ai/api/collections/col_4f2a9b3c/items/d8a3f1c2-4e5b-6789-abcd-ef0123456789" \
  -H "Authorization: Bearer vrd_your_api_key"

Response


PATCH /api/collections/:id/items/reorder

PATCH/api/collections/:id/items/reorder

Change the display order of debates within a collection. Send the full desired order as an array of debateId + order pairs.

Full order required

You must supply all debates in the collection in the items array. Partial reorders are not supported — missing debates may be moved to unexpected positions.

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe collection ID.

Request Body

NameTypeRequiredDescription
itemsarrayRequiredArray of ordering entries. Each entry is { debateId: string (UUID), order: integer >= 0 }. Minimum 1 entry.

Example Requests

bash
curl -X PATCH "https://api.askverdict.ai/api/collections/col_4f2a9b3c/items/reorder" \
  -H "Authorization: Bearer vrd_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      { "debateId": "d8a3f1c2-4e5b-6789-abcd-ef0123456789", "order": 0 },
      { "debateId": "f9b4e2d1-5a6c-7890-bcde-f01234567890", "order": 1 },
      { "debateId": "a1b2c3d4-5e6f-7890-abcd-ef0123456789", "order": 2 }
    ]
  }'

Response


Collection Object Reference

FieldTypeDescription
idstringCollection identifier
namestringDisplay name
descriptionstring | nullOptional description
isPublicbooleantrue if the collection is publicly viewable
userIdstringID of the owning user
createdAtstring (ISO 8601)Creation timestamp
updatedAtstring (ISO 8601)Last modification timestamp
itemsCollectionItem[]Included only in GET /collections/:id — ordered list of debates

CollectionItem Object

FieldTypeDescription
debateIdstring (UUID)ID of the debate
orderintegerDisplay order (0-indexed, ascending)
addedAtstring (ISO 8601)When the debate was added
debateobjectSummary of the debate — id, question, status, mode, createdAt

Was this page helpful?