> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://contentful.com/developers/docs/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://contentful.com/_mcp/server. # Update an AI provider PATCH https://api.contentful.com/organizations/{organization_id}/ai/providers/{provider_id} Content-Type: application/json-patch+json Use this endpoint to update a specific AI provider using [JSON Patch](http://jsonpatch.com/) format. This is useful for updating credentials, configuration, or selected models without replacing the entire provider configuration. Reference: https://contentful.com/developers/docs/references/content-management-api/ai-providers/update-an-ai-provider ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `organization_id` (string, required) — ID of the organization - `provider_id` (string, required) — ID of the AI provider ### Body (application/json-patch+json) This endpoint expects a map from string to any. - `map from string to any` ## Response ### 200 OK - Request successful - `map from string to any` ## Examples **Request** ```json [ { "op": "replace", "path": "/credentials", "value": { "apiKey": "a-new-gemini-api-key" } } ] ``` **Response** ```json { "selectedModels": [ { "id": "gemini-2.0-flash-exp", "name": "Gemini 2.0 Flash" }, { "id": "gemini-1.5-pro", "name": "Gemini 1.5 Pro" } ], "sys": { "createdAt": "2025-11-16T10:30:00Z", "createdBy": { "sys": { "id": "1xGZIRXr2WPnsLkKfREo0z", "linkType": "User", "type": "Link" } }, "id": "3aab1ce0-442c-42eb-b1e4-c17d9206189a", "organization": { "sys": { "id": "0D9ZC8rLWiw6x5qizZGiRs", "linkType": "Organization", "type": "Link" } }, "updatedAt": "2025-11-17T14:45:00Z", "updatedBy": { "sys": { "id": "1xGZIRXr2WPnsLkKfREo0z", "linkType": "User", "type": "Link" } }, "verifiedAt": "2025-11-16T10:30:01Z" }, "type": "google-gemini" } ``` **SDK Code** ```android Android SDK currently doesn't implement this endpoint. ``` ```java Java SDK currently doesn't implement this endpoint. ``` ```kotlin Kotlin SDK currently doesn't implement this endpoint. ``` ```swift Swift We currently don't provide a CMA SDK for this platform. ``` ```js-legacy JavaScript (legacy) SDK currently doesn't implement this endpoint. ``` ```javascript JavaScript SDK currently doesn't implement this endpoint. ``` ```php PHP SDK currently doesn't implement this endpoint. ``` ```ruby Ruby SDK currently doesn't implement this endpoint. ``` ```python Python SDK currently doesn't implement this endpoint. ``` ```.net .NET SDK currently doesn't implement this endpoint. ```