Authentication

Authenticate with the Orbitr API using JWT tokens.

Login

Obtain an access token by authenticating with your email and password.

POST /api/v1/auth/login

Request Body

FieldTypeRequiredDescription
emailstringYesYour account email
passwordstringYesYour account password

Example Request

curl -X POST https://api.getorbitr.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]", "password": "your-password"}'

Example Response

{
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "token_type": "bearer"
}

Using the Token

Include the token in the Authorization header for all subsequent requests:

curl https://api.getorbitr.com/api/v1/sites \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

Current User

Verify your token and get user details:

GET /api/v1/auth/me

Example Response

{
  "id": "user-uuid",
  "email": "[email protected]",
  "name": "Your Name",
  "role": "user"
}

Token Expiration

Access tokens expire after a set period. When a token expires, you'll receive a 401 Unauthorized response. Re-authenticate by calling the login endpoint again.

Google OAuth

Users who signed up via Google OAuth can also authenticate via the Google OAuth flow. The standard login endpoint works for email/password accounts.