---
title: "Create a server"
method: POST
path: "/v1/servers"
tags: ["Servers"]
---

# Create a server

`POST /v1/servers`

## Request

- Base URL: `https://api.sendora.se`
- URL: `https://api.sendora.se/v1/servers`
- Auth: HTTP bearer

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

- object
  - `name` string, required: 1 to 100 characters.
  - `mode` 'live' | 'test': 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.

## Response `201`

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

- object: The new server with its first key, its value shown this once.
  - `serverId` string, uuid, required: The id every server key, stream and message of the server refers to.
  - `name` string, 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.
  - `createdAt` string, date-time, required
  - `token` object, required: The server’s first key, named default; its value is never shown again.
    - `tokenId` string, uuid, required
    - `name` string, required: The name given at creation, for people to tell keys apart.
    - `prefix` string, required: The first characters of the key, to match it with a value in hand.
    - `createdAt` string, date-time, required
    - `revokedAt` string, date-time, nullable, required
    - `token` string, required: The key itself, shown this once.

## Other responses

- `400`: The body, the query or a header does not match what the route takes.
- `401`: The key is missing, malformed or revoked.
- `403`: The key is of the other kind, or a connected app may not do this here: it is not for connections, the connection may only read here, or it is for test servers only.
- `409`: The account already has a server with that name, or as many servers as it may.

---

[API](https://skmtc.dev/sendora/apis/sendora-api.md) · [All operations](https://skmtc.dev/sendora/apis/sendora-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sendora/apis/sendora-api/revisions/72efbbb34b64?raw)
