---
title: "Create or update a script credential binding"
method: POST
path: "/api/credential-bindings"
tags: ["Script Connections"]
---

# Create or update a script credential binding

`POST /api/credential-bindings`

## Request body

- object
  - `id` string, uuid
  - `configKey` string, required
  - `allowedHosts` string[], required
  - `headerTemplate` string
  - `queryTemplate` string
  - `scope` 'global' | 'agent' | 'repo'
  - `scopeId` string, nullable
  - `active` boolean
  - `authKind` 'config' | 'oauth'
  - `oauthAuthorizationId` string

## Response `200`

Saved credential binding

## Other responses

- `400` — Validation error
- `403` — Only the lead agent can manage script connections

## Changes

- **2026-07-24** `5caa2f4d1afb` — 1 warning, 1 info
  - removed the request property `oauthProvider`
  - added the new optional request property `oauthAuthorizationId`
- **2026-07-09** `4f56890cc278` — 1 info
  - endpoint added
- **2026-07-02** `0c910612f9ac` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/changes/api/credential-bindings/post.md)

---

[API](https://skmtc.dev/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/revisions/92a1dcbd2fc7/schema)
