> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clinikapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference (in the dashboard)

> Copy-ready requests for every resource, using your API address and the start of your key.

# API reference in the dashboard

## What this is for

The dashboard's **API reference** page is a shortcut: pick a kind of record and instantly get a working "list" request and a working "create" request, in cURL (a command you can paste into a terminal) or TypeScript (code for your server). It is the fastest way to see what a call looks like. The complete reference with every field is in the [API Reference](https://docs.clinikapi.com/api-reference/overview.md) tab of this site.

## Before you start

* Any member can open it.
* Have a key. The examples show only the first characters of one of your keys, so you will paste your full key in yourself. Create keys on [Access](https://docs.clinikapi.com/dashboard/projects/access-keys.md).

## Copy a request

**1. Open the page**

Choose **API reference** in the sidebar. The page is titled **API reference**: "Copy-ready requests for every resource, using your API address and the start of your key."

**2. Pick a resource**

In the list on the left, select a type such as **Patients**. Use **Filter resources** to search.

**3. Pick a language**

Under "List patients" and "Create a record", choose the **cURL** or **TypeScript** tab.

**4. Copy**

Select **Copy code**.

**5. Add your full key and run it**

Replace the shortened key (for example `clk_test_ab12cd…`) with your real key, ideally from an environment variable. For cURL the key goes in the `x-api-key` header. Run it.

## What you'll see

* **Base URL and authentication**: the API address (`https://api.clinikapi.com/v1`) with a copy button, and the reminder: send your key in the `x-api-key` header; test keys (`clk_test_`) use the sandbox, live keys (`clk_live_`) use production; never put a key in a browser or app.

* For the chosen resource, the heading and a line like `GET https://api.clinikapi.com/v1/patients`.

* **List** and **Create a record** examples. The create example uses a small sample (`firstName: "Jane"`, `lastName: "Doe"`); each resource has different required fields, so check the resource's guide for the real shape.

* If you have no key yet, the examples show `clk_test_…`.

* A link to the **API documentation** for full details.

## Common questions

> **What is cURL?**
>
> A command-line tool for sending web requests. Paste the snippet into a terminal (macOS, Linux, or Windows PowerShell with curl installed) and press Enter.

> **Why is my key cut off with '…'?**
>
> The dashboard never keeps your full key, only the first characters, so it can only show that much. Use the full key you saved when you created it.

> **Why does the create example fail for other resources?**
>
> The sample body is a generic person example. Each resource needs its own fields. Open that resource's guide, for example [Observations](https://docs.clinikapi.com/guides/observations.md).

> **What is the TypeScript snippet using?**
>
> The ClinikAPI SDK, `@clinikapi/sdk`, on your server, with the key read from an environment variable. See the [quickstart](https://docs.clinikapi.com/quickstart.md).

> **Are test and live keys used the same way?**
>
> Yes, the only difference is which data they reach.

## Troubleshooting

| What you see | What to do |
| - | - |
| The request returns an authentication error | The key is shortened, mistyped, revoked or from another project. Use the full key. |
| `403` when creating | The key lacks the **Write** scope. Create a key with **Write**. |
| A validation error when creating | The sample fields do not fit this resource. See its guide. |
| `429` | You hit the rate limit. Wait a minute. |

## Related

* [Access: API keys](https://docs.clinikapi.com/dashboard/projects/access-keys.md)
* [Your first 10 minutes](https://docs.clinikapi.com/dashboard/getting-started.md)
* [Authentication](https://docs.clinikapi.com/authentication.md)
* [Glossary](https://docs.clinikapi.com/dashboard/glossary.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.