Get the session
GET
/api/sessionSigned-in memberRead-only
1. GET /api/csrf and keep the session cookie it sets. It answers {"headerName": "X-CSRF-TOKEN", "parameterName": "_csrf", "token"}. 2. Send the token in that header with every POST, PUT, and DELETE, for example POST /api/registrations. 3. Sign in through POST /login with email and password form fields and the token. It answers with a redirect, never JSON: to / when it worked, and to /login?error when it did not. 4. Fetch a new token. Signing in replaces the session and its token, so the token from step 1 is now refused with 403 access_denied. 5. Read the signed-in identity from GET /api/session.
Response
Success: 200
| Field | Type | Required | Notes |
|---|---|---|---|
userId | string (uuid) | Optional | |
organizationId | string (uuid) | Optional | |
email | string | Optional | |
displayName | string | Optional | |
role | enum AppUserRole | Optional | ADMINMEMBER |
Errors
| Status | Code | Applies to |
|---|---|---|
400 | validation_faileda field is missing or out of range | Any endpoint |
400 | invalid_parametera path or query parameter is missing or does not convert, such as an ID that is not a UUID | Any endpoint |
401 | authentication_requiredno session | Any endpoint |
404 | not_foundno such address | Any endpoint |
405 | method_not_allowedthe address does not take that method | Any endpoint |
415 | unsupported_media_typethe address does not read a body of that type | Any endpoint |
500 | internal_errora fault ReleaseFlow did not foresee; the body never carries the exception behind it | Any endpoint |
400 | output_language_invalid | Account area |
400 | ui_locale_invalid | Account area |
400 | invitation_invalid | Account area |
400 | organization_slug_invalid | Account area |
404 | invitation_not_found | Account area |
404 | member_not_found | Account area |
409 | email_already_registered | Account area |
409 | invitation_already_pending | Account area |
409 | invitation_email_unavailable | Account area |
409 | organization_slug_taken | Account area |
409 | member_last_administrator | Account area |
Request
bash
# Sign in first and keep the session cookie in cookies.txt (see Sessions and CSRF).
curl "http://localhost:8080/api/session" \
-b cookies.txt -c cookies.txt
Response
200Example
{
"userId": "<uuid>",
"organizationId": "<uuid>",
"email": "<string>",
"displayName": "<string>",
"role": "ADMIN"
}