POST
/
v2
/
integrations
/
log-drains
import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.logDrains.createLogDrain({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    requestBody: {
      name: "My first log drain",
      secret: "a1Xsfd325fXcs",
      deliveryFormat: "json",
      url: "https://example.com/log-drain",
    },
  });

  // Handle the result
  console.log(result);
}

run();
{
  "clientId": "oac_xRhY4LAB7yLhUADD69EvV7ct",
  "configurationId": "icfg_cuwj0AdCdH3BwWT4LPijCC7t",
  "createdAt": 1558531915505,
  "id": "ld_nBuA7zCID8g4QZ8g",
  "deliveryFormat": "json",
  "name": "My first log drain",
  "ownerId": "kr1PsOIzqEL5Xg6M4VZcZosf",
  "projectId": "AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb",
  "projectIds": "AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb",
  "url": "https://example.com/log-drain",
  "sources": [
    "build",
    "edge"
  ],
  "createdFrom": "integration",
  "headers": "{\"Authorization\": \"Bearer 123\"}",
  "environments": [
    "production"
  ],
  "branch": "feature/*",
  "samplingRate": 0.5
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Query Parameters

teamId
string

The Team identifier to perform the request on behalf of.

Example:

"team_1a2b3c4d5e6f7g8h9i0j1k2l"

slug
string

The Team slug to perform the request on behalf of.

Example:

"my-team-url-slug"

Body

application/json

Response

200
application/json
The log drain was successfully created

The response is of type object.