> For the complete documentation index, see [llms.txt](https://docs.groundcover.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/create-ingestion-key.md).

# Create Ingestion Key

Create a new ingestion key.

### Endpoint

**POST** `/api/rbac/ingestion-keys/create`

### Authentication

This endpoint requires API Key authentication via the Authorization header.

### Headers

```bash
Authorization: Bearer <YOUR_API_KEY>
Content-Type: application/json
```

### Request Body

Required and optional fields for creating an ingestion key:

```json
{
  "name": "string",
  "type": "sensor|thirdParty|rum"
}
```

| Parameter | Type   | Required | Description                                                        |
| --------- | ------ | -------- | ------------------------------------------------------------------ |
| `name`    | string | **Yes**  | Unique name for the ingestion key (must be lowercase with hyphens) |
| `type`    | string | **Yes**  | Key type (`"sensor"`, `"thirdParty"`, `"rum"`)                     |
| `tags`    | array  | No       | Array of tags to associate with the key                            |

### Examples

#### Create Basic Sensor Key

```bash
curl -L \
  --request POST \
  --url 'https://api.groundcover.com/api/rbac/ingestion-keys/create' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "production-k8s-sensor",
    "type": "sensor"
  }'
```

#### Create Third-Party Integration Key

```bash
curl -L \
  --request POST \
  --url 'https://api.groundcover.com/api/rbac/ingestion-keys/create' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "otel-collector-prod",
    "type": "thirdParty",
    "tags": ["otel", "production"]
  }'
```

#### Create RUM Key with Configuration

```bash
curl -L \
  --request POST \
  --url 'https://api.groundcover.com/api/rbac/ingestion-keys/create' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "frontend-rum-monitoring",
    "type": "rum",
    "tags": ["rum", "frontend", "web"]
  }'
```

### Response

#### Response Schema

```json
{
  "id": "string",
  "name": "string", 
  "createdBy": "string",
  "creationDate": "string",
  "key": "string",
  "type": "string",
  "tags": ["string"]
}
```

#### Response Example

```json
{
  "id": "12345678-1234-1234-1234-123456789abc",
  "name": "production-k8s-sensor",
  "createdBy": "user@company.com",
  "creationDate": "2025-08-31T14:09:15Z",
  "key": "gcik_AEBAAAE4_XXXXXXXXX_XXXXXXXXX_XXXXXXXX",
  "type": "sensor",
  "remoteConfig": true,
  "tags": []
}
```

### Key Types

| Type           | Description                                             | Default remoteConfig |
| -------------- | ------------------------------------------------------- | -------------------- |
| `"sensor"`     | Keys for groundcover sensors and agents                 | `true`               |
| `"thirdParty"` | Keys for third-party integrations (OpenTelemetry, etc.) | `false`              |
| `"rum"`        | Keys for Real User Monitoring data ingestion            | `false`              |

### Verification

To verify the key was created successfully, use the List Ingestion Keys endpoint:

```bash
curl -L \
  --request POST \
  --url 'https://api.groundcover.com/api/rbac/ingestion-keys/list' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "production-k8s-sensor"
  }'
```

### Naming Requirements

* **Names must be lowercase** with hyphens as separators
* **No capital letters, spaces, or special characters** (except hyphens)
* **Examples of valid names**: `production-k8s-sensor`, `otel-staging-api`, `rum-frontend`
* **Examples of invalid names**: `Production-K8s`, `OTEL_API`, `rum frontend`

### Related Documentation

For comprehensive information about ingestion keys, including usage and management, see:

* [Ingestion Keys](https://docs.groundcover.com/use-groundcover/remote-access-and-apis/ingestion-keys)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/create-ingestion-key.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
