Skip to content
campaiDeveloper
campai.com

Templates

GET/{organizationId}/templates/{templateId}Reads only

Get template

Gets a template and its editable properties for an organization. Provide the organization ID and template ID; the response is the template, with actor details protected according to the caller’s permissions.

Permissions

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

Who may call it

  • The caller must have organization access and the template.read permission.
  • A template of type receipt also requires receipt.read.
  • A template of type donationConfirmation also requires donationsSettings.read.

Request

Path parameters

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

A request the admin app sent for “Create a receipt”.

Response

200 Successful response

Content-Type: application/json

object

Response200
{
  "_id": "000000000000000000000001",
  "organization": "000000000000000000000001",
  "designRevision": 0,
  "type": "transactional",
  "folder": "000000000000000000000001",
  "publishedAt": "2026-06-15T22:30:00Z",
  "archivedAt": "2026-06-15T22:30:00Z",
  "name": "string",
  "description": "string",
  "draft": {
    "email": {
      "version": 1,
      "channel": "email",
      "container": {
        "type": "container",
        "id": "string",
        "desktop": {
          "padding": [
            null
          ]
        },
        "mobile": {
          "padding": [
            null
          ]
        },
        "width": 1,
        "fontFamily": "System",
        "background": {
          "backgroundColor": {
            "color": "string",
            "hide": true
          },
          "backgroundGradient": {
            "hide": true,
            "stops": [
              {
                "color": "string",
                "position": 0
              }
            ],
            "angle": 1
          },
          "backgroundImage": {
            "hide": true,
            "image": {
              "type": "resource",
              "resourceId": "string"
            },
            "size": "cover",
            "position": "top left"
          }
        },
        "items": [
          {
            "id": "string",
            "name": "string",
            "hideOnMobile": true,
            "hideOnDesktop": true,
            "hidden": true,
            "locked": true,
            "condition": {
              "operator": "and",
              "conditions": [
                null
              ]
            },
            "desktop": {
              "margin": [
                null
              ],
              "padding": [
                null
              ],
              "radius": 0
            },
            "mobile": {
              "margin": [
                null
              ],
              "padding": [
                null
              ],
              "radius": 0
            },
            "type": "block",
            "repeat": {
              "source": {
                "variable": "string"
              }
            },
            "background": {
              "backgroundColor": {
                "color": "string",
                "hide": true
              },
              "backgroundGradient": {
                "hide": true,
                "stops": [
                  {
                    "color": null,
                    "position": null
                  }
                ],
                "angle": 1
              },
              "backgroundImage": {
                "hide": true,
                "image": null,
                "size": "cover",
                "position": "top left"
              }
            },
            "border": {
              "color": "string",
              "width": 0,
              "style": "solid",
              "hide": true
            },
            "items": [
              {
                "id": "string",
                "name": "string",
                "hideOnMobile": true,
                "hideOnDesktop": true,
                "hidden": true,
                "locked": true,
                "condition": null,
                "desktop": {
                  "width": null
                },
                "mobile": {
                  "width": null
                },
                "type": "table",
                "align": "left",
                "border": {
                  "color": null,
                  "width": null,
                  "style": "solid",
                  "hide": null
                },
                "collapseMobile": true,
                "items": [
                  null
                ]
              }
            ]
          }
        ]
      },
      "languages": [
        "string"
      ],
      "resources": [
        {
          "resource": "string",
          "id": "string"
        }
      ]
    },
    "letter": {
      "version": 1,
      "channel": "paper",
      "container": {
        "type": "container",
        "id": "string",
        "repeat": {
          "source": {
            "variable": "string"
          }
        },
        "pageSize": {
          "width": 1,
          "height": 1,
          "landscape": true
        },
        "fontFamily": "string",
        "items": [
          {
            "id": "string",
            "name": "string",
            "hidden": true,
            "locked": true,
            "condition": {
              "operator": "and",
              "conditions": [
                null
              ]
            },
            "type": "page",
            "repeat": {
              "source": {
                "variable": "string"
              }
            },
            "margin": [
              null
            ],
            "background": {
              "backgroundColor": {
                "color": "string",
                "hide": true
              },
              "backgroundGradient": {
                "hide": true,
                "stops": [
                  {
                    "color": null,
                    "position": null
                  }
                ],
                "angle": 1
              },
              "backgroundImage": {
                "hide": true,
                "image": null,
                "size": "cover",
                "position": "top left"
              }
            },
            "foldingMarks": [
              {
                "top": 1,
                "left": 1,
                "width": 1
              }
            ],
            "items": [
              {
                "id": "string",
                "name": "string",
                "hidden": true,
                "locked": true,
                "condition": null,
                "margin": [
                  null
                ],
                "padding": [
                  null
                ],
                "radius": null,
                "background": {
                  "backgroundColor": null,
                  "backgroundGradient": null,
                  "backgroundImage": null
                },
                "border": {
                  "color": null,
                  "width": null,
                  "style": "solid",
                  "hide": null
                },
                "orientation": "horizontal",
                "placement": "top left",
                "gapX": null,
                "gapY": 0,
                "type": "section",
                "repeat": null,
                "height": {
                  "value": null,
                  "unit": "#"
                },
                "items": [
                  null
                ]
              }
            ]
          }
        ]
      },
      "unit": "px",
      "languages": [
        "string"
      ],
      "onlineLetter": true,
      "resources": [
        {
          "resource": "string",
          "id": "string"
        }
      ],
      "attachment": {
        "resourceId": "string",
        "mode": "overlay",
        "pages": 1
      }
    },
    "pass": {
      "version": 1,
      "channel": "pass",
      "id": "string",
      "languages": [
        "string"
      ],
      "resources": [
        {
          "resource": "string",
          "id": "string"
        }
      ],
      "isSingleUse": true,
      "expiresAt": {
        "variable": "string"
      },
      "locations": [
        {
          "latitude": -90,
          "longitude": -180
        }
      ],
      "issuerName": {
        "mode": "plain",
        "values": {
          "key": [
            {
              "kind": "literal",
              "value": "string"
            }
          ]
        },
        "fallbackLanguage": "string"
      },
      "logoImage": {
        "type": "resource",
        "resourceId": "string"
      },
      "mainImage": {
        "type": "resource",
        "resourceId": "string"
      },
      "textFields": {
        "key": {
          "type": "header",
          "label": {
            "mode": "plain",
            "values": {
              "key": [
                null
              ]
            },
            "fallbackLanguage": "string"
          },
          "value": {
            "mode": "plain",
            "values": {
              "key": [
                null
              ]
            },
            "fallbackLanguage": "string"
          }
        }
      },
      "barcode": {
        "format": "qrcode",
        "content": {
          "mode": "plain",
          "values": {
            "key": [
              null
            ]
          },
          "fallbackLanguage": "string"
        },
        "text": {
          "mode": "plain",
          "values": {
            "key": [
              null
            ]
          },
          "fallbackLanguage": "string"
        }
      },
      "apple": {
        "showIssuerName": true,
        "textColor": "string",
        "hideMainFields": true
      },
      "google": {
        "renderWideLogo": true
      },
      "type": "custom",
      "custom": {
        "header": {
          "mode": "plain",
          "values": {
            "key": [
              {
                "kind": "literal",
                "value": null
              }
            ]
          },
          "fallbackLanguage": "string"
        },
        "subheader": {
          "mode": "plain",
          "values": {
            "key": [
              {
                "kind": "literal",
                "value": null
              }
            ]
          },
          "fallbackLanguage": "string"
        },
        "backgroundColor": {
          "mode": "plain",
          "values": {
            "key": [
              {
                "kind": "literal",
                "value": null
              }
            ]
          },
          "fallbackLanguage": "string"
        }
      }
    },
    "retiredResources": [
      {
        "resource": "string",
        "id": "string"
      }
    ],
    "savedAt": "2026-06-15T22:30:00Z"
  },
  "email": {
    "design": {
      "version": 1,
      "channel": "email",
      "container": {
        "type": "container",
        "id": "string",
        "desktop": {
          "padding": [
            null
          ]
        },
        "mobile": {
          "padding": [
            null
          ]
        },
        "width": 1,
        "fontFamily": "System",
        "background": {
          "backgroundColor": {
            "color": "string",
            "hide": true
          },
          "backgroundGradient": {
            "hide": true,
            "stops": [
              {
                "color": "string",
                "position": 0
              }
            ],
            "angle": 1
          },
          "backgroundImage": {
            "hide": true,
            "image": {
              "type": "resource",
              "resourceId": "string"
            },
            "size": "cover",
            "position": "top left"
          }
        },
        "items": [
          {
            "id": "string",
            "name": "string",
            "hideOnMobile": true,
            "hideOnDesktop": true,
            "hidden": true,
            "locked": true,
            "condition": {
              "operator": "and",
              "conditions": [
                null
              ]
            },
            "desktop": {
              "margin": [
                null
              ],
              "padding": [
                null
              ],
              "radius": 0
            },
            "mobile": {
              "margin": [
                null
              ],
              "padding": [
                null
              ],
              "radius": 0
            },
            "type": "block",
            "repeat": {
              "source": {
                "variable": "string"
              }
            },
            "background": {
              "backgroundColor": {
                "color": "string",
                "hide": true
              },
              "backgroundGradient": {
                "hide": true,
                "stops": [
                  {
                    "color": "string",
                    "position": 0
                  }
                ],
                "angle": 1
              },
              "backgroundImage": {
                "hide": true,
                "image": {
                  "type": "resource",
                  "resourceId": "string"
                },
                "size": "cover",
                "position": "top left"
              }
            },
            "border": {
              "color": "string",
              "width": 0,
              "style": "solid",
              "hide": true
            },
            "items": [
              {
                "id": "string",
                "name": "string",
                "hideOnMobile": true,
                "hideOnDesktop": true,
                "hidden": true,
                "locked": true,
                "condition": {
                  "operator": "and",
                  "conditions": null
                },
                "desktop": {
                  "width": {
                    "type": "hug",
                    "width": {
                      "value": null,
                      "unit": "#"
                    }
                  }
                },
                "mobile": {
                  "width": {
                    "type": "hug",
                    "width": null
                  }
                },
                "type": "table",
                "align": "left",
                "border": {
                  "color": "string",
                  "width": 0,
                  "style": "solid",
                  "hide": true
                },
                "collapseMobile": true,
                "items": [
                  {
                    "id": "string",
                    "name": "string",
                    "hideOnMobile": true,
                    "hideOnDesktop": true,
                    "hidden": true,
                    "locked": true,
                    "condition": null,
                    "desktop": {
                      "placement": "top left",
                      "height": null
                    },
                    "mobile": {
                      "placement": "top left",
                      "height": null
                    },
                    "type": "tableRow",
                    "repeat": null,
                    "backgroundColor": {
                      "color": null,
                      "hide": null
                    },
                    "border": {
                      "color": null,
                      "width": null,
                      "style": "solid",
                      "hide": null
                    },
                    "items": [
                      null
                    ]
                  }
                ]
              }
            ]
          }
        ]
      },
      "languages": [
        "string"
      ],
      "resources": [
        {
          "resource": "string",
          "id": "string"
        }
      ]
    },
    "attachments": [
      {
        "resource": "string",
        "id": "string"
      }
    ]
  },
  "standard": true,
  "transactionalType": "content"
}

Errors

Other errors

StatusErrorWhen
404No fixed messageIf the template is not found in the organization, the endpoint returns HTTP 404 (NOT_FOUND).

Errors nearly every request can meet are listed under Errors.