MedicalTrace

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

ParameterInRequiredTypeDescription
emailbodyYesstringDemo mailbox, such as [email protected].
passwordbodyYesstringAt 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

FieldTypeDescriptionExample
accessTokenstringSend as Authorization: Bearer on later calls.demo.local.jwt
user.idstringUser id.aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa
user.emailstringSigned-in email.[email protected]
user.namestringDisplay name.Demo Manufacturer Admin
memberships[].orgIdstringOrganization this membership belongs to.11111111-1111-4111-8111-111111111111
memberships[].rolestringRole name stored on the membership.admin
memberships[].permissionsstring[]Permissions checked on later routes. * allows every named permission.asset:read
memberships[].organization.statusstringOrganization status. A draft cannot act as an approved participant.APPROVED