---
title: "Queue a new job for the store."
method: POST
path: "/{storeName}/jobs"
tags: ["jobs"]
---

# Queue a new job for the store.

`POST /{storeName}/jobs`

The body of the request contains a generic job request object
The `jobType` field is used to define the kind of job to be created.
The `jobParameters` field is a map of string parameter name to string
value. The parameters accepted (or required) for a job vary by job type,
as described in the table below.

| Job Type | Parameter  | Description |
|----------|------------|-------------|
| consolidate | -       |  - 
| createsnapshot | TargetStoreName | REQUIRED: The name of the store to be created by the snapshot process.
|  | PersistenceType | REQUIRED: The persistence model to use for the store created by the snapshot process. Must be one of `AppendOnly` or `Rewrite` |
|  | CommitId | OPTIONAL: The unique identifier of the commit point of the source store to create the snapshot from. If not specified, the most recent commit point is used.
| export | FileName | REQUIRED: The name of the file to be written by the export process.
| | Format | OPTIONAL: The MIME type of the output format to be used by the export. Defaults to applicaiton/x-nquads.
| | GraphUri | OPTIONAL: The URI of the graph to be exported. If not specified, all of the graphs in the store will be exported.
| import | FileName | REQUIRED: The name of the file to be imported. This file must exist in the import directory of the store.
| | DefaultGraphUri | OPTIONAL: Provides a default target graph for the data (if the data does not itself specify a target graph). Defaults to the BrightstarDB default graph.
| repeattransaction | JobId | REQUIRED: The unique identifier of the job to be repeated.
| sparqlupdate | UpdateExpression | REQUIRED: The SPARQL Update expression to be processed.
| transaction | Preconditions | OPTIONAL: Triples or Quads that must exist in the store before the transaction is applied.
| transaction | NonexistencePreconditions | OPTIONAL: Triples or Quads that must not exist in the store before the transaction is applied.
| transaction | Deletes | OPTIONAL: Triples or Quads to be removed from the store.
| transaction | Inserts | OPTIONAL: Triples or Quads to be added to the store.
| transaction | DefaultGraphUri | OPTIONAL: The default target graph for the transaction, used to convert triples to quads.
| updatestats | - | - 

NOTE: The `Preconditions`, `NonExistencePreconditions`, `Deletes` and Inserts parameters for the transaction job
must use NQuads (or NTriples) syntax with a newline separating each triple or quad. The `Preconditions`, 
`NonExistencePreconditions` and `Deletes` all support the use of the "special" URI `http://www.brightstardb.com/.well-known/model/wildcard` for a wildcard match in the position where it is used. For more information please see http://brightstardb.readthedocs.org/en/latest/RDF_Client_API/#transactional-update

## Path parameters

- `storeName` string, required

## Request body

- JobRequestObject — An extensible model for defining the parameters of a job.
  - `jobType` 'consolidate' | 'createsnapshot' | 'export' | 'import' | 'repeattransaction' | 'sparqlupdate' | 'transaction' | 'updatestats' — The type of the job.
  - `label` string — A user-friendly name for the job.
  - `jobParameters` object — A dictionary mapping parameter name to value.

## Response `201`

The job request was accepted and the job has been queued.

The URL for monitoring the status of the job can be found in the 
Location response header.

- JobResponseModel
  - `jobId` string, GUID, required — The unique identifier of the job
  - `label` string — A user-friendly label for the job specified when the job was queued.
  - `jobStatus` 'Pending' | 'Started' | 'CompletedOk' | 'TransactionError' | 'Unknown' — The current processing state of the job.
  - `statusMessage` string — The last progress message recorded by the server for the processing of this job.
  - `storeName` string — The name of the store that the job is queued on
  - `exceptionInfo` ExceptionDetail
    - `type` string — The type of exception
    - `message` string — The message string from the exception
    - `stackTrace` string — The stack trace captured when the exception was handled.
    - `helpLink` string — The help link from the exception
    - `data` object — A map of additional data contained in the exception
    - `innerException` ExceptionDetail — recursive
  - `queuedTime` string, date-time — The date/time when the job was queued on the server.
  - `startTime` string, date-time — The date/time when the job started processing. This value will not be available when the jobStatus is "Pending".
  - `endTime` string, date-time — The date/time when the job completed processing. This value will not be available when the jobStatus is "Pending" or "Started".

## Other responses

- `400` — Bad Request. An unrecognized jobType was specified or one or more required parameters for the job were not supplied, or one or more parameters for the job where invalid.

## Changes

- **2015-05-26** `694b44600c48` — 2 info
  - api operation id `createJob` was added
  - api tag `jobs` added
- **2015-05-26** `37652d797bdc` — 1 info
  - endpoint added
- **2015-05-19** `404ee72d2da6` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/brightstardb/apis/brightstardb-rest-api/changes/:storeName/jobs/post.md)

---

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