Authentication
Register users, log in, and retrieve the current session. All protected endpoints require a Bearer token in the Authorization header.
POST
/auth/registerCreate a new user account and receive an access token.
Request Body
| Field | Type | Required | Note |
|---|---|---|---|
| string | Yes | Valid email address | |
| password | string | Yes | Min 8 characters |
| name | string | Yes | Display name |
Response
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "usr_a1b2c3",
"email": "you@company.com",
"name": "Your Name"
}
}POST
/auth/loginAuthenticate with email and password. Returns an access token.
Request Body
| Field | Type | Required | Note |
|---|---|---|---|
| string | Yes | — | |
| password | string | Yes | — |
Response
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "usr_a1b2c3",
"email": "you@company.com",
"name": "Your Name"
}
}GET
/auth/meAuth requiredGet 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.