Get a CSRF token
GET
/api/csrfPublicRead-only
The public endpoints need a CSRF token from GET /api/csrf. Every unusable token returns 400 invitation_invalid. Other errors are 409 invitation_already_pending, 409 invitation_email_unavailable (the email already belongs to a member who is not removed), 404 invitation_not_found, 404 member_not_found (an unknown, removed, or other Organization's member), 409 member_last_administrator, and 403 access_denied for members calling administrator endpoints. A session refused because its member changed answers 401 authentication_required, like any request without a session. See ADR-0043.
Response
Success: 200
| Field | Type | Required | Notes |
|---|---|---|---|
headerName | string | Optional | |
parameterName | string | Optional | |
token | string | Optional |
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 |
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
curl "http://localhost:8080/api/csrf" \
-b cookies.txt -c cookies.txt
Response
200Example
{
"headerName": "<string>",
"parameterName": "<string>",
"token": "<string>"
}