---
title: "Create job"
method: POST
path: "/jobs"
tags: ["Jobs"]
---

# Create job

`POST /jobs`

## Request

- Base URL: `https://localhost:8446/api/v2`
- URL: `https://localhost:8446/api/v2/jobs`
- Auth: API key in header `Authorization`

Create new job.

## Query parameters

- `ignore_errors` boolean

## Request body

- object
  - `name` string, required: Job name
  - `type` string, required: Job type
  - `description` string: Job description
  - `groups` object, required: Array of job groups
  - `groups.id` number, required: Group id
  - `group.permission` string, required: Group permissions. Selective permissions (sro and srw) are allowed only for sync, file_caching and hybrid_work jobs
  - `groups.path` object, required: Group path
  - `groups.path.macro` string: Macro. If the parameter is not specified, custom path is used. If use %USERDEFINED% or %GETFILES% macro, you mustn't use path field for all OS Not allowed for High Availability Groups
  - `groups.path.linux` string, required: Linux path
  - `groups.path.linux_cache` string, required: Linux cache path. Only for group with caching_gateway role
  - `groups.path.win` string, required: Windows path
  - `groups.path.osx` string, required: OS X path
  - `groups.path.android` string, required: Android path
  - `groups.path.xbox` string, required: Xbox path. Only for distribution jobs
  - `groups.role` string: Role. regular by default. Required for file_caching and hybrid_work jobs. primary_storage, caching_gateway roles are used in file_caching jobs. primary_storage, caching_gateway, enduser roles are used in hybrid_work jobs. regular role is used in distribution, consolidation, script, sync, storage_tiering_and_archival jobs.
  - `groups.file_policy_id` number: File policy id. Required for group with caching_gateway, enduser role
  - `groups.priority_agents` boolean: Priority agents. Only for group with primary_storage role or group in sync job.
  - `groups.lock_server` boolean: Locks server. Only for the case when setting.use_file_locking is true for High availability group with primary_storage role or in sync job.
  - `agents` object, required: Array of job agents
  - `agents.id` number, required: Agent id
  - `agents.permission` string, required: Agent permissions. Selective permissions (sro and srw) are allowed only for sync, file_caching and hybrid_work jobs
  - `agents.path` object, required: Agent path
  - `agents.path.macro` string: Macro. If the parameter is not specified, custom path is used. If use %USERDEFINED% or %GETFILES% macro, you mustn't use path field for all OS
  - `agents.path.linux` string, required: Linux path
  - `agents.path.linux_cache` string, required: Linux cache path. Only for agent with caching_gateway role
  - `agents.path.win` string, required: Windows path
  - `agents.path.osx` string, required: OS X path
  - `agents.path.android` string, required: Android path
  - `agents.path.xbox` string, required: Xbox path. Only for distribution jobs
  - `agents.storage_config_id` number: Storage connector config id If the parameter is not specified, Storage connector isn't used
  - `agents.role` string: Role. regular by default. Required for file_caching and hybrid_work jobs. primary_storage, caching_gateway roles are used in file_caching jobs. primary_storage, caching_gateway, enduser roles are used in hybrid_work jobs. regular role is used in distribution, consolidation, script, sync, storage_tiering_and_archival jobs.
  - `agents.file_policy_id` number: File policy id. Required for agent with caching_gateway, enduser role
  - `agents.priority_agents` boolean: Priority agents. Only for agent with primary_storage role or agent in sync job.
  - `agents.lock_server` boolean: Locks server. Only for the case when setting.use_file_locking is true for agent with primary_storage role or agent in sync job.
  - `triggers` object: Job triggers. Only for distribution, consolidation, storage_tiering_and_archival jobs
  - `triggers.pre_indexing` object: Before file-indexing begins
  - `triggers.pre_indexing.linux` object, required: Linux command
  - `triggers.pre_indexing.linux.script` string, required: Command
  - `triggers.pre_indexing.linux.shell` string: Shell, default "/bin/sh"
  - `triggers.pre_indexing.linux.ext` string: Script file extension, default "sh"
  - `triggers.pre_indexing.win` object, required: Windows command
  - `triggers.pre_indexing.win.script` string, required: Command
  - `triggers.pre_indexing.win.shell` string: Shell, default "cmd.exe /Q /C", use "powershell -NoProfile -ExecutionPolicy Bypass -NonInteractive -InputFormat None -File" for PowerShell
  - `triggers.pre_indexing.win.ext` string: Script file extension, default "cmd", use "ps1" for PowerShell
  - `triggers.pre_indexing.osx` object, required: Mac command
  - `triggers.pre_indexing.osx.script` string, required: Command
  - `triggers.pre_indexing.osx.shell` string: Shell, default "/bin/sh"
  - `triggers.pre_indexing.osx.ext` string: Script file extension, default "sh"
  - `triggers.pre_move` object: Before an agent finalizing download. Only for distribution jobs
  - `triggers.pre_move.linux` object, required: Linux command
  - `triggers.pre_move.linux.script` string, required: Command
  - `triggers.pre_move.linux.shell` string: Shell, default "/bin/sh"
  - `triggers.pre_move.linux.ext` string: Script file extension, default "sh"
  - `triggers.pre_move.win` object, required: Windows command
  - `triggers.pre_move.win.script` string, required: Command
  - `triggers.pre_move.win.shell` string: Shell, default "cmd.exe /Q /C", use "powershell -NoProfile -ExecutionPolicy Bypass -NonInteractive -InputFormat None -File" for PowerShell
  - `triggers.pre_move.win.ext` string: Script file extension, default "cmd", use "ps1" for PowerShell
  - `triggers.pre_move.osx` object, required: Mac command
  - `triggers.pre_move.osx.script` string, required: Command
  - `triggers.pre_move.osx.shell` string: Shell, default "/bin/sh"
  - `triggers.pre_move.osx.ext` string: Script file extension, default "sh"
  - `triggers.post_download` object: After an agent completes downloading
  - `triggers.post_download.linux` object, required: Linux command
  - `triggers.post_download.linux.script` string, required: Command
  - `triggers.post_download.linux.shell` string: Shell, default "/bin/sh"
  - `triggers.post_download.linux.ext` string: Script file extension, default "sh"
  - `triggers.post_download.win` object, required: Windows command
  - `triggers.post_download.win.script` string, required: Command
  - `triggers.post_download.win.shell` string: Shell, default "cmd.exe /Q /C", use "powershell -NoProfile -ExecutionPolicy Bypass -NonInteractive -InputFormat None -File" for PowerShell
  - `triggers.post_download.win.ext` string: Script file extension, default "cmd", use "ps1" for PowerShell
  - `triggers.post_download.osx` object, required: Mac command
  - `triggers.post_download.osx.script` string, required: Command
  - `triggers.post_download.osx.shell` string: Shell, default "/bin/sh"
  - `triggers.post_download.osx.ext` string: Script file extension, default "sh"
  - `triggers.complete` object: After all agents complete downloading
  - `triggers.complete.linux` object, required: Linux command
  - `triggers.complete.linux.script` string, required: Command
  - `triggers.complete.linux.shell` string: Shell, default "/bin/sh"
  - `triggers.complete.linux.ext` string: Script file extension, default "sh"
  - `triggers.complete.win` object, required: Windows command
  - `triggers.complete.win.script` string, required: Command
  - `triggers.complete.win.shell` string: Shell, default "cmd.exe /Q /C", use "powershell -NoProfile -ExecutionPolicy Bypass -NonInteractive -InputFormat None -File" for PowerShell
  - `triggers.complete.win.ext` string: Script file extension, default "cmd", use "ps1" for PowerShell
  - `triggers.complete.osx` object, required: Mac command
  - `triggers.complete.osx.script` string, required: Command
  - `triggers.complete.osx.shell` string: Shell, default "/bin/sh"
  - `triggers.complete.osx.ext` string: Script file extension, default "sh"
  - `script` object: Script for script job
  - `script.linux` object, required: Linux command
  - `script.linux.script` string, required: Command
  - `script.linux.shell` string: Shell, default "/bin/sh"
  - `script.linux.ext` string: Script file extension, default "sh"
  - `script.win` object, required: Windows command
  - `script.win.script` string, required: Command
  - `script.win.shell` string: Shell, default "cmd.exe /Q /C", use "powershell -NoProfile -ExecutionPolicy Bypass -NonInteractive -InputFormat None -File" for PowerShell
  - `script.win.ext` string: Script file extension, default "cmd", use "ps1" for PowerShell
  - `script.osx` object, required: Mac command
  - `script.osx.script` string, required: Command
  - `script.osx.shell` string: Shell, default "/bin/sh"
  - `script.osx.ext` string: Script file extension, default "sh"
  - `scheduler` object: Scheduler. Not applicable for sync, file_caching, hybrid_work job
  - `scheduler.type` string, required: Type of the scheduler
  - `scheduler.time` number: once - timestamp in seconds, daily - number of seconds since midnight, weekly - array of seconds since midnight
  - `scheduler.every` number: minutes - run every N minutes(min 5 minutes), hourly - run every N hours, daily - run every N days
  - `scheduler.days` number: weekly - array of days of week to run (encoded in numbers from 0 to 6, 0 is Sunday)
  - `scheduler.start` number: Scheduler start time (timestamp in seconds) for minutes, hourly, daily and weekly schedulers
  - `scheduler.finish` number: Scheduler finish time (timestamp in seconds) for minutes, hourly, daily and weekly schedulers
  - `scheduler.skip_if_running` boolean: Wait for job run to complete before starting new one (for all scheduler types except manually and now)
  - `scheduler.config` object: Job monthly scheduler configuration
  - `scheduler.config.offset` number, required: Specifies the position within a month When representing a day, the value range is 1–31 When representing monday, tuesday, wednesday, thursday, friday, saturday, and sunday the value range is 1–5
  - `scheduler.config.unit` string, required: Specifies the day of the month or the day of week
  - `scheduler.config.direction` string, required: Determines the reference point within the month for scheduling. month_beginning - the offset is calculated starting from the first day of the month month_end - the offset is calculated starting from the last day of the month
  - `scheduler.config.time` number, required: Specifies the time of the day to run the job (minutes)
  - `settings` object: Job settings.
  - `settings.priority` number: Job priority. Not applicable for script jobs. The lowest priority: 0, the highest: 10. Default value is 5
  - `settings.use_ram_optimization` boolean: Use RAM-optimized configuration. Not applicable for script jobs. Not configurable and true by default for file_caching, hybrid_work jobs. Is only supported for jobs with Agents of version 3.0.0 and newer. Default value is true
  - `settings.reference_agent_id` number: Deprecated since 4.0. Use reference_instance_type and reference_instance_id instead. The Reference Agent propagates and overwrites file permissions on other Agents in sync, file_caching, hybrid_work jobs. Selecting a Reference Agent is required for the jobs that synchronize file permissions. Default value is null.
  - `settings.reference_instance_id` number: The Reference Instance (Agent or High Availability group) propagates and overwrites file permissions on other Agents in sync, file_caching, hybrid_work jobs. Selecting a Reference Instance is required for the jobs that synchronize file permissions. Default value is null
  - `settings.reference_instance_type` string: The Reference type. Agents and High Availability groups are allowed only. Default value is null (reference instance was removed or was not specified)
  - `settings.profile` object: Unique profile settings for job
  - `settings.delete_synced_files` boolean: Delete synced files. Only for distribution, consolidation, storage_tiering_and_archival jobs
  - `settings.delete_synced_files_ttl` number: Delete synced files (in days). Only for distribution, consolidation, storage_tiering_and_archival jobs
  - `settings.archive_by` string: Criterion to archive by. Determines what field will be used settings.files_list, settings.modification_time or settings.access_time. Only one selected criterion is applied. Similar settings from profile will be ignored. If source is cloud storage access_time criterion must not be used. Only for storage_tiering_and_archival job. More information can be found here.
  - `settings.files_list` string: List of regular expressions separated by a new line character \n to match files based on their paths. Only for storage_tiering_and_archival job. Required and must not be empty if settings.archive_by=path</code.
  - `settings.modification_time` object: Files will be matched based on time in seconds since they were last modified. If only settings.modification_time.min is provided files with modification time earlier than settings.modification_time.min seconds ago will be matched. If only settings.modification_time.max is provided files with modification time later than settings.modification_time.max seconds ago will be matched. If both values are provided they are treated as absolute timestamps in seconds and files with modification time between settings.modification_time.min and settings.modification_time.max will be matched. At least one value must be provided. Only for storage_tiering_and_archival job.
  - `settings.modification_time.max` number: Max modification time in seconds.
  - `settings.modification_time.min` number: Min modification time in seconds.
  - `settings.access_time` object: Files will be matched based on time in seconds since they were last accessed. If only settings.access_time.min is provided files with access time earlier than settings.access_time.min seconds ago will be matched. If only settings.access_time.max is provided files with access time later than settings.access_time.max seconds ago will be matched. If both values are provided they are treated as absolute timestamps in seconds and files with access time between settings.access_time.min and settings.access_time.max will be matched. At least one value must be provided. Only for storage_tiering_and_archival job.
  - `settings.access_time.max` number: Max access time in seconds.
  - `settings.access_time.min` number: Min access time in seconds.
  - `settings.aws_s3_storage_class` string: Setting that will be used if job's destination is Amazon Glacier storage. Only for storage_tiering_and_archival job.
  - `settings.aws_s3_retrieval_tier` string: Setting that will be used if job's source is Amazon Glacier storage. Only for storage_tiering_and_archival job.
  - `settings.use_file_locking` boolean: File locks setting. Only for sync, file_caching, hybrid_work jobs
  - `settings.file_locks_timeout` number: File locks timeout. Applicable only if setting.use_file_locking is true
  - `settings.file_locks_sync_interval` number: File locks sync interval. Applicable only if setting.use_file_locking is true
  - `settings.file_locks_ignore_list` string: File locks ignore list. Applicable only if setting.use_file_locking is true
  - `settings.file_locks_allowed_access_when_no_server` string: File locks access to files when no access to locks server. Applicable only if setting.use_file_locking is true.
  - `settings.map_folder_to_driver` string: Map a local folder to a drive letter, applicable only for hybrid jobs on Windows end-users starting from version 4.2.0. Ensure that Agents are not assigned the same drive letter in multiple jobs. The drive letter should follow the format X:. To unmap the folder, provide an empty string
  - `use_new_cipher` boolean: Use new version of cipher suite. Not configurable and true by default for file_caching, hybrid_work jobs.
  - `post_command_local_time` number: Local Agent time after an Agent run completes downloading trigger (in seconds)
  - `pre_move_command_local_time` number: Local Agent time after an Agent run before finalizing download trigger (in seconds)
  - `profile_id` number: Job Profile id. If the parameter is not specified, default jobs profile id is used. Ignored if unique profile settings for job are specified
  - `notifications` object: List of job notifications
  - `notifications.destinations` object, required: Array of notification destinations. One of email, user_id, web_hook_id is required
  - `notifications.destinations.email` string, required: Email to send notifications
  - `notifications.destinations.user_id` number, required: Id of user to send notifications
  - `notifications.destinations.web_hook_id` number, required: Id of webhook to send notifications
  - `notifications.trigger` string, required: Notification trigger.
  - `notifications.settings` object, required: Notification settings
  - `notifications.settings.error_code` string, required: Error code to trigger notification. Is null in case of notification is configured for any error code. Only for JOB_RUN_ERROR trigger
  - `notifications.settings.notify_after_error_timeout` boolean, required: Trigger notification after error timeout. Only for JOB_RUN_ERROR trigger
  - `notifications.settings.error_timeout` number: Error timeout (seconds). Only for JOB_RUN_ERROR trigger. Minimum value is 1 minute
  - `notifications.settings.notify_on_error_remove` boolean, required: Notify when error is resolved. Only for JOB_RUN_ERROR trigger
  - `notifications.settings.complete_timeout` number, required: Send notification if job run isn't complete within time wait period (seconds). Only for JOB_RUN_NOT_COMPLETE trigger. Minimum value is 1 minute
  - `notifications.settings.dont_send_if_no_data_transferred` boolean, required: Skip notice if jobs did not transfer files. Only for JOB_RUN_FINISHED trigger

## Response `200`

Successful response

- object

## Other responses

- `default`: Error response. Depending on the error, either a 4xx or 5xx response status is returned.

---

[API](https://skmtc.dev/resilio/apis/resilio-api.md) - [All operations](https://skmtc.dev/resilio/apis/resilio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/resilio/apis/resilio-api/revisions/ca39130a395e?raw)
