Change a source schedule: its name, week or objects, or make it active, dry, paused or archived. Made active, or its week or objects changed while active, it applies the current hour's state at once. Turned off from active (paused, archived, or back in dry run, which acts no more), it resumes its own pauses within a minute, unless leave_paused; an archived one's objects may then go on another schedule
PATCH
/v1/buyer/automation/schedules/{id}
const url = 'https://example.com/v1/buyer/automation/schedules/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"leave_paused":true,"name":"example","objects":[{"connection_id":1,"key":{"country":"example","source_campaign":"example","values":["example"]},"level":"campaign"}],"status":"active","week":{"hours":[1],"time_zone":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/v1/buyer/automation/schedules/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "leave_paused": true, "name": "example", "objects": [ { "connection_id": 1, "key": { "country": "example", "source_campaign": "example", "values": [ "example" ] }, "level": "campaign" } ], "status": "active", "week": { "hours": [ 1 ], "time_zone": "example" } }'Who: a workspace’s buyer, or its key. API keys with the buyer:write scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
leave_paused
boolean
name
string | null
objects
Array<object> | null
object
connection_id
required
integer format: int64
key
required
object
country
string
source_campaign
string
values
required
Array<string>
level
required
string
status
string | null
Responses
Section titled “Responses”OK
Media typeapplication/json
object
created_at
required
string format: date-time
created_by
required
id
required
integer format: int64
last_transition_at
required
string | null format: date-time
last_transition_id
required
string
name
required
string
next_boundary_at
required
string | null format: date-time
objects
required
Array<object>
object
connection
required
object
id
required
integer format: int64
name
string
key
required
object
country
required
string
source_campaign
required
string
values
required
Array<string>
level
required
string | null
sequence
required
integer format: int64
status
required
string | null
updated_at
required
string format: date-time
updated_by
required
week
required
object
hours
required
Array<integer>
time_zone
required
string
workspace_id
required
integer format: int64
Example
{ "created_by": { "kind": "user" }, "objects": [ { "level": "campaign" } ], "status": "active", "updated_by": { "kind": "user" }}default
Section titled “default”An error, as go-commons apperr maps it
Media typeapplication/json
object
error
required
object
code
required
string
fields
object
key
additional properties
string
message
required
string
Example generated
{ "error": { "code": "example", "fields": { "additionalProperty": "example" }, "message": "example" }}