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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Create drain

> Creates a drain with filters and a delivery destination.

`vercel.createDrain` creates a drain with filters and a delivery destination.

```ts automations/create-drain.automation.ts theme={null}
import { automation } from "automate.ax"
import { vercel } from "automate.ax/vercel"

export default automation("Create drain", () => {
  vercel.createDrain({
    name: "Automate.ax logs",
    projects: "all",
    schemas: {
      log: { version: "1" },
    },
    teamId: "team_1",
  })
})
```

## Input

* `name`: the drain name shown in Vercel.
* `projects`: `"all"` or `"some"`. When you choose `"some"`, pass the selected Vercel project IDs in `projectIds`.
* `schemas`: schema versions keyed by event family, such as `log`, `trace`, or `analytics`.
* `teamId`: the target team. OAuth connections default to the team where the integration is installed.

You can also set Vercel's typed `delivery`, `filter`, `sampling`, `source`, and `transforms` options.

## Output

Returns the created Vercel drain, including its ID, status, schemas, delivery configuration, and source.

## Provider behavior

You can use an OAuth or access-token Vercel connection. This action creates provider state, so Automate.ax does not treat it as replay-safe. Vercel rejects unsupported schema, delivery, and project combinations.
