Draft a credential
Create an unsigned credential for a granted claim type.
Call this as Demo Lab, while the lab is manufacturer or current custodian of the equipment. The member needs credential:issue, and the organization needs an issuer grant whose credentialType matches claimType. The seed grant is electrical_safety_inspection. Upload alone does not create this row.
1. Request URL
POST https://api.medicaltrace.net/v1/credentials/draft
2. Request parameters
| Parameter | In | Required | Type | Description |
|---|---|---|---|---|
Authorization | header | Yes | string | Bearer token from POST /auth/login. The sample value demo.local.jwt is a placeholder. |
X-Organization-Id | header | Yes | string | Issuer organization. Demo Lab in the sample. |
equipmentId | body | Yes | string | Device the claim is about. |
claimType | body | Yes | string | Must match an active issuer grant. |
claims | body | Yes | object | Canonical claim body. A later signature covers this version. |
validFrom | body | Yes | string | ISO-8601 start of the validity window. |
validTo | body | Yes | string | ISO-8601 end of the validity window. |
documentDigests | body | No | string[] | Digests of the document versions this claim cites. |
3. Request example
curl -s -X POST 'https://api.medicaltrace.net/v1/credentials/draft' \
-H 'content-type: application/json' \
-H 'authorization: Bearer demo.local.jwt' \
-H 'x-organization-id: 33333333-3333-4333-8333-333333333333' \
-d '{"equipmentId":"44444444-4444-4444-8444-444444444444","claimType":"electrical_safety_inspection","claims":{"result":"sample_pass","device":"DEMO-BED-001"},"validFrom":"2026-01-01T00:00:00.000Z","validTo":"2027-03-01T00:00:00.000Z","documentDigests":["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"]}'4. Response data
HTTP 201. The body below uses the fictional DEMO-BED-001 fixtures.
{
"id": "55555555-5555-4555-8555-555555555555",
"equipmentId": "44444444-4444-4444-8444-444444444444",
"issuerOrgId": "33333333-3333-4333-8333-333333333333",
"claimType": "electrical_safety_inspection",
"lifecycle": "DRAFT",
"status": "ACTIVE",
"validFrom": "2026-01-01T00:00:00.000Z",
"validTo": "2027-03-01T00:00:00.000Z"
}5. Response fields
| Field | Type | Description | Example |
|---|---|---|---|
id | string | Credential id for sign, revoke, and verify. | 55555555-5555-4555-8555-555555555555 |
lifecycle | string | DRAFT until sign. Sign moves it to ANCHOR_PENDING. | DRAFT |
status | string | ACTIVE, REVOKED, or SUPERSEDED. This is separate from the signature. | ACTIVE |