---
title: "Edit AI Provider"
method: PATCH
path: "/users/{userId}/ai/providers/{aiProviderId}"
tags: ["AI"]
---

# Edit AI Provider

`PATCH /users/{userId}/ai/providers/{aiProviderId}`

## Request

- Base URL: `https://api.crowdin.com/api/v2`
- URL: `https://api.crowdin.com/api/v2/users/{userId}/ai/providers/{aiProviderId}`
- Auth: none declared
- TypeScript: <https://skmtc.dev/crowdin/apis/crowdin-api-v2/docs/users/:userId/ai/providers/:aiProviderId/patch.ts> (a function with typed inputs; its response is checked against the schema)

**Required scopes:** `ai.provider` (Read and Write).

## Path parameters

- `userId` integer, required
- `aiProviderId` integer, required

## Request body

- AiProviderOperation[]: A JSON Patch document as defined by <a href="https://tools.ietf.org/html/rfc6902#section-3" target="_blank">RFC 6902</a>
  - `op` 'replace' | 'test', required: Patch operation to perform
  - `path` '/name' | '/type' | '/credentials' | '/config' | '/isEnabled' | '/useSystemCredentials', json-pointer, required: A JSON Pointer as defined by <a href="https://tools.ietf.org/html/rfc6901" target="_blank">RFC 6901</a>

## Response `200`

AI provider was successfully updated

