Create an Account
const url = 'https://app.caprid.com/v1/signup';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"email":"dev@acme.example","password":"correct horse battery staple","namespace":"acme"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.caprid.com/v1/signup \ --header 'Content-Type: application/json' \ --data '{ "email": "dev@acme.example", "password": "correct horse battery staple", "namespace": "acme" }'Creates an Account. Every Account starts by doing one of two things:
- Creating an Organization. Send
namespace. The Organization is named after the Namespace (you can rename it later), you are its Owner, and the response carries its first API key. This is the only time that key’s secret is shown, so store it now. - Joining one. Send
invitationinstead, and you become a Member of the Organization that invited you, with the role it invited you as. You get no API key, because the Organization already has its own. Without WorkOS login, send the secret from the Invitation’s link, because nothing has verified your email. With WorkOS login, send the Invitation’sidfromGET /v1/signup.
The response also sets a session cookie, for a signup that came from the dashboard.
Password signups are limited to 20 an hour from each client address.
With WorkOS login, the body needs only namespace or invitation.
The email is the one WorkOS verified, there is no password, and the
request has to carry the cookie the login callback set.
Request Bodyrequired
Section titled “Request Bodyrequired”Send namespace or invitation. email and password are
required too, unless the server uses WorkOS login.
object
Stored lowercased. Alice@example.com and alice@example.com are the same Account.
Length is the only rule. Counted in characters, not bytes.
A Namespace’s name, which is the root of every path signed for it.
It never changes. Use lowercase letters, digits and hyphens, and start
and end with a letter or digit. Some names, like admin and
default, are reserved, and so is every name that starts with
trial-, which only Trial Organizations get.
Join the Organization this Invitation is for, instead of
creating one. Send the secret from its link, or with
WorkOS login, its id. Your email has to be the one
invited.
Examples
Create an Organization
{ "email": "dev@acme.example", "password": "correct horse battery staple", "namespace": "acme"}Join with an Invitation's link
{ "email": "alice@acme.example", "password": "correct horse battery staple", "invitation": "sbi_mR3x9Qe2vT8wY1zA4bC7dF0gH5jK6lN2pS8uV3xZ1qW"}Responses
Section titled “Responses”The Account, and when it created an Organization, that Organization’s first API key with its secret.
object
object
The person signed in. Absent for an API key.
When the person signed up. Absent for an API key.
The API key making the call, with its namespaces limit if it
has one. A limited key can’t list its Organization’s Namespaces,
so this is how it finds the ones it can reach. Absent for a
session.
object
Identifies the key for revoking it. Not a secret.
The first 6 characters of the secret after sb_, so you can tell keys apart.
Absent for a key that never expires.
Absent for a key that has never been used.
The Namespaces the key is limited to, by name. Absent for a key
with no limit. A deleted Namespace drops out, so a key whose
Namespaces have all been deleted has [] here and can do nothing.
A customer of Switchboard. It owns its Namespaces, and the API keys, Nodes and enrollments that serve them. Its Members manage all of it.
object
Identifies the Organization in routes. It never changes.
For display. Any Member can change it.
Your role in it. Absent for an API key, which has none.
When a Trial Organization lapses, so its Agent knows how long it has to get a person to claim it. Absent for every other Organization.
The one Namespace you can reach, as this reported before Organizations. Absent unless you reach exactly one.
That Namespace’s platform_peering. Absent along with namespace.
object
Identifies the key for revoking it. Not a secret.
The first 6 characters of the secret after sb_, so you can tell keys apart.
Absent for a key that never expires.
Absent for a key that has never been used.
The Namespaces the key is limited to, by name. Absent for a key
with no limit. A deleted Namespace drops out, so a key whose
Namespaces have all been deleted has [] here and can do nothing.
The API key itself. Shown only in this response.
Example
{ "account": { "api_key": { "id": "3f9a1c07be42", "namespaces": [ "acme-staging" ] }, "organizations": [ { "id": 4, "name": "Acme", "role": "owner", "trial_expires_at": 1760604800 } ], "namespace": "acme" }, "api_key": { "id": "3f9a1c07be42", "namespaces": [ "acme-staging" ], "secret": "sb_R2x0Z9kQ7mVt3xLp8wNc1bYh5sDf2gJr6uEa0zWiTq4" }}Headers
Section titled “Headers”__Host-switchboard_session over HTTPS, switchboard_session over plain HTTP: HttpOnly, SameSite=Lax, Path=/, valid for 14 days.
The request is malformed or a field is invalid. The message says which.
object
Example
{ "error": "the requested grants exceed the key's scope"}With WorkOS login, there is no signup in progress. Sign in at /app/ first.
object
Example
{ "error": "the requested grants exceed the key's scope"}The Invitation is for another email address.
object
Example
{ "error": "the requested grants exceed the key's scope"}No such Invitation.
object
Example
{ "error": "the requested grants exceed the key's scope"}The email or the Namespace is already taken.
object
Example
{ "error": "the requested grants exceed the key's scope"}The Invitation has already been used, was revoked, or has expired. Ask for a new one.
object
Example
{ "error": "this invitation has expired"}Rate limited. Try again later.
object
Example
{ "error": "the requested grants exceed the key's scope"}