Clone sinks from one environment to another
POST
/api/v1/log-sinks/clone
const url = 'https://osctrl.net/api/v1/log-sinks/clone';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"overwrite":true,"source_environment_id":1,"target_environment_id":1}'};
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://osctrl.net/api/v1/log-sinks/clone \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "overwrite": true, "source_environment_id": 1, "target_environment_id": 1 }'Copies all log sinks from a source environment (use 0 for global) to a target environment. With overwrite=false returns 409 if the target already has sinks.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Request body
Media typeapplication/json
object
overwrite
boolean
source_environment_id
integer
target_environment_id
integer
Examplegenerated
{ "overwrite": true, "source_environment_id": 1, "target_environment_id": 1}Responses
Section titled “Responses”OK
Media typeapplication/json
Array<object>
object
bytes_sent
integer
config
Array<integer>
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, "config": [ 1 ], "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"}Target has sinks
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"}