- CrowdinAiProviderResource: Base schema of resource container. Container is a wrapper object that contains payload in required `data` property and provides space for adding any other metadata.
  - `data` CrowdinAiProvider, required
    - `id` integer
    - `name` string
    - `type` string
    - `credentials` union
      - object
        - `apiKey` string, required: Api key
        - `baseUrl` string: Override the provider API base URL (e.g. a self-hosted proxy or third-party gateway)
        - `headers` object: Custom HTTP headers sent with every request to the provider. Authorization headers are managed by the provider and can't be overridden unless `sendCustomHeadersOnly` is `true`.
        - `sendCustomHeadersOnly` boolean: If `true`, only the headers from `headers` are sent — the headers Crowdin manages for this provider (`Authorization`) are skipped, so the request must carry everything the endpoint requires. Default is `false`. __Note:__ Can only be set to `true` when `headers` contains at least one header
      - object
        - `resourceName` string, required: Resource name
        - `apiKey` string, required: Api key
        - `deploymentName` string, required: Deployment name
        - `apiVersion` string, required: Api version
        - `baseUrl` string: Override the provider API base URL (e.g. a self-hosted proxy or third-party gateway)
        - `headers` object: Custom HTTP headers sent with every request to the provider. Authorization headers are managed by the provider and can't be overridden unless `sendCustomHeadersOnly` is `true`.
        - `sendCustomHeadersOnly` boolean: If `true`, only the headers from `headers` are sent — the headers Crowdin manages for this provider (`api-key`) are skipped, so the request must carry everything the endpoint requires. Default is `false`. __Note:__ Can only be set to `true` when `headers` contains at least one header
      - object
        - `project` string, required: Project
        - `region` string, required: Region
        - `serviceAccountKey` object: Service account key. Required if `workloadIdentityFederationAudience` is not provided.
        - `workloadIdentityFederationAudience` string: Workload Identity Federation audience. Required if `serviceAccountKey` is not provided.
        - `serviceAccountEmail` string: Optional service account email to impersonate when using Workload Identity Federation.
        - `baseUrl` string: Override the provider API base URL (e.g. a self-hosted proxy or third-party gateway)
        - `headers` object: Custom HTTP headers sent with every request to the provider. Authorization headers are managed by the provider and can't be overridden unless `sendCustomHeadersOnly` is `true`.
        - `sendCustomHeadersOnly` boolean: If `true`, only the headers from `headers` are sent — the headers Crowdin manages for this provider (`Authorization`) are skipped, so the request must carry everything the endpoint requires. Default is `false`. __Note:__ Can only be set to `true` when `headers` contains at least one header. Can't be used with `workloadIdentityFederationAudience`
      - object
        - `apiKey` string, required: Api key
        - `baseUrl` string: Override the provider API base URL (e.g. a self-hosted proxy or third-party gateway)
        - `headers` object: Custom HTTP headers sent with every request to the provider. Authorization headers are managed by the provider and can't be overridden unless `sendCustomHeadersOnly` is `true`.
        - `sendCustomHeadersOnly` boolean: If `true`, only the headers from `headers` are sent — the headers Crowdin manages for this provider (`Authorization`, `Accept`) are skipped, so the request must carry everything the endpoint requires. Default is `false`. __Note:__ Can only be set to `true` when `headers` contains at least one header
      - object
        - `apiKey` string, required: Api key
        - `baseUrl` string: Override the provider API base URL (e.g. a self-hosted proxy or third-party gateway)
        - `headers` object: Custom HTTP headers sent with every request to the provider. Authorization headers are managed by the provider and can't be overridden unless `sendCustomHeadersOnly` is `true`.
        - `sendCustomHeadersOnly` boolean: If `true`, only the headers from `headers` are sent — the headers Crowdin manages for this provider (`x-api-key`, `anthropic-version`, `accept`) are skipped, so the request must carry everything the endpoint requires. Default is `false`. __Note:__ Can only be set to `true` when `headers` contains at least one header
      - object
        - `apiKey` string, required: Api key
        - `baseUrl` string: Override the provider API base URL (e.g. a self-hosted proxy or third-party gateway)
        - `headers` object: Custom HTTP headers sent with every request to the provider. Authorization headers are managed by the provider and can't be overridden unless `sendCustomHeadersOnly` is `true`.
        - `sendCustomHeadersOnly` boolean: If `true`, only the headers from `headers` are sent — the headers Crowdin manages for this provider (`Authorization`) are skipped, so the request must carry everything the endpoint requires. Default is `false`. __Note:__ Can only be set to `true` when `headers` contains at least one header
      - object
        - `apiKey` string, required: API key
        - `projectId` string, required: Project ID
        - `region` string, required: Region
        - `baseUrl` string: Override the provider API base URL (e.g. a self-hosted proxy or third-party gateway)
        - `headers` object: Custom HTTP headers sent with every request to the provider. Authorization headers are managed by the provider and can't be overridden unless `sendCustomHeadersOnly` is `true`.
        - `sendCustomHeadersOnly` boolean: If `true`, only the headers from `headers` are sent — the headers Crowdin manages for this provider (`Authorization`) are skipped, so the request must carry everything the endpoint requires. Default is `false`. __Note:__ Can only be set to `true` when `headers` contains at least one header
      - object
        - `apiKey` string, required: API key
        - `baseUrl` string: Override the provider API base URL (e.g. a self-hosted proxy or third-party gateway)
        - `headers` object: Custom HTTP headers sent with every request to the provider. Authorization headers are managed by the provider and can't be overridden unless `sendCustomHeadersOnly` is `true`.
        - `sendCustomHeadersOnly` boolean: If `true`, only the headers from `headers` are sent — the headers Crowdin manages for this provider (`Authorization`) are skipped, so the request must carry everything the endpoint requires. Default is `false`. __Note:__ Can only be set to `true` when `headers` contains at least one header
      - object
        - `deployments` object[], required: Deployed models of the Foundry project. Each entry is self-contained — copy its Target URI and API key from the deployment details page in the Foundry portal (deployments of one project may live on different connected Azure resources)
          - `deploymentName` string, required: Deployment name (used as the model id)
          - `targetUri` string, required: Deployment Target URI (its path encodes the API the deployment is served by, e.g. /anthropic/v1/messages or /openai/v1/chat/completions)
          - `apiKey` string, required: API key of the Azure resource hosting the deployment
        - `headers` object: Custom HTTP headers sent with every request to the provider. Authorization headers are managed by the provider and can't be overridden unless `sendCustomHeadersOnly` is `true`.
        - `sendCustomHeadersOnly` boolean: If `true`, only the headers from `headers` are sent — the headers Crowdin manages for this provider (`api-key` on the OpenAI route, `x-api-key`, `anthropic-version` and `accept` on the Anthropic route) are skipped, so the request must carry everything the endpoint requires. Default is `false`. __Note:__ Can only be set to `true` when `headers` contains at least one header
      - object
        - `identifier` string, required: Crowdin App identifier
        - `key` string, required: AI Provider module key
    - `config` object: AI provider configuration
      - `actionRules` AiProviderCrowdinConfigurationActionRule[]: Configuration of available models for actions
        - `action` 'pre_translate' | 'qa_check'
        - `availableAiModelIds` string[]: Available AI provider model ids. Get via [List AI Provider Models](#operation/api.ai.providers.models.getMany)
    - `isEnabled` boolean
    - `useSystemCredentials` boolean
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `promptsCount` number

## Other responses

- `400`: Invalid Request Parameters
- `401`: Unauthorized
- `403`: Forbidden
- `404`: AI provider with specified user id and id was not found
- `405`: Method Not Allowed

---

[API](https://skmtc.dev/crowdin/apis/crowdin-api-v2.md) - [All operations](https://skmtc.dev/crowdin/apis/crowdin-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/crowdin/apis/crowdin-api-v2/revisions/27aae7751699?raw)
