Creates a new Integration Log Drain (deprecated)
POST
https://api.vercel.com/v2/integrations/log-drainsCreates an Integration log drain. This endpoint must be called with an OAuth2 client (integration), since log drains are tied to integrations. If it is called with a different token type it will produce a 400 error.
https://api.vercel.com/v2/integrations/log-drains
const response = await fetch('https://api.vercel.com/v2/integrations/log-drains?teamId=string&slug=string', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ "name": "My first log drain", "projectIds": [], "secret": "a1Xsfd325fXcs", "deliveryFormat": "json", "url": "https://example.com/log-drain", "sources": [], "headers": "value", "environments": [] }),});
const data = await response.json();console.log(data);Response
{ "branch": "feature/*", "clientId": "oac_xRhY4LAB7yLhUADD69EvV7ct", "configurationId": "icfg_3bwCLgxL8qt5kjRLcv2Dit7F", "createdAt": "1558531915505", "createdFrom": "integration", "deliveryFormat": "json", "environments": [], "headers": "{\"Authorization\": \"Bearer 123\"}", "id": "ld_nBuA7zCID8g4QZ8g", "name": "My first log drain", "ownerId": "kr1PsOIzqEL5Xg6M4VZcZosf", "projectId": "AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb", "projectIds": [], "samplingRate": "0.5", "source": { "defaultFor": "eve-tracing", "kind": "self-served" }, "sources": [], "url": "https://example.com/log-drain"}AuthorizationbearerToken
Default authentication mechanism
application/json
A secret to sign log drain notification headers so a consumer can verify their authenticity
The url where you will receive logs. The protocol must be
https:// or http:// when type is json and ndjson.200The log drain was successfully created
400One of the provided values in the request body is invalid.
The provided token is not from an OAuth2 Client
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error