The Auth endpoints mint and exchange Harmont session tokens. They are
the only endpoints in this API where the request is unauthenticated
on purpose; everything else takes a Bearer header from one of these.
Claim a transferred session token (CLI loopback poll)
Request Body
application/json
Claim request
TypeScript Definitions
Use the request body type in TypeScript.
The nonce the CLI generated for this loopback handoff.
Response Body
application/json
application/json
curl -X POST "https://api.harmont.dev/api/v0/auth/cli/claim" \ -H "Content-Type: application/json" \ -d '{ "nonce": "a7Kp...random" }'{
"token": "string"
}{
"error": {
"code": "string",
"doc_url": "string",
"message": "string",
"request_id": "string",
"type": "string"
}
}Mint a human-typeable CLI paste code
Authorization
bearer A Harmont session bearer token.
In: header
Response Body
application/json
curl -X POST "https://api.harmont.dev/api/v0/auth/cli/code"{
"code": "K7P2QR9MX3WZ4NTV"
}Redeem a CLI paste code for a session token
Request Body
application/json
Redeem request
TypeScript Definitions
Use the request body type in TypeScript.
The paste code shown by the SPA.
Response Body
application/json
application/json
curl -X POST "https://api.harmont.dev/api/v0/auth/cli/redeem" \ -H "Content-Type: application/json" \ -d '{ "code": "K7P2QR9MX3WZ4NTV" }'{
"token": "string"
}{
"error": {
"code": "string",
"doc_url": "string",
"message": "string",
"request_id": "string",
"type": "string"
}
}Hand a session token to a locally-running CLI (loopback)
Authorization
bearer A Harmont session bearer token.
In: header
Request Body
application/json
Transfer request
TypeScript Definitions
Use the request body type in TypeScript.
The opaque nonce the CLI generated and is polling claim with.
Response Body
curl -X POST "https://api.harmont.dev/api/v0/auth/cli/transfer" \ -H "Content-Type: application/json" \ -d '{ "nonce": "a7Kp...random" }'Log out (revoke the current bearer token)
Authorization
bearer A Harmont session bearer token.
In: header
Response Body
curl -X POST "https://api.harmont.dev/api/v0/auth/logout"