Templates

Reusable starting points for deal rooms, documents, proposals, mutual action plans and emails. The list holds the organization's own templates and Closepact's built-in library, which every organization shares.

List templates

GET/templates

Active templates — the organization's own and Closepact's built-in library — most used first, a page at a time. Each carries a preview (how many content rows it holds, per section); add include_content=1 to get the full content as well, or fetch one with GET /templates/{template}.

curl 'https://api.closepact.com/v1/api/templates' \
  -H "Authorization: Bearer $CLOSEPACT_API_KEY"
Response · 200
{
  "data": [
    {
      "id": "01a14f90-5d2c-7a18-9e3b-4c6d8f0a2b71",
      "name": "Serviceavtal – fastighetsskötsel",
      "type": "room",
      "scope": "organization",
      "is_built_in": false,
      "description": "Rum för nya serviceavtal: offert, avtal för signering och tidplan för uppstart.",
      "is_active": true,
      "usage_count": 37,
      "last_used_at": "2026-10-12T08:10:55+00:00",
      "created_at": "2026-03-02T09:30:00+00:00",
      "preview": {
        "sections": {
          "overview": 1,
          "documents": 2,
          "pricing": 1
        },
        "content_count": 4,
        "has_branding": true
      }
    }
  ],
  "links": {
    "first": null,
    "last": null,
    "prev": null,
    "next": null
  },
  "meta": {
    "path": "https://api.closepact.com/v1/api/templates",
    "per_page": 25,
    "next_cursor": null,
    "prev_cursor": null
  }
}

Query parameters

  • filter[type]string

    Only templates of this type. Repeat as filter[type][] for several.

    One ofroomdocumentproposalmapemail

  • qstring

    Case-insensitive match anywhere in the name.

    Example Serviceavtal

  • include_contentboolean

    Include each template's full content.

    Default false

  • limitinteger

    Items per page. Values outside 1–100 are clamped.

    Default 251–100

  • cursorstring

    Opaque cursor from meta.next_cursor or meta.prev_cursor of the previous page.

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
      • namestringrequired
      • is_built_inbooleanrequired

        True for a Closepact library template shared by every organization. It can be used but not deleted.

      • typestringrequired

        What it makes: a deal room, a document, a proposal, a mutual action plan, or an email.

        One ofroomdocumentproposalmapemail

      • scopestringrequired

        One ofpersonalteamorganization

      • descriptionstringnullablerequired
      • is_activebooleanrequired
      • usage_countintegernullablerequired

        Times it has been used. Null in the response that creates it.

      • last_used_atstring(date-time)nullablerequired
      • created_atstring(date-time)required
      • previewobjectrequired
      • contentobject | array of valuesnullable

        The template's body; its shape depends on type. Only on GET /templates/{template}, or with include_content=1 on the list. Sent as an empty array [] when empty.

    • linksobjectrequired
    • metaobjectrequired
  • 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
  • 429The key has made more requests this minute than its limit allows.
    Errors

Create a template

POST/templates
Scope write Permission templates.create

Adds a template to the organization's library. content is stored as given and read by the part of Closepact the type belongs to; for a room template it holds contents — rows with a section (overview, documents, pricing, map, attachments), a kind (text, video, link, document, …), and title, body or url — and optionally brand_overrides. The easiest way to get a valid content is to copy it from an existing template (GET /templates/{template}).

scope defaults to organization.

curl -X POST 'https://api.closepact.com/v1/api/templates' \
  -H "Authorization: Bearer $CLOSEPACT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Serviceavtal – fastighetsskötsel",
  "type": "room",
  "description": "Rum för nya serviceavtal: offert, avtal för signering och tidplan för uppstart.",
  "content": {
    "contents": [
      {
        "section": "overview",
        "kind": "text",
        "title": "Välkommen",
        "body": "Här samlar vi allt inför uppstarten av ert serviceavtal."
      },
      {
        "section": "documents",
        "kind": "link",
        "title": "Våra villkor",
        "url": "https://nordiskfastighet.se/villkor"
      }
    ]
  }
}'
Response · 201
{
  "data": {
    "id": "01a15c44-1f8e-7b3a-a2d5-6e9c0b4f7a12",
    "name": "Serviceavtal – fastighetsskötsel",
    "type": "room",
    "scope": "organization",
    "is_built_in": false,
    "description": "Rum för nya serviceavtal: offert, avtal för signering och tidplan för uppstart.",
    "is_active": true,
    "usage_count": null,
    "last_used_at": null,
    "created_at": "2026-10-18T09:02:11+00:00",
    "preview": {
      "sections": {
        "overview": 1,
        "documents": 1
      },
      "content_count": 2,
      "has_branding": false
    }
  }
}

