Setup
- Register your endpoint and tool definitions with your application API key.
- Arrange review of the connector with Cortexa.
- Connect each clinician using a Bearer credential or OAuth.
- Call tools with the clinician’s Partner JWT.
1. Register the connector
POST /connectors — use the Cortexa-Api-Key header and this JSON body:
id, manifest_hash, and approved: false. Save the ID as
CONNECTOR_ID and arrange review before making calls.
These operations use the API key. Any definition change requires another review
and a new clinician connection, including changes to descriptions.
REST requirements
EHR profile
Useprofile: "ehr" to require these six tools. Your manifest defines their
input and output schemas.
MCP requirements
Usetransport: "mcp" and a Streamable HTTP endpoint. Copy each tool’s name,
description, schemas, and annotations from tools/list, and set write explicitly.
REST method and path fields are ignored. Stdio and legacy HTTP+SSE are unsupported.
Cortexa checks the live tool catalog before calls. A change returns
409 CONNECTOR_SCHEMA_CHANGED; update the manifest, arrange review, and reconnect.
MCP writes send the stable call ID in _meta.idempotencyKey for server-side deduplication.
2. Connect the clinician
Use the clinician’s Partner JWT. Each connection belongs to that clinician and workspace.Bearer credential
DELETE /connectors/{connector_id}/connection. Reconnecting invalidates
pending write approvals.
OAuth
Setauth: "oauth2" in the connector manifest and add an oauth object:
- Call
POST /connectors/{connector_id}/oauth/authorize. - Open the returned
authorization_urlfor the clinician. - Send the callback’s
codeandstatetoPOST /connectors/{connector_id}/oauth/completeusing the same grant.
3. Call a tool
GET /connectors/tools lists the tools available to the current clinician.
The connected clinician approves the write in Cortexa’s approval interface.
Arrange this interface during onboarding. A Partner JWT cannot approve a write
by sending an
approved flag. Cortexa Agent can also propose connected-tool
writes through its approval UI.
Check a call’s status
GET /connector-calls/{call_id} returns one of:
Retry a lost response with the same key and arguments. Changing the arguments or
connection under that key returns
409. A stalled executing or unknown call
may have reached the EHR; reconcile it by call ID before submitting a new write.