Retrieve a list of all Drains
GET
/__remote/api.vercel.com/v1/drainsAllows to retrieve the list of Drains of the authenticated team.
Request
import { Edgenivo } from "@vercel/sdk";
const vercel = new Edgenivo({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.drains.getDrains({ teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l", slug: "my-team-url-slug", });
console.log(result);}
run();Response
{ "drains": [ { "createdAt": "123", "delivery": { "compression": "gzip", "encoding": "json", "endpoint": "string", "headers": "value", "secret": "string", "type": "http" }, "disabledAt": "123", "disabledBy": "string", "disabledReason": "account-plan-downgrade", "firstErrorTimestamp": "123", "id": "icfg_1234567890", "name": "Example Name", "ownerId": "example_id", "projectIds": [], "sampling": [ { "env": "preview", "rate": "123", "requestPath": "string", "type": "head_sampling" } ], "schemas": { "ai_gateway": "value", "analytics": "value", "audit_log": "value", "connect": "value", "log": "value", "speed_insights": "value", "trace": "value" }, "source": { "defaultFor": "eve-tracing", "kind": "self-served" }, "status": "disabled", "teamId": "example_id", "updatedAt": "123", "deliveryStats": { "attempts": "123", "failures": "123", "state": "failing", "window": "24h" }, "filterV2": { "filter": { "deployment": { "environments": [] }, "log": { "legacy_excludeCachedStaticAssetLogs": "false", "sources": [] }, "project": { "ids": [] }, "type": "basic" }, "version": "v2" } } ]}AuthorizationbearerToken
Default authentication mechanism
Include
deliveryStats with the delivery health of each drain over the last 24 hours. Ignored for teams without drain delivery metrics.400One of the provided values in the request query is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error
503The delivery stats could not be loaded. Retry, or omit `includeDeliveryStats`.