Skip to navigation

Create a collection

Requires posts:write. Creates an empty collection on the key’s team, without adding posts or spending credits. To create one while adding posts, pass collections: [{ "name": "…" }] on POST /content/posts/add or POST /content/accounts/add instead.

type defaults to campaign. A group can take a parentId to nest it under an existing campaign; groups nest one level, so a parentId that is a group is a 400. Whitespace in name is collapsed. Because add requests match collections by name, a name another active collection on the team already has (any casing) is a 409 with error.code: collection_name_taken and error.candidates[] listing { id, name, type }. Use that id instead of creating a duplicate.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

OR
X-Api-Keystring
API Key authentication via header

Request

This endpoint expects an object.
namestringRequired1-120 characters
typeenumOptionalDefaults to campaign
Allowed values:
parentIdstringOptional

Only with type: group. The campaign to nest under.

descriptionstringOptional<=500 characters

Response

The new collection
dataobjectOptional
metaobjectOptional

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error