Skip to content
Docs

Creates a Configurable Log Drain (deprecated)

POSThttps://api.vercel.com/v1/log-drains
Creates a configurable log drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed)
https://api.vercel.com/v1/log-drains
const response = await fetch('https://api.vercel.com/v1/log-drains?teamId=string&slug=string', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"deliveryFormat": "json",
"url": "https://example.com",
"headers": "value",
"projectIds": [],
"sources": [],
"environments": [],
"secret": "string",
"samplingRate": "123",
"name": "Example Name"
}),
});
const data = await response.json();
console.log(data);
Response
"value"
AuthorizationbearerToken

Default authentication mechanism

teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
application/json
deliveryFormatobjectRequired
The delivery log format
urlstringRequired
The log drain url
headersobjectOptional
Headers to be sent together with the request
projectIdsarrayOptional
sourcesarrayRequired
environmentsarrayOptional
secretstringOptional
Custom secret of log drain
samplingRatenumberOptional
The sampling rate for this log drain. It should be a percentage rate between 0 and 100. With max 2 decimal points
namestringOptional
The custom name of this log drain.
200Success
400One of the provided values in the request body is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error