Room contents

The blocks a room is built from — text, links, videos, documents, proposals and quotes — arranged in sections.

List a room's contents

GET/rooms/{room}/contents

Returns 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"
Response · 200
{
  "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)required

    The 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 objectsrequired
      • idstring(uuid)required
      • sectionstringrequired

        The part of the room page a block appears in.

        One ofoverviewdocumentspricingmapattachments

      • kindstringrequired

        What the block is.

        One ofsectiontextvideolinkdocumentproposalquote

      • titlestringnullablerequired
      • bodystringnullablerequired
      • urlstringnullablerequired
      • payloadobject | array of valuesnullablerequired

        An empty set comes back as [].

        at most 0 items

      • positionintegerrequired

        Order within the section, starting at 1.

      • content_typestringnullablerequired
      • content_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: feature names the capability (the operation's x-feature) and required_tier the 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.
    Errors
  • 403The key lacks the scope, or the member it acts as lacks the permission or holds no seat in the module (module_seat_required — an administrator assigns seats under Settings → Users), or the organization is suspended.
    Errors
  • 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

POST/rooms/{room}/contents

Appends 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."
}'
Response · 201
{
  "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)required

    The room's id.

Request body

application/json · required

  • sectionstringrequired

    The part of the room page a block appears in.

    One ofoverviewdocumentspricingmapattachments

  • kindstringrequired

    What the block is.

    One ofsectiontextvideolinkdocumentproposalquote

  • titlestringnullable

    at most 255 characters

  • bodystringnullable

    Text for a text block.

  • urlstring(uri)nullable

    For link and video blocks.

    at most 2,000 characters

  • content_typestringnullable

    What content_id points at: document, proposal or quote.

    at most 32 characters

  • content_idstring(uuid)nullable

    For document, proposal and quote blocks: the id of that record in your organization.

  • payloadobjectnullable

    Extra data the room page renders the block with.

  • visibilityobjectnullable

    Which 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.
    • dataobjectrequired
      • idstring(uuid)required
      • sectionstringrequired

        The part of the room page a block appears in.

        One ofoverviewdocumentspricingmapattachments

      • kindstringrequired

        What the block is.

        One ofsectiontextvideolinkdocumentproposalquote

      • titlestringnullablerequired
      • bodystringnullablerequired
      • urlstringnullablerequired
      • payloadobject | array of valuesnullablerequired

        An empty set comes back as [].

        at most 0 items

      • positionintegerrequired

        Order within the section, starting at 1.

      • content_typestringnullablerequired
      • content_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: feature names the capability (the operation's x-feature) and required_tier the 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.
    Errors
  • 403The key lacks the scope, or the member it acts as lacks the permission or holds no seat in the module (module_seat_required — an administrator assigns seats under Settings → Users), or the organization is suspended.
    Errors
  • 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

DELETE/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"
Response · 200
{
  "deleted": true
}

Path parameters

  • roomstring(uuid)required

    The room's id.

  • contentstring(uuid)required

    The content block's id. It must belong to this room.

Responses

  • Confirmation that the record was deleted.

    • deletedbooleanrequired

      One oftrue

  • 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: feature names the capability (the operation's x-feature) and required_tier the 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.
    Errors
  • 403The key lacks the scope, or the member it acts as lacks the permission or holds no seat in the module (module_seat_required — an administrator assigns seats under Settings → Users), or the organization is suspended.
    Errors
  • 404No such record in this organization.
    Errors
  • 429The key has made more requests this minute than its limit allows.
    Errors