Sign a credential
Sign a draft credential and enqueue an integrity commitment.
Requires credential:issue and an active grant for the credential’s claim type. The caller’s organization must be the issuer on the draft. The demo signature is HMAC-SHA256-DEV, not a production issuer key. Signing does not make the claim true.
1. Request URL
POST https://api.medicaltrace.net/v1/credentials/55555555-5555-4555-8555-555555555555/sign
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 | The issuer organization on the draft. |
id | path | Yes | string | Credential id returned by the draft call. |
3. Request example
curl -s -X POST 'https://api.medicaltrace.net/v1/credentials/55555555-5555-4555-8555-555555555555/sign' \
-H 'authorization: Bearer demo.local.jwt' \
-H 'x-organization-id: 33333333-3333-4333-8333-333333333333'4. Response data
HTTP 201. The body below uses the fictional DEMO-BED-001 fixtures.
{
"id": "55555555-5555-4555-8555-555555555555",
"lifecycle": "ANCHOR_PENDING",
"status": "ACTIVE",
"payloadDigest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"signedEnvelope": {
"schemaVersion": 1,
"claimType": "electrical_safety_inspection",
"alg": "HMAC-SHA256-DEV",
"signature": "demo-signature"
}
}5. Response fields
| Field | Type | Description | Example |
|---|---|---|---|
lifecycle | string | ANCHOR_PENDING after sign. The chain confirmation can still be pending. | ANCHOR_PENDING |
payloadDigest | string | Digest of the canonical envelope. | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
signedEnvelope.alg | string | Demo algorithm label. | HMAC-SHA256-DEV |