Hoppa till innehållet

API reference

Transactional email delivery. Every request carries an API key as a bearer token: a server key (sk_) for everything inside one server, an account key (ak_) for what belongs to the account; a key of the wrong kind answers 403 wrong_token_kind. Every error answers a JSON body with an error code and a message.

Base URL https://api.sendora.se. Every request carries Authorization: Bearer and an API key: a server key (sk_) for everything inside one server, an account key (ak_) for what belongs to the account. Every error answers JSON with an error code and a message; the codes are listed under each route. Timestamps are ISO 8601 in UTC. Each route has a page of its own; the same document is served asOpenAPI 3.1.

Sending

Hand messages over for delivery.

  • Send one messagePOST /v1/email

    TypeScript sendora.email.send(message)

    Python sendora.email.send(**message)

  • Send up to 100 messagesPOST /v1/email/batch

    TypeScript sendora.email.sendBatch(messages)

    Python sendora.email.send_batch(messages)

Messages

The message log and each message’s timeline.

  • Read a messageGET /v1/messages/{id}

    TypeScript sendora.messages.get(messageId)

    Python sendora.messages.get(message_id)

  • Search the message logPOST /v1/messages/search

    TypeScript sendora.messages.search(filters)

    Python sendora.messages.search(**filters)

Streams

The streams of the server: transactional, broadcast, and at most one inbound.

  • List the streamsGET /v1/streams

    TypeScript sendora.streams.list()

    Python sendora.streams.list()

  • Create a streamPOST /v1/streams

    TypeScript sendora.streams.create({ kind, name })

    Python sendora.streams.create(kind=..., name=...)

  • Read a streamGET /v1/streams/{id}

    TypeScript sendora.streams.get(streamId)

    Python sendora.streams.get(stream_id)

  • Update a streamPATCH /v1/streams/{id}

    TypeScript sendora.streams.update(streamId, { name, contentRetentionDays })

    Python sendora.streams.update(stream_id, name=..., content_retention_days=...)

  • Archive a streamPOST /v1/streams/{id}/archive

    TypeScript sendora.streams.archive(streamId)

    Python sendora.streams.archive(stream_id)

Broadcasts

One message to many, sent as a broadcast.

  • List the broadcastsGET /v1/broadcasts

    TypeScript sendora.broadcasts.list(query)

    Python sendora.broadcasts.list(limit=..., after=...)

  • Send a broadcastPOST /v1/broadcasts

    TypeScript sendora.broadcasts.send(broadcast)

    Python sendora.broadcasts.send(**broadcast)

  • Get a broadcastGET /v1/broadcasts/{id}

    TypeScript sendora.broadcasts.get(broadcastId)

    Python sendora.broadcasts.get(broadcast_id)

  • Cancel a broadcastPOST /v1/broadcasts/{id}/cancel

    TypeScript sendora.broadcasts.cancel(broadcastId)

    Python sendora.broadcasts.cancel(broadcast_id)

Suppressions

Addresses the server no longer sends to.

  • List the suppressed addressesGET /v1/suppressions

    TypeScript sendora.suppressions.list(query)

    Python sendora.suppressions.list(stream_id=..., limit=..., after=...)

  • Lift a suppressionPOST /v1/suppressions/delete

    TypeScript sendora.suppressions.delete({ address })

    Python sendora.suppressions.delete(address=...)

Webhooks

Where events are posted, signed with each of the webhook’s live secrets, and every delivery of them.

  • List the webhooksGET /v1/webhooks

    TypeScript sendora.webhooks.list()

    Python sendora.webhooks.list()

  • Create a webhookPOST /v1/webhooks

    TypeScript sendora.webhooks.create({ url, events })

    Python sendora.webhooks.create(url=..., events=...)

  • Read a webhookGET /v1/webhooks/{id}

    TypeScript sendora.webhooks.get(webhookId)

    Python sendora.webhooks.get(webhook_id)

  • Remove a webhookDELETE /v1/webhooks/{id}

    TypeScript sendora.webhooks.delete(webhookId)

    Python sendora.webhooks.delete(webhook_id)

  • List the deliveries of a webhookGET /v1/webhooks/{id}/deliveries

    TypeScript sendora.webhooks.deliveries(webhookId, query)

    Python sendora.webhooks.deliveries(webhook_id, status=..., limit=..., after=...)

  • Replay a deliveryPOST /v1/webhooks/{id}/deliveries/{deliveryId}/replay

    TypeScript sendora.webhooks.replay(webhookId, deliveryId)

    Python sendora.webhooks.replay(webhook_id, delivery_id)

  • Create a signing secretPOST /v1/webhooks/{id}/secrets

    TypeScript sendora.webhooks.createSecret(webhookId)

    Python sendora.webhooks.create_secret(webhook_id)

  • Delete a signing secretDELETE /v1/webhooks/{id}/secrets/{secretId}

    TypeScript sendora.webhooks.deleteSecret(webhookId, secretId)

    Python sendora.webhooks.delete_secret(webhook_id, secret_id)

Inbound

