# Replace providers

URL: https://docs.hanzo.ai/docs/openapi/iam/updateprovider

> Changes a provider's settings or rotates the credentials it holds.

`PUT /v1/iam/providers/{owner}/{name}`

> [IAM →](https://docs.hanzo.ai/docs/openapi/iam) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                        |
| ------------- | ------------------------------------------------------ |
| **Address**   | `https://api.hanzo.ai/v1/iam/providers/{owner}/{name}` |
| **Method**    | `PUT`                                                  |
| **Operation** | `updateProvider`                                       |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`                 |

Changes a provider's settings or rotates the credentials it
holds. The change takes effect on the next sign-in through it — sessions
already issued are unaffected.

A provider that is not there answers "nothing changed" rather than an error, so
the call is safe to repeat.

## Request

52 fields, body `application/json` (required).

| Field                    | In   | Type               | Required | Description |
| ------------------------ | ---- | ------------------ | -------- | ----------- |
| `owner`                  | path | string             | yes      |             |
| `name`                   | path | string             | yes      |             |
| `appId`                  | body | string             | —        |             |
| `bucket`                 | body | string             | —        |             |
| `category`               | body | string             | —        |             |
| `cert`                   | body | string             | —        |             |
| `clientId`               | body | string             | —        |             |
| `clientId2`              | body | string             | —        |             |
| `clientSecret`           | body | string             | —        |             |
| `clientSecret2`          | body | string             | —        |             |
| `content`                | body | string             | —        |             |
| `createdAt`              | body | string (date-time) | —        |             |
| `createdTime`            | body | string             | —        |             |
| `customAuthUrl`          | body | string             | —        |             |
| `customLogo`             | body | string             | —        |             |
| `customTokenUrl`         | body | string             | —        |             |
| `customUserInfoUrl`      | body | string             | —        |             |
| `deleted`                | body | boolean            | —        |             |
| `disableSsl`             | body | boolean            | —        |             |
| `displayName`            | body | string             | —        |             |
| `domain`                 | body | string             | —        |             |
| `emailRegex`             | body | string             | —        |             |
| `enablePkce`             | body | boolean            | —        |             |
| `enableProxy`            | body | boolean            | —        |             |
| `enableSignAuthnRequest` | body | boolean            | —        |             |
| `endpoint`               | body | string             | —        |             |
| `host`                   | body | string             | —        |             |
| `httpHeaders`            | body | object             | —        |             |
| `httpHeaders.*`          | body | string             | —        |             |
| `id`                     | body | string             | —        |             |
| `idP`                    | body | string             | —        |             |
| `intranetEndpoint`       | body | string             | —        |             |
| `issuerUrl`              | body | string             | —        |             |
| `metadata`               | body | string             | —        |             |
| `method`                 | body | string             | —        |             |
| `name`                   | body | string             | —        |             |
| `owner`                  | body | string             | —        |             |
| `pathPrefix`             | body | string             | —        |             |
| `port`                   | body | integer (int64)    | —        |             |
| `providerUrl`            | body | string             | —        |             |
| `receiver`               | body | string             | —        |             |
| `regionId`               | body | string             | —        |             |
| `scopes`                 | body | string             | —        |             |
| `signName`               | body | string             | —        |             |
| `sslMode`                | body | string             | —        |             |
| `subType`                | body | string             | —        |             |
| `templateCode`           | body | string             | —        |             |
| `title`                  | body | string             | —        |             |
| `type`                   | body | string             | —        |             |
| `updatedAt`              | body | string (date-time) | —        |             |
| `userMapping`            | body | object             | —        |             |
| `userMapping.*`          | body | string             | —        |             |

## Response

| Status    | Body               | Meaning           |
| --------- | ------------------ | ----------------- |
| `200`     | iam.mutationResult | ok                |
| `202`     | Approval           | held for approval |
| `default` | problem-details    | refused           |

`200` body — 52 fields.

| Field                             | In   | Type               | Always | Description |
| --------------------------------- | ---- | ------------------ | ------ | ----------- |
| `affected`                        | body | boolean            | —      |             |
| `provider`                        | body | iam.Provider       | —      |             |
| `provider.appId`                  | body | string             | —      |             |
| `provider.bucket`                 | body | string             | —      |             |
| `provider.category`               | body | string             | —      |             |
| `provider.cert`                   | body | string             | —      |             |
| `provider.clientId`               | body | string             | —      |             |
| `provider.clientId2`              | body | string             | —      |             |
| `provider.clientSecret`           | body | string             | —      |             |
| `provider.clientSecret2`          | body | string             | —      |             |
| `provider.content`                | body | string             | —      |             |
| `provider.createdAt`              | body | string (date-time) | —      |             |
| `provider.createdTime`            | body | string             | —      |             |
| `provider.customAuthUrl`          | body | string             | —      |             |
| `provider.customLogo`             | body | string             | —      |             |
| `provider.customTokenUrl`         | body | string             | —      |             |
| `provider.customUserInfoUrl`      | body | string             | —      |             |
| `provider.deleted`                | body | boolean            | —      |             |
| `provider.disableSsl`             | body | boolean            | —      |             |
| `provider.displayName`            | body | string             | —      |             |
| `provider.domain`                 | body | string             | —      |             |
| `provider.emailRegex`             | body | string             | —      |             |
| `provider.enablePkce`             | body | boolean            | —      |             |
| `provider.enableProxy`            | body | boolean            | —      |             |
| `provider.enableSignAuthnRequest` | body | boolean            | —      |             |
| `provider.endpoint`               | body | string             | —      |             |
| `provider.host`                   | body | string             | —      |             |
| `provider.httpHeaders`            | body | object             | —      |             |
| `provider.httpHeaders.*`          | body | string             | —      |             |
| `provider.id`                     | body | string             | —      |             |
| `provider.idP`                    | body | string             | —      |             |
| `provider.intranetEndpoint`       | body | string             | —      |             |
| `provider.issuerUrl`              | body | string             | —      |             |
| `provider.metadata`               | body | string             | —      |             |
| `provider.method`                 | body | string             | —      |             |
| `provider.name`                   | body | string             | —      |             |
| `provider.owner`                  | body | string             | —      |             |
| `provider.pathPrefix`             | body | string             | —      |             |
| `provider.port`                   | body | integer (int64)    | —      |             |
| `provider.providerUrl`            | body | string             | —      |             |
| `provider.receiver`               | body | string             | —      |             |
| `provider.regionId`               | body | string             | —      |             |
| `provider.scopes`                 | body | string             | —      |             |
| `provider.signName`               | body | string             | —      |             |
| `provider.sslMode`                | body | string             | —      |             |
| `provider.subType`                | body | string             | —      |             |
| `provider.templateCode`           | body | string             | —      |             |
| `provider.title`                  | body | string             | —      |             |
| `provider.type`                   | body | string             | —      |             |
| `provider.updatedAt`              | body | string (date-time) | —      |             |
| `provider.userMapping`            | body | object             | —      |             |
| `provider.userMapping.*`          | body | string             | —      |             |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo iam providers owner set <owner> <name>
```

**SDK**

**.ts**

```ts
import { Configuration, IamApi } from 'hanzoai';

const api = new IamApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.updateProvider({ owner: 'owner', name: 'name', appId: "<appId>", bucket: "<bucket>" });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import IamApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = IamApi(client).update_provider(owner='owner', name='name', app_id="<appId>", bucket="<bucket>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.IamAPI.UpdateProvider(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, iam_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = iam_api::update_provider(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.IamApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new IamApi(client).updateProvider();
```

**HTTP**

```bash
curl -X PUT https://api.hanzo.ai/v1/iam/providers/<owner>/<name> \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "appId": "<appId>",
       "bucket": "<bucket>"
     }'
```

**MCP**

Tool `iam`, op `updateProvider` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "iam",
         "arguments": {
           "op": "updateProvider",
           "input": {
             "owner": "<owner>",
             "name": "<name>",
             "appId": "<appId>",
             "bucket": "<bucket>"
           }
         }
       }
     }'
```

---

[IAM API](https://docs.hanzo.ai/docs/openapi/iam) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
