Servers

Servers are the top-level organizational unit in Postject. Each server has its own API token, message streams, and templates.


Plan Limits

The number of servers you can create depends on your plan:

PlanServer Limit
Free1 server
Starter3 servers
Growth10 servers
ProfessionalUnlimited
ScaleCustom

Create a Server

Creates a new server under your account. The server is automatically provisioned with three default message streams (Transactional, Broadcast, and Inbound) and a unique API token. This endpoint requires JWT Bearer authentication.

POSThttps://api.postject.com/v1/servers

Request Body

namestring (required)

A human-readable name for the server.

json
{
  "name": "Production App"
}

Response

json
{
  "id": "clx8f2k9a0001uy7z3g4h5j6k",
  "name": "Production App",
  "token": "pt_live_sk7f2a9b3c4d5e6f7a8b9c0d1e2f3a4b",
  "createdAt": "2025-07-15T10:30:00.000Z",
  "streams": [
    {
      "id": "clx8f2k9a0002uy7z1a2b3c4d",
      "name": "Transactional",
      "type": "transactional"
    },
    {
      "id": "clx8f2k9a0003uy7z5e6f7g8h",
      "name": "Broadcast",
      "type": "broadcast"
    },
    {
      "id": "clx8f2k9a0004uy7z9i0j1k2l",
      "name": "Inbound",
      "type": "inbound"
    }
  ]
}

List All Servers

Returns all servers associated with your account, including a count of streams in each server. Requires JWT Bearer authentication.

GEThttps://api.postject.com/v1/servers
json
[
  {
    "id": "clx8f2k9a0001uy7z3g4h5j6k",
    "name": "Production App",
    "token": "pt_live_sk7f2a9b3c4d5e6f7a8b9c0d1e2f3a4b",
    "createdAt": "2025-07-15T10:30:00.000Z",
    "_count": {
      "streams": 3
    }
  },
  {
    "id": "clx9a3m1b0005vy8z4h5i6j7k",
    "name": "Staging Environment",
    "token": "pt_live_tk8g3b0c4d6e7f8a9b0c1d2e3f4a5b6c",
    "createdAt": "2025-07-16T14:22:00.000Z",
    "_count": {
      "streams": 4
    }
  }
]

Get a Server

Retrieves a single server by its ID, including the full list of streams attached to it. Requires JWT Bearer authentication.

GEThttps://api.postject.com/v1/servers/:id
json
{
  "id": "clx8f2k9a0001uy7z3g4h5j6k",
  "name": "Production App",
  "token": "pt_live_sk7f2a9b3c4d5e6f7a8b9c0d1e2f3a4b",
  "createdAt": "2025-07-15T10:30:00.000Z",
  "streams": [
    {
      "id": "clx8f2k9a0002uy7z1a2b3c4d",
      "name": "Transactional",
      "slug": "transactional",
      "type": "transactional",
      "description": "Password resets, receipts, and account notifications",
      "createdAt": "2025-07-15T10:30:00.000Z"
    },
    {
      "id": "clx8f2k9a0003uy7z5e6f7g8h",
      "name": "Broadcast",
      "slug": "broadcast",
      "type": "broadcast",
      "description": "Marketing campaigns and newsletters",
      "createdAt": "2025-07-15T10:30:00.000Z"
    },
    {
      "id": "clx8f2k9a0004uy7z9i0j1k2l",
      "name": "Inbound",
      "slug": "inbound",
      "type": "inbound",
      "description": "Incoming email processing",
      "createdAt": "2025-07-15T10:30:00.000Z"
    }
  ]
}

Delete a Server

Permanently deletes a server and all of its associated data. Requires JWT Bearer authentication.

DELETEhttps://api.postject.com/v1/servers/:id

Cascade Warning

Deleting a server is irreversible and cascades to all associated resources. This includes all message streams, sent messages, message events, templates, and the server API token. Make sure you have exported any data you need before proceeding.

json
{
  "message": "Server deleted successfully",
  "id": "clx8f2k9a0001uy7z3g4h5j6k"
}