Developers

A small API, documented honestly.

Opsylo's public API covers four resources today. This page lists what it actually serves — not a roadmap written in the present tense.

Read this before you plan an integration

The public API is four resources: leads, contacts, invoices (read-only) and stock items. There is no public endpoint for jobs, accounting, payroll or webhooks subscription management — those are reachable only from inside the application. Outbound webhooks with signed delivery do exist and are configured in your workspace settings, not over the API. The typed TypeScript client is in the repository and is not published to npm. If your integration needs something in this paragraph, write to dev@opsylo.com — the surface grows in the direction people ask for.

Authentication

A bearer API key, created in your workspace and shown once. Keys are stored hashed, carry explicit scopes, and are rate limited per plan. A request also needs the module its resource belongs to be active on the workspace.

Create a leadcURL
# An API key is created in your workspace: Settings → API keys.
# The secret is shown once, is stored hashed, and starts with "opk_".

curl -X POST "$OPSYLO_BASE_URL/v1/leads" \
  -H "Authorization: Bearer $OPSYLO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Knest Builders", "phone": "9876543210", "source": "manual" }'

# Two things are checked before the handler runs:
#   1. the key carries the scope for the route  → 403 otherwise
#   2. the workspace has the module activated   → 403 MODULE_NOT_ENTITLED otherwise

Every endpoint

GET/v1/leadsleads:readcrm_pipeline

List leads, paginated.

POST/v1/leadsleads:writecrm_pipeline

Create a lead.

GET/v1/contactscontacts:readcrm_contacts

List contacts, paginated.

POST/v1/contactscontacts:writecrm_contacts

Create a contact.

GET/v1/invoicesinvoices:readfin_invoicing

List invoices, paginated. Read-only — invoices are raised in the app.

GET/v1/itemsitems:readerp_inventory

List stock items, paginated.

POST/v1/itemsitems:writeerp_inventory

Create a stock item.

Responses are paginated with page and pageSize. Errors carry a machine-readable code. Requests and responses are validated against the same Zod contracts the web app uses, so a field cannot mean two different things.