Skip to main content

Authentication

The Galadriel API uses API tokens for authentication. Include your token in the Authorization header:
Authorization: Bearer YOUR_API_TOKEN

Getting an API Token

  1. Sign up at https://app.galadriel.com
  2. Navigate to Settings → API Tokens
  3. Click “Create Token”
  4. Copy and securely store your token
Keep your API token secure. Do not share it or commit it to version control.

Example Request

curl https://api.galadriel.com/v1/orders \
  -H "Authorization: Bearer gal_abc123..."

Token Permissions

Tokens can have different permission scopes:
ScopeDescription
orders:readView orders and orderbook
orders:writeCreate and cancel orders
leases:readView lease details
leases:writeManage leases (terminate, resell)
full_accessAll permissions (recommended for CLI)

Rotating Tokens

For security, rotate your tokens regularly:
  1. Create a new token
  2. Update your application to use the new token
  3. Delete the old token

API Token Format

Tokens are prefixed with gal_ followed by a random string:
gal_1234567890abcdefghijklmnop

Unauthorized Responses

If authentication fails, you’ll receive a 401 response:
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API token"
  }
}
Common causes:
  • Missing Authorization header
  • Invalid token format
  • Expired or revoked token
  • Insufficient permissions for the requested operation