{"openapi":"3.1.0","info":{"title":"Clerra API","version":"1","description":"Read a firm's clients, filing deadlines, invoices, jobs and pipeline; add clients (with their CRA deadlines built for them), jobs, notes, to-dos and leads; follow activity — including document uploads, requests, proposals and signatures — by polling /events or with webhooks. Every key belongs to one firm and sees only that firm. Available on paid plans; the firm can switch it off at any time. Full guide: https://clerra.ca/developers","contact":{"name":"Clerra","url":"https://clerra.ca/developers"}},"servers":[{"url":"https://app.clerra.ca/api/v1"}],"security":[{"apiKey":[]},{"oauth2":[]}],"paths":{"/me":{"get":{"operationId":"getMe","summary":"Check a key","description":"Which firm the key belongs to and what it can do. Works with any scope — use it to test a connection.\n\nAny scope.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Me"}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/clients":{"get":{"operationId":"getClients","summary":"List clients","description":"Every client, oldest first.\n\nScope: `clients:read`.","parameters":[{"name":"limit","in":"query","required":false,"description":"1–100, default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The id of the last record you received; continues after it.","schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"description":"Only records changed at or after this ISO 8601 time — for syncing.","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Part of the name, legal name or email (2+ letters or numbers).","schema":{"type":"string"}},{"name":"email","in":"query","required":false,"description":"Exact email (not case-sensitive).","schema":{"type":"string"}},{"name":"business_number","in":"query","required":false,"description":"The 9-digit business number (a full program account like 123456789RC0001 works too).","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Client"}},"next_cursor":{"type":["string","null"]}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postClients","summary":"Add a client","description":"Adds a client exactly as Add client in Clerra does: client code, Vault folders, and the filing calendar built by the deadline engine. Clerra never guesses a client's type, year end or province — leave out what you don't know and the client is added with missing_details listing it, with no deadlines until the firm confirms it on the Clients page. If a client already has the same email or business number, that client is returned (200, meta.duplicate) instead of a second one being made — so a retried request is safe. Starts as onboarding unless you say active.\n\nScope: `clients:write`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The client's name as it should show in Clerra. Required."},"legal_name":{"type":["string","null"],"description":"Legal name, when it differs."},"entity_type":{"type":["string","null"],"enum":["individual","corporation","cooperative","partnership","limited_partnership","trust","non_profit","charity",null],"description":"What kind of taxpayer. Leave it out if you don't know."},"province":{"type":["string","null"],"enum":["AB","BC","MB","NB","NL","NS","NT","NU","ON","PE","QC","SK","YT",null],"description":"Two-letter province or territory code. Leave it out if you don't know."},"fiscal_year_end_month":{"type":["integer","null"],"description":"1–12. Give it with fiscal_year_end_day; leave both out for an individual (Dec 31 by law) or if you don't know."},"fiscal_year_end_day":{"type":["integer","null"],"description":"1–31."},"email":{"type":["string","null"],"format":"email","description":"Main email. Also how an existing client is recognised."},"phone":{"type":["string","null"],"description":"Main phone."},"business_number":{"type":["string","null"],"description":"CRA business number (9 digits) or program account (123456789RC0001). Also how an existing client is recognised."},"status":{"type":["string","null"],"enum":["onboarding","active",null],"description":"onboarding (default) or active."},"contact_name":{"type":["string","null"],"description":"Primary contact's name — added to the client's People."},"contact_email":{"type":["string","null"],"format":"email","description":"Primary contact's email (defaults to email)."},"contact_phone":{"type":["string","null"],"description":"Primary contact's phone."},"address_line1":{"type":["string","null"],"description":"Street address."},"address_line2":{"type":["string","null"],"description":"Unit, suite."},"city":{"type":["string","null"],"description":"City."},"postal_code":{"type":["string","null"],"description":"Postal code."},"account_manager_id":{"type":["string","null"],"format":"uuid","description":"Team member who owns the relationship (GET /team). Someone other than the connecting person needs “Assign work to others”."},"notes":{"type":["string","null"],"description":"An opening note on the client's Notes tab."},"match_existing_by":{"type":["string","null"],"enum":["email_or_business_number","business_number",null],"description":"email_or_business_number (default) or business_number — use business_number when related businesses share an email."}},"required":["name"]},"example":{"name":"Northwind Bakery Ltd.","entity_type":"corporation","province":"ON","fiscal_year_end_month":3,"fiscal_year_end_day":31,"email":"books@northwind.example","business_number":"123456789","contact_name":"Amira Haddad"}}}},"responses":{"201":{"description":"201 Created, or 200 with meta.duplicate when the client already existed.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Client"},"meta":{"$ref":"#/components/schemas/CreateMeta"}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/clients/{id}":{"get":{"operationId":"getClientsById","summary":"Get a client","description":"One client by id.\n\nScope: `clients:read`.","parameters":[{"name":"id","in":"path","required":true,"description":"Client id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Client"}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/filings":{"get":{"operationId":"getFilings","summary":"List filings","description":"Every filing deadline across the firm's clients.\n\nScope: `filings:read`.","parameters":[{"name":"limit","in":"query","required":false,"description":"1–100, default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The id of the last record you received; continues after it.","schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"description":"Only records changed at or after this ISO 8601 time — for syncing.","schema":{"type":"string"}},{"name":"client_id","in":"query","required":false,"description":"Only this client's.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"upcoming, in_progress, waiting_on_client, filed, skipped.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Filing"}},"next_cursor":{"type":["string","null"]}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices":{"get":{"operationId":"getInvoices","summary":"List invoices","description":"Invoices with totals and what's still owing.\n\nScope: `invoices:read`.","parameters":[{"name":"limit","in":"query","required":false,"description":"1–100, default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The id of the last record you received; continues after it.","schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"description":"Only records changed at or after this ISO 8601 time — for syncing.","schema":{"type":"string"}},{"name":"client_id","in":"query","required":false,"description":"Only this client's.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"next_cursor":{"type":["string","null"]}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/clients/{id}/notes":{"post":{"operationId":"postClientsByIdNotes","summary":"Add a note to a client","description":"Logs a note on the client's Communications, attributed to the person who connected the key or app. The same note sent again within 24 hours is returned (200, meta.duplicate), not added twice.\n\nScope: `notes:write`.","parameters":[{"name":"id","in":"path","required":true,"description":"Client id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","description":"The note. Required."},"title":{"type":["string","null"],"description":"A heading (defaults to “Note from <app or key name>”)."},"occurred_at":{"type":["string","null"],"format":"date-time","description":"When it happened (defaults to now)."}},"required":["body"]},"example":{"title":"Booked a discovery call","body":"Wants help with the 2026 T2 and setting up payroll.","occurred_at":"2027-03-04T15:30:00Z"}}}},"responses":{"201":{"description":"201 Created, or 200 with meta.duplicate.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Note"},"meta":{"$ref":"#/components/schemas/CreateMeta"}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs":{"get":{"operationId":"getJobs","summary":"List jobs","description":"Client jobs (not internal, firm-only work).\n\nScope: `jobs:read`.","parameters":[{"name":"limit","in":"query","required":false,"description":"1–100, default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The id of the last record you received; continues after it.","schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"description":"Only records changed at or after this ISO 8601 time — for syncing.","schema":{"type":"string"}},{"name":"client_id","in":"query","required":false,"description":"Only this client's.","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Part of the job's name.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"open (anything not done, filed or cancelled), or one status: not_started, in_progress, waiting_on_client, in_review, on_hold, done, filed, cancelled.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"next_cursor":{"type":["string","null"]}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postJobs","summary":"Create a job","description":"Starts a job for a client exactly as New job in Clerra does — from a template (its steps are copied in and go to the client's usual people) or blank. job.created fires, so automations and webhooks run. The same job for the same client within 24 hours is returned (200, meta.duplicate), not made twice.\n\nScope: `jobs:write`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","format":"uuid","description":"The client. Required."},"template_id":{"type":["string","null"],"format":"uuid","description":"A job template (GET /job-templates)."},"name":{"type":["string","null"],"description":"Job name. Required unless a template is given (the job then takes its name)."},"due_date":{"type":["string","null"],"format":"date","description":"Due date, YYYY-MM-DD."},"assigned_to":{"type":["string","null"],"format":"uuid","description":"Team member doing it (GET /team) — they're notified. Someone other than the connecting person needs “Assign work to others”."}},"required":["client_id","name"]},"example":{"client_id":"8a6d4c2e-1b3f-4a5c-9e7d-6f8a0b1c2d3e","template_id":"4b3c2d1e-0f9a-4b8c-8d7e-6f5a4b3c2d1e","due_date":"2027-06-15"}}}},"responses":{"201":{"description":"201 Created, or 200 with meta.duplicate.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Job"},"meta":{"$ref":"#/components/schemas/CreateMeta"}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/job-templates":{"get":{"operationId":"getJobTemplates","summary":"List job templates","description":"The firm's job templates — for choosing one when creating a job.\n\nScope: `jobs:read`.","parameters":[{"name":"limit","in":"query","required":false,"description":"1–100, default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The id of the last record you received; continues after it.","schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"description":"Only records changed at or after this ISO 8601 time — for syncing.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/JobTemplate"}},"next_cursor":{"type":["string","null"]}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/team":{"get":{"operationId":"getTeam","summary":"List team members","description":"The firm's active team members — for choosing who work goes to.\n\nScope: `team:read`.","parameters":[{"name":"limit","in":"query","required":false,"description":"1–100, default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The id of the last record you received; continues after it.","schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"description":"Only records changed at or after this ISO 8601 time — for syncing.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TeamMember"}},"next_cursor":{"type":["string","null"]}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/todos":{"post":{"operationId":"postTodos","summary":"Add a to-do","description":"Puts a to-do on a team member's list (on their Today page), optionally about a client. The same to-do for the same person within 24 hours, not yet done, is returned (200, meta.duplicate), not added twice.\n\nScope: `todos:write`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"What needs doing. Required."},"assigned_to":{"type":"string","format":"uuid","description":"Whose list it goes on (GET /team). Required."},"due_date":{"type":["string","null"],"format":"date","description":"When it's due, YYYY-MM-DD."},"client_id":{"type":["string","null"],"format":"uuid","description":"The client it's about."}},"required":["title","assigned_to"]},"example":{"title":"Call back about the HST notice","assigned_to":"0d1e2f3a-4b5c-4d6e-8f70-81a2b3c4d5e6","due_date":"2027-03-05","client_id":"8a6d4c2e-1b3f-4a5c-9e7d-6f8a0b1c2d3e"}}}},"responses":{"201":{"description":"201 Created, or 200 with meta.duplicate.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Todo"},"meta":{"$ref":"#/components/schemas/CreateMeta"}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leads":{"get":{"operationId":"getLeads","summary":"List leads","description":"The sales pipeline.\n\nScope: `leads:read`.","parameters":[{"name":"limit","in":"query","required":false,"description":"1–100, default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The id of the last record you received; continues after it.","schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"description":"Only records changed at or after this ISO 8601 time — for syncing.","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Part of the name, contact name or email (2+ letters or numbers).","schema":{"type":"string"}},{"name":"email","in":"query","required":false,"description":"Exact email (not case-sensitive).","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}},"next_cursor":{"type":["string","null"]}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postLeads","summary":"Create a lead","description":"Adds a prospect to the pipeline (source “API” unless you give one). Unknown fields are rejected, not ignored.\n\nScope: `leads:write`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Business or person. Required."},"contact_name":{"type":["string","null"],"description":"Who to talk to."},"email":{"type":["string","null"],"format":"email","description":"Email."},"phone":{"type":["string","null"],"description":"Phone."},"website":{"type":["string","null"],"description":"Website."},"entity_type":{"type":["string","null"],"description":"Kind of taxpayer."},"stage":{"type":["string","null"],"enum":["new","contacted","meeting","proposal","won","lost",null],"description":"Pipeline stage (default new)."},"source":{"type":["string","null"],"description":"Where it came from."},"estimated_value":{"type":["number","null"],"description":"Expected yearly fees, in dollars."},"notes":{"type":["string","null"],"description":"Notes."}},"required":["name"]},"example":{"name":"Northwind Bakery Ltd.","contact_name":"Amira Haddad","email":"amira@northwind.example","stage":"new","source":"Website form"}}}},"responses":{"201":{"description":"201 Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Lead"}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/events":{"get":{"operationId":"getEvents","summary":"List events","description":"What happened, oldest first — poll with ?after. Only kinds of record the key can read (a key with Read invoices sees invoice.* and payment.*).\n\nScope: `events:read`.","parameters":[{"name":"after","in":"query","required":false,"description":"The id of the last event you received.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1–100, default 50.","schema":{"type":"integer"}},{"name":"type","in":"query","required":false,"description":"Comma-separated event types, e.g. filing.filed,invoice.paid.","schema":{"type":"string"}},{"name":"order","in":"query","required":false,"description":"asc (default) or desc for the newest first (no paging).","schema":{"type":"string"}},{"name":"include","in":"query","required":false,"description":"record — add each event's record as it is now.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"next_cursor":{"type":["string","null"]}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/events/{id}":{"get":{"operationId":"getEventsById","summary":"Get an event","description":"One event, the same shape as in the list and in webhooks — for confirming a webhook delivery with Clerra when you can't check its signature. Only kinds of record the key can read; anything else is not found.\n\nScope: `events:read`.","parameters":[{"name":"id","in":"path","required":true,"description":"Event id (a webhook's Clerra-Event-Id header).","schema":{"type":"string"}},{"name":"include","in":"query","required":false,"description":"record — add the event's record as it is now.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Event"}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/hooks":{"get":{"operationId":"getHooks","summary":"List hooks","description":"The hooks this key made.\n\nScope: `webhooks:manage`.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Hook"}}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postHooks","summary":"Create a hook","description":"Subscribe an https URL to event types the key can read. The response includes the signing secret — shown this once.\n\nScope: `webhooks:manage`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"https URL on a public host. Required."},"events":{"type":"array","items":{"type":"string"},"description":"Event types. Required."},"description":{"type":["string","null"],"description":"Note."}},"required":["url","events"]},"example":{"url":"https://hooks.example.com/clerra","events":["filing.filed","invoice.paid"],"description":"Our CRM"}}}},"responses":{"201":{"description":"201 Created, with secret.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Hook"}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/hooks/{id}":{"delete":{"operationId":"deleteHooksById","summary":"Delete a hook","description":"Stop sending to a hook this key made.\n\nScope: `webhooks:manage`.","parameters":[{"name":"id","in":"path","required":true,"description":"Hook id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean"}}}}}}}},"4XX":{"description":"See error codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"client.created":{"post":{"summary":"A client is added","description":"Signed with the Clerra-Signature header. data keys: source, status, entity_type.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"client.status_changed":{"post":{"summary":"A client's status changes","description":"Signed with the Clerra-Signature header. data keys: from, to.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"filing.status_changed":{"post":{"summary":"A filing's status changes","description":"Signed with the Clerra-Signature header. data keys: from, to, rule_code, due_date.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"filing.filed":{"post":{"summary":"A filing is marked filed","description":"Signed with the Clerra-Signature header. data keys: rule_code, due_date, filed_source.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"filing.overdue":{"post":{"summary":"A filing becomes overdue","description":"Signed with the Clerra-Signature header. data keys: rule_code, due_date.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"document.uploaded":{"post":{"summary":"A document is uploaded","description":"Signed with the Clerra-Signature header. data keys: by, request_id, request_item_id.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"request.created":{"post":{"summary":"A document request is sent","description":"Signed with the Clerra-Signature header. data keys: due_date, items, job_id.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"request.items_received":{"post":{"summary":"A client uploads everything requested","description":"Signed with the Clerra-Signature header. data keys: items, job_id.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"request.completed":{"post":{"summary":"A document request is completed","description":"Signed with the Clerra-Signature header. data keys: job_id.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"invoice.created":{"post":{"summary":"An invoice is created","description":"Signed with the Clerra-Signature header. data keys: source, status, total_cents.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"invoice.sent":{"post":{"summary":"An invoice is sent","description":"Signed with the Clerra-Signature header. data keys: total_cents, due_date.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"invoice.paid":{"post":{"summary":"An invoice is paid in full","description":"Signed with the Clerra-Signature header. data keys: total_cents, source.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"payment.received":{"post":{"summary":"A payment is received","description":"Signed with the Clerra-Signature header. data keys: amount_cents, source, paid_in_full, paid_on.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"invoice.overdue":{"post":{"summary":"An invoice becomes overdue","description":"Signed with the Clerra-Signature header. data keys: due_date, balance_cents.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"invoice.payment_failed":{"post":{"summary":"A card payment fails","description":"Signed with the Clerra-Signature header. data keys: none.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"proposal.sent":{"post":{"summary":"A proposal is sent","description":"Signed with the Clerra-Signature header. data keys: none.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"proposal.accepted":{"post":{"summary":"A proposal is accepted","description":"Signed with the Clerra-Signature header. data keys: none.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"proposal.declined":{"post":{"summary":"A proposal is declined","description":"Signed with the Clerra-Signature header. data keys: none.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"signature.viewed":{"post":{"summary":"A client opens a document to sign","description":"Signed with the Clerra-Signature header. data keys: kind.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"signature.completed":{"post":{"summary":"A document is fully signed","description":"Signed with the Clerra-Signature header. data keys: kind.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"job.created":{"post":{"summary":"A job is created","description":"Signed with the Clerra-Signature header. data keys: source, template_id, obligation_id.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"job.status_changed":{"post":{"summary":"A job's status changes","description":"Signed with the Clerra-Signature header. data keys: from, to.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"job.step_completed":{"post":{"summary":"A job step is completed","description":"Signed with the Clerra-Signature header. data keys: job_id, auto.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"job.assigned":{"post":{"summary":"A job is assigned to someone","description":"Signed with the Clerra-Signature header. data keys: to, from, source.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"lead.created":{"post":{"summary":"A lead is added","description":"Signed with the Clerra-Signature header. data keys: source, stage.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"lead.stage_changed":{"post":{"summary":"A lead moves stage","description":"Signed with the Clerra-Signature header. data keys: from, to.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}},"intake.received":{"post":{"summary":"A client email arrives in the inbox","description":"Signed with the Clerra-Signature header. data keys: none.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges it; anything else is retried."}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key from Settings → API: Authorization: Bearer clerra_…"},"oauth2":{"type":"oauth2","description":"For apps many firms connect. Authorization code with PKCE (S256); refresh tokens rotate. Apps are registered by Clerra.","flows":{"authorizationCode":{"authorizationUrl":"https://app.clerra.ca/oauth/authorize","tokenUrl":"https://app.clerra.ca/oauth/token","refreshUrl":"https://app.clerra.ca/oauth/token","scopes":{"clients:read":"Client names, contact details, entity type, province and status.","clients:write":"Add new clients. Their filing deadlines are built the same way as when you add one in Clerra.","notes:write":"Log a note on a client's Communications.","filings:read":"Every client's filing deadlines and their status.","invoices:read":"Invoices, totals and what's still owing (no payment links).","jobs:read":"Jobs, their status, due dates and who's assigned, and the firm's job templates.","jobs:write":"Start a job for a client, from one of your job templates or blank.","todos:write":"Put a to-do on a team member's list.","team:read":"Team members' names and email addresses — to choose who work goes to.","leads:read":"The sales pipeline.","leads:write":"Create new leads in the sales pipeline.","documents:read":"When a document is uploaded: its name, size, folder and who uploaded it. Never the file itself or a link to it.","requests:read":"Document requests sent to clients, and when a client has uploaded everything asked for.","proposals:read":"Proposals sent, accepted or declined, with their fees.","signatures:read":"When an engagement letter or document is opened or fully signed.","inbox:read":"When a client email arrives at your firm's intake address: who sent it and the subject line — never the message itself.","events:read":"What happened, as it happens — limited to the kinds of record the key can read.","webhooks:manage":"Subscribe a URL (like a Zapier trigger) to activity as it happens — only kinds of record it can read."}}}}},"schemas":{"Client":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"name":{"type":"string","description":"Display name."},"legal_name":{"type":["string","null"],"description":"Legal name, when it differs."},"entity_type":{"type":"string","enum":["individual","corporation","cooperative","partnership","limited_partnership","trust","non_profit","charity","custom"],"description":"What kind of taxpayer — it decides which CRA deadlines apply. “custom” is a firm-defined type that generates no deadlines."},"status":{"type":"string","description":"Where the client stands with the firm."},"province":{"type":["string","null"],"description":"Two-letter province or territory code."},"email":{"type":["string","null"],"format":"email","description":"Main email."},"phone":{"type":["string","null"],"description":"Main phone."},"client_code":{"type":["string","null"],"description":"The firm's own reference."},"fiscal_year_end":{"type":["object","null"],"description":"{ month, day } — for businesses and trusts."},"office_id":{"type":["string","null"],"format":"uuid","description":"The office the client belongs to."},"account_manager_id":{"type":["string","null"],"format":"uuid","description":"The staff member who owns the relationship."},"needs_details":{"type":"boolean","description":"True when Clerra can't yet work out the client's deadlines (a detail is missing) — it never guesses."},"missing_details":{"type":"array","items":{"type":"string"},"description":"Which details are missing: entity_type, fiscal_year_end, province. Empty when none are. The client has no filing deadlines until the firm confirms them."},"created_at":{"type":"string","format":"date-time","description":"When the client was added."},"updated_at":{"type":"string","format":"date-time","description":"Last change."}},"description":"A person or business the firm works for."},"Filing":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"client_id":{"type":"string","format":"uuid","description":"The client it's for."},"name":{"type":"string","description":"What's due, e.g. “T1 return”."},"rule_code":{"type":["string","null"],"description":"The rule that produced it."},"category":{"type":["string","null"],"enum":["income_tax","gst_hst","payroll","payroll_run","information_returns","provincial","registry",null],"description":"Family of deadline."},"period_start":{"type":["string","null"],"format":"date","description":"Start of the period it covers."},"period_end":{"type":["string","null"],"format":"date","description":"End of the period it covers."},"due_date":{"type":"string","format":"date","description":"When it's due."},"status":{"type":"string","enum":["upcoming","in_progress","waiting_on_client","filed","skipped"],"description":"Progress."},"filed_at":{"type":["string","null"],"format":"date-time","description":"When it was marked filed."},"created_at":{"type":"string","format":"date-time","description":"When it was created."},"updated_at":{"type":"string","format":"date-time","description":"Last change."}},"description":"One deadline for one client — a return, remittance or slip — computed from CRA and provincial rules."},"Invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"client_id":{"type":"string","format":"uuid","description":"The client billed."},"number":{"type":"string","description":"Invoice number."},"status":{"type":"string","description":"draft, sent, paid, void and so on."},"issue_date":{"type":["string","null"],"format":"date","description":"Issue date."},"due_date":{"type":["string","null"],"format":"date","description":"Due date."},"currency":{"type":"string","description":"ISO currency code."},"subtotal_cents":{"type":"integer","description":"Before tax, in cents."},"tax_cents":{"type":"integer","description":"All sales tax (GST/HST/PST/QST), in cents."},"total_cents":{"type":"integer","description":"Total, in cents."},"credited_cents":{"type":"integer","description":"Credit notes applied, in cents."},"paid_cents":{"type":"integer","description":"Paid so far, in cents."},"balance_cents":{"type":"integer","description":"Still owing (0 for a void invoice), in cents."},"paid_on":{"type":["string","null"],"format":"date","description":"When it was paid in full."},"created_at":{"type":"string","format":"date-time","description":"When it was created."},"updated_at":{"type":"string","format":"date-time","description":"Last change."}},"description":"A bill to a client. Amounts are integers in cents; no payment links are exposed."},"Job":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"client_id":{"type":"string","format":"uuid","description":"The client it's for."},"name":{"type":"string","description":"Job name."},"period":{"type":["string","null"],"description":"Period label, e.g. “2025”."},"status":{"type":"string","description":"Progress."},"due_date":{"type":["string","null"],"format":"date","description":"Due date."},"assigned_to":{"type":["string","null"],"format":"uuid","description":"Staff member doing it."},"reviewer_id":{"type":["string","null"],"format":"uuid","description":"Staff member reviewing it."},"template_id":{"type":["string","null"],"format":"uuid","description":"Template it came from."},"completed_at":{"type":["string","null"],"format":"date-time","description":"When it was finished."},"created_at":{"type":"string","format":"date-time","description":"When it was created."},"updated_at":{"type":"string","format":"date-time","description":"Last change."}},"description":"A piece of work for a client — a T1, a year-end, a bookkeeping month."},"Lead":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"name":{"type":"string","description":"Business or person."},"contact_name":{"type":["string","null"],"description":"Who to talk to."},"email":{"type":["string","null"],"format":"email","description":"Email."},"phone":{"type":["string","null"],"description":"Phone."},"entity_type":{"type":["string","null"],"description":"Kind of taxpayer, if known."},"stage":{"type":"string","enum":["new","contacted","meeting","proposal","won","lost"],"description":"Pipeline stage."},"source":{"type":["string","null"],"description":"Where it came from (“API” when created through it)."},"estimated_value":{"type":["number","null"],"description":"Expected yearly fees, in dollars."},"expected_close":{"type":["string","null"],"format":"date","description":"When the firm expects to win it."},"owner_id":{"type":["string","null"],"format":"uuid","description":"Staff member who owns it."},"website":{"type":["string","null"],"description":"Website."},"converted_client_id":{"type":["string","null"],"format":"uuid","description":"The client it became, once won."},"created_at":{"type":"string","format":"date-time","description":"When it was added."},"updated_at":{"type":"string","format":"date-time","description":"Last change."}},"description":"A prospect in the firm's sales pipeline."},"JobTemplate":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"name":{"type":"string","description":"Template name."},"description":{"type":["string","null"],"description":"What it's for."},"category":{"type":["string","null"],"description":"The firm's grouping."},"steps_in_order":{"type":"boolean","description":"True when each step waits for the one before it."},"created_at":{"type":"string","format":"date-time","description":"When it was made."},"updated_at":{"type":"string","format":"date-time","description":"Last change."}},"description":"One of the firm's job templates — a job started from it gets its steps."},"TeamMember":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"name":{"type":"string","description":"Their name."},"email":{"type":["string","null"],"format":"email","description":"Their sign-in email."}},"description":"An active member of the firm — someone work can go to."},"Note":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"client_id":{"type":"string","format":"uuid","description":"The client."},"title":{"type":["string","null"],"description":"The note's heading."},"body":{"type":"string","description":"The note."},"logged_by":{"type":["string","null"],"format":"uuid","description":"The person it's attributed to (who connected the key or app)."},"source":{"type":"string","description":"“zapier” through the Zapier app, “api” otherwise."},"occurred_at":{"type":"string","format":"date-time","description":"When it happened."},"created_at":{"type":"string","format":"date-time","description":"When it was added."}},"description":"A note on a client's Communications."},"Todo":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"assigned_to":{"type":"string","format":"uuid","description":"Whose list it's on."},"title":{"type":"string","description":"What needs doing."},"due_date":{"type":["string","null"],"format":"date","description":"When it's due."},"client_id":{"type":["string","null"],"format":"uuid","description":"The client it's about."},"done":{"type":"boolean","description":"Ticked off."},"created_at":{"type":"string","format":"date-time","description":"When it was added."}},"description":"An item on a team member's to-do list."},"Document":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"client_id":{"type":"string","format":"uuid","description":"The client."},"file_name":{"type":"string","description":"File name."},"file_type":{"type":["string","null"],"description":"MIME type, e.g. application/pdf."},"size_bytes":{"type":"integer","description":"Size in bytes."},"folder":{"type":["string","null"],"description":"The folder it's in."},"uploaded_by":{"type":"string","enum":["client","firm"],"description":"Who uploaded it."},"uploaded_by_name":{"type":["string","null"],"description":"Their name."},"request_id":{"type":["string","null"],"format":"uuid","description":"The document request it answered."},"request_item":{"type":["string","null"],"description":"The requested item it answered."},"shared_with_client":{"type":"boolean","description":"Visible to the client in their portal."},"scan_status":{"type":"string","description":"Malware scan: clean once scanned; pending just after upload."},"uploaded_at":{"type":"string","format":"date-time","description":"When it was uploaded."}},"description":"A file on a client's Documents tab — its details only. The file itself, and any link to it, never leave Clerra. The record of document.* events."},"DocumentRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"client_id":{"type":"string","format":"uuid","description":"The client."},"job_id":{"type":["string","null"],"format":"uuid","description":"The job it's for."},"title":{"type":"string","description":"Request title."},"status":{"type":"string","description":"open or complete."},"due_date":{"type":["string","null"],"format":"date","description":"When it's needed by."},"items_total":{"type":"integer","description":"Items asked for."},"items_received":{"type":"integer","description":"Items the client has sent."},"created_at":{"type":"string","format":"date-time","description":"When it was sent."},"updated_at":{"type":"string","format":"date-time","description":"Last change."}},"description":"A list of documents asked of a client. The record of request.* events."},"Proposal":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"client_id":{"type":"string","format":"uuid","description":"The client."},"title":{"type":"string","description":"Proposal title."},"status":{"type":"string","description":"draft, sent, accepted or declined."},"one_time_total_cents":{"type":"integer","description":"One-time fees before tax, in cents."},"items":{"type":"array","items":{"type":"object"},"description":"Each service: { name, billing (one_time | recurring), frequency, amount_cents }."},"accepted_by_name":{"type":["string","null"],"description":"The name the client signed with."},"sent_at":{"type":["string","null"],"format":"date-time","description":"When it was sent."},"accepted_at":{"type":["string","null"],"format":"date-time","description":"When it was accepted."},"declined_at":{"type":["string","null"],"format":"date-time","description":"When it was declined."},"starts_on":{"type":["string","null"],"format":"date","description":"When the engagement starts."},"term_months":{"type":["integer","null"],"description":"Length of the engagement."},"engagement_letter_id":{"type":["string","null"],"format":"uuid","description":"Its engagement letter."},"created_at":{"type":"string","format":"date-time","description":"When it was made."},"updated_at":{"type":"string","format":"date-time","description":"Last change."}},"description":"A proposal of services and fees sent to a client. The record of proposal.* events."},"Signature":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"kind":{"type":"string","enum":["document","engagement_letter"],"description":"What was signed."},"client_id":{"type":"string","format":"uuid","description":"The client."},"title":{"type":"string","description":"Its title."},"status":{"type":"string","description":"draft, sent or signed."},"signer_name":{"type":["string","null"],"description":"Who it was sent to."},"signed_by_name":{"type":["string","null"],"description":"The name it was signed with."},"signed_at":{"type":["string","null"],"format":"date-time","description":"When it was signed."},"created_at":{"type":"string","format":"date-time","description":"When it was made."},"updated_at":{"type":"string","format":"date-time","description":"Last change."}},"description":"A document or engagement letter sent for signing. Never a signing link. The record of signature.* events."},"IntakeEmail":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"client_id":{"type":["string","null"],"format":"uuid","description":"The client it came from, when Clerra could tell."},"from_name":{"type":["string","null"],"description":"Sender's name."},"from_email":{"type":["string","null"],"format":"email","description":"Sender's address."},"subject":{"type":["string","null"],"description":"Subject line."},"status":{"type":"string","description":"new, handled or dismissed."},"attachments_filed":{"type":"integer","description":"Attachments saved to the client's documents."},"received_at":{"type":"string","format":"date-time","description":"When it arrived."}},"description":"An email that arrived at the firm's intake address — who sent it and the subject line, never the message. The record of intake.received."},"Event":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"object":{"type":"string","description":"Always “event”."},"api_version":{"type":"string","description":"The envelope version (a date)."},"type":{"type":"string","description":"What happened, e.g. filing.filed."},"occurred_at":{"type":"string","format":"date-time","description":"When."},"firm_id":{"type":"string","format":"uuid","description":"The firm."},"client_id":{"type":["string","null"],"format":"uuid","description":"The client it's about, if any."},"subject_type":{"type":["string","null"],"description":"Kind of record: client, filing, invoice, job, step, lead, document, request, proposal, signature, intake."},"subject_id":{"type":["string","null"],"format":"uuid","description":"That record's id."},"data":{"type":"object","description":"Ids, statuses, amounts and dates about the change — never names or messages."},"record":{"type":["object","null"],"description":"The record as it is now (as the API returns it). In webhooks always; in GET /events with ?include=record. Null if it's gone."}},"description":"Something that happened — the same shape in GET /events and in every webhook."},"Hook":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique, never reused."},"url":{"type":"string","format":"uri","description":"Where Clerra POSTs."},"description":{"type":["string","null"],"description":"Note."},"events":{"type":"array","items":{"type":"string"},"description":"Event types it receives."},"enabled":{"type":"boolean","description":"False once switched off (by the firm, a 410 from the receiver, or 20 failures in a row)."},"disabled_reason":{"type":["string","null"],"description":"Why it was switched off."},"created_at":{"type":"string","format":"date-time","description":"When it was made."}},"description":"A URL subscribed (through the API) to kinds of event."},"Me":{"type":"object","properties":{"firm":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]}}},"key":{"type":"object","properties":{"name":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"expires_at":{"type":["string","null"],"format":"date-time"}}}}},"CreateMeta":{"type":"object","description":"What a create did. A retried or repeated request returns the record already there instead of making a second.","properties":{"created":{"type":"boolean","description":"True when a new record was made."},"duplicate":{"type":"boolean","description":"True when an existing record was returned instead (status 200)."},"matched_on":{"type":"string","description":"Why it counted as the same: email, business_number or recent_identical."},"message":{"type":"string","description":"What happened, in a sentence you can show a person."}},"required":["created","duplicate","message"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}