TWIN Supply Chain Docs
API Reference

Authentication

How to authenticate requests to a TWIN supply-chain node.

Every API call requires a JWT, obtained by logging in. All endpoints accept it either as the access_token session cookie or as an Authorization: Bearer header — both carry the same token. If both are sent, the Bearer header takes precedence.

CredentialWhere it comes fromTypical use
Session cookie (access_token)Set-Cookie on loginBrowsers, the front end
Authorization: Bearer <jwt>The same token, read from the cookiecurl, scripts, servers

POST /authentication/login

Log in to obtain a session cookie.

Request
POST /authentication/login
Content-Type: application/json
Body
{
  "email": "[email protected]",
  "password": "your-password"
}

Response 200

The JWT is delivered via Set-Cookie, not the response body.

Response headers
Set-Cookie: access_token=<jwt>; HttpOnly; Path=/; SameSite=Strict
Response body
{
  "expiry": 1719150000000
}

expiry is milliseconds since Unix epoch.

Errors

StatusCause
401Wrong email or password
400Missing or malformed field

On this page