Skip to content

Sign in with an e-mail address and password

POST
/api/auth/sign-in
curl --request POST \
--url https://forge.example.com/api/auth/sign-in \
--header 'Content-Type: application/json' \
--data '{ "email": "example", "password": "example", "sandboxCode": "example" }'

On success, answers an access token that lasts a few minutes and sets the refresh token in an HttpOnly cookie limited to /api/auth. A person with a second step gets a challenge instead (secondFactor, challenge, expiresIn, and factors: totp, passkey or both); send it with a code to the second-factor route, or with a passkey to the passkey second-factor route. Repeated failures lock the account for a while. When the person’s organization has turned passwords off, a right password answers 409 with the reason. sandboxCode is for the public demo alone: sent with its published username and password, it opens the sandbox the code belongs to from this browser, and a code the demo does not know answers 400 naming sandboxCode; with any other account it is ignored.

Media typeapplication/json
object
email
required
string
password
required
string
sandboxCode
null | string

Example generated

{
"email": "example",
"password": "example",
"sandboxCode": "example"
}

OK

Media typeapplication/json
object
accessToken
required
string
expiresIn
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
user
required
object
id
required
string format: uuid
email
required
string
displayName
required
string
roles
required
Array<string>
organization
required
object
id
required
string format: uuid
name
required
string
slug
required
string
trial
One of:
null
secondStepNeeded
boolean
serviceAccount
boolean
demo
One of:
null

Example

{
"user": {
"secondStepNeeded": false
}
}

A refusal or an error, as a problem document. A model or draft you may not see answers 404, as one that does not exist.

Media typeapplication/problem+json
object
type
string
title
string
status
integer
detail
string
instance
string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}