# Create providers

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

> Adds an identity provider your people can sign in with, or a service your applications send through — a social or enterprise login, an email or SMS sender, a storage or payment connector.

`POST /v1/iam/providers`

> [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` |
| **Method**    | `POST`                                  |
| **Operation** | `addProvider`                           |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`  |

Adds an identity provider your people can sign in with, or a
service your applications send through — a social or enterprise login, an email
or SMS sender, a storage or payment connector.

A provider is configured once and then switched on per application, so several
applications can share one set of credentials.

## Request

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

| Field                    | In   | Type               | Required | Description |
| ------------------------ | ---- | ------------------ | -------- | ----------- |
| `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.providerResult | ok                |
| `202`     | Approval           | held for approval |
| `default` | problem-details    | refused           |

`200` body — 51 fields.

| Field                             | In   | Type               | Always | Description |
| --------------------------------- | ---- | ------------------ | ------ | ----------- |
| `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 create
```

**SDK**

**.ts**

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

const api = new IamApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.addProvider({ 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).add_provider(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.AddProvider(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::add_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).addProvider();
```

**HTTP**

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

**MCP**

Tool `iam`, op `addProvider` — 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": "addProvider",
           "input": {
             "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)
