API quick start
Read cases and deadlines, open cases from your claims system, and receive signed webhooks. JSON over HTTPS, with one key in one header.
1. Make a key#
An admin makes keys in Avertyn under Settings → Connections → API keys. Pick only the scopes you need. A test key starts avk_test_ and a live key avk_live_. A key can have an expiry date and a list of addresses it may be used from.
2. Make your first call#
Every request goes to the base address https://ssjougrsaecdwfuxeasd.supabase.co/functions/v1/api-gateway. Ask which workspace the key belongs to:
curl https://ssjougrsaecdwfuxeasd.supabase.co/functions/v1/api-gateway/v1/me \
-H "Authorization: Bearer $AVERTYN_KEY"const r = await fetch("https://ssjougrsaecdwfuxeasd.supabase.co/functions/v1/api-gateway/v1/me", {
headers: { Authorization: `Bearer ${process.env.AVERTYN_KEY}` },
});
console.log(await r.json());import os, requests
r = requests.get("https://ssjougrsaecdwfuxeasd.supabase.co/functions/v1/api-gateway/v1/me",
headers={"Authorization": f"Bearer {os.environ['AVERTYN_KEY']}"})
print(r.json())3. List cases#
Cases come soonest response date first, 50 at a time and 200 at most. Lists return data, has_more and next_cursor; pass next_cursor as cursor for the next page. A cursor is good only for the list and filters it came from.
curl "https://ssjougrsaecdwfuxeasd.supabase.co/functions/v1/api-gateway/v1/cases?limit=50&phase=open_negotiation" \
-H "Authorization: Bearer $AVERTYN_KEY"Every filter is on the endpoint's page.
4. Open a case from your claims system#
curl -X POST https://ssjougrsaecdwfuxeasd.supabase.co/functions/v1/api-gateway/v1/disputes \
-H "Authorization: Bearer $AVERTYN_KEY" \
-H "Idempotency-Key: clm-10442-notice" \
-H "Content-Type: application/json" \
-d '{"disputes":[{"external_ref":"CLM-10442","cpt_code":"99285","billed_amount":4200,"qpa_amount":1150,"notice_received_on":"2026-11-10"}]}'Scopes#
| Scope | What it allows |
|---|---|
cases:read:basic | Read cases with operational fields only: the step, the phase and the dates. No amounts and no patient details |
cases:read | Read cases with amounts, codes and plan names |
cases:read:phi | Read cases with the patient reference, the claim number and the date of service. Needs the BAA |
cases:write | Open cases and run governed steps |
cases:fields | Change case fields. Needs the BAA |
metrics:read | Read the scorecard and exposure |
documents:read | Read documents |
documents:write | Attach documents to cases. Needs the BAA |
inbound:write | Bring messages into Messages from Zendesk, Front or email. Needs the BAA |
webhooks:manage | Add, pause and remove webhook endpoints |
Rules every call follows#
- Request ID. Every answer carries
x-request-id(req_and 32 characters). Quote it when you write to us. - Errors. One shape for every error, sent as
application/problem+json:type,title,status,detailandrequest_id. A 422 may adderrors, one line for each field. - Safe repeats. Send an
Idempotency-Key(up to 200 characters) on a POST, PATCH or DELETE. The same request with the same key within 24 hours returns the first answer, markedidempotent-replayed: true, and does nothing twice. The same key with a different request answers 409. - Limits. Each key may make 120 requests a minute unless changed. Every answer carries
x-ratelimit-limit,x-ratelimit-remainingandx-ratelimit-reset(seconds). Over the limit answers 429 withretry-after; refused requests don't count.
Error codes#
| Status | Means |
|---|---|
400 | A parameter is not valid |
401 | The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow |
403 | The key does not have a scope this route needs |
404 | Not found in this key's workspace |
409 | The Idempotency-Key was used with a different request, or the first request is still running |
422 | Understood and refused; detail says why |
429 | Over the key's limit for this minute |
500 | Avertyn could not complete the request |
Next#
Ask about this page
Answered from Avertyn's docs only, with links to where they say so. Not legal advice. Leave out patient details.