Colony API for developers
Read and write your own Colony data from your own software. It is a plain REST API over HTTPS that speaks JSON. This is version 1.
Get started in three steps
- Sign in to Colony. You need a Colony account; the API only ever gives you access to your own company's data.
- Create a token. Open Settings, API Tokens (/ApiTokens). A personal token sees exactly what you see in the app and can be made read-only. A company key sees the whole company and is meant for system-to-system integrations; only an owner or admin can make one. The token is shown once. A token expires after 90 days unless you choose another date, and you can revoke any token on that page.
- Call the API with the token as a bearer token:
curl "https://colonys.io/api/v1/customers?per_page=5" \
-H "Authorization: Bearer YOUR_TOKEN"
A read-only token can only use GET. Use a read-only personal token while you are trying things out.
What you get back
A single record or an action comes back as { "data": ... }. A list comes back as { "data": [ ... ], "meta": { "page": 1, "per_page": 5, "total": 42 } }. An error comes back as { "error": { "code": "...", "message": "..." } } with the matching HTTP status. A record you are not allowed to see answers 404, the same as one that does not exist.
Who sees what
A personal token sees what its person sees in Colony: an owner or admin sees the whole company, a manager sees themselves and their team, and a rep sees their own records. Visibility is checked on every request, so a role change takes effect at once. Every record belongs to one company, taken from the token; you never send a company id.
Limits and good manners
- Rate limit: about 120 requests a minute per token. Over that you get
429withRetry-After: 60. - Pages:
pageandper_page(up to 100), newest first, with a total. - Keeping a copy in sync: add
limit(1 to 200),updated_since(an ISO 8601 time) orcursor(themeta.nextof the previous page) to get changes oldest first with no total;meta.nextisnullon the last page. - Smaller answers:
fields=id,namekeeps only those fields (idalways stays). - Safe retries: send an
Idempotency-Keyheader (1 to 255 visible characters) on aPOSTthat creates something. The same key from the same token within 24 hours returns the first answer instead of creating a second record.
What is in the API
| Area | What you can do |
|---|---|
| Customers and leads | List, read, create, update, soft delete; move a lead to a stage; upsert by your own system's id (PUT /customers/by-external/{source}/{id}) and in batches of up to 100 |
| Sales | Quotes and invoices, issue, convert a quote to an invoice, void, credit notes, payments, products and prices; recurring invoices |
| Work | Tasks and boards, tickets, jobs, bookings |
| Documents | Document and form templates, shares and their status, e-signature envelopes, the signed PDF |
| Loyalty | Cards, points and vouchers, stamp and redeem |
| Inbox | Read threads and messages |
| Team | Users (company-wide tokens only) |
| Events | Webhook subscriptions and an event feed (below) |
What can be created, changed or deleted depends on the resource; the reference below lists every call. There is no endpoint for sending SMS or WhatsApp messages yet, and email can only be sent as a ticket reply (POST /tickets/{id}/replies). Some things are also deliberately left out of the API (for example deleting data in bulk, exports and administration). Some areas are only present when that product is switched on for your company.
Webhooks
Subscribe with POST /api/v1/webhooks/subscribe to be told when something happens (for example lead.created or invoice.paid), or read the feed with GET /api/v1/events. Every delivery carries an X-Colony-Signature header: the hex HMAC-SHA256 of the raw request body using your subscription's secret. Check it before you trust a delivery. A Zapier or Make webhook can be pointed at the same subscription.
Reference
- Interactive API reference (every call, with its fields and answers).
- OpenAPI file for generating a client or importing into your API tool.
Questions and changes
Write to support@colonys.io. Your use of the API is covered by the Terms of Service and the Privacy Policy.