Approve a CLI login
POST
/auth/device/approve
const url = 'https://api.krakenkey.io/auth/device/approve';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"userCode":"BCDF-GHJK"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.krakenkey.io/auth/device/approve \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "userCode": "BCDF-GHJK" }'Creates an API key for the signed-in user and hands it to the waiting CLI. Requires a dashboard session; API keys cannot approve logins.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
userCode
required
User code shown by the CLI
string
Example
BCDF-GHJKResponses
Section titled “Responses”API key limit reached
Called with an API key
Not found or expired