# Jobs API

Use the Jobs API to retrieve, create, update, and delete job targets or the description.
This REST API lets you interact with:
  
   - <i>M.Target</i> entities, which are targets of a job.
   - The <i>M.JobDescription</i> entity, which contains information about what to do and what is in progress.

{% admonition type="info" name="Note" %} To help you switch to the Jobs API, we provide [guidance on how to update calls in your code](https://doc.sitecore.com/ch/en/developers/cloud-dev/switch-to-the-jobs-api.html). {% /admonition %}

 ## Authentication

 To use the Jobs API, you need:

  - The URL of your Content Hub server. You can get this from your Content Hub Administrator. Enter this URL in the <b>{{server}}</b> variable by hovering your mouse over the variable in the <b>Try it</b> pane and then clicking <b>Edit</b>.
  - An [access token and the client ID](https://doc.sitecore.com/ch/en/developers/cloud-dev/oauth-tokens.html#making-requests). Both are sent with every request. You can create a token through the [Content Hub interface](https://doc.sitecore.com/ch/en/users/content-hub/create-an-oauth-client.html)  or by [requesting one using the API itself](https://doc.sitecore.com/ch/en/developers/cloud-dev/oauth-tokens.html#making-requests).


Version: v2.0
License: closed source

Metadata:
  - product: Content Hub

## Servers

```
https://{server}
```

Variables:
- `server`
  Default: "your-server"

## Security

### OAuth2

Type: oauth2
Token URL: /oauth/token
Scopes:

## Download OpenAPI description

 - [Jobs API](https://api-docs.sitecore.com/_bundle/ch/jobs-api/@v2.0/index.yaml)

## Jobs

 - [GET /api/v2/jobs/{id}](https://api-docs.sitecore.com/ch/jobs-api/jobs/jobbyidv2.md): Retrieves a job with a specified ID. Job targets are not retrieved. Only the link to the relation is used. You can get the job ID in the [Job details](https://doc.sitecore.com/ch/en/users/content-hub/
## Job description

 - [GET /api/jobs/{id}/description](https://api-docs.sitecore.com/ch/jobs-api/job-description/jobdescription.md): Retrieves the description for a specific job using its ID, for example `39595`.
 - [PUT /api/jobs/{id}/description](https://api-docs.sitecore.com/ch/jobs-api/job-description/createorupdatedescription.md): Creates a job description entity if it does not exist or updates the job description entity. It confirms that the job exists and that the user has permission to access it. Properties or relations not
 - [PATCH /api/jobs/{id}/description](https://api-docs.sitecore.com/ch/jobs-api/job-description/partialupdatedescription.md): Updates part of the job description entity. It confirms that both the job and description exist and that the user has permission to modify them. Properties or relations not included in the request wil
 - [DELETE /api/jobs/{id}/description](https://api-docs.sitecore.com/ch/jobs-api/job-description/deletedescription.md): Deletes the description associated with a job. It confirms that both the job and description exist and that the user has permission to access them.
 - [GET /api/jobs/{id}/description/{descriptionId}](https://api-docs.sitecore.com/ch/jobs-api/job-description/jobdescriptionbyid.md): Retrieves the description for a specific job using its ID, for example `39595`.
## Targets

 - [POST /api/jobs/{id}/targets](https://api-docs.sitecore.com/ch/jobs-api/targets/createtarget.md): Creates a new target for the specified job and returns the job target ID, for example `39605`.
 - [GET /api/jobs/{id}/targets](https://api-docs.sitecore.com/ch/jobs-api/targets/jobtargets.md): Lists all the targets associated with a job that match the criteria.
 - [POST /api/jobs/{id}/targets/bulk](https://api-docs.sitecore.com/ch/jobs-api/targets/createtargets.md): Creates new targets for the specified job and returns the job target IDs.
 - [GET /api/jobs/{id}/targets/{targetId}](https://api-docs.sitecore.com/ch/jobs-api/targets/jobtarget.md): Retrieves a job target using the job ID and the target ID.
 - [PUT /api/jobs/{id}/targets/{targetId}](https://api-docs.sitecore.com/ch/jobs-api/targets/updatetarget.md): Updates a target associated with a job. It ensures that both the job and target exist and that the user has access to them. Properties or relations not included in the request will be set to null.
 - [PATCH /api/jobs/{id}/targets/{targetId}](https://api-docs.sitecore.com/ch/jobs-api/targets/partialupdatetarget.md): Partial update on a target associated with a job. It ensures that the job and target exist and that the user has access to them. The properties and relations included in the request will be updated.
 - [DELETE /api/jobs/{id}/targets/{targetId}](https://api-docs.sitecore.com/ch/jobs-api/targets/deletetarget.md): Deletes a target for a job using its ID.
