# Start installing the Koidog GitHub App.

> Answers once the address to open in a browser (`verificationUri`, GitHub's install page with a single-use state) and when it expires (10 minutes).
> https://koi.dog/docs/api/github/start-git-hub-installation/

`POST /api/v1/github/installation/consent` · Scope: `config`

The state is bound to who started it and this workspace. A person finishes it in the dashboard (`completeGitHubInstallation`). GitHub's page lets the person choose the account, so the same call adds another account or organization. `409 not_configured` when the server has no App credentials. The timeline records the key ID, action and outcome.

## Headers.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | Retry the same request with the same key. [Retry rules](https://koi.dog/docs/api/#retries). |

## Response.

201 Created · JSON object

## Request.

```sh
curl -X POST https://api.koi.dog/api/v1/github/installation/consent \
    -H "Authorization: Bearer $KOIDOG_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)"
```

```js
const res = await fetch("https://api.koi.dog/api/v1/github/installation/consent", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
  },
});
console.log(await res.json());
```

```python
import os
import uuid

import requests

r = requests.post(
    "https://api.koi.dog/api/v1/github/installation/consent",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "verificationUri": "string",
  "expiresAt": "string"
}
```
