> For the complete documentation index, see [llms.txt](https://docs.mymedtrics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mymedtrics.com/api-reference/graphql-gateway.md).

# GraphQL gateway

Read programs, rotations, evaluations and your integrations in one request, with the credentials you already have.

A read-only query API over the same data as the Connect API — programs, rotations and evaluations — plus the integrations hub: the catalog, what your institution has turned on, LTI platforms, health and audit. One request returns exactly the fields you ask for, shaped for a screen. It uses the **same credentials as Connect**; nothing is created or changed through it — for that, use the [Connect API](/api-reference/connect-api.md).

### Your first query

```bash
curl -X POST "https://sandbox.mymedtrics.com/graphql/v1" \
  -H "X-Medtrics-Sandbox-Key: $MEDTRICS_SANDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"query { programs(first: 5) { id name shortName } }"}'
```

```json
{ "data": { "programs": [ { "id": "prog_…", "name": "Internal Medicine", "shortName": "IM" } ] } }
```

On a live tenant, replace the host with `https://<client-name>.mymedtrics.com` and the sandbox header with `X-API-Key: <your mct_live_… key>`.

### How it works

|             |                                                                                                                                                                                                                                                                                    |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Endpoint    | `POST https://<client-name>.mymedtrics.com/graphql/v1`, JSON body `{ "query": "…", "variables": {} }`                                                                                                                                                                              |
| Credentials | A Connect API app key — `X-API-Key: mct_live_…` on your tenant, `X-Medtrics-Sandbox-Key: mct_sbx_…` on the [sandbox](/get-started/sandbox.md). The key's scopes decide which queries answer (`programs:read`, `integrations:read`, `lti-platforms:read`, `integration-audit:read`) |
| Paging      | Lists take `first` and `after`; connection results return `edges { node }` and `pageInfo { hasNextPage endCursor }`                                                                                                                                                                |
| Limits      | Queries at most 5 levels deep; the rate limit of your API app; no mutations, no subscriptions; introspection is off — the [types](/api-reference/graphql-gateway/types.md) page and the [schema download](/api-reference/graphql-gateway/types.md#schema) replace it               |

### What you can ask

| Group                                                                                                       | Answers                                                                                  | Queries                                                                                                                     |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [Programs, rotations and evaluations](/api-reference/graphql-gateway/programs-rotations-and-evaluations.md) | The same training data Connect serves, read in one request — for dashboards and reports. | `programs` · `program` · `rotations` · `evaluations`                                                                        |
| [Integrations](/api-reference/graphql-gateway/integrations.md)                                              | What Medtrics can connect to, and what your institution has turned on.                   | `integrations` · `integration` · `institutionIntegrations` · `institutionIntegration`                                       |
| [LTI platforms](/api-reference/graphql-gateway/lti-platforms.md)                                            | The LMS platforms registered for your institution, their courses and grade links.        | `ltiPlatforms` · `ltiPlatform` · `ltiContexts` · `ltiGradeLinks`                                                            |
| [Health and audit](/api-reference/graphql-gateway/health-and-audit.md)                                      | Whether each integration is working, and who changed what.                               | `integrationHealth` · `healthConnection` · `integrationHealthConnection` · `integrationAuditLog` · `integrationActivityLog` |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mymedtrics.com/api-reference/graphql-gateway.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
