---
title: "Partially update credentials for an existing git provider. Only the fields you send are replaced; omitted fields keep their stored values. Basic-auth providers rotate `username`/`password`, SSH-key providers `private_key` and `public_key` together; both refuse fields of another auth method. For the other auth methods, fields that don't apply are ignored. A new token or password is also written to the provider's connections. The response names the replaced fields, never their values."
method: PATCH
path: "/git-providers/{provider_id}/credentials"
tags: ["Git Providers"]
---

# Partially update credentials for an existing git provider. Only the fields you send are replaced; omitted fields keep their stored values. Basic-auth providers rotate \`username\`/\`password\`, SSH-key providers \`private_key\` and \`public_key\` together; both refuse fields of another auth method. For the other auth methods, fields that don't apply are ignored. A new token or password is also written to the provider's connections. The response names the replaced fields, never their values.

`PATCH /git-providers/{provider_id}/credentials`

## Request

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

## Path parameters

- `provider_id` integer, required

## Request body

- UpdateProviderCredentialsRequest: Partial-update payload for provider credentials. Every field is optional; only the fields the user re-enters are applied. The server validates that the fields supplied make sense for the provider's current auth_method (e.g. `app_id` + `private_key` only apply to GitHub Apps).
  - `app_id` string, nullable: Application ID (GitHub App integer as string; GitLab App string).
  - `app_secret` 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.
  - `client_id` string, nullable: OAuth client ID (GitLab OAuth, GitHub App).
  - `client_secret` 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.
  - `password` 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.
  - `private_key` 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.
  - `public_key` string, nullable: SSH public key (one OpenSSH line) of an SSH-key provider. Replaced together with `private_key`, which then carries the SSH private key.
  - `redirect_uri` string, nullable: OAuth redirect URI (GitLab OAuth / GitLab App).
  - `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.
  - `username` string, nullable: Username of a basic-auth provider (generic Git server, Bitbucket app password). Omit to keep the stored username.
  - `webhook_secret` 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`

Credentials updated

- UpdateProviderCredentialsResponse: Result of a credential update: the provider and the names of the credential fields that were replaced. Credential values are never returned.
  - `auth_method` string, required
  - `base_url` string, nullable
  - `created_at` string, date-time, required
  - `id` integer, required
  - `is_active` boolean, required
  - `is_default` boolean, required
  - `name` string, required
  - `provider_type` string, required
  - `updated_at` string, date-time, required
  - `updated_fields` string[], required: Names of the fields that were replaced, e.g. `["password"]`. Fields that do not apply to the provider's auth method are not listed.

## Other responses

- `400`: Invalid credentials for the provider's auth method
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Provider not found
- `500`: Internal server error

## Changes

- **2026-11-26** `199b8052eb32`: 9 breaking, 1 warning, 4 info
  - the response's body type changed from `object` to no type for status `200`
  - removed the required property `auth_method` from the response with the `200` status
  - removed the required property `created_at` from the response with the `200` status
  - removed the required property `id` from the response with the `200` status
  - …10 more
- **2026-10-23** `7d41b820a372`: 10 breaking, 5 info
  - the request property `app_secret` became not nullable
  - the request property `client_secret` became not nullable
  - the request property `private_key` became not nullable
  - the request property `token` became not nullable
  - …11 more
- **2026-10-23** `24af93ff5379`: 10 breaking, 5 info
  - removed `#/components/schemas/SecretString, subschema #2` from the `app_secret` request property `oneOf` list
  - removed `#/components/schemas/SecretString, subschema #2` from the `client_secret` request property `oneOf` list
  - removed `#/components/schemas/SecretString, subschema #2` from the `private_key` request property `oneOf` list
  - removed `#/components/schemas/SecretString, subschema #2` from the `token` request property `oneOf` list
  - …11 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/git-providers/:provider_id/credentials/patch.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)
