Skip to content
Developer guide

Quickstart: your first integration with the EVORIV API

From an API key to a lead created safely from your own code, in five steps. Every example runs against the published OpenAPI document.

In short

Create an API key in EVORIV under Settings, Developers, call GET /record-types to see what you may read, describe a record type for its fields, and create records with POST /record-types/{recordType}/records and an Idempotency-Key header. Errors are JSON with a code and a message; a 429 tells you how long to wait in Retry-After.

1. Create an API key

In EVORIV, open Settings, Developers and create an API key. Choose read and write for this guide. The key is shown once, is valid for up to 90 days and can be revoked at any time. Every request runs as the person who created the key, with that person's permissions.

No workspace to try it in? Start a free development environment to build and test in, with demo data of a fictional installation company.

  • Keep the key on your server, for example in EVORIV_API_KEY. Requests from a browser (with an Origin header) are refused.

2. List what you can read

Every record type has an apiName such as foundation.company, foundation.contact, sales.lead or sales.opportunity. Ask which ones the key's person may read.

curl
curl https://api.evoriv.com/api/dev/v1/record-types \
  -H "Authorization: Bearer $EVORIV_API_KEY"

3. Describe a record type

The description lists the fields the person may read and set, whether they may create records of this type, the options of each choice field and the relationships you can follow. Field names are apiNames too, such as sales.lead_email.

curl
curl https://api.evoriv.com/api/dev/v1/record-types/sales.lead \
  -H "Authorization: Bearer $EVORIV_API_KEY"

4. Create a lead, once

Send the fields by apiName. Add an Idempotency-Key header with your own id for this submission (8 to 80 letters, digits or _ . : -). If the network drops and you send the same request again, EVORIV answers with the first result (status 200 and replayed: true) instead of creating a second lead.

Creating goes through EVORIV's own rules: validation, unique values, the audit trail and the workspace's automations, exactly as when someone adds the lead in EVORIV.

curl
curl -X POST https://api.evoriv.com/api/dev/v1/record-types/sales.lead/records \
  -H "Authorization: Bearer $EVORIV_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: website-form-000183" \
  -d '{
    "fields": {
      "sales.lead_first_name": "Anouk",
      "sales.lead_last_name": "de Vries",
      "sales.lead_company_name": "Bakkerij De Vries",
      "sales.lead_email": "anouk@bakkerij.example",
      "sales.lead_source": "website",
      "sales.lead_status": "new"
    }
  }'
Response
HTTP/1.1 201 Created
EVORIV-API-Version: 1

{
  "data": {
    "created": true,
    "recordId": "6f1c2b9e-4a6d-4b8e-9a51-0c3d2e7f1a24",
    "recordType": "sales.lead",
    "version": 1,
    "title": "Anouk de Vries",
    "url": "https://app.evoriv.com/...",
    "fields": { "sales.lead_company_name": "Bakkerij De Vries", "...": "..." }
  }
}

# The same request with the same Idempotency-Key again:
HTTP/1.1 200 OK
{ "data": { "replayed": true, "recordId": "6f1c2b9e-...", "...": "..." } }
Node.js
// Node.js 18 or later (fetch is built in). Run it on your server:
// EVORIV refuses requests that carry a browser Origin header.
const BASE = "https://api.evoriv.com/api/dev/v1";
const KEY = process.env.EVORIV_API_KEY; // evapi_...

async function evoriv(method, path, { body, idempotencyKey } = {}) {
  for (let attempt = 1; ; attempt++) {
    const res = await fetch(BASE + path, {
      method,
      headers: {
        Authorization: `Bearer ${KEY}`,
        ...(body ? { "Content-Type": "application/json" } : {}),
        ...(idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {}),
      },
      body: body ? JSON.stringify(body) : undefined,
    });
    const json = await res.json();
    if (res.ok) return json.data;
    // 429: wait as long as Retry-After says, then send the SAME request again.
    if (res.status === 429 && attempt < 3) {
      const seconds = Number(res.headers.get("Retry-After") ?? "1");
      await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
      continue;
    }
    const { code, message, reason } = json.error ?? {};
    throw Object.assign(new Error(message ?? `HTTP ${res.status}`), { status: res.status, code, reason });
  }
}

const { recordTypes } = await evoriv("GET", "/record-types");
console.log(recordTypes.map((type) => type.apiName));

const lead = await evoriv("POST", "/record-types/sales.lead/records", {
  idempotencyKey: "website-form-000183", // your own id for this submission
  body: {
    fields: {
      "sales.lead_last_name": "de Vries",
      "sales.lead_company_name": "Bakkerij De Vries",
      "sales.lead_email": "anouk@bakkerij.example",
      "sales.lead_source": "website",
      "sales.lead_status": "new",
    },
  },
});
console.log(lead.recordId, lead.replayed ? "existed already" : "created");

5. Errors and limits

A failed request answers with error.code, a message written for people and sometimes a reason. Every response carries EVORIV-API-Version: 1 and Cache-Control: no-store.

  • 400 INVALID_REQUEST: a value or an unknown parameter or property was refused; the message says which.
  • 401 UNAUTHENTICATED: no valid, unexpired key.
  • 403 FORBIDDEN: the person may not do this, the request came from a browser, or a read key tried to write (reason read_only_token).
  • 404 NOT_FOUND: no such record, or one this person may not read. Both answer the same.
  • 409 INVALID_REQUEST with reason conflict: the record changed since you read it, a unique value is taken, or a lifecycle rule refuses it.
  • 429 RATE_LIMITED: wait for Retry-After seconds. 120 requests a minute per key and 600 per workspace; per key 120 records written a minute and 10,000 created a day.
Error
HTTP/1.1 403 Forbidden

{
  "error": {
    "code": "FORBIDDEN",
    "message": "This token is read-only. A workspace admin can create a token with write access in EVORIV Settings.",
    "reason": "read_only_token"
  }
}

Lists return at most 50 records per page. Pass nextCursor as cursor for the next page; it is null on the last one.

Next steps

  • Hear about changes instead of polling: receive and verify webhooks.
  • Let every user of your app work with their own account: Sign in with EVORIV.
  • Up to 100 records in one request: POST /record-types/{recordType}/records:batch, with one Idempotency-Key per batch.

Questions about the quickstart

Do I send EVORIV-API-Version with every request?
You may; it is not required. The version is in the address (/api/dev/v1) and every response carries EVORIV-API-Version: 1.
What happens without an Idempotency-Key?
Each request creates a new record. With a key, a retry returns the first result instead of creating twice, so send one for every create you might retry.
Can I create work orders with the generic records endpoint?
No. Work orders and service requests have their own endpoints (POST /work-orders and POST /service-requests), which follow the Operations flow.

Build it in a workspace of your own.

A development environment to build and test in, with demo data and every API endpoint.

Want to run your company on EVORIV? Start free