---
title: "Get Agent jobs by Agent id"
method: GET
path: "/agents/{id}/jobs"
tags: ["Agents"]
---

# Get Agent jobs by Agent id

`GET /agents/{id}/jobs`

## Request

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

Returns all jobs configuration for Agent.

## Path parameters

- `id` number, required

## Response `200`

Successful response

- object
  - `permission` string, required: Agent permissions
  - `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
  - `path` string, required: Agents path
  - `storage_config_id` number, required: Storage connector config id. If the parameter is not specified, Storage connector isn't used
  - `role` string, required: Role 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.
  - `file_policy_id` number, required: File policy id. Only for agent with caching_gateway, enduser role
  - `priority_agents` boolean, required: Priority agents. Only for agent with primary_storage role or agent in sync job.
  - `lock_server` boolean, required: 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.script` string, required: Command
  - `triggers.pre_indexing.shell` string, required: Shell
  - `triggers.pre_indexing.ext` string, required: Script file extension
  - `triggers.pre_move` object: Before an agent finalizing download. Only for distribution jobs
  - `triggers.pre_move.script` string, required: Command
  - `triggers.pre_move.shell` string, required: Shell
  - `triggers.pre_move.ext` string, required: Script file extension
  - `triggers.post_download` object: After an agent completes downloading
  - `triggers.post_download.script` string, required: Command
  - `triggers.post_download.shell` string, required: Shell
  - `triggers.post_download.ext` string, required: Script file extension
  - `triggers.complete` object: After all agents complete downloading
  - `triggers.complete.linux` object, required: Linux command
  - `triggers.complete.script` string, required: Command
  - `triggers.complete.shell` string, required: Shell
  - `script` object: Script for script job
  - `script.script` string, required: Command
  - `script.shell` string, required: Shell
  - `script.ext` string, required: Script file extension
  - `id` number, required: Job id
  - `type` string, required: Job type
  - `name` string, required: Job name
  - `description` string, required: Job description
  - `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.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)
  - `scheduler.skip_if_running` boolean: Wait for job run to complete before starting new one (for all scheduler types except manually and now)
  - `scheduler.next_schedule_run_time` number: Next start job time (in seconds) applied by scheduler, -1 means no next schedule run
  - `settings` object: Job settings.
  - `settings.priority` number: Job priority. Not applicable for script jobs. The lowest priority: 0, the highest: 10
  - `settings.use_ram_optimization` boolean: Use RAM-optimized configuration. Not applicable for script jobs
  - `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. Setting's value is -1 in case Reference Instance was deleted from the Job
  - `settings.reference_instance_type` string: The Reference Instance type. Agents and High Availability groups are allowed only. Default value is null (reference instance was removed or was not specified)
  - `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.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. 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.
  - `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. 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. 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_drive` string: Map a local folder to a drive letter, applicable only for hybrid jobs on Windows end-users starting from version 4.2.0.
  - `errors` object, required: List of job errors
  - `errors.code` number: Error code (deprecated since 2.9.1)
  - `errors.code_str` string, required: Error string code
  - `errors.message` string, required: Error message
  - `last_start_time` number, required: Last time in seconds when the job was started
  - `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

## 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)
