Skip to content

The caller's own identity ​

Generated from core/api/router.go. Edit the router, not this file.

MethodPathWho can call it
POST/api/v1/auth/logoutAny authenticated user
POST/api/v1/auth/passwordAny authenticated user
GET/api/v1/meAny authenticated user

POST /api/v1/auth/logout ​

Who can call itAny authenticated user
HandlersessionHandler.Logout
Display tokenRefused — not a viewer-safe GET

Responses ​

StatusBody
200An object with message (string)
Example request
bash
curl -X POST 'https://certpilot.example.com/api/v1/auth/logout' \
  -H 'Authorization: Bearer <token>'

POST /api/v1/auth/password ​

Who can call itAny authenticated user
HandlersessionHandler.ChangePassword
Display tokenRefused — not a viewer-safe GET

Changing a password requires the current one even though the caller is already authenticated: a session left open on an unattended machine should not be enough to lock its owner out of their account.

Request body ​

ChangePasswordInput carries the current password as well as the new one.

FieldTypeDescription
current_passwordstringrequired
new_passwordstringrequired

Responses ​

StatusBody
200An object with message (string)
400{ "error": … }
· both the current password and a new one are required
· the new password is the same as the current one
403{ "error": … }
· only an account with a password can change one
· the current password is not correct
500{ "error": … }
· your account could not be read
· the password could not be changed
Example request
bash
curl -X POST 'https://certpilot.example.com/api/v1/auth/password' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "current_password": "<current_password>",
  "new_password": "<new_password>"
}'

GET /api/v1/me ​

Who can call itAny authenticated user
HandlersessionHandler.Me
Display tokenReadable by an unattended screen

The role reported here is the one from CertPilot's users table, not the one in the token. A frontend that decoded the JWT itself would keep showing controls for a role the API had stopped honouring.

Responses ​

StatusBody
200A MeResponse object
Example request
bash
curl -X GET 'https://certpilot.example.com/api/v1/me' \
  -H 'Authorization: Bearer <token>'