---
title: "Lock an OAuth integration connection to a package so only that package (and any previously granted packages) can call..."
method: POST
path: "/v1/integrations/{name}/lock"
tags: ["integrations"]
---

# Lock an OAuth integration connection to a package so only that package (and any previously granted packages) can call...

`POST /v1/integrations/{name}/lock`

## Request

- Base URL: `https://api.kody.codes`
- URL: `https://api.kody.codes/v1/integrations/{name}/lock`
- Auth: HTTP bearer

Lock an OAuth integration connection to a package so only that package (and any previously granted packages) can call createAuthenticatedFetch / token refresh. Execute and other packages are denied. Agents can lock; unlocking or removing a grant is website-only at /account/integrations/:name. This capability cannot loosen usage. integrationSave still cannot change usageMode.

Org permission: `integration:use`.

## Path parameters

- `name` string, required: Saved integration connection name (provider key).

## Request body

- object
  - `package_id` string, required: Saved package id that may use this integration.

## Response `200`

Success.

- object
  - `name` string, required
  - `usage_mode` 'packages', required
  - `allowed_package_ids` string[], required
  - `usage_url` string, required

## Other responses

- `400`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `401`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `403`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `404`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `409`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `413`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `429`: Too many requests (edge IP/token limit) or an entitlement / plan-cap limit. Wait at least `Retry-After` seconds before retrying.
- `500`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `503`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `default`: Error envelope `{ "error": { "code", "message", "details"? } }`.

---

[API](https://skmtc.dev/kody/apis/kody-api.md) · [All operations](https://skmtc.dev/kody/apis/kody-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kody/apis/kody-api/revisions/a020ecedb82b?raw)
