Skip to content

Make somebody staff

POST
/staff/people
curl --request POST \
--url https://api.sloose.com/staff/people \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "email": "hello@example.com", "name": "example" }'

Backoffice route: a staff session, or ADMIN_TOKEN. Gives the staff role to an email address. Somebody who has never signed in gets an account, unverified until their first magic link. They are told by email where to sign in. The first staff member of a deployment is made this way with the admin token.

Media typeapplication/json
object
email
required

The address that will be staff.

string format: email
name

For somebody who has never signed in; ignored otherwise.

string
>= 1 characters <= 120 characters
Examplegenerated
{
"email": "hello@example.com",
"name": "example"
}

Now staff.

Media typeapplication/json
object
person
required
object
id
required
string
email
required
string
name
required
string
createdAt
required
string
Examplegenerated
{
"person": {
"id": "example",
"email": "example",
"name": "example",
"createdAt": "example"
}
}

The request body did not match the schema. issues carries the Zod issue list.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

A bearer that is neither the token nor a live session (code: AUTH_REQUIRED).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

A customer’s session, an API token, or no bearer at all — not staff, and not the ADMIN_TOKEN (code: ADMIN_REQUIRED).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

Already staff (code: ALREADY_STAFF).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}