---
title: "CreateOidcApiKey"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: EZGH Cloud organizations and IAM › oidcApiKeys

`POST /v1/organizations/{orgId}/bots/{botId}/oidc-api-keys`

## Path parameters

- `CreateOidcApiKey.path.orgId` (string, required)
- `CreateOidcApiKey.path.botId` (string, required)

## Request body

_Required._

- `CreateOidcApiKey.token` (string, required)
  - minLength 1; maxLength 16384
- `CreateOidcApiKey.name` (string, optional)
- `CreateOidcApiKey.expiresInSeconds` (integer, optional)
  - min 900; max 43200

## Example request

```json
{
  "token": "string",
  "name": "string",
  "expiresInSeconds": 900
}
```

## Code samples

### cURL

```curl
curl --request POST \
  --url https://orgs.ezghcloud.com/v1/organizations/string/bots/string/oidc-api-keys \
  --header 'Content-Type: application/json' \
  --data '
{
  "token": "string",
  "name": "string",
  "expiresInSeconds": 900
}
'
```

### TypeScript

```typescript
const url = 'https://orgs.ezghcloud.com/v1/organizations/string/bots/string/oidc-api-keys';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({token: 'string', name: 'string', expiresInSeconds: 900})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://orgs.ezghcloud.com/v1/organizations/string/bots/string/oidc-api-keys"

payload = {
    "token": "string",
    "name": "string",
    "expiresInSeconds": 900
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

Success

#### Example

```json
{
  "apiKey": {
    "id": "string",
    "organizationId": "string",
    "name": "string",
    "prefix": "string",
    "owner": {
      "type": "user",
      "id": "string"
    },
    "createdBy": "string",
    "createdAt": "string",
    "lastUsedAt": "string",
    "expiresAt": "string",
    "sourceIdentity": {
      "type": "SsoUser",
      "principalId": "string",
      "userName": "string"
    }
  },
  "token": "string"
}
```

- `CreateOidcApiKey.response.201.apiKey` (object, required)
  - `CreateOidcApiKey.response.201.apiKey.id` (string, required)
  - `CreateOidcApiKey.response.201.apiKey.organizationId` (string, required)
  - `CreateOidcApiKey.response.201.apiKey.name` (string, required)
  - `CreateOidcApiKey.response.201.apiKey.prefix` (string, required)
  - `CreateOidcApiKey.response.201.apiKey.owner` (object, required)
    - `CreateOidcApiKey.response.201.apiKey.owner.type` (string, required)
      - one of `"user"`, `"bot"`
    - `CreateOidcApiKey.response.201.apiKey.owner.id` (string, required)
  - `CreateOidcApiKey.response.201.apiKey.createdBy` (string, required)
  - `CreateOidcApiKey.response.201.apiKey.createdAt` (string, required)
  - `CreateOidcApiKey.response.201.apiKey.lastUsedAt` (any of, required)
    - any of: `string`, `null`
  - `CreateOidcApiKey.response.201.apiKey.expiresAt` (any of, required)
    - any of: `string`, `null`
  - `CreateOidcApiKey.response.201.apiKey.sourceIdentity` (any of, required)
    - any of: `object`, `null`
- `CreateOidcApiKey.response.201.token` (string, required)

### 400

InvalidRequest

#### Example

```json
{
  "error": {
    "code": "invalid_request",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `CreateOidcApiKey.response.400.error` (object, required)
  - `CreateOidcApiKey.response.400.error.code` (string, required)
    - one of `"invalid_request"`
  - `CreateOidcApiKey.response.400.error.message` (string, required)
  - `CreateOidcApiKey.response.400.error.issues` (array<object>, optional)
    - `CreateOidcApiKey.response.400.error.issues.path` (string, required)
    - `CreateOidcApiKey.response.400.error.issues.message` (string, required)

### 401

Unauthenticated

#### Example

```json
{
  "error": {
    "code": "unauthenticated",
    "message": "string"
  }
}
```

- `CreateOidcApiKey.response.401.error` (object, required)
  - `CreateOidcApiKey.response.401.error.code` (string, required)
    - one of `"unauthenticated"`
  - `CreateOidcApiKey.response.401.error.message` (string, required)

### 409

LimitExceeded

#### Example

```json
{
  "error": {
    "code": "limit_exceeded",
    "message": "string"
  }
}
```

- `CreateOidcApiKey.response.409.error` (object, required)
  - `CreateOidcApiKey.response.409.error.code` (string, required)
    - one of `"limit_exceeded"`
  - `CreateOidcApiKey.response.409.error.message` (string, required)

### 429

TooManyRequests

#### Example

```json
{
  "error": {
    "code": "too_many_requests",
    "message": "string"
  }
}
```

- `CreateOidcApiKey.response.429.error` (object, required)
  - `CreateOidcApiKey.response.429.error.code` (string, required)
    - one of `"too_many_requests"`
  - `CreateOidcApiKey.response.429.error.message` (string, required)

### 500

InternalError

#### Example

```json
{
  "error": {
    "code": "internal_error",
    "message": "string"
  }
}
```

- `CreateOidcApiKey.response.500.error` (object, required)
  - `CreateOidcApiKey.response.500.error.code` (string, required)
    - one of `"internal_error"`
  - `CreateOidcApiKey.response.500.error.message` (string, required)

### 503

Unavailable

#### Example

```json
{
  "error": {
    "code": "unavailable",
    "message": "string"
  }
}
```

- `CreateOidcApiKey.response.503.error` (object, required)
  - `CreateOidcApiKey.response.503.error.code` (string, required)
    - one of `"unavailable"`
  - `CreateOidcApiKey.response.503.error.message` (string, required)


Source: https://docs.ezghcloud.com/orgs-api/oidcApiKeys/CreateOidcApiKey/index.md
