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.
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."
}
}
| Status | Code | Meaning |
|---|---|---|
| 400 | validation_error | Something is missing or wrong in the request. |
| 401 | unauthorized | The key is missing, wrong or revoked. |
| 403 | plan | The API is not included in your plan. |
| 404 | not_found | Unknown resource or record. |
| 405 | method_not_allowed | That 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}
| Resource | Contains |
|---|---|
contacts | People in your CRM |
companies | Companies |
deals | Deals with stage, value and next step |
tasks | Tasks |
notes | Notes |
tracked-emails | Sent emails with opens, clicks, device and rough location |
| Parameter | Description |
|---|---|
limit | 1 to 100, default 50. |
cursor | Value from next_cursor to get the next page. |
updated_since | Only 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
| Field | Description |
|---|---|
text | The note, up to 10 000 characters. Required. |
page_id | Id 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:
| Header | Value |
|---|---|
Strezia-Event | The event type, for example email.opened |
Strezia-Signature | t=<unix time>,v1=<hex HMAC> |
User-Agent | Strezia-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.