Request body

application/json · required

  • namestringrequired

    2–255 characters

  • typestringrequired

    One ofroomdocumentproposalmapemail

  • scopestring

    One ofpersonalteamorganization

    Default "organization"

  • descriptionstringnullable

    at most 5,000 characters

  • contentobject

    The template's body; its shape depends on type. Defaults to empty.

  • team_idstring(uuid)nullable

    The team a team template belongs to: one of this organization's teams. Any other id fails validation (422).

Responses

  • Headers

    • X-RateLimit-Limit — Requests this key may make per minute.
    • X-RateLimit-Remaining — Requests left in the current minute.
    • dataobjectrequired

      A reusable starting point.

      • idstring(uuid)required
      • namestringrequired
      • is_built_inbooleanrequired

        True for a Closepact library template shared by every organization. It can be used but not deleted.

      • typestringrequired

        What it makes: a deal room, a document, a proposal, a mutual action plan, or an email.

        One ofroomdocumentproposalmapemail

      • scopestringrequired

        One ofpersonalteamorganization

      • descriptionstringnullablerequired
      • is_activebooleanrequired
      • usage_countintegernullablerequired

        Times it has been used. Null in the response that creates it.

      • last_used_atstring(date-time)nullablerequired
      • created_atstring(date-time)required
      • previewobjectrequired
      • contentobject | array of valuesnullable

        The template's body; its shape depends on type. Only on GET /templates/{template}, or with include_content=1 on the list. Sent as an empty array [] when empty.

  • 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
  • 422The request body or query failed validation.
    Errors
  • 429The key has made more requests this minute than its limit allows.
    Errors

Retrieve a template

GET/templates/{template}

One template, always with its full content. Works for the organization's own templates and for Closepact's built-in library; another organization's template answers 404.

curl 'https://api.closepact.com/v1/api/templates/01a14f90-5d2c-7a18-9e3b-4c6d8f0a2b71' \
  -H "Authorization: Bearer $CLOSEPACT_API_KEY"
Response · 200
{
  "data": {
    "id": "01a14f90-5d2c-7a18-9e3b-4c6d8f0a2b71",
    "name": "Serviceavtal – fastighetsskötsel",
    "type": "room",
    "scope": "organization",
    "is_built_in": false,
    "description": "Rum för nya serviceavtal: offert, avtal för signering och tidplan för uppstart.",
    "is_active": true,
    "usage_count": 37,
    "last_used_at": "2026-10-12T08:10:55+00:00",
    "created_at": "2026-03-02T09:30:00+00:00",
    "preview": {
      "sections": {
        "overview": 1,
        "documents": 1
      },
      "content_count": 2,
      "has_branding": false
    },
    "content": {
      "contents": [
        {
          "section": "overview",
          "kind": "text",
          "title": "Välkommen",
          "body": "Här samlar vi allt inför uppstarten av ert serviceavtal."
        },
        {
          "section": "documents",
          "kind": "link",
          "title": "Våra villkor",
          "url": "https://nordiskfastighet.se/villkor"
        }
      ]
    }
  }
}

Path parameters

  • templatestring(uuid)required

    The template's id.

    Example 01a14f90-5d2c-7a18-9e3b-4c6d8f0a2b71

Responses

  • Headers

    • X-RateLimit-Limit — Requests this key may make per minute.
    • X-RateLimit-Remaining — Requests left in the current minute.
    • dataobjectrequired

      A reusable starting point.

      • idstring(uuid)required
      • namestringrequired
      • is_built_inbooleanrequired

        True for a Closepact library template shared by every organization. It can be used but not deleted.

      • typestringrequired

        What it makes: a deal room, a document, a proposal, a mutual action plan, or an email.

        One ofroomdocumentproposalmapemail

      • scopestringrequired

        One ofpersonalteamorganization

      • descriptionstringnullablerequired
      • is_activebooleanrequired
      • usage_countintegernullablerequired

        Times it has been used. Null in the response that creates it.

      • last_used_atstring(date-time)nullablerequired
      • created_atstring(date-time)required
      • previewobjectrequired
      • contentobject | array of valuesnullable

        The template's body; its shape depends on type. Only on GET /templates/{template}, or with include_content=1 on the list. Sent as an empty array [] when empty.

  • 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