Room contents
The blocks a room is built from — text, links, videos, documents, proposals and quotes — arranged in sections.
List a room's contents
/rooms/{room}/contentsReturns every content block in the room, ordered by position. Positions count up within each section, so group by section to rebuild the page. Not paginated.
curl 'https://api.closepact.com/v1/api/rooms/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40/contents' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY"{
"data": [
{
"id": "01a15c44-7a1b-7c2d-9e3f-0a1b2c3d4e5f",
"section": "overview",
"kind": "text",
"title": "Välkommen",
"body": "Här hittar ni allt om er hemstädning varannan vecka.",
"url": null,
"payload": null,
"position": 1,
"content_type": null,
"content_id": null
},
{
"id": "01a15c45-3d4e-7f5a-8b6c-7d8e9f0a1b2c",
"section": "documents",
"kind": "document",
"title": "Avtal hemstädning.pdf",
"body": null,
"url": null,
"payload": null,
"position": 1,
"content_type": "document",
"content_id": "01a15c3f-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
}
]
}Path parameters
roomstring(uuid)requiredThe room's id.
Responses
Headers
X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
dataarray of objectsrequiredidstring(uuid)requiredsectionstringrequiredThe part of the room page a block appears in.
One of
overviewdocumentspricingmapattachmentskindstringrequiredWhat the block is.
One of
sectiontextvideolinkdocumentproposalquotetitlestringnullablerequiredbodystringnullablerequiredurlstringnullablerequiredpayloadobject | array of valuesnullablerequiredAn empty set comes back as
[].at most 0 items
positionintegerrequiredOrder within the section, starting at 1.
content_typestringnullablerequiredcontent_idstring(uuid)nullablerequired
- 401No key, or the key is invalid, revoked or expired, or its creator no longer has access.Errors
- 402The organization has not bought the module this endpoint belongs to, or it has lapsed to read-only, or its tier does not include what the operation needs:Errors
featurenames the capability (the operation'sx-feature) andrequired_tierthe cheapest tier that grants it. Every operation answers this with"feature": "core.api"when no module the organization holds is on a tier that includes the API. - 403The key lacks the scope, or the member it acts as lacks the permission or holds no seat in the module (Errors
module_seat_required— an administrator assigns seats under Settings → Users), or the organization is suspended. - 404No such record in this organization.Errors
- 429The key has made more requests this minute than its limit allows.Errors
Add content to a room
/rooms/{room}/contentsAppends a content block to the end of a section. Which fields matter depends on kind: text uses title and body; link and video use url; document, proposal and quote point at a record of yours with content_id (and conventionally content_type set to the same word) — that record must belong to your organization. section blocks are headings.
visibility restricts the block to some stakeholders; it is stored but not returned. Visible to buyers at once if the room is published. Not idempotent: each call adds another block.
curl -X POST 'https://api.closepact.com/v1/api/rooms/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40/contents' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"section": "overview",
"kind": "text",
"title": "Välkommen",
"body": "Här hittar ni allt om er hemstädning varannan vecka."
}'{
"data": {
"id": "01a15c44-7a1b-7c2d-9e3f-0a1b2c3d4e5f",
"section": "overview",
"kind": "text",
"title": "Välkommen",
"body": "Här hittar ni allt om er hemstädning varannan vecka.",
"url": null,
"payload": null,
"position": 1,
"content_type": null,
"content_id": null
}
}Path parameters
roomstring(uuid)requiredThe room's id.
Request body
application/json · required
sectionstringrequiredThe part of the room page a block appears in.
One of
overviewdocumentspricingmapattachmentskindstringrequiredWhat the block is.
One of
sectiontextvideolinkdocumentproposalquotetitlestringnullableat most 255 characters
bodystringnullableText for a
textblock.urlstring(uri)nullableFor
linkandvideoblocks.at most 2,000 characters
content_typestringnullableWhat
content_idpoints at:document,proposalorquote.at most 32 characters
content_idstring(uuid)nullableFor
document,proposalandquoteblocks: the id of that record in your organization.payloadobjectnullableExtra data the room page renders the block with.
visibilityobjectnullableWhich stakeholders may see the block.
Responses
Headers
X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
dataobjectrequiredidstring(uuid)requiredsectionstringrequiredThe part of the room page a block appears in.
One of
overviewdocumentspricingmapattachmentskindstringrequiredWhat the block is.
One of
sectiontextvideolinkdocumentproposalquotetitlestringnullablerequiredbodystringnullablerequiredurlstringnullablerequiredpayloadobject | array of valuesnullablerequiredAn empty set comes back as
[].at most 0 items
positionintegerrequiredOrder within the section, starting at 1.
content_typestringnullablerequiredcontent_idstring(uuid)nullablerequired
- 401No key, or the key is invalid, revoked or expired, or its creator no longer has access.Errors
- 402The organization has not bought the module this endpoint belongs to, or it has lapsed to read-only, or its tier does not include what the operation needs:Errors
featurenames the capability (the operation'sx-feature) andrequired_tierthe cheapest tier that grants it. Every operation answers this with"feature": "core.api"when no module the organization holds is on a tier that includes the API. - 403The key lacks the scope, or the member it acts as lacks the permission or holds no seat in the module (Errors
module_seat_required— an administrator assigns seats under Settings → Users), or the organization is suspended. - 404No such record in this organization.Errors
- 422The request body or query failed validation.Errors
- 429The key has made more requests this minute than its limit allows.Errors
Remove content from a room
/rooms/{room}/contents/{content}Removes the block from the room. The document, proposal or quote it pointed at is not deleted. The other blocks keep their positions.
curl -X DELETE 'https://api.closepact.com/v1/api/rooms/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40/contents/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY"{
"deleted": true
}Path parameters
roomstring(uuid)requiredThe room's id.
contentstring(uuid)requiredThe content block's id. It must belong to this room.
Responses
Confirmation that the record was deleted.
deletedbooleanrequiredOne of
true
- 401No key, or the key is invalid, revoked or expired, or its creator no longer has access.Errors
- 402The organization has not bought the module this endpoint belongs to, or it has lapsed to read-only, or its tier does not include what the operation needs:Errors
featurenames the capability (the operation'sx-feature) andrequired_tierthe cheapest tier that grants it. Every operation answers this with"feature": "core.api"when no module the organization holds is on a tier that includes the API. - 403The key lacks the scope, or the member it acts as lacks the permission or holds no seat in the module (Errors
module_seat_required— an administrator assigns seats under Settings → Users), or the organization is suspended. - 404No such record in this organization.Errors
- 429The key has made more requests this minute than its limit allows.Errors