Authorize · Guide

Review clinical orders

Use clinician ordering when an AI agent proposes a prescription, lab or referral that a licensed clinician must approve. The agent submits the order with its reasoning, and the clinician reviews both and authorizes with a passkey. You get a signed record of who authorized exactly what, when, with which verified credential. Your system then places the order.

Before you begin: export the sandbox Enterprise key. Its account has a seeded prescriber whose NPI is verified.

export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x

Limitations: Provenance authorizes and records; it doesn't place orders, make clinical decisions or check drug interactions. It isn't certified for electronic prescribing of controlled substances (EPCS), so a controlled order is authorized for the record and your system transmits it under its own authority.

1. Register the prescriber

Register each clinician with POST /v1/authorize/prescribers. Provenance checks the credentials itself and assigns a tier; a tier sent by the client is ignored.

tierConfirmed by
self_attestedNothing yet: a name on file
npi_verifiedA valid NPI whose name matches the CMS NPPES registry
license_verifiedAn active state license with no disciplinary action, from a credential vendor
dea_verifiedA valid DEA registration, from a credential vendor

A match on a federal exclusion list sets excluded: true, and that prescriber's orders are refused whatever their tier.

curl $PROVENANCE_API/v1/authorize/prescribers \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "full_name": "Jane Doe, MD", "npi": "1234567893", "license_state": "MA" }'

The response, trimmed:

{
  "id": "presc_01M5Q2ZT9RZK82MNZTBANQV36H",
  "object": "prescriber",
  "full_name": "Jane Doe, MD",
  "npi": "1234567893",
  "excluded": false,
  "exclusion_checked": false
}

The tier field shows the result, and evidence lists each credential source and what it found. A source that isn't set up on the server says so, and the tier stops below it: without a credential vendor, the highest tier is npi_verified.

2. Check which orders need which tier

The clinical_order policy sets the tier each kind of order needs, and which need a second clinician. Read it with GET /v1/mandate/policies:

curl "$PROVENANCE_API/v1/authorize/clinical_order_policies" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
{
  "object": "policy",
  "domain": "clinical_order",
  "document": {
    "rules": [
      { "id": "controlled-substance", "match": { "controlled": true }, "required_tier": "dea_verified", "cosign": true },
      { "id": "prescription", "match": { "order_type": "rx" }, "required_tier": "npi_verified" }
    ],
    "default_required_tier": "self_attested"
  },
  "is_default": true
}

By default a controlled substance needs a dea_verified prescriber and a second clinician's co-sign, and a prescription needs npi_verified. Change it with PUT /v1/authorize/clinical_order_policies.

3. Submit the agent's order

The agent submits the order with POST /v1/authorize/clinical_orders. The payload is bound by hash, so the order placed can't differ from the one authorized. The reasoning is the agent's own account, bound into the record and shown to the clinician labelled as agent-supplied.

curl -s $PROVENANCE_API/v1/authorize/clinical_orders \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prescriber_id": "presc_00000000000000000000000048",
    "order_type": "rx",
    "payload": { "drug": "amoxicillin", "dose": "500mg", "route": "PO", "quantity": 30, "frequency": "TID" },
    "reasoning": { "diagnosis": "strep pharyngitis", "rapid_strep": "positive" }
  }' | tee order.json
export ORDER_ID=$(jq -r .id order.json)

The response, trimmed:

{
  "id": "ord_01M5Q30H0NRZKYZAC2SGFRGVRX",
  "object": "order",
  "status": "pending_review",
  "order_type": "rx",
  "controlled": false,
  "clinical_summary": "amoxicillin · 500mg · PO · 30 · TID",
  "prescriber": { "full_name": "Jane Doe, MD", "npi": "1234567893", "tier": "npi_verified", "excluded": false },
  "required_tier": "npi_verified",
  "approvals_needed": 1,
  "policy": { "id": "pol_3F9A1C7E52B04D8E6A1F27C9B4", "version": null, "rule": { "id": "prescription", "name": null, "phase": "assess", "action": "review", "conditions": [] } }
}

Orders wait 24 hours for review, then expire.

4. The clinician reviews and decides

Show the clinician the order and its reasoning, in your EHR with the <provenance-clinical-order> embed or on your own screen. They authorize with a passkey, as in biometric approval, through POST /v1/authorize/clinical_orders/{id}/approve. Re-sending the payload checks that it hasn't changed.

curl $PROVENANCE_API/v1/authorize/clinical_orders/$ORDER_ID/approve \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"device_id\": \"$DEVICE_ID\",
    \"biometric_challenge\": \"$BIOMETRIC_CHALLENGE\",
    \"biometric_assertion\": $(cat assertion.json),
    \"action_payload\": { \"drug\": \"amoxicillin\", \"dose\": \"500mg\", \"route\": \"PO\", \"quantity\": 30, \"frequency\": \"TID\" }
  }"
{
  "id": "ord_01M5Q30H0NRZKYZAC2SGFRGVRX",
  "object": "order",
  "status": "authorized",
  "authorized_tier": "npi_verified",
  "outcome": "authorized"
}

To refuse, the clinician declines with POST /v1/authorize/clinical_orders/{id}/decline. A decided order can't be decided again.

curl $PROVENANCE_API/v1/authorize/clinical_orders/$ORDER_ID/decline \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "Penicillin allergy on file" }'
{
  "id": "ord_01M5Q30H0NRZKYZAC2SGFRGVRX",
  "object": "order",
  "status": "declined",
  "decline_reason": "Penicillin allergy on file",
  "outcome": "declined"
}

5. Place the authorized order

Subscribe a webhook to authorize.clinical_order.authorized; your system places the order when it arrives. Read the order to confirm the status rather than trusting a browser event. For the record, GET /v1/authorize/clinical_orders/{id}/receipt returns an ES256-signed receipt with the prescriber's tier and the sealed reasoning, verifiable offline against the published keys.

Errors you might see

SymptomCauseFix
outcome: "denied", reason: "prescriber_tier_insufficient"The prescriber's tier is below what the policy requiresVerify more credentials, or route to a qualified prescriber.
outcome: "denied", reason: "prescriber_excluded"The prescriber is on a federal exclusion listThe order can't be authorized by this prescriber.
outcome: "cosign_pending", reason: "controlled_substance_cosign_required"A controlled order needs a second clinicianHave a second clinician authorize too.
400 approval_biometric_requiredAuthorize was sent without a passkey assertionHave the clinician confirm with a passkey.
payload_hash_mismatchThe payload sent at authorize differs from the one submittedSend the order's payload unchanged.

See also

Was this page helpful? Send us feedback

LLM? Read llms.txt.