---
title: "Update access token for a connection (when tokens expire or are rotated)"
method: POST
path: "/git-connections/{connection_id}/update-token"
tags: ["Git Provider Connections"]
---

# Update access token for a connection (when tokens expire or are rotated)

`POST /git-connections/{connection_id}/update-token`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/git-connections/{connection_id}/update-token`
- Auth: HTTP bearer

## Path parameters

- `connection_id` integer, required

## Request body

- UpdateTokenRequest
  - `access_token` string, password, required: A credential. Write-only: it is never returned, and the AI assistant supplies it through a secret slot instead of typing it into the conversation.
  - `refresh_token` string, password, nullable: A credential. Write-only: it is never returned, and the AI assistant supplies it through a secret slot instead of typing it into the conversation.

## Response `200`

Token updated successfully

- UpdateTokenResponse
  - `connection_id` integer, required
  - `is_active` boolean, required
  - `message` string, required

## Other responses

- `400`: Invalid token configuration
- `401`: Unauthorized
- `403`: Git provider permission required
- `404`: Connection not found
- `429`: Git provider rate limit exceeded
- `500`: Internal server error

## Changes

- **2026-10-23** `7d41b820a372`: 3 breaking, 1 info
  - the request property `refresh_token` became not nullable
  - the `access_token` request property format changed from no format to `password`
  - the `refresh_token` request property type changed from `string, null` to no type
  - added `#/components/schemas/SecretString, subschema #2` to the `refresh_token` request property `oneOf` list
- **2026-10-23** `24af93ff5379`: 2 breaking, 2 info
  - removed `#/components/schemas/SecretString, subschema #2` from the `refresh_token` request property `oneOf` list
  - the `refresh_token` request property type changed from no type to `string, null`
  - the request property `refresh_token` became nullable
  - the `access_token` request property format was generalized from `password` to no format
- **2026-10-22** `842d42ed4659`: 3 breaking, 1 info
  - the request property `refresh_token` became not nullable
  - the `access_token` request property format changed from no format to `password`
  - the `refresh_token` request property type changed from `string, null` to no type
  - added `#/components/schemas/SecretString, subschema #2` to the `refresh_token` request property `oneOf` list
- …earlier changes not shown

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/git-connections/:connection_id/update-token/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
