POST
/
site
/
{site}
/
job
curl --request POST \
  --url https://{appDomain}/site/{site}/job \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: text/plain' \
  --header 'X-Idempotency-Key: <x-idempotency-key>' \
  --data '/ip firewall filter add action=accept chain=input comment="Allow Winbox" disabled=no dst-port=8291 protocol=tcp
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "token": "jobTokenExample",
  "site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "idempotency_key": "some-idempotency-key-uuid-or-id",
  "description": "<string>",
  "express_execute": true,
  "needs_acknowledgement": true,
  "should_backup": true,
  "associated_backup": "site-uuid-here/1678886400.rsc",
  "started_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z",
  "failed_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "log_url": "logs?group=sites&streams=site-uuid&start=2023-01-01T00:00:00&end=2023-01-01T00:30:00&filter={$.message=*jobTokenExample*}&limit=10",
  "script": "<string>"
}

Authorizations

Authorization
string
header
required

Standard JWT token obtained via a separate authentication process. Required for most user-facing API endpoints.

Headers

X-Idempotency-Key
string
required

A UUID to ensure the request is processed only once.

X-Description
string

A brief description of the job. Defaults if not provided.

Required string length: 3 - 100
X-Needs-Ack
boolean
default:true

Whether the job requires explicit 'done' status from the device (true) or is completed upon download (false).

X-Backup
boolean
default:false

Whether to create an SFTP backup before running the script.

X-Express-Execute
boolean
default:false

Whether to attempt to trigger an immediate poll from the device after job creation.

Path Parameters

site
string
required

The UUID of the Site to create the job for.

Body

text/plain · string

The RouterOS script payload to be executed.

The body is of type string.

Required string length: 3 - 10000
Example:

"/ip firewall filter add action=accept chain=input comment=\"Allow Winbox\" disabled=no dst-port=8291 protocol=tcp\n"

Response

201
application/json

Job created successfully. Returns the created job resource.

The response is of type object.