Skip to content
campaiDeveloper
campai.com

Templates

GET/{organizationId}/templates/countsReads only

Count templates

Counts an organization's non-archived templates by type and subtype. It returns an array of type, subtype and count values, excluding templates with an email or letter that has no design.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • Requires organization access and the template.read permission.
  • Without receipt.read, receipt templates are excluded from the counts.
  • Without donationsSettings.read, donation confirmation templates are excluded from the counts.

Request

Path parameters

  • organizationIdidrequired
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request GET 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/templates/counts' \
  --header 'X-API-Key: YOUR_API_KEY'

Response

200 Successful response

Content-Type: application/json

A list of object.

  • typestring
    transactional contact booking receipt donationConfirmation
  • subtypestringnullable

    [].subtype is null for contact templates that apply to all contact types.

  • countnumber
Response200
[
  {
    "type": "transactional",
    "subtype": "string",
    "count": 1
  }
]

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.