---
title: "Create a new data exporter config"
method: POST
path: "/api/data-exporter-configs"
tags: ["data-exporter-configs"]
---

# Create a new data exporter config

`POST /api/data-exporter-configs`

Create a new data exporter config

## Request body

- DataExporterConfig — Settings to export Otorshi events
  - `bufferSize` integer — buffer size
  - `config` union — Data Exporter config
    - ElasticConfig — The configuration for elastic access
      - `clusterUri` string, required — URL of the elastic cluster
      - `headers` object, required — Additionnal http headers
      - `index` string, required — Index for events. Default is otoroshi-events
      - `password` string, required — Optional password
      - `type` string, required — Type of events. Default is event
      - `user` string, required — Optional user
    - KafkaConfig — The configuration for kafka access
      - `keyPass` string — Optional keypass
      - `keyStore` string — Optional path to keystore
      - `servers` string[], required — URLs of the kafka servers
      - `topic` string — Optional kafka topic (otoroshi-events by default)
      - `trustore` string — Optional path to trustore
    - PulsarDataExporterConfig — The configuration for kafka access
      - `namespace` string, required — Namespace
      - `tenant` string, required — Tenant
      - `topic` string, required — Topic
      - `uri` string[], required — URI of the pulsar server
    - FileDataExporterConfig
      - `path` string, required — Path to file
    - MailerGenericExporterConfig
      - `headers` object — Optional headers
      - `to` string[] — Email adresses of recipents
      - `type` 'generic', required — Type of mailer
      - `url` string — Url of mailer
    - MailerConsoleExporterConfig
      - `type` 'generic' — Type of mailer
    - MailerMailgunExporterConfig
      - `apiKey` string — Mailgun apiKey
      - `domain` string — Mailgun domain
      - `eu` boolean — Whether the mailgun server is european
      - `to` string[] — Email adresses of recipents
      - `type` 'mailgun', required — Type of mailer
    - MailerMailjetExporterConfig
      - `apiKeyPrivate` string — Mailjet private apiKey
      - `apiKeyPublic` string — Mailjet public apiKey
      - `to` string[] — Email adresses of recipents
      - `type` 'mailjet', required — Type of mailer
    - MailerSendgridExporterConfig
      - `apiKeyPublic` string — Sendgrid apiKey
      - `to` string[] — Email adresses of recipents
      - `type` 'sendgrid', required — Type of mailer
    - ConsoleDataExporterConfig
    - CustomDataExporterConfig
      - `config` object, required — Custom data exporter config
      - `ref` string, required — Script Ref
  - `desc` string — Description
  - `enabled` string — Boolean
  - `filtering` Filtering
    - `exclude` object[] — Excluding pattern
    - `include` object[] — Including pattern
  - `groupDuration` integer — duration
  - `groupSize` integer — Group size
  - `id` string — Id
  - `jsonWorkers` integer — nb workers
  - `location` Location
    - `teams` object[], required — Team ids
    - `tenant` string, required — Tenant id
  - `metadata` object — Metadata
  - `name` string — Name
  - `projection` object — projection
  - `sendWorkers` integer — send workers
  - `typ` 'kafka' | 'pulsar' | 'file' | 'mailer' | 'elastic' | 'console' | 'custom' — Type of data exporter

## Response `200`

Successful operation

- DataExporterConfig — Settings to export Otorshi events
  - `bufferSize` integer — buffer size
  - `config` union — Data Exporter config
    - ElasticConfig — The configuration for elastic access
      - `clusterUri` string, required — URL of the elastic cluster
      - `headers` object, required — Additionnal http headers
      - `index` string, required — Index for events. Default is otoroshi-events
      - `password` string, required — Optional password
      - `type` string, required — Type of events. Default is event
      - `user` string, required — Optional user
    - KafkaConfig — The configuration for kafka access
      - `keyPass` string — Optional keypass
      - `keyStore` string — Optional path to keystore
      - `servers` string[], required — URLs of the kafka servers
      - `topic` string — Optional kafka topic (otoroshi-events by default)
      - `trustore` string — Optional path to trustore
    - PulsarDataExporterConfig — The configuration for kafka access
      - `namespace` string, required — Namespace
      - `tenant` string, required — Tenant
      - `topic` string, required — Topic
      - `uri` string[], required — URI of the pulsar server
    - FileDataExporterConfig
      - `path` string, required — Path to file
    - MailerGenericExporterConfig
      - `headers` object — Optional headers
      - `to` string[] — Email adresses of recipents
      - `type` 'generic', required — Type of mailer
      - `url` string — Url of mailer
    - MailerConsoleExporterConfig
      - `type` 'generic' — Type of mailer
    - MailerMailgunExporterConfig
      - `apiKey` string — Mailgun apiKey
      - `domain` string — Mailgun domain
      - `eu` boolean — Whether the mailgun server is european
      - `to` string[] — Email adresses of recipents
      - `type` 'mailgun', required — Type of mailer
    - MailerMailjetExporterConfig
      - `apiKeyPrivate` string — Mailjet private apiKey
      - `apiKeyPublic` string — Mailjet public apiKey
      - `to` string[] — Email adresses of recipents
      - `type` 'mailjet', required — Type of mailer
    - MailerSendgridExporterConfig
      - `apiKeyPublic` string — Sendgrid apiKey
      - `to` string[] — Email adresses of recipents
      - `type` 'sendgrid', required — Type of mailer
    - ConsoleDataExporterConfig
    - CustomDataExporterConfig
      - `config` object, required — Custom data exporter config
      - `ref` string, required — Script Ref
  - `desc` string — Description
  - `enabled` string — Boolean
  - `filtering` Filtering
    - `exclude` object[] — Excluding pattern
    - `include` object[] — Including pattern
  - `groupDuration` integer — duration
  - `groupSize` integer — Group size
  - `id` string — Id
  - `jsonWorkers` integer — nb workers
  - `location` Location
    - `teams` object[], required — Team ids
    - `tenant` string, required — Tenant id
  - `metadata` object — Metadata
  - `name` string — Name
  - `projection` object — projection
  - `sendWorkers` integer — send workers
  - `typ` 'kafka' | 'pulsar' | 'file' | 'mailer' | 'elastic' | 'console' | 'custom' — Type of data exporter

## Other responses

- `400` — Bad resource format. Take another look to the swagger, or open an issue :)
- `401` — You have to provide an Api Key. Api Key can be passed with 'Otoroshi-Client-Id' and 'Otoroshi-Client-Secret' headers, or use basic http authentication
- `404` — Resource not found or does not exist

---

[API](https://skmtc.net/maif/apis/otoroshi.md) · [All operations](https://skmtc.net/maif/apis/otoroshi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/maif/otoroshi/versions/276881687271/schema)
