Skip to content

Log in

POST
/v1/login
curl --request POST \
--url https://app.caprid.com/v1/login \
--header 'Content-Type: application/json' \
--data '{ "email": "hello@example.com", "password": "example" }'

Exchanges an email and password for a session cookie. Sessions last 14 days. Scripts should use an API key instead.

Failed logins are limited to 10 per 15 minutes, counted separately per email and per client address.

Media typeapplication/json
object
email
required
string format: email
password
required
string

Example generated

{
"email": "hello@example.com",
"password": "example"
}

Logged in.

Media typeapplication/json
object
account
required
object
email

The person signed in. Absent for an API key.

string format: email
created_at

When the person signed up. Absent for an API key.

integer
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
id
required

Identifies the key for revoking it. Not a secret.

string
label
required
string
preview
required

The first 6 characters of the secret after sb_, so you can tell keys apart.

string
created_at
required
integer
expires_at

Absent for a key that never expires.

integer
last_used_at

Absent for a key that has never been used.

integer
namespaces

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.

Array<string>
organizations
required
Array<object>

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
id
required

Identifies the Organization in routes. It never changes.

integer
name
required

For display. Any Member can change it.

string
role

Your role in it. Absent for an API key, which has none.

string
Allowed values: owner member
created_at
required
integer
trial_expires_at

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.

integer
namespace

The one Namespace you can reach, as this reported before Organizations. Absent unless you reach exactly one.

string
>= 3 characters <= 32 characters /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/
platform_peering

That Namespace’s platform_peering. Absent along with namespace.

boolean

Example

{
"account": {
"api_key": {
"id": "3f9a1c07be42",
"namespaces": [
"acme-staging"
]
},
"organizations": [
{
"id": 4,
"name": "Acme",
"role": "owner",
"trial_expires_at": 1760604800
}
],
"namespace": "acme"
}
}
Set-Cookie
string

__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.

Media typeapplication/json
object
error
required
string

Example

{
"error": "the requested grants exceed the key's scope"
}

The email and password don’t match an Account. The response is the same whether or not the email exists.

Media typeapplication/json
object
error
required
string

Example

{
"error": "the requested grants exceed the key's scope"
}

This server logs people in through WorkOS, and passwords no longer work.

Media typeapplication/json
object
error
required
string

Example

{
"error": "the requested grants exceed the key's scope"
}

Rate limited. Try again later.

Media typeapplication/json
object
error
required
string

Example

{
"error": "the requested grants exceed the key's scope"
}