# Change an integration

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

Change an integration's target, credentials or settings. Changing the target discards any stored credentials. For a credentialed target change, supply replacements or explicitly remove the authentication. Use `reconnect: true` to renew GitHub authorization.

`POST /v1/organization/integration/modify`

## Parameters

- `integration` (string, required): Integration name in the selected account.
- `target` (string): New upstream HTTPS origin for a proxy or registry. Include no path, query or credentials. Changing the target clears stored credentials.
- `headers` (string[]): Request header to replace, in NAME: VALUE form. Other headers are retained. Treated as a secret and never included in errors.
- `remove_headers` (string[]): Stored request header to stop sending, by header name such as `Authorization`.
- `bearer` (string): Bearer token for the service. Treated as a secret and never included in errors.
- `basic_auth` (string): Service credential in USERNAME:PASSWORD form. Treated as a secret and never included in errors.
- `strip_prefix` (string): URL path prefix to remove before forwarding, such as `/v1`. Omit to keep the existing prefix. An empty value clears it.
- `attachments` (string[]): Additional Computers to grant access for a proxy or registry. Use `computer:NAME`, `pool:POOL`, `tag:TAG` or `auto:all`.
- `comment` (string): Replacement comment, one line of at most 200 bytes. Empty clears it; omission keeps it.
- `peer` (boolean): Forward to the private Computer website given by `target`. You need owner or root access to that Computer.
- `no_auth` (boolean): Send requests without adding credentials. Clears stored credentials when editing an integration.
- `read_only` (boolean): Block writes (GitHub integrations only).
- `reconnect` (boolean): Start a new authorization flow for a GitHub integration. The response includes a link and, when available, a device code. Send any other settings changes in a separate edit.
- `organization` (string): Organization name or ID. A credential, named resource or sole membership can select the organization for you.

## Returns

- `data` (object, always present): An updated 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 edit INTEGRATION
  [--target TARGET]
  [--header HEADER ...]
  [--remove-header REMOVE-HEADER ...]
  [--bearer BEARER]
  [--basic-auth BASIC-AUTH]
  [--strip-prefix STRIP-PREFIX]
  [--attachment ATTACHMENT ...]
  [--comment COMMENT]
  [--peer]
  [--no-auth]
  [--read-only true|false]
  [--reconnect]
  [--organization ORGANIZATION]
```

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

```sh tab="cURL"
curl https://heaven.dev/v1/organization/integration/modify \
  -H "Authorization: Bearer $HEAVEN_SIGN_IN_KEY" \
  --json '{"action": "edit", "integration": "payments", "comment": "Payments API"}'
```

```json tab="MCP"
{ "tool": "integration_edit",
  "arguments": { "integration": "payments", "comment": "Payments API" } }
```

Response:

```json title="Response excerpt"
{
  "version": 1,
  "data": {
    "address": "payments.int.heaven.dev",
    "id": "08f9c9e7-598b-40ab-a49e-2bc09da039a1"
  }
}
```
