Hoppa till innehållet

Create a server

POST/v1/servers

TypeScript account.servers.create({ name })

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

Key ak_… an account key

Adds a server to the account with its default transactional stream and its first key, whose value is answered this once. A server holds up to two live keys, so a second can be created before the first is revoked. Names are unique within the account, and the account holds up to its cap of servers.

Request body

  • namestring (at least 1, at most 100 characters)required

    1 to 100 characters.

  • mode"live" | "test"default "live"

    live unless told otherwise. A test server’s keys start sk_test_, and addresses at simulator.sendora.se act out a delivery, a bounce, a deferral or a complaint on it.

{
  "name": "Invoicing"
}

Responses

201The new server with its first key, its value shown this once.

  • serverIdstring (uuid)required

    The id every server key, stream and message of the server refers to.

  • namestring (at least 1, at most 100 characters)required

    The name given at creation, unique within the account.

  • mode"live" | "test"required

    live delivers; test goes through everything but delivery, so nothing reaches a recipient. Fixed when the server is created.

  • createdAtstring (date-time)required
  • tokenobjectrequired

    The server’s first key, named default; its value is never shown again.

    • tokenIdstring (uuid)required
    • namestringrequired

      The name given at creation, for people to tell keys apart.

    • prefixstringrequired

      The first characters of the key, to match it with a value in hand.

    • createdAtstring (date-time)required
    • revokedAtstring (date-time) or nullrequired
    • tokenstringrequired

      The key itself, shown this once.

Example

{
  "serverId": "7c1e4d2a-0b9f-4a3e-8d6c-5e2f1a9b8c70",
  "name": "Invoicing",
  "mode": "live",
  "createdAt": "2026-09-20T12:00:00.000Z",
  "token": {
    "tokenId": "3b0c9e2f-6d4a-4e8b-8a1c-9f2d7e6c5b40",
    "name": "default",
    "prefix": "sk_a1b2c3d4e5",
    "createdAt": "2026-09-20T12:00:00.000Z",
    "revokedAt": null,
    "token": "sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v"
  }
}

Errors

Every error answers error, the code, and message, a sentence for a person. A code that adds fields is shown in full below the table.

CodeStatusMeaning
invalid_request400The body, the query or a header does not match what the route takes.
unauthorized401The key is missing, malformed or revoked.
wrong_token_kind403The key is of the other kind: a server key (sk_) where an account key (ak_) is needed, or the reverse. The message names the kind the operation takes.
server_exists409The account already has a server with that name.
server_limit409The account has as many servers as it may; Sendora raises the cap on request.

invalid_request

  • issuesarray of object

    One entry per invalid field; absent when a header is wrong.

    • pathstringrequired

      The field, dotted, such as to.0.email; empty when the whole body is wrong.

    • messagestringrequired

Example

{
  "error": "invalid_request",
  "message": "The request is invalid: to.0: Invalid email address",
  "issues": [
    {
      "path": "to.0",
      "message": "Invalid email address"
    }
  ]
}

server_limit

  • maxServersintegerrequired

    Servers the account may have at once.

Example

{
  "error": "server_limit",
  "message": "The account may have at most 10 servers.",
  "maxServers": 10
}