---
title: "Force-refresh the stored OAuth tokens for a provider (never returns token values)"
method: POST
path: "/api/oauth-apps/{provider}/refresh"
tags: ["Script Connections"]
---

# Force-refresh the stored OAuth tokens for a provider (never returns token values)

`POST /api/oauth-apps/{provider}/refresh`

## Path parameters

- `provider` string, required

## Response `200`

Refresh result with token status and new expiry

- object
  - `refreshed` true, required
  - `tokenStatus` 'ok' | 'expiring' | 'refresh-failed' | 'revoked' | 'missing', required
  - `expiresAt` string, nullable, required

## Other responses

- `400` — No stored tokens or provider does not support refresh
- `403` — Only the lead agent can manage script connections
- `404` — OAuth app not found
- `502` — Provider token endpoint rejected the refresh

## Changes

- **2026-08-07** `06cac6a7c5bc` — 5 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`
  - …1 more
- **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/oauth-apps/:provider/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)
