---
title: "Refresh a script connection"
method: POST
path: "/api/script-connections/{id}/refresh"
tags: ["Script Connections"]
---

# Refresh a script connection

`POST /api/script-connections/{id}/refresh`

## Path parameters

- `id` string, uuid, required

## Response `200`

Refreshed script connection

- object
  - `connection` object, required
    - `id` string, required
    - `slug` string, required
    - `displayName` string, nullable, required
    - `kind` 'raw' | 'openapi' | 'mcp' | 'graphql', required
    - `scope` 'global' | 'agent' | 'repo', required
    - `scopeId` string, nullable, required
    - `baseUrl` string, nullable, required
    - `baseUrlSource` 'user' | 'spec', required
    - `baseUrlMismatch` object
      - `specUrl` string, required
      - `effectiveUrl` string, required
    - `allowedHosts` string[], required
    - `credentialBindingId` string, nullable, required
    - `authType` 'none' | 'bearer' | 'header' | 'query' | 'oauth', required
    - `authConfigKey` string, nullable, required
    - `authAuthorizationId` string, nullable, required
    - `authParamName` string, nullable, required
    - `authTemplateOverride` string, nullable, required
    - `authHostsOverride` string[], nullable, required
    - `openapiSpecSourceKind` 'url' | 'inline' | 'agent_fs' | 'vendored' | 'null', nullable, required
    - `openapiSpecSource` string, nullable, required
    - `openapiSpecEtag` string, nullable, required
    - `openapiSpecFetchedAt` string, nullable, required
    - `mcpServerId` string, nullable, required
    - `generatedAt` string, nullable, required
    - `generationError` string, nullable, required
    - `enabled` boolean, required
    - `version` number, required
    - `createdAt` string, required
    - `updatedAt` string, required
    - `createdBy` string, nullable, required
    - `updatedBy` string, nullable, required
    - `operationCount` number, required
    - `toolCount` number, required
    - `credentialBinding` object, nullable, required
      - `id` string, required
      - `configKey` string, required
      - `authKind` 'config' | 'oauth', required
      - `oauthAuthorizationId` string
      - `tokenStatus` 'ok' | 'expiring' | 'refresh-failed' | 'revoked' | 'missing'
    - `auth` object, required
      - `type` 'none' | 'bearer' | 'header' | 'query' | 'oauth', required
      - `configKey` string
      - `authorizationId` string
      - `paramName` string
      - `status` 'ok' | 'expiring' | 'refresh-failed' | 'revoked' | 'missing'

## Other responses

- `400` — Connection cannot be refreshed
- `403` — Only the lead agent can manage script connections
- `404` — Script connection not found

## Changes

- **2026-08-07** `06cac6a7c5bc` — 4 info
  - added the media type `application/json` for the response with the status `200`
  - added the media type `application/json` for the response with the status `400`
  - added the media type `application/json` for the response with the status `403`
  - added the media type `application/json` for the response with the status `404`
- **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/script-connections/:id/refresh/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/e0acd2155cad/schema)
