Skip to main content

Overview

The EmaalCoin API uses PASETO bearer tokens for authentication. Obtain tokens via login endpoints and send them in the Authorization header.

Token Types

Login Endpoints

Email + Password

Returns access_token and refresh_token (PASETO).

PIN Login

Or with phone number:

Refresh Token Flow

When the access token expires, exchange the refresh token for new tokens:
Refresh token rotation is enabled. The old refresh token is revoked immediately after use. Always use the new refresh token returned in the response for future refreshes.

Using the Token

Add the access token to every protected request:

PIN Management

  • Set during registration: Include pin in POST /api/v1/users/register
  • Update existing PIN: PUT /api/v1/auth/user/id/{id}/pin

Unauthenticated Endpoints

These endpoints do not require a token:
  • POST /api/v1/users/register
  • POST /api/v1/users/login-pin