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

# Api

> Automatically manage Key Results using custom API workflows.

## Overview

The KnowKR API allows you to update OKR measurements programmatically. This guide is primarily for developers who want custom integrations with KnowKR. If you're not a developer, you can use one of the existing integrations below or contact us for help.

## Retrieving Your API Token

1. Log in to your KnowKR account.
2. Click on your profile icon in the top left corner and select "API Keys".
3. Click the "Create API Key" button, name your key, and click "Generate Key".
4. Copy your API key and keep it secure as it grants access to your account.

## Endpoints

### Update Key Result Measurement

**Endpoint:**
`POST https://app.knowkr.com/api/key-results/measurements`

**Description:**
Updates the measurement value of a specific key result in KnowKR.

**Headers:**

| Key         | Value          | Required |
| ----------- | -------------- | -------- |
| X-API-TOKEN | Your Api Token | Yes      |

**Request Body:**
Send a JSON object containing the id of the key result and the new value for its measurement.

```json theme={null}
{
    "id": "your-key-result-id",
    "value": "your-measurement-value"
}
```

Response:

| Code | Description                         |
| ---- | ----------------------------------- |
| 200  | Measurement successfully updated.   |
| 400  | Invalid request. Check the payload. |
| 401  | Unauthorized. Check your API token. |
| 500  | Server error. Try again later.      |

**Example Request:**

```bash theme={null}
curl -X POST https://app.knowkr.com/api/key-results/measurements \
-H "Content-Type: application/json" \
-H "X-API-Token: your_api_token" \
-d '{
"id": "12345",
"value": "42"
}'
```
