Authentication

Manage user accounts and JWT tokens. Registration creates a new organization with the registering user as org_owner.

Register

POST
/v1/auth/register
Create a new organization and user account.

Request Body

FieldTypeRequiredDescription
emailstringYesUser email address
passwordstringYesPassword (min 8 characters)
orgNamestringYesOrganization display name

Example Request

bash
curl -X POST https://api.elydora.com/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "s3cureP@ssw0rd",
    "orgName": "Acme Corp"
  }'

Response

json
{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "user": {
    "id": "usr_abc123",
    "email": "[email protected]",
    "orgId": "org_acme",
    "role": "org_owner"
  }
}

Login

POST
/v1/auth/login
Authenticate with email and password to receive a JWT.

Request Body

FieldTypeRequiredDescription
emailstringYesUser email address
passwordstringYesUser password

Example Request

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

Response

json
{
  "token": "eyJhbGciOiJIUzI1NiIs..."
}

Get Current User

GET
/v1/auth/me
Returns the authenticated user's profile.
Auth: Any authenticated user

Example Request

bash
curl https://api.elydora.com/v1/auth/me \
  -H "Authorization: Bearer <token>"

Response

json
{
  "id": "usr_abc123",
  "email": "[email protected]",
  "orgId": "org_acme",
  "role": "org_owner",
  "createdAt": "2026-01-15T10:30:00Z"
}

Refresh Token

POST
/v1/auth/refresh
Exchange a valid JWT for a new token with extended expiry.
Auth: Any authenticated user

Example Request

bash
curl -X POST https://api.elydora.com/v1/auth/refresh \
  -H "Authorization: Bearer <token>"

Response

json
{
  "token": "eyJhbGciOiJIUzI1NiIs..."
}