The mail the server has received: the messages, their raw form and their attachments.

  • Search received messagesPOST /v1/inbound/search

    TypeScript sendora.inbound.search(filters)

    Python sendora.inbound.search(**filters)

  • Read a received messageGET /v1/inbound/{id}

    TypeScript sendora.inbound.get(inboundMessageId)

    Python sendora.inbound.get(inbound_message_id)

  • Download the raw messageGET /v1/inbound/{id}/raw

    TypeScript sendora.inbound.raw(inboundMessageId)

    Python sendora.inbound.raw(inbound_message_id)

  • Download an attachmentGET /v1/inbound/{id}/attachments/{attachmentId}

    TypeScript sendora.inbound.attachment(inboundMessageId, attachmentId)

    Python sendora.inbound.attachment(inbound_message_id, attachment_id)

  • List the inbound domainsGET /v1/inbound/domains

    TypeScript sendora.inboundDomains.list()

    Python sendora.inbound_domains.list()

  • Claim a domain for an inbound streamPOST /v1/inbound/domains

    TypeScript sendora.inboundDomains.create({ streamId, domain })

    Python sendora.inbound_domains.create(stream_id=..., domain=...)

  • Read an inbound domainGET /v1/inbound/domains/{id}

    TypeScript sendora.inboundDomains.get(inboundDomainId)

    Python sendora.inbound_domains.get(inbound_domain_id)

  • Remove an inbound domainDELETE /v1/inbound/domains/{id}

    TypeScript sendora.inboundDomains.delete(inboundDomainId)

    Python sendora.inbound_domains.delete(inbound_domain_id)

  • Check the records nowPOST /v1/inbound/domains/{id}/verify

    TypeScript sendora.inboundDomains.verify(inboundDomainId)

    Python sendora.inbound_domains.verify(inbound_domain_id)

Keys

A server's own keys under one of them, up to two live at once; an account key manages them under /v1/servers/{id}/tokens, and the account's own keys are created in the dashboard.

  • List the keysGET /v1/tokens

    TypeScript sendora.tokens.list()

    Python sendora.tokens.list()

  • Create a keyPOST /v1/tokens

    TypeScript sendora.tokens.create({ name })

    Python sendora.tokens.create(name=...)

  • Read a keyGET /v1/tokens/{id}

    TypeScript sendora.tokens.get(tokenId)

    Python sendora.tokens.get(token_id)

  • Revoke a keyDELETE /v1/tokens/{id}

    TypeScript sendora.tokens.revoke(tokenId)

    Python sendora.tokens.revoke(token_id)

Servers

The account’s servers and each one’s keys, under an account key: a server is created with its first key and holds up to two. GET /v1/server takes a server key and reads that key’s own server.

  • TypeScript sendora.server.get()

    Python sendora.server.get()

  • List the serversGET /v1/servers

    TypeScript account.servers.list()

    Python account.servers.list()

  • Create a serverPOST /v1/servers

    TypeScript account.servers.create({ name })

    Python account.servers.create(name=...)

  • Read a serverGET /v1/servers/{id}

    TypeScript account.servers.get(serverId)

    Python account.servers.get(server_id)

  • Rename a serverPATCH /v1/servers/{id}

    TypeScript account.servers.update(serverId, { name })

    Python account.servers.update(server_id, name=...)

  • Delete a serverDELETE /v1/servers/{id}

    TypeScript account.servers.delete(serverId)

    Python account.servers.delete(server_id)

  • List the keys of a serverGET /v1/servers/{id}/tokens

    TypeScript account.servers.tokens.list(serverId)

    Python account.servers.tokens.list(server_id)

  • Create a key for a serverPOST /v1/servers/{id}/tokens

    TypeScript account.servers.tokens.create(serverId, { name })

    Python account.servers.tokens.create(server_id, name=...)

  • Read a key of a serverGET /v1/servers/{id}/tokens/{tokenId}

    TypeScript account.servers.tokens.get(serverId, tokenId)

    Python account.servers.tokens.get(server_id, token_id)

  • Revoke a key of a serverDELETE /v1/servers/{id}/tokens/{tokenId}

    TypeScript account.servers.tokens.revoke(serverId, tokenId)

    Python account.servers.tokens.revoke(server_id, token_id)

Domains

Sending domains and their two DNS records, under an account key.

  • TypeScript account.domains.list()

    Python account.domains.list()

  • Add a sending domainPOST /v1/domains

    TypeScript account.domains.create({ domain })

    Python account.domains.create(domain=...)

  • Read a sending domainGET /v1/domains/{id}

    TypeScript account.domains.get(domainId)

    Python account.domains.get(domain_id)

  • Remove a sending domainDELETE /v1/domains/{id}

    TypeScript account.domains.delete(domainId)

    Python account.domains.delete(domain_id)

  • Check the records nowPOST /v1/domains/{id}/verify

    TypeScript account.domains.verify(domainId)

    Python account.domains.verify(domain_id)

Erasures

A person's data erased from every server of the account, under an account key.

  • Erase a personPOST /v1/erasures

    TypeScript account.erasures.create({ address })

    Python account.erasures.create(address=...)

  • Read an erasureGET /v1/erasures/{id}

    TypeScript account.erasures.get(erasureId)

    Python account.erasures.get(erasure_id)

Webhook events

What a webhook receives for each event, with its fields and an example, is on Webhook events.