Skip to main content
PATCH
https://api.keywordsai.co
/
api
/
providers
/
{pk}
import requests

provider_pk = 123
url = f"https://api.keywordsai.co/api/providers/{provider_pk}/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "provider_name": "Updated Azure Provider",
    "api_key": "new-api-key"
}

response = requests.patch(url, headers=headers, json=payload)
print(response.json())
{
  "id": "my-azure-provider",
  "provider_id": "my-azure-provider",
  "provider_name": "Updated Azure Provider",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T12:00:00Z"
}
Update a specific custom provider. Only the provided fields will be updated - other fields remain unchanged.
Restrictions:
  • The provider_id field is read-only and cannot be changed
  • Only the owning organization can update their custom providers
  • Managed providers (is_managed: true) cannot have critical fields modified

Path parameters

pk
integer
required
The provider’s primary key ID to update.
123

Request body

All fields are optional. Only provide the fields you want to update.
provider_name
string
Human-readable provider name.
"provider_name": "Updated Azure Provider"
api_key
string
API key for the provider (write-only, never returned in responses).
"api_key": "new-api-key"
extra_kwargs
object
Additional provider configuration (write-only, never returned in responses).
{
  "extra_kwargs": {
    "base_url": "https://updated-endpoint.openai.azure.com",
    "timeout": 90
  }
}

Response

Returns the updated provider object without sensitive fields.
{
  "id": "my-azure-provider",
  "provider_id": "my-azure-provider",
  "provider_name": "Updated Azure Provider",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T12:00:00Z"
}
import requests

provider_pk = 123
url = f"https://api.keywordsai.co/api/providers/{provider_pk}/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "provider_name": "Updated Azure Provider",
    "api_key": "new-api-key"
}

response = requests.patch(url, headers=headers, json=payload)
print(response.json())