Sign in with an e-mail address and password
const url = 'https://forge.example.com/api/auth/sign-in';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"email":"example","password":"example","sandboxCode":"example"}'};
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://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.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Example generated
{ "email": "example", "password": "example", "sandboxCode": "example"}Responses
Section titled “Responses”OK
object
object
Example
{ "user": { "secondStepNeeded": false }}default
Section titled “default”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.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}