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 /api/v1/account/2fa
Badge

Response 200 OK application/json

  • methods array[object]
    • confirmed_at string<date-time>
    • id string<uuid>
    • label string
    • last_used_at string<date-time> nullable
    • required_at_enrollment boolean
    • type string
  • mfa_required boolean

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 /api/v1/account/2fa/totp
Badge

Request body application/json required

  • code string nullable

Response 200 OK application/json

  • otpauth_uri string
  • secret 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' \
  -H 'Authorization: Bearer <badge>' \
  -H 'Content-Type: application/json' \
  -d '{
  "code": "string"
}'

Response 200

{
  "otpauth_uri": "string",
  "secret": "string"
}

Disable TOTP

DELETE /api/v1/account/2fa/totp
Badge

Request body application/json required

  • code string 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 /api/v1/account/2fa/totp/confirm
Badge

Request body application/json required

  • code string required

Response 200 OK application/json

  • recovery_codes array[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 /api/v1/account/api-keys/rotate
Badge

Request body application/json required

  • description string nullable
  • revoke_immediately boolean nullable

Response 200 OK application/json

  • api_key string
  • expires_at string<date-time>
  • id string<uuid>
  • predecessor_expires_at string<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 /api/v1/account/me
Badge

Response 200 OK application/json

  • account string
  • auth_provider string
  • avatar_url string
  • email string
  • must_reset_password boolean nullable
  • name string
  • organization_id string<uuid>
  • user_id string<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 /api/v1/account/me/groups
Badge

Response 200 OK application/json

  • groups array[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"
  ]
}