Templates API

Templates are the starting points an account keeps for its invoices, estimates, contracts, proposals, and projects. They are written in the app. The API reads them and makes new records from them, which is where an account's own wording, its usual line items, and its usual project structure come from.

Contract and Proposal Templates

GET /api/v2/contract_templates
GET /api/v2/proposal_templates

The account's own templates, followed by the built-in defaults Clientary provides. A built-in default has a negative id and built_in set, and no page of its own. Pass defaults=false to leave the built-in ones out.

{
  "total_count": 9,
  "contract_templates": [
    { "id": 12, "subject": "Standard terms", "description": "Our usual terms", "built_in": false, "contract_sections": [ ... ] },
    { "id": -1, "subject": "Simple Contract", "description": "This is a basic contract, suitable for all purposes", "built_in": true, "contract_sections": [ ... ] },
    ...
  ]
}
GET /api/v2/contract_templates/:id
GET /api/v2/proposal_templates/:id

One template with its sections. A negative id reads a built-in default.

Making a contract or proposal from a template

Create the document with a template_id alongside the usual fields. The template's sections, title, signature, and settings are copied first, and anything in the request is applied on top, so a subject in the request replaces the template's, and sections in the request stand in for the template's sections. The new document records the template it came from, a built-in one by its negative id.

POST /api/v2/proposals
{
  "template_id": 12,
  "proposal": { "client_id": 7, "date": "2026-10-01" }
}

Invoice and Estimate Templates

GET /api/v2/invoice_templates
GET /api/v2/estimate_templates

The account's own templates by name, followed by the built-in templates Clientary provides, 30 to a page. Pass page for the pages after the first. A built-in template has a negative id, a description of when to use it, and built_in set. Pass defaults=false to leave the built-in ones out. Each template has its name and the fields an invoice or estimate made from it starts with: its title, its summary (an estimate's scope), note, taxes, and line items.

{
  "page_size": 30,
  "page_count": 1,
  "total_count": 17,
  "invoice_templates": [
    {
      "id": 41,
      "name": "Monthly retainer",
      "description": null,
      "built_in": false,
      "title": "Monthly design retainer",
      "summary": "Design work for the month",
      "note": "Thank you for your business",
      "tax": "8.25",
      "tax_label": "Sales Tax",
      "invoice_items": [
        { "title": "Design hours", "item_type": 3, "quantity": 20.0, "price": 120.0, "taxable": true, "position": 0 }
      ],
      "updated_at": "2026-11-14T18:02:11Z"
    },
    { "id": -192, "name": "Services Invoice Template", "description": "...", "built_in": true, ... },
    ...
  ]
}
GET /api/v2/invoice_templates/:id
GET /api/v2/estimate_templates/:id

One template. A negative id reads a built-in template.

Making an invoice or estimate from a template

Create the document with a template_id alongside the usual fields. The template's title, text, line items, and taxes are copied first, and anything in the request is applied on top, so a title in the request replaces the template's, and line items in the request stand in for the template's.

POST /api/v2/invoices
{
  "template_id": 41,
  "invoice": { "client_id": 7, "date": "2026-11-01", "due_date": "2026-12-01", "currency_code": "USD" }
}

Project Templates

GET /api/v2/project_templates

Accepts q to search by name and description, and page. Each template lists the phases and tasks by name that a project made from it starts with.

{
  "page_size": 30,
  "page_count": 1,
  "total_count": 1,
  "project_templates": [
    {
      "id": 4,
      "template_name": "Website build",
      "template_description": "Design, build, launch",
      "project_type": 1,
      "rate": 5000.0,
      "currency_code": "usd",
      "phases": ["Design", "Build", "Launch"],
      "tasks": ["Kickoff call", "Wireframes", "Deploy"]
    }
  ]
}
GET /api/v2/project_templates/:id
Making a project from a template

Create the project with a template_id. The template's settings, phases, and tasks are copied, with each task kept in its phase, and anything in the request is applied on top. The new project records the template it came from.

POST /api/v2/projects
{
  "template_id": 4,
  "project": { "client_id": 7, "name": "Acme website" }
}