Linje

API docs

Transactional email and inbound email webhooks.

Linje handles product email in both directions. Your app can send transactional email with one API call, and inbound mail can come back as a signed JSON webhook.

Send mail POST /v1/messages
Create inbox POST /v1/inboxes
Portal setup Portal -> Settings

Auth

Portal access plus two scoped credentials.

Credential Use Scope
Portal session Claim sender domains, rotate tokens, configure webhooks, inspect traffic One account in the UI
Project token Send mail, inspect messages/events, manage project inboxes One project
Inbox manage token Inspect or manage one inbox One inbox

Send email

Use POST /v1/messages for transactional mail.

This is the core send endpoint. It is intended for receipts, magic links, password resets, invites, and other product mail.

curl -fsS \
  -H "Authorization: Bearer $LINJE_PROJECT_TOKEN" \
  -H "content-type: application/json" \
  -H "idempotency-key: magic-link:user-123" \
  -d '{
    "from":"auth@tx.example.com",
    "to":["you@example.com"],
    "subject":"Your sign-in link",
    "text":"Use the sign-in link in your app.",
    "html":"<p>Use the sign-in link in your app.</p>"
  }' \
  https://api.linje.systems/v1/messages
Auth

Use a project token for normal sending.

Idempotency

Set an `idempotency-key` for safe retries.

From domains

Project-token sends must use an allowed `from` domain.

Quickstarts

Start with the job your app needs.

Inbound email

Use POST /v1/inboxes to turn email into webhooks.

You can provision a Linje inbox, point mail directly at it, or forward mail into it. When Linje receives a message, it POSTs a structured JSON payload to your endpoint.

curl -fsS \
  -H "Authorization: Bearer $LINJE_PROJECT_TOKEN" \
  -H "content-type: application/json" \
  -d '{
    "id":"support",
    "webhook-url":"https://app.example.com/inbound"
  }' \
  https://api.linje.systems/v1/inboxes
POST https://app.example.com/inbound
x-linje-inbound-id: ...
x-linje-signature: sha256=...

{
  "event-id":"...",
  "from":"user@example.com",
  "to":"support@in.example.com",
  "subject":"Need help",
  "attachments":[...]
}

Signatures

Webhook signatures use HMAC-SHA256 over timestamp + body.

Verify against the raw request body bytes, not re-serialized JSON. Linje sends `x-linje-timestamp` and `x-linje-signature` on inbound and outbound webhooks.

expected = HMAC_SHA256(secret, timestamp + "." + raw_body)
x-linje-signature = "sha256=<hex>"
Inbound headers

`x-linje-inbound-id`, `x-linje-delivery-id`, `x-linje-timestamp`, `x-linje-signature`

Delivery model

Webhook delivery is at least once, so your endpoint should be idempotent.

Projects and domains

Projects give you scoped tokens and sender-domain rules.

Project owners do setup in the portal. Claim sender domains there, publish the DNS records Linje gives you, then attach verified domains and copy the project token for runtime use in your application.

Portal -> Settings

1. Create your first project
2. Claim a sender domain
3. Publish the DNS records
4. Wait for verification, then attach the domain
5. Copy the project token and webhook secret
Project token

Use it for `POST /v1/messages`, `GET /v1/messages`, `GET /v1/events`, and `POST /v1/inboxes`.

Inspection

Use the portal for day-to-day timelines and replay, or call the message/event endpoints directly.

Domains

DNS instructions live in the portal so the exact records stay attached to the claim state.

Outbound event webhooks

Projects can receive delivery lifecycle events too.

If a project has an outbound webhook configured, Linje can emit `message.accepted`, `message.delivered`, `message.bounced`, and `message.dead` events.

Event Meaning
message.accepted Linje handed the message off successfully.
message.delivered Remote MX accepted the message.
message.bounced A DSN bounce was ingested and correlated.
message.dead Linje stopped retrying delivery.

Boundary

Linje is deliberately not a marketing email platform.

Linje does transactional outbound email and inbound email-to-webhook delivery. It does not do campaigns, audiences, lists, open tracking, click tracking, journeys, visual template building, or business-specific routing rules.

Linje owns

Email delivery, webhook delivery, attempts, bounces, signatures, and replay.

Your app owns

Business logic, customer workflows, extraction, triage, and follow-up actions.

The contract

Stable events and artifacts in, explicit API calls and webhooks out.

Reference

Key endpoints.

Method Path Purpose
POST /v1/messages Send transactional email
GET /v1/messages List outbound messages for one project
GET /v1/messages/:id Inspect one message
POST /v1/inboxes Create or update an inbound inbox
GET /v1/inboxes List inboxes
GET /v1/events List delivery events for one project
POST /v1/events/:id/replay Replay one outbound webhook event
GET /v1/inbound/messages/:id Inspect one inbound message
POST /v1/inbound/messages/:id/replay Replay one inbound webhook delivery