API and webhooks

Read your CRM and tracking data, create tasks and notes, and get notified the moment an email is opened, a link is clicked or nobody replies.

The API works with data stored in Strezia storage. Emails are never sent through the API, so nothing leaves your outbox without you pressing Send.

Base URL

https://strezia.com/portaler/api/v1

All responses are JSON. Lists are paginated and sorted with the most recently changed records first.

Authentication

Create an API key in Strezia Mail under Settings › API and webhooks. The key starts with szk_ and is shown once. Send it in the Authorization header:

curl https://strezia.com/portaler/api/v1/me \
  -H "Authorization: Bearer szk_your_key"

You can also use the header X-API-Key: szk_your_key. Revoke a key at any time on the same page. A revoked or wrong key returns 401.

Errors

Errors use normal HTTP status codes and a JSON body:

{
  "error": {
    "code": "not_found",
    "message": "Not found."
  }
}
StatusCodeMeaning
400validation_errorSomething is missing or wrong in the request.
401unauthorizedThe key is missing, wrong or revoked.
403planThe API is not included in your plan.
404not_foundUnknown resource or record.
405method_not_allowedThat method is not available on this path.

Account

GET/me

Returns your account, plan, the resources you can read and the webhook events you can subscribe to.

{
  "company": "you@company.com",
  "plan": "Strezia Mail Pro",
  "status": "Aktiv",
  "resources": ["contacts", "companies", "deals", "tasks", "notes", "tracked-emails"],
  "events": ["email.opened", "link.clicked", "reminder.no_reply"]
}

List records

GET/{resource}

ResourceContains
contactsPeople in your CRM
companiesCompanies
dealsDeals with stage, value and next step
tasksTasks
notesNotes
tracked-emailsSent emails with opens, clicks, device and rough location
ParameterDescription
limit1 to 100, default 50.
cursorValue from next_cursor to get the next page.
updated_sinceOnly records changed after this time, ISO 8601. Good for syncing.
curl "https://strezia.com/portaler/api/v1/deals?limit=20&updated_since=2026-11-01T00:00:00Z" \
  -H "Authorization: Bearer szk_your_key"

{
  "data": [
    { "id": "1f2e...", "properties": { "Name": "Spring campaign", "Stage": "Proposal", "Value": 12000 }, ... }
  ],
  "has_more": true,
  "next_cursor": "20"
}

Get a record

GET/{resource}/{id}

curl https://strezia.com/portaler/api/v1/contacts/1f2e3d4c-... \
  -H "Authorization: Bearer szk_your_key"

Create a task

POST/tasks

Send the task's properties by name, the same names you see in Strezia Mail.

curl -X POST https://strezia.com/portaler/api/v1/tasks \
  -H "Authorization: Bearer szk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"properties": {"Task name": "Call Anna about the proposal", "Due date": "2026-11-25"}}'

Returns 201 with the new task.

Create a note

POST/notes

FieldDescription
textThe note, up to 10 000 characters. Required.
page_idId of a contact, company or deal to attach the note to.
curl -X POST https://strezia.com/portaler/api/v1/notes \
  -H "Authorization: Bearer szk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"page_id": "1f2e3d4c-...", "text": "Prefers a call before 10."}'

Webhooks

Add a webhook in Strezia Mail under Settings › API and webhooks: an HTTPS address and the events you want. You get a signing secret once. Use Test to send a test event right away.

Each event is a POST with a JSON body and these headers:

HeaderValue
Strezia-EventThe event type, for example email.opened
Strezia-Signaturet=<unix time>,v1=<hex HMAC>
User-AgentStrezia-Webhooks/1

Answer with any 2xx status within 5 seconds. Redirects are not followed.

Events

email.opened

{
  "id": "evt_2da0cf801a2a2cb5d959",
  "type": "email.opened",
  "created": "2026-11-19T10:53:36+00:00",
  "data": {
    "email_id": "Kq3Vx...",
    "subject": "Proposal for spring",
    "recipient": "anna@nordvik.se",
    "opens": 3,
    "device": "Apple Mail · iOS",
    "location": "Malmö, SE",
    "occurred_at": "2026-11-19T10:53:36+00:00"
  }
}

link.clicked

Same as above, with url (the link that was clicked) instead of opens.

reminder.no_reply

Sent once when an email you asked to be reminded about has had no reply by the chosen date. Contains email_id, message_id, subject and recipient.

test

Sent when you press Test. data.message says it is a test.

Verifying signatures

Compute an HMAC SHA-256 of <t>.<raw body> with your signing secret and compare it with v1. Reject events where t is more than five minutes old.

Node.js

const crypto = require('crypto');

function verify(rawBody, header, secret) {
  const [, t, v1] = /t=(\d+),v1=([0-9a-f]+)/.exec(header) || [];
  if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false;
  const sig = crypto.createHmac('sha256', secret).update(t + '.' + rawBody).digest('hex');
  return crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(v1));
}

PHP

$raw = file_get_contents('php://input');
preg_match('/t=(\d+),v1=([0-9a-f]+)/', $_SERVER['HTTP_STREZIA_SIGNATURE'] ?? '', $m);
$ok = $m && abs(time() - (int)$m[1]) <= 300
   && hash_equals(hash_hmac('sha256', $m[1] . '.' . $raw, $secret), $m[2]);

Need help?

Email sync@strezia.com. We read everything.