Sign in
Exchange a demo email and password for a bearer token.
The demo API checks the email and password hash, then returns an HMAC-signed JWT and the caller’s active memberships. This token is for local and demo use. It is not a production identity provider.
1. Request URL
POST https://api.medicaltrace.net/v1/auth/login
2. Request parameters
| Parameter | In | Required | Type | Description |
|---|---|---|---|---|
email | body | Yes | string | Demo mailbox, such as [email protected]. |
password | body | Yes | string | At least 6 characters. The local seed password is password123. |
3. Request example
curl -s -X POST 'https://api.medicaltrace.net/v1/auth/login' \
-H 'content-type: application/json' \
-d '{"email":"[email protected]","password":"password123"}'4. Response data
HTTP 201. The body below uses the fictional DEMO-BED-001 fixtures.
{
"accessToken": "demo.local.jwt",
"user": {
"id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
"email": "[email protected]",
"name": "Demo Manufacturer Admin"
},
"memberships": [
{
"orgId": "11111111-1111-4111-8111-111111111111",
"role": "admin",
"permissions": [
"asset:create",
"asset:read",
"asset:update_metadata",
"*"
],
"organization": {
"id": "11111111-1111-4111-8111-111111111111",
"displayName": "Demo Manufacturer",
"status": "APPROVED"
}
}
]
}5. Response fields
| Field | Type | Description | Example |
|---|---|---|---|
accessToken | string | Send as Authorization: Bearer on later calls. | demo.local.jwt |
user.id | string | User id. | aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa |
user.email | string | Signed-in email. | [email protected] |
user.name | string | Display name. | Demo Manufacturer Admin |
memberships[].orgId | string | Organization this membership belongs to. | 11111111-1111-4111-8111-111111111111 |
memberships[].role | string | Role name stored on the membership. | admin |
memberships[].permissions | string[] | Permissions checked on later routes. * allows every named permission. | asset:read |
memberships[].organization.status | string | Organization status. A draft cannot act as an approved participant. | APPROVED |