---
title: "Create a fetch job"
slug: "create-a-fetch-job-1523319"
abstract: "Overview and exmple of a fetch job object used to request the creation of a new fetch job."
---
# Create a fetch job

You use a create fetch job object to request the creation of a new fetch job. The following properties are required:

| Parameter | Type | Description |
| --- | --- | --- |
| `state_description` | String | Description of the current state of the job. This parameter needs to be set but can be empty (`""`). |
| `asset` | [Link](https://doc.sitecore.com/ch/en/developers/cloud-dev/link.html) | Link to the asset entity that receives the files. |
| `files` | Array. <[file](https://doc.sitecore.com/ch/en/developers/cloud-dev/file.html)> | Array of [file](https://doc.sitecore.com/ch/en/developers/cloud-dev/file.html) objects that describe where to retrieve the files to add to the asset. |

Each of the file objects should have the following properties:

| Name | Type | Description |
| --- | --- | --- |
| `type` | String | The type of source to retrieve the file from, such as `Web` for an HTTP resource. |
| `href` | String | The URL of the resource. |
| `delete_when_done` | Boolean | Optional parameter that determines whether to delete the file when the fetch job is done. For an HTTP resource, a `DELETE` request is sent to the resource URL. |

## Fetch source

You can use the `Web` fetch source to retrieve resources that are accessible from a URL (optionally pre-signed). The file name is retrieved from the `Content-Disposition` header if available or made up from the path. The `href` member specifies the URL to the resource.

The following example is a fetch job object that fetches two files and links them to an asset:

```json
{
  "asset":{
    "href":"http://server/api/entities/23"
  },
  "files":[
    {
      "type":"Web",
      "href":"http://server/path/file1.jpg"
    },
    {
      "type":"Web",
      "href":"http://server/path/file2.jpg",
      "delete_when_done":true
    }
  ]
}

```