Getting Started
This page gets you from zero to a successful POST /v1/TENANT/recommendation call in one cURL.
You need
- Your partner API key. You received it from CollectiveX Health out-of-band (encrypted channel). It starts with
zpka_. Do not commit it to source control. - The sandbox base URL:
https://partners.collectivex.health(same URL for sandbox + production — your key's tenant scope determines which environment you reach). - Your tenant slug — the URL component CollectiveX assigns to your account. Ask your CollectiveX Health contact if you don't know it.
curland a shell.
Minimal working request
Copy-paste this. Replace $CXH_API_KEY, $CXH_BASE_URL, and $TENANT with your values.
Code
Expected response
HTTP 200 OK. Body:
Code
Up to 7 citations per response, ordered by relevance descending. The relevance field is a 0.0–1.0 query-document match score from our biomedical reranker (MedCPT) — interpret it as a relative ranking signal within the response, not a calibrated probability. Full semantics + caveats in request-response-reference.md. citations is empty when recommendation is null and suppression_reason is populated.
What could go wrong on first run
First request returning 403
consent_not_provisioned? This is the most common day-zero failure. Your API key was issued but consent provisioning is a separate manual step on the CollectiveX side — they don't happen together. Reply to whoever delivered your key and ask for consent activation. The 403 is not a code bug; nothing to fix client-side.
| HTTP | detail or error.code | Fix |
|---|---|---|
401 Unauthorized | Zuplo problem+json, detail: "No Authorization Header" / "Invalid Authorization Scheme" / "Authorization Failed" | API key is missing, wrong scheme, malformed, revoked, or scoped to a different env. See errors.md for the full envelope. Use ApiKey scheme — Bearer is rejected. |
403 Forbidden | Zuplo problem+json, detail: "missing_partner_id" | Unusual — Zuplo normally injects X-Zuplo-Partner-Id for you. Contact support (support.md) with trace.requestId. |
403 Forbidden | {"detail": "consent_not_provisioned"} | Most common first-run failure. No consent record exists for your tenant yet — provisioning is a separate step from key issuance. Reply to your key delivery email asking for consent activation. |
403 Forbidden | {"detail": "consent_revoked"} | Active consent was revoked. Contact support — this is a contract-level event. |
422 Unprocessable Entity | flat envelope, error.code = "invalid_request" | Body schema is wrong. See request-response-reference.md for the full contract. |
422 Unprocessable Entity | flat envelope, error.code = "out_of_scope" | Query is clinical/diagnostic (triggered in safety_mode: strict). Use safety_mode: permissive for non-clinical wellness queries. |
429 Too Many Requests | Zuplo-emitted body; Retry-After header | Rate limit: 30 req/min per key. Backoff per the Retry-After header. See rate-limits.md. |
502 Bad Gateway | flat envelope, error.code = "persistence_failed" | Transient upstream write failure. Retry the same request_id after 1s — idempotency will serve the cached result if the write succeeded on retry. |
Flat envelope shape (used by all 422 / 500 / 502 responses):
Code
Three envelope shapes total — flat (origin), Zuplo problem+json (gateway 401/403), simple {"detail": "..."} (origin consent 403). errors.md walks through each.
Tenant pre-flight (GET /v1/health/me)
Before chasing imaginary client bugs, hit:
Code
A 200 returns:
Code
If consent_active is false, no /v1/TENANT/recommendation call will succeed — fix consent provisioning before anything else. This endpoint costs nothing — it doesn't burn a recommendation budget.
What next
- request-response-reference.md — full request body contract, enum tables, response fields, suppression semantics.
- authentication.md — API key format, rotation, revocation.
- errors.md — full error walkthrough with retry guidance per status.
- idempotency.md — safe retries and the 5-minute cache.
- rate-limits.md — 30 req/min, backoff recommendations.
The auto-generated OpenAPI reference is hosted at docs.collectivex.health alongside this written guide. Rebuilt on every change to the gateway docs.