The caller's own identity
Generated from core/api/router.go. Edit the router, not this file.
| Method | Path | Who can call it |
|---|---|---|
POST | /api/v1/auth/logout | Any authenticated user |
POST | /api/v1/auth/password | Any authenticated user |
GET | /api/v1/me | Any authenticated user |
POST /api/v1/auth/logout
| Who can call it | Any authenticated user |
| Handler | sessionHandler.Logout |
| Display token | Refused — not a viewer-safe GET |
Responses
| Status | Body |
|---|---|
200 | An 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 it | Any authenticated user |
| Handler | sessionHandler.ChangePassword |
| Display token | Refused — 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.
| Field | Type | Description | |
|---|---|---|---|
current_password | string | required | |
new_password | string | required |
Responses
| Status | Body |
|---|---|
200 | An 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 it | Any authenticated user |
| Handler | sessionHandler.Me |
| Display token | Readable 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
| Status | Body |
|---|---|
200 | A MeResponse object |
Example request
bash
curl -X GET 'https://certpilot.example.com/api/v1/me' \
-H 'Authorization: Bearer <token>'