Skip to main content

Authentication

Register users, log in, and retrieve the current session. All protected endpoints require a Bearer token in the Authorization header.

POST/auth/register

Create a new user account and receive an access token.

Request Body

FieldTypeRequiredNote
emailstringYesValid email address
passwordstringYesMin 8 characters
namestringYesDisplay name

Response

{
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "user": {
    "id": "usr_a1b2c3",
    "email": "you@company.com",
    "name": "Your Name"
  }
}
POST/auth/login

Authenticate with email and password. Returns an access token.

Request Body

FieldTypeRequiredNote
emailstringYes
passwordstringYes

Response

{
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "user": {
    "id": "usr_a1b2c3",
    "email": "you@company.com",
    "name": "Your Name"
  }
}
GET/auth/meAuth required

Get the currently authenticated user's profile.

Response

{
  "id": "usr_a1b2c3",
  "email": "you@company.com",
  "name": "Your Name"
}

Using tokens

Include the token in every authenticated request:

curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://api.hivemeld.com/auth/me

Tokens do not expire by default. If a request returns 401, log in again to get a fresh token.