Authentication

RubyLab's API uses JWT (JSON Web Tokens) for authentication.

Obtaining Tokens

curl -X POST https://api.rubylab.app/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "your-password"}'

Response:

{
  "data": {
    "access_token": "eyJhbG...",
    "refresh_token": "eyJhbG...",
    "expires_in": 900
  }
}

Access tokens expire after 15 minutes. Use the refresh token to obtain a new access token.