---
title: "CreateIngestKey"
---

> 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 › ingestKeys

`POST /v1/organizations/{orgId}/projects/{projectId}/ingest-keys`

## Authentication

Requires one of the following:

- `apiKey`, http, header `Authorization`
- `oauth`, http, header `Authorization`
- `sessionCookie`, apiKey, in cookie

## Path parameters

- `CreateIngestKey.path.orgId` (string, required)
- `CreateIngestKey.path.projectId` (string, required)

## Header parameters

- `CreateIngestKey.header.idempotency-key` (string, optional)

## Request body

_Required._

- `CreateIngestKey.name` (string, required)
- `CreateIngestKey.allowedActions` (array<string>, required)
  - maxLength 128; pattern `^[a-z]{2,32}(\.[a-z][A-Za-z]*){1,2}$`

## Example request

```json
{
  "name": "string",
  "allowedActions": [
    "string"
  ]
}
```

## Code samples

### cURL

```curl
curl --request POST \
  --url https://orgs.ezghcloud.com/v1/organizations/string/projects/string/ingest-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "string",
  "allowedActions": [
    "string"
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://orgs.ezghcloud.com/v1/organizations/string/projects/string/ingest-keys';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({name: 'string', allowedActions: ['string']})
};

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/projects/string/ingest-keys"

payload = {
    "name": "string",
    "allowedActions": ["string"]
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 201

Success

#### Example

```json
{
  "ingestKey": {
    "id": "string",
    "slug": "string",
    "name": "string",
    "resourceName": "string",
    "organizationId": "string",
    "projectId": "string",
    "prefix": "string",
    "allowedActions": [
      "string"
    ],
    "createdBy": {
      "type": "user",
      "id": "string",
      "displayName": "string"
    },
    "createdAt": "string",
    "revokedAt": "string"
  },
  "token": "string"
}
```

- `CreateIngestKey.response.201.ingestKey` (object, required)
  - `CreateIngestKey.response.201.ingestKey.id` (string, required)
  - `CreateIngestKey.response.201.ingestKey.slug` (string, required)
  - `CreateIngestKey.response.201.ingestKey.name` (string, required)
  - `CreateIngestKey.response.201.ingestKey.resourceName` (string, required)
  - `CreateIngestKey.response.201.ingestKey.organizationId` (string, required)
  - `CreateIngestKey.response.201.ingestKey.projectId` (string, required)
  - `CreateIngestKey.response.201.ingestKey.prefix` (string, required)
  - `CreateIngestKey.response.201.ingestKey.allowedActions` (array<string>, required)
  - `CreateIngestKey.response.201.ingestKey.createdBy` (object, required)
    - `CreateIngestKey.response.201.ingestKey.createdBy.type` (string, required)
      - one of `"user"`, `"oauth"`, `"apiKey"`, `"bot"`
    - `CreateIngestKey.response.201.ingestKey.createdBy.id` (string, required)
    - `CreateIngestKey.response.201.ingestKey.createdBy.displayName` (any of, required)
      - any of: `string`, `null`
  - `CreateIngestKey.response.201.ingestKey.createdAt` (string, required)
  - `CreateIngestKey.response.201.ingestKey.revokedAt` (any of, required)
    - any of: `string`, `null`
- `CreateIngestKey.response.201.token` (string, required)

### 400

InvalidRequest

#### Example

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

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

### 401

Unauthenticated

#### Example

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

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

### 403

AccessDenied | ForbiddenOrigin

#### Example

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

Any of:

- [AccessDeniedEncoded](/orgs-api/schemas/AccessDeniedEncoded/)
- [ForbiddenOriginEncoded](/orgs-api/schemas/ForbiddenOriginEncoded/)

### 404

NotFound

#### Example

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

- `CreateIngestKey.response.404.error` (object, required)
  - `CreateIngestKey.response.404.error.code` (string, required)
    - one of `"not_found"`
  - `CreateIngestKey.response.404.error.message` (string, required)

### 409

IdempotencyConflict | IdempotencyInProgress

#### Example

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

Any of:

- [IdempotencyConflictEncoded](/orgs-api/schemas/IdempotencyConflictEncoded/)
- [IdempotencyInProgressEncoded](/orgs-api/schemas/IdempotencyInProgressEncoded/)

### 429

TooManyRequests

#### Example

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

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

### 500

InternalError

#### Example

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

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

### 503

Unavailable

#### Example

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

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


Source: https://docs.ezghcloud.com/orgs-api/ingestKeys/CreateIngestKey/index.md
