> For the complete documentation index, see [llms.txt](https://docs.mdintegrations.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mdintegrations.com/partner/troubleshooting/technical-concepts/request-and-response-conventions.md).

# Request & Response Conventions

Every endpoint you'll call as a partner follows the same base URL, path structure, and authentication pattern. Once you've learned these conventions, you can predict how any new endpoint behaves before you've even opened its documentation — which is largely the point of writing them down here rather than repeating them on every reference page.

## Base URL

All partner-facing requests go to:

```
https://api.mdintegrations.com/v1/partner/
```

## Authentication header

Every request under `/v1/partner/` requires a valid Bearer token, obtained via the client\_credentials flow described in Authentication & Credentials:

```http
Authorization: Bearer <access_token>
```

Requests missing this header, or presenting an expired or malformed token, receive a `401` response — see Error Codes & Handling for what to do next.

> **Note:** `Authorization: Bearer <access_token>` is the only header the Partner API requires. If you've seen other MDI clients send additional headers — like a custom signature or version header — those belong to the Partner control panel's own internal session mechanism, not to the OAuth2-based Partner API, and you don't need to replicate them in your integration.

## Request format

Send request bodies as JSON with a `Content-Type: application/json` header:

```http
POST https://api.mdintegrations.com/v1/partner/patients
Authorization: Bearer <access_token>
Content-Type: application/json
```

```json
{
  "first_name": "Jane",
  "last_name": "Doe",
  "email": "jane.doe@example.com"
}
```

## Response format

Responses are JSON. Successful responses return the resource (or list of resources) you requested, along with a `2xx` HTTP status. Error responses follow a consistent envelope, described in Error Codes & Handling, so you can build a single error-handling path that works across every endpoint rather than writing bespoke handling per call.

## Environments share the same base URL

Sandbox and Live requests hit the same `api.mdintegrations.com` base URL and the same `/v1/partner/` paths — nothing in the URL itself distinguishes them. The distinction comes entirely from which credential, and therefore which token, you authenticate with. See Sandbox vs. Live Environments for why keeping the two separate matters, and note that IDs from one environment are never valid in the other, even though the URL looks identical either way.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mdintegrations.com/partner/troubleshooting/technical-concepts/request-and-response-conventions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
