eContract Developers
API ReferenceTemplates

Archive template

Archive (soft-delete) a custom contract template with DELETE /contract-templates/{id}. Needs the templates:delete scope; system templates cannot be archived.

DELETE /contract-templates/:id

Archive a custom template. This performs a soft delete — the template is marked as archived and no longer appears in listing results. System templates cannot be archived.

Authentication

Requires the templates:delete scope (API key or OAuth token) and a role with the contracts:delete permission.

Path Parameters

ParameterTypeRequiredDescription
idstringYesTemplate ID

Response

Returns 204 No Content on success.

Errors

StatusDescription
400Cannot archive system templates
404Template not found

Example

curl -X DELETE \
  "https://api.econtract.online/api/v1/contract-templates/{templateId}" \
  -H "Authorization: Bearer cl_live_your_key"
await fetch(
  `https://api.econtract.online/api/v1/contract-templates/${templateId}`,
  {
    method: "DELETE",
    headers: { Authorization: `Bearer ${process.env.ECONTRACT_API_KEY}` },
  }
);
requests.delete(
    f"https://api.econtract.online/api/v1/contract-templates/{template_id}",
    headers={"Authorization": f"Bearer {os.environ[\'ECONTRACT_API_KEY\']}"},
)

On this page