Account
The calling user's own account and second factors.
7 endpoints · Plakar Control Plane v0.18 · Base URL, authentication and errors
List the second factors of the calling user
GET
Badge
/api/v1/account/2fa
Response 200 OK application/json
-
methodsarray[object]-
confirmed_atstring<date-time> -
idstring<uuid> -
labelstring -
last_used_atstring<date-time> nullable -
required_at_enrollmentboolean -
typestring
-
-
mfa_requiredboolean
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 'https://pcp.example.com/api/v1/account/2fa' \
-H 'Authorization: Bearer <badge>'Response 200
{
"methods": [
{
"confirmed_at": "2026-01-01T00:00:00Z",
"id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"label": "string",
"last_used_at": "2026-01-01T00:00:00Z",
"required_at_enrollment": true,
"type": "string"
}
],
"mfa_required": true
}Start a TOTP enrollment
POST
Badge
/api/v1/account/2fa/totp
Request body application/json required
-
codestring nullable
Response 200 OK application/json
-
otpauth_uristring -
secretstring
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/account/2fa/totp' \
-H 'Authorization: Bearer <badge>' \
-H 'Content-Type: application/json' \
-d '{
"code": "string"
}'Response 200
{
"otpauth_uri": "string",
"secret": "string"
}Disable TOTP
DELETE
Badge
/api/v1/account/2fa/totp
Request body application/json required
-
codestring required
Response 204 No Content
No response body.
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 DELETE 'https://pcp.example.com/api/v1/account/2fa/totp' \
-H 'Authorization: Bearer <badge>' \
-H 'Content-Type: application/json' \
-d '{
"code": "string"
}'Confirm a TOTP enrollment
POST
Badge
/api/v1/account/2fa/totp/confirm
Request body application/json required
-
codestring required
Response 200 OK application/json
-
recovery_codesarray[string]
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/account/2fa/totp/confirm' \
-H 'Authorization: Bearer <badge>' \
-H 'Content-Type: application/json' \
-d '{
"code": "string"
}'Response 200
{
"recovery_codes": [
"string"
]
}Rotate the calling API key
POST
Badge
/api/v1/account/api-keys/rotate
Request body application/json required
-
descriptionstring nullable -
revoke_immediatelyboolean nullable
Response 200 OK application/json
-
api_keystring -
expires_atstring<date-time> -
idstring<uuid> -
predecessor_expires_atstring<date-time> nullable
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/account/api-keys/rotate' \
-H 'Authorization: Bearer <badge>' \
-H 'Content-Type: application/json' \
-d '{
"description": "string",
"revoke_immediately": true
}'Response 200
{
"api_key": "string",
"expires_at": "2026-01-01T00:00:00Z",
"id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"predecessor_expires_at": "2026-01-01T00:00:00Z"
}Get the calling user
GET
Badge
/api/v1/account/me
Response 200 OK application/json
-
accountstring -
auth_providerstring -
avatar_urlstring -
emailstring -
must_reset_passwordboolean nullable -
namestring -
organization_idstring<uuid> -
user_idstring<uuid>
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 'https://pcp.example.com/api/v1/account/me' \
-H 'Authorization: Bearer <badge>'Response 200
{
"account": "string",
"auth_provider": "string",
"avatar_url": "string",
"email": "string",
"must_reset_password": true,
"name": "string",
"organization_id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"user_id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90"
}List the groups of the calling user
GET
Badge
/api/v1/account/me/groups
Response 200 OK application/json
-
groupsarray[string]
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 'https://pcp.example.com/api/v1/account/me/groups' \
-H 'Authorization: Bearer <badge>'Response 200
{
"groups": [
"string"
]
}