Create a log sink
POST
/api/v1/log-sinks
const url = 'https://example.com/api/v1/log-sinks';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"categories":["example"],"config":{},"enabled":true,"environment_id":1,"info":"example","name":"example","order":1,"type":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/log-sinks \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "categories": [ "example" ], "config": {}, "enabled": true, "environment_id": 1, "info": "example", "name": "example", "order": 1, "type": "example" }'Creates a new log sink instance for the given environment (or global when environment_id is 0).
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Request body
Media typeapplication/json
object
categories
Array<string>
config
object
enabled
boolean
environment_id
integer
info
string
name
string
order
integer
type
string
Examplegenerated
{ "categories": [ "example" ], "config": {}, "enabled": true, "environment_id": 1, "info": "example", "name": "example", "order": 1, "type": "example"}Responses
Section titled “Responses”Created
Media typeapplication/json
object
bytes_sent
integer
categories
Array<string>
config
object
created_at
string
enabled
boolean
environment_id
integer
exports_count
integer
id
integer
info
string
name
string
order
integer
source
string
type
string
updated_at
string
Examplegenerated
{ "bytes_sent": 1, "categories": [ "example" ], "config": {}, "created_at": "example", "enabled": true, "environment_id": 1, "exports_count": 1, "id": 1, "info": "example", "name": "example", "order": 1, "source": "example", "type": "example", "updated_at": "example"}Bad request
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Unauthorized
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Forbidden
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Conflict
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Internal server error
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}