Table of Contents

API : Tools: Scheduled jobs : Update

Introduction

Replaces the settings of a scheduled job. The body is the same as Create - every field is written, so send the complete job.

Note that runAs is written too, so updating a job with runAs = ME transfers ownership to the admin making the change.

The job's type (what) is kept, so a job created by a feature - such as an employee or SIP trunk deletion - still belongs to that feature after an edit. Editing a SIP trunk deletion (what = DELETE_SIP_ACCOUNT) also moves the trunk's deleteDate to the new when.

Request

URL https://api.telecomx.dk/tools/scheduledjobs/:id
Method POST
Access level Admin

Body

Field Type Required Description
name String Yes Human readable label, 1-200 characters.
hostname String Yes Hostname to call, with or without a scheme.
path String No Path appended to the hostname. Defaults to empty.
method String Yes GET, POST, PATCH or DELETE.
params Object No Key-value pairs, all values strings. Defaults to empty.
body Object or Array No Request body. Defaults to empty.
timeoutMs Number No Request timeout, 1000-600000 ms. Defaults to 120000.
when Date Conditional When to run. Required when there is no recurrence; ignored when there is, because the first run is derived from the recurrence.
recurrence Object No Recurrence settings, see Recurrence. Omit for a one-shot job.
runAs String No ME to run as the calling admin, SYSTEM to run as the TelecomX system employee. Defaults to ME. Recurring jobs should use SYSTEM, so the schedule survives the creating admin leaving.
customerId Id No Customer the job relates to. Defaults to the TelecomX customer.
accountId Id No Account the job relates to. Jobs sharing an account are never run concurrently.

Query example

https://api.telecomx.dk/tools/scheduledjobs/6a2a6b21db0276bd0a548391

Response

The updated job, with the same fields as List.

Errors

Error code Message Description
400 invalid_data The id is not a valid ObjectId
403 access_denied Insufficient access level
404 not_found No job has that id
500 internal_error <Unspecified>