---
title: "Create a new Drain"
method: POST
path: "/v1/drains"
tags: ["drains"]
---

# Create a new Drain

`POST /v1/drains`

## Request

- Base URL: `https://api.vercel.com`
- URL: `https://api.vercel.com/v1/drains`
- Auth: HTTP bearer

Create a new Drain with the provided configuration.

## Query parameters

- `teamId` string
- `slug` string

## Request body

- object
  - `name` string, required
  - `projects` 'some' | 'all', required
  - `projectIds` string[]
  - `filter` object
    - `version` string, required
    - `filter` union, required
      - object
        - `type` string, required
        - `project` object
          - `ids` string[]
        - `log` object
          - `sources` string[]
        - `deployment` object
          - `environments` string[]
      - object
        - `type` string, required
        - `text` string, required
  - `schemas` object, required
  - `delivery` union
    - object
      - `type` string, required
      - `endpoint` string, required
      - `compression` 'gzip' | 'none'
      - `encoding` 'json' | 'ndjson', required
      - `headers` object, required
      - `secret` string
    - object
      - `type` string, required
      - `endpoint` object, required
        - `traces` string, required
      - `encoding` 'proto' | 'json', required
      - `headers` object, required
      - `secret` string
    - object
      - `type` string, required
      - `endpoint` string, required
      - `encoding` 'json' | 'ndjson', required
      - `compression` 'none', required
      - `fileStructure` 'hive', required
      - `roleArn` string, required
      - `region` string, required
      - `serverSideEncryption` 'AES256' | 'aws:kms' | 'aws:kms:dsse'
      - `objectAcl` 'private' | 'bucket-owner-read' | 'bucket-owner-full-control'
  - `sampling` object[]
    - `type` string, required
    - `rate` number, required: Sampling rate from 0 to 1 (e.g., 0.1 for 10%)
    - `env` 'production' | 'preview': Environment to apply sampling to
    - `requestPath` string: Request path prefix to apply the sampling rule to
  - `transforms` object[]
    - `id` string, required
  - `source` union
    - object
      - `kind` string
      - `externalResourceId` string, required
    - object
      - `kind` string
      - `resourceId` string, required
    - object
      - `kind` string, required
    - object
      - `kind` string, required

## Response `200`

- union
  - object
    - `createdAt` number, required
    - `delivery` union, required
      - object
        - `compression` 'gzip' | 'none'
        - `encoding` 'json' | 'ndjson', required
        - `endpoint` string, required
        - `headers` object, required
        - `secret` union
          - string
          - object
            - `kind` 'INTEGRATION_SECRET', required
        - `type` 'http', required
      - object
        - `encoding` 'json' | 'proto', required
        - `endpoint` object, required
          - `traces` string, required
        - `headers` object, required
        - `secret` union
          - string
          - object
            - `kind` 'INTEGRATION_SECRET', required
        - `type` 'otlphttp', required
      - object
        - `endpoint` string, required
        - `table` string, required
        - `type` 'clickhouse', required
      - object
        - `compression` 'none', required
        - `encoding` 'json' | 'ndjson', required
        - `endpoint` string, required
        - `fileStructure` 'hive', required
        - `objectAcl` 'authenticated-read' | 'aws-exec-read' | 'bucket-owner-full-control' | 'bucket-owner-read' | 'private' | 'public-read' | 'public-read-write'
        - `region` string, required
        - `roleArn` string, required
        - `serverSideEncryption` 'AES256' | 'aws:kms' | 'aws:kms:dsse'
        - `type` 's3', required
      - object
        - `target` 'vercel-otel-traces-db', required
        - `type` 'internal', required
    - `disabledAt` number
    - `disabledBy` string
    - `disabledReason` 'account-plan-downgrade' | 'disabled-by-admin' | 'disabled-by-owner' | 'feature-not-available' | 'limits-exceeded'
    - `firstErrorTimestamp` number
    - `id` string, required
    - `name` string, required
    - `ownerId` string, required
    - `projectIds` string[]
    - `sampling` object[]
      - `env` 'preview' | 'production'
      - `rate` number, required
      - `requestPath` string
      - `type` 'head_sampling', required
    - `schemas` object, required
      - `ai_gateway` object
      - `analytics` object
      - `audit_log` object
      - `connect` object
      - `log` object
      - `speed_insights` object
      - `trace` object
    - `source` union, required
      - object
        - `defaultFor` 'eve-tracing': Informational marker for a system-owned default drain.
        - `kind` 'self-served', required
      - object
        - `externalResourceId` string
        - `integrationConfigurationId` string, required
        - `integrationId` string, required
        - `kind` 'integration', required
        - `resourceId` string
    - `status` 'disabled' | 'enabled' | 'errored'
    - `teamId` string, nullable
    - `updatedAt` number, required
    - `deliveryStats` object: Delivery health of a drain over the last 24 hours: `failing` when more than 5 delivery attempts and at least 1% of all attempts did not succeed, `healthy` otherwise, and `unknown` when there were no attempts or the stats could not be loaded.
      - `attempts` number, required: All delivery attempts in the window.
      - `failures` number, required: Delivery attempts that did not succeed in the window.
      - `state` 'failing' | 'healthy' | 'unknown', required
      - `window` '24h', required
    - `filterV2` object
      - `filter` union, required
        - object
          - `deployment` object
            - `environments` string[]
          - `log` object
            - `legacy_excludeCachedStaticAssetLogs` false | true
            - `sources` string[]
          - `project` object
            - `ids` string[]
          - `type` 'basic', required
        - object
          - `text` string, required
          - `type` 'odata', required
      - `version` 'v2', required
  - object
    - `createdAt` number, required
    - `delivery` union, required
      - object
        - `compression` 'gzip' | 'none'
        - `encoding` 'json' | 'ndjson', required
        - `endpoint` string, required
        - `headers` object, required
        - `secret` union
          - string
          - object
            - `kind` 'INTEGRATION_SECRET', required
        - `type` 'http', required
      - object
        - `encoding` 'json' | 'proto', required
        - `endpoint` object, required
          - `traces` string, required
        - `headers` object, required
        - `secret` union
          - string
          - object
            - `kind` 'INTEGRATION_SECRET', required
        - `type` 'otlphttp', required
      - object
        - `endpoint` string, required
        - `table` string, required
        - `type` 'clickhouse', required
      - object
        - `compression` 'none', required
        - `encoding` 'json' | 'ndjson', required
        - `endpoint` string, required
        - `fileStructure` 'hive', required
        - `objectAcl` 'authenticated-read' | 'aws-exec-read' | 'bucket-owner-full-control' | 'bucket-owner-read' | 'private' | 'public-read' | 'public-read-write'
        - `region` string, required
        - `roleArn` string, required
        - `serverSideEncryption` 'AES256' | 'aws:kms' | 'aws:kms:dsse'
        - `type` 's3', required
      - object
        - `target` 'vercel-otel-traces-db', required
        - `type` 'internal', required
    - `disabledAt` number
    - `disabledBy` string
    - `disabledReason` 'account-plan-downgrade' | 'disabled-by-admin' | 'disabled-by-owner' | 'feature-not-available' | 'limits-exceeded'
    - `firstErrorTimestamp` number
    - `id` string, required
    - `name` string, required
    - `ownerId` string, required
    - `projectIds` string[]
    - `sampling` object[]
      - `env` 'preview' | 'production'
      - `rate` number, required
      - `requestPath` string
      - `type` 'head_sampling', required
    - `schemas` object, required
      - `ai_gateway` object
      - `analytics` object
      - `audit_log` object
      - `connect` object
      - `log` object
      - `speed_insights` object
      - `trace` object
    - `source` union, required
      - object
        - `defaultFor` 'eve-tracing': Informational marker for a system-owned default drain.
        - `kind` 'self-served', required
      - object
        - `externalResourceId` string
        - `integrationConfigurationId` string, required
        - `integrationId` string, required
        - `kind` 'integration', required
        - `resourceId` string
    - `status` 'disabled' | 'enabled' | 'errored'
    - `teamId` string, nullable
    - `updatedAt` number, required
    - `deliveryStats` object: Delivery health of a drain over the last 24 hours: `failing` when more than 5 delivery attempts and at least 1% of all attempts did not succeed, `healthy` otherwise, and `unknown` when there were no attempts or the stats could not be loaded.
      - `attempts` number, required: All delivery attempts in the window.
      - `failures` number, required: Delivery attempts that did not succeed in the window.
      - `state` 'failing' | 'healthy' | 'unknown', required
      - `window` '24h', required
    - `filterV2` object
      - `filter` union, required
        - object
          - `deployment` object
            - `environments` string[]
          - `log` object
            - `legacy_excludeCachedStaticAssetLogs` false | true
            - `sources` string[]
          - `project` object
            - `ids` string[]
          - `type` 'basic', required
        - object
          - `text` string, required
          - `type` 'odata', required
      - `version` 'v2', required
    - `integrationConfigurationUri` string
    - `integrationIcon` string
    - `integrationWebsite` string
    - `projectAccess` union
      - object
        - `access` 'all', required
        - `managedBy` 'drain' | 'integration', required
      - object
        - `access` 'some', required
        - `projectIds` string[], required
        - `managedBy` 'drain' | 'integration', required

## Other responses

- `400`: One of the provided values in the request body is invalid.
- `401`: The request is not authorized.
- `402`
- `403`: You do not have permission to access this resource.
- `404`
- `410`

## Changes

- **2026-10-22** `4686ebfcdc1e`: 1 breaking, 1 info
  - added `subschema #1, subschema #2` to the response body `oneOf` list for the response status `200`
  - removed `subschema #1, subschema #2` from the response body `oneOf` list for the response status `200`
- **2026-09-30** `099fbe1f521c`: 1 info
  - added the non-success response with the status `404`
- **2026-09-22** `0f7ea3d3b39b`: 1 breaking, 1 info
  - added `subschema #1, subschema #2` to the response body `oneOf` list for the response status `200`
  - removed `subschema #1, subschema #2` from the response body `oneOf` list for the response status `200`
- **2026-08-21** `915cc4809c98`: 1 breaking, 1 info
  - added `subschema #1, subschema #2` to the response body `oneOf` list for the response status `200`
  - removed `subschema #1, subschema #2` from the response body `oneOf` list for the response status `200`
- **2026-07-26** `01c71864fa50`: 1 breaking, 1 info
  - added `subschema #1, subschema #2` to the response body `oneOf` list for the response status `200`
  - removed `subschema #1, subschema #2` from the response body `oneOf` list for the response status `200`

[Operation history](https://skmtc.dev/vercel/apis/vercel-api/changes/v1/drains/post.md)

---

[API](https://skmtc.dev/vercel/apis/vercel-api.md) - [All operations](https://skmtc.dev/vercel/apis/vercel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vercel/apis/vercel-api/revisions/60686c0e1f6a?raw)
