---
title: "Upsert Provider Credential"
method: PUT
path: "/v1/provider-credentials/{slot}"
tags: ["provider-credentials"]
---

# Upsert Provider Credential

`PUT /v1/provider-credentials/{slot}`

## Request

- Base URL: `https://api.cyberdesk.io`
- URL: `https://api.cyberdesk.io/v1/provider-credentials/{slot}`
- Auth: HTTP bearer

Add or replace the organization's credential for a provider slot.

Once a slot has a credential, Cyberdesk stops using its own keys for that provider.

## Path parameters

- `slot` 'anthropic' | 'openai' | 'google' | 'aws_bedrock', required

## Headers

- `Idempotency-Key` string

## Request body

- ProviderCredentialUpsert: Credential material for one slot. Which fields are required depends on the slot.
  - `api_key` string, nullable: API key for the anthropic/openai slots, or the Bedrock API key when bedrock_auth_mode=api_key.
  - `service_account_json` string, nullable: Google Cloud service account key file contents (JSON string) for the google slot.
  - `bedrock_auth_mode` 'api_key' | 'iam'
  - `aws_access_key_id` string, nullable
  - `aws_secret_access_key` string, nullable
  - `aws_region` string, nullable: AWS region for Bedrock. One of: us-east-1, us-east-2, us-west-2.

## Response `200`

Successful Response

- ProviderCredentialResponse: State of one BYOK slot. Never includes secret material.
  - `slot` 'anthropic' | 'openai' | 'google' | 'aws_bedrock', required
  - `display_name` string, required
  - `source` 'cyberdesk' | 'organization', required
  - `covered_providers` string[], required
  - `status` 'active' | 'invalid' | 'missing'
  - `auth_type` 'api_key' | 'service_account_json' | 'aws_bedrock_api_key' | 'aws_iam'
  - `display_metadata` ProviderCredentialDisplayMetadata: Non-secret metadata shown in the dashboard.
    - `key_last4` string, nullable
    - `project_id` string, nullable
    - `client_email` string, nullable
    - `aws_region` string, nullable
    - `access_key_id_last4` string, nullable
  - `last_error` string, nullable
  - `activated_at` string, date-time, nullable
  - `last_validated_at` string, date-time, nullable
  - `created_at` string, date-time, nullable
  - `updated_at` string, date-time, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-11-03** `5579352ae05e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cyberdesk-hq/apis/cyberdesk-cloud/changes/v1/provider-credentials/:slot/put.md)

---

[API](https://skmtc.dev/cyberdesk-hq/apis/cyberdesk-cloud.md) - [All operations](https://skmtc.dev/cyberdesk-hq/apis/cyberdesk-cloud/llms.txt) - [OpenAPI document](https://skmtc.dev/cyberdesk-hq/apis/cyberdesk-cloud/revisions/5579352ae05e?raw)
