Authentication

How to authenticate with the Kyper API using Bearer tokens.

Bearer token

All authenticated API requests require a Bearer token in the Authorization header.

text
Authorization: Bearer kpr_a1b2c3d4e5f6...

There are two ways to obtain a token:

  1. 1
    Profile page — log into kyper.shop, go to your profile, and copy your API token.
  2. 2
    Device authorization flow — the CLI uses this to authenticate programmatically via browser confirmation. See the Device Authorization page for the full walkthrough.

Error responses

Status Meaning Response
401 Missing or invalid token {"error": "Unauthorized"}
403 Email not verified {"error": "Email not verified. Please verify your email before using the API."}

GET /api/v1/me

Returns the authenticated user's ID, email, and role. Useful for verifying that a token is valid and confirming which account is active.

Parameter Value
Auth required Yes
Request body None

Request

bash
curl -H "Authorization: Bearer kpr_a1b2c3d4e5f6..." \
  https://kyper.shop/api/v1/me

Response 200 OK

json
{
  "id": 42,
  "email": "[email protected]",
  "role": "developer"
}

Response fields

Field Type Description
id integer User ID
email string Account email address
role string One of consumer, developer, or admin