Auth
Sign-in, badges and second-factor challenges.
7 endpoints · Plakar Control Plane v0.18 · Base URL, authentication and errors
Issue a new badge
POST
Badge
/api/v1/auth/badge
Re-issues the caller’s badge, for instance scoped to another organization.
Request body application/json required
-
organization_idstring<uuid> -
rolestring nullable
Response 200 OK application/json
-
tokenstring
Errors
- 400 Bad Request (validation or deserialization error)
- 401 Missing, invalid or expired credentials
- 403 The caller may not do this
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl -X POST 'https://pcp.example.com/api/v1/auth/badge' \
-H 'Authorization: Bearer <badge>' \
-H 'Content-Type: application/json' \
-d '{
"organization_id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"role": "string"
}'Response 200
{
"token": "string"
}Complete a login with a second factor
POST
No authentication
/api/v1/auth/login/2fa
Request body application/json required
-
challenge_idstring required -
codestring required
Response 200 OK application/json
-
tokenstring
Errors
- 400 Bad Request (validation or deserialization error)
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl -X POST 'https://pcp.example.com/api/v1/auth/login/2fa' \
-H 'Content-Type: application/json' \
-d '{
"challenge_id": "string",
"code": "string"
}'Response 200
{
"token": "string"
}Log in with an API key
POST
No authentication
/api/v1/auth/login/apikey
Request body application/json required
-
api_keystring required
Response 200 OK application/json
-
tokenstring
Errors
- 400 Bad Request (validation or deserialization error)
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl -X POST 'https://pcp.example.com/api/v1/auth/login/apikey' \
-H 'Content-Type: application/json' \
-d '{
"api_key": "string"
}'Response 200
{
"token": "string"
}Start the TOTP enrollment a login requires
POST
No authentication
/api/v1/auth/login/enroll/totp
Request body application/json required
-
enrollment_challenge_idstring required
Response 200 OK application/json
-
otpauth_uristring -
secretstring
Errors
- 400 Bad Request (validation or deserialization error)
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl -X POST 'https://pcp.example.com/api/v1/auth/login/enroll/totp' \
-H 'Content-Type: application/json' \
-d '{
"enrollment_challenge_id": "string"
}'Response 200
{
"otpauth_uri": "string",
"secret": "string"
}Confirm the TOTP enrollment a login requires
POST
No authentication
/api/v1/auth/login/enroll/totp/confirm
Request body application/json required
-
codestring required -
enrollment_challenge_idstring required
Response 200 OK application/json
-
recovery_codesarray[string] -
tokenstring
Errors
- 400 Bad Request (validation or deserialization error)
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl -X POST 'https://pcp.example.com/api/v1/auth/login/enroll/totp/confirm' \
-H 'Content-Type: application/json' \
-d '{
"code": "string",
"enrollment_challenge_id": "string"
}'Response 200
{
"recovery_codes": [
"string"
],
"token": "string"
}Log in with email and password
POST
No authentication
/api/v1/auth/login/password
Request body application/json required
-
accountstring required -
passwordstring required
Response 200 OK application/json
-
challenge_idstring nullable -
enrollment_challenge_idstring nullable -
tokenstring nullable
Errors
- 400 Bad Request (validation or deserialization error)
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl -X POST 'https://pcp.example.com/api/v1/auth/login/password' \
-H 'Content-Type: application/json' \
-d '{
"account": "string",
"password": "string"
}'Response 200
{
"challenge_id": "string",
"enrollment_challenge_id": "string",
"token": "string"
}Poll a pending login
POST
No authentication
/api/v1/auth/poll/{token}
Path parameters
-
tokenstring required
Response 200 OK application/json
-
tokenstring
Response 202 The login is still pending
No response body.
Errors
- 400 Bad Request (validation or deserialization error)
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl -X POST 'https://pcp.example.com/api/v1/auth/poll/{token}'Response 200
{
"token": "string"
}