# Create an integration

URL: https://heaven.dev/docs/reference/integrations/create
Updated: 2026-11-21

Create an HTTPS proxy, registry or GitHub integration, or restore the built-in self integration. Heaven keeps the stored upstream credential outside the Computers that use it. GitHub requires authorization through the returned link or device flow before the integration is ready.

`POST /v1/organization/integration/create`

## Parameters

- `kind` (string, required): Integration type. `http-proxy` forwards to an HTTPS service. `registry` authenticates to a container registry. `github` starts GitHub authorization. `self` restores the built-in Computer metadata service.
- `name` (string): Name for an HTTPS proxy, registry or GitHub integration. Use 1 to 63 lowercase letters, digits and hyphens, starting and ending with a letter or digit. The built-in `self` integration keeps its fixed name.
- `target` (string): Upstream HTTPS origin for a proxy or registry, such as `https://api.example.com`. Include no path, query or credentials.
- `headers` (string[]): Request header for the service, in NAME: VALUE form. Treated as a secret and never included in errors.
- `bearer` (string): Bearer token for the service. Treated as a secret and never included in errors.
- `basic_auth` (string): Upstream login in `USERNAME:PASSWORD` form on one line. Required for a registry integration. Treated as a secret and never included in errors.
- `strip_prefix` (string): URL path prefix to remove before forwarding requests, such as /v1.
- `attachments` (string[]): Computers allowed to use the integration. Use `computer:NAME`, `pool:POOL`, `tag:TAG` or `auto:all`. Omit to create without attachments.
- `comment` (string): Integration comment, one line of at most 200 bytes.
- `peer` (boolean): Forward to the private Computer website given by `target`. You need owner or root access to that Computer. Attached Computers authenticate with their own identities.
- `no_auth` (boolean): Send requests without adding credentials. Clears stored credentials when editing an integration.
- `read_only` (boolean): Block writes (GitHub integrations only).
- `organization` (string): Organization name or ID. A credential, named resource or sole membership can select the organization for you.

## Returns

- `data` (object, always present): A created integration, a pending GitHub authorization, or a completed GitHub connection.
  - `alternative-1` (object): The integration affected by this request.
    - `address` (string): Address attached Computers use to call the integration. May be omitted.
    - `detached` (boolean): Whether detaching removed any of the attachments named. May be omitted.
    - `id` (string, always present): Integration ID.
    - `not_attached` (string[]): Attachments named to detach that it did not have. May be omitted.
    - `paused` (boolean): Whether the integration is now paused. May be omitted.
  - `alternative-2` (object): Authorization needed to connect a GitHub integration.
    - `device` (object): Code and GitHub page for the device authorization flow, when available. May be omitted.
      - `code` (string, always present): Code to enter at GitHub.
      - `expires` (string (date-time), always present): When the device code expires.
      - `url` (string, always present): GitHub page where you enter the code.
      - `waiting` (boolean): Whether the command was repeated before authorization completed. May be omitted.
    - `expires` (string (date-time), always present): When the browser connection request expires.
    - `id` (string, always present): Integration being connected.
    - `install_url` (string, always present): Page to install the GitHub app on another account or organization.
    - `note` (string): Why no device code is available, when GitHub could not start that flow. May be omitted.
    - `url` (string, always present): Browser connection page, used while signed in to Heaven.
  - `alternative-3` (object): The GitHub integration after authorization completed.
    - `github_user` (string, always present): GitHub user the integration acts as.
    - `id` (string, always present): Connected integration's ID.
    - `install_url` (string): Page to install the app on another account or organization. May be omitted.
    - `name` (string, always present): Integration name.
    - `owners` (string[] | null, always present): GitHub installation owners accessible through the connection.

## Errors

Each code is explained in full at https://heaven.dev/docs/reference/errors.

| Code | Status | What happened |
|---|---:|---|
| `invalid` | 400 | An input is missing or invalid. |
| `unauthenticated` | 401 | The credential is missing, invalid, expired or revoked. |
| `denied` | 403 | The caller lacks permission for this action. |
| `not_found` | 404 | The resource is absent or inaccessible to this caller. |
| `conflict` | 409 | The request conflicts with the current resource state or an earlier request. |
| `over_capacity` | 409 | The request exceeds a resource or credential allowance. |
| `access_list_full` | 409 | The change would exceed the access-list allowance. |
| `payment_required` | 402 | Payment or credit is required. |
| `rate_limited` | 429 | The caller's request rate exceeds its limit. |
| `busy` | 429 | Too much work is in progress to accept this request. |
| `unknown` | 503 | The outcome is unconfirmed; a change may have happened. |
| `unavailable` | 503 | The service or requested feature is unavailable. |

## Notes

- CLI: `heaven login` with `HEAVEN_API_KEY` unset. MCP: Heaven sign-in. cURL: `HEAVEN_SIGN_IN_KEY` from approved device sign-in (`POST /v1/auth/create`).
- A key limited to a command list cannot run this command.

## Examples

```sh tab="heaven CLI"
heaven integration create KIND
  [--name NAME]
  [--target TARGET]
  [--header HEADER ...]
  [--bearer BEARER]
  [--basic-auth BASIC-AUTH]
  [--strip-prefix STRIP-PREFIX]
  [--attachment ATTACHMENT ...]
  [--comment COMMENT]
  [--peer]
  [--no-auth]
  [--read-only true|false]
  [--organization ORGANIZATION]
```

```sh tab="SSH"
ssh cli@heaven.dev integration create KIND
  [--name NAME]
  [--target TARGET]
  [--header HEADER ...]
  [--bearer BEARER]
  [--basic-auth BASIC-AUTH]
  [--strip-prefix STRIP-PREFIX]
  [--attachment ATTACHMENT ...]
  [--comment COMMENT]
  [--peer]
  [--no-auth]
  [--read-only true|false]
  [--organization ORGANIZATION]
```

```sh tab="cURL"
curl https://heaven.dev/v1/organization/integration/create \
  -H "Authorization: Bearer $HEAVEN_SIGN_IN_KEY" \
  --json '{"kind": "http-proxy", "name": "payments", "target": "https://api.example.com", "bearer": "sk_live_example"}'
```

```json tab="MCP"
{ "tool": "integration_create",
  "arguments": { "kind": "http-proxy", "name": "payments", "target": "https://api.example.com", "bearer": "sk_live_example" } }
```

Response:

```json title="Response excerpt"
{
  "version": 1,
  "data": {
    "address": "payments.int.heaven.dev",
    "id": "bee4b310-9a80-4412-abbb-5d10f455ed4a"
  }
}
```
