<!-- https://staircase.co/platform/integration/job -->
# Job

# Job

Scheduled and on-demand execution with full lifecycle tracking: create, run, resume, stop, and webhook triggers.

Anything recurring runs here — nightly vendor pulls, report generation, bulk translation runs. A job carries its schedule, its payload and its state, and can be resumed rather than only restarted.

Webhook triggering means an external event starts a job directly, which is how a vendor's asynchronous completion becomes the next stage of work without a poller.

## How it works

Resumability is the reason the lifecycle is explicit rather than implied by a scheduler. A bulk run that fails partway through should continue from where it stopped; that is only possible if the run's position is state the job itself carries.

## Operations

<!--source:api-specifications-->

### Jobs
<!--/source-->

`POST` `/jobs`

<!--source:api-specifications-->

#### Create Job[new]
<!--/source-->

`createJob`

<!--source:api-specifications-->
Create Job
<!--/source-->

<!--source:api-specifications-->
Create Job will enable creation of a new job. To create a new job, you need to provide the below information:

- `name`
- `definition`
- `description` (Optional)
- `product_name` (Optional). Will be used to report performance metrics to Heath as a `product_name`, while setting `origin_product` to 'Job'

All Jobs consist of States

Show the rest State: States are the steps used to define Jobs. A different operation is performed in each State and the next step is specified.

#### Quick links

Available States are:

- InvokeProduct
- AthenaStartQuery
- AthenaGetResults
- AthenaGetResultsAsUrl
- AthenaGetResultsAsReference
- Choice
- Wait
- Mockdata
- Data
- Outputaggregate
- WaitForAction
- WaitForCallback

Available InvokeProduct settings:

- `Path` The staircase path where you will call the API (Required)
- `PathParameters` (Optional). Can be specified if path should be dynamically changed during API calls.
- `QueryParameters` (Optional). Can be specified if query string should be dynamically changed during API calls.
- `Method` Type of api call you will make
- `RequestPayload` (Optional). Request body of a http call.
- `EnvironmentSettings` (Optional). Environment settings allow invoking Staircase product on the other Staircase environment.
- `Headers` (Optional). Environment settings allow invoking Staircase product on the other Staircase environment.
- `CallbackSettings` (Optional). Allow invoking Staircase product with `callback_url`. If `WaitForCallback` present `CallbackSettings` going to be added by default.
- `WaitForCallback` (Optional). If present, State will wait for callback from a product. WaitForCallback can be used to specify success and/or failed values.
- `IterationSettings` (Optional). Job supports iteration settings for dynamic parallelism.
- `Projection` (Optional). Specifies the field(s) to return. To return all fields, omit this parameter.
- `TimeoutSeconds` (Optional). If the task runs longer than the specified seconds, this state fails.
- `ExceptNext` (Optional). Define your next state if any error occurs.
- `Retry` (Optional). Retry logic if any error in InvokeProduct happens it does retry.
- `After` (Optional). After action to execute after Product was invoked.

Available InvokeJob settings:

- `JobName` Job Name to invoke
- `TransactionId` Persistence Transaction ID
- `RequestPayload`. Request payload for Job invocation.
- `Projection` (Optional). Specifies the field(s) to return. To return all fields, omit this parameter.
- `IterationSettings` (Optional). Job supports iteration settings for dynamic parallelism.
- `TimeoutSeconds` (Optional). If the task runs longer than the specified seconds, this state fails.
- `ExceptNext` (Optional). Define your next state if any error occurs.
- `Retry` (Optional). Retry logic if any error in InvokeJob happens it does retry.

Available Intrinsic Functions are:

- `ulid`
- `array_get`
- `array_chunks`
- `add`
- `concat`
- `split`
- `replace`
- `merge`
- `date_format`
- `date_end_day`
- `date_start_day`
- `date_now`
- `date_next_day`
- `date_previous_day`
- `date_to_iso`
- `date_to_iso_tz`
- `date_from_iso`

#### Job Language

There are few ways to work with States definition.

As a JSON-path, string should start from `$.`

```
"PathParameters": {
 "transaction_id": "$.transaction_id"
 }
```

It is possible to escape a string with JSON-path like with `\$.`, for example

```
RequestPayload:
 query:
 path:
 path: \$.people[*].has_taxpayer_identifier_value.has_value
 format: jsonpath
 operation: eq
 value: $.request_payload.data.has_taxpayer_identifier_value.has_value
```

As a JMESPath, where string should start from `$jmespath.`

Example selecting 2 fields from `metrics` array of objects

```
"Projection": {
 "metrics": "$jmespath.metrics[*].{created_at: date_format(created_at, '%Y-%m-%dT%H:%M:%S.%f','%Y-%m-%d %H:%M:%S'), transaction_id: transaction_id}",
 "next": "$.next_token"
 }
```

JMESPath pipe example

```
"Projection": {
 "created_at": "$jmespath.created_at | date_format(@, '%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d')"
 }
```

JMESPath if-exists else example

```
"PathParameters": {
 "end_date": "$jmespath.outputs.LatestData.response_payload.created_at || outputs.Start.date",
 "product_name": "$.outputs.Start.product_name",
 "start_date": "$jmespath.outputs.LatestData.response_payload.created_at || outputs.Start.date"
 }
```

Follow the link bellow to review other JMESPath Examples

##### JMESPath Intrinsic Functions

According to JMESPath specification there is a list of Builtin functions. However, Job Language also provides a small number of "Intrinsic Functions", constructs which look like functions in programming languages and can be used to help process the data going to and from States. Date formats should be defined with Python datetime formatting When a function fail it returns `null`.

###### `ulid`

Allow to generate ULID

`ulid`

```
{
 "name": "ulid-test",
 "definition": {
 "StartAt": "Start",
 "States": {
 "Start": {
 "Type": "Data",
 "Data": {
 "ulid": "$jmespath.ulid"
 },
 "End": true
 }
 
 }
 }
 }
```

###### `array_get`

Allow to get element from an array using element index as jmespath

`array_get(array, index)`

```
{
 "PathParameters": {
 "flow_name": "$jmespath.array_get(outputs.Start.flow_names,outputs.Loop.index)",
 "start_date": "$jmespath.(outputs.LatestData.response_payload.start_date || outputs.Start.date)"
 }
 }
```

###### `array_chunks`

Allow to create array of arrays with the fixed size.

`array_chunks(array, chunk_size)`

```
{
 "name": "job_name",
 "definition": {
 "StartAt": "Start",
 "States": {
 "Start": {
 "Type": "MockData",
 "Data": {
 "array": [
 "1","2","3","4","5","6","7","8","9"
 ]
 },
 "Next": "Data"
 },
 "Data": {
 "Type": "Data",
 "Data": {
 "chunks": "$jmespath.array_chunks(outputs.Start.array,`2`)"
 },
 "End": true
 }
 }
 }
 }
```

Should provide following output

```
{
 "response_payload": {
 "chunks": [
 [
 "1",
 "2"
 ],
 [
 "3",
 "4"
 ],
 [
 "5",
 "6"
 ],
 [
 "7",
 "8"
 ],
 [
 "9"
 ]
 ]
 } 
}
```

###### `add`

Allow to add a number to number. Jmespath require that every Number should be inside "`" quotes

`add(number1, number2)`

```
{
 "Start": {
 "Data": {
 "index": 2
 },
 "Next": "Math",
 "Type": "MockData"
 },
 "Math": {
 "Data": {
 "index": "$jmespath.add(outputs.Start.index,`-1`)"
 },
 "End": true,
 "Type": "Data"
 }
}
```

###### `concat`

Allow to concat 2 strings. Jmespath require that every String should be inside "'" quotes

`concat(string1, string2)`

```
{
 "Start": {
 "Data": {
 "name":"foo"
 },
 "Next": "Math",
 "Type": "MockData"
 },
 "Math": {
 "Data": {
 "name": "$jmespath.concat('bar ',outputs.Start.name)"
 },
 "End": true,
 "Type": "Data"
 }
}
```

###### `split`

Split a string using separator

`split(string_1, separator)`

```
{
 "name": "split-test",
 "definition": {
 "StartAt": "Start",
 "States": {
 "Start": {
 "Type": "Data",
 "Data": {
 "people": [
 {
 "@id": "id_replace",
 "@type": "person",
 "first_name": "person_name",
 "email_address": "email@email.com"
 }
 ]
 },
 "Next": "Split"
 },
 "Split": {
 "Type": "Data",
 "Data": {
 "domain": "$jmespath.outputs.Start.people[0].email_address | split(@,'@')[1]"
 },
 "End": true
 } 
 }
 }
 }
```

Will return,

```
{
 "name": "split-test",
 "status": "SUCCEEDED",
 "current_step": "Split",
 "response_payload": {
 "domain": "email.com"
 }
 }
```

###### `replace`

Allow to replace sub_string in a string. Jmespath require that every String should be inside "'" quotes

`replace(where, to_replace, replace_with)`

```
{
 "States": {
 "Start": {
 "Type": "Data",
 "Data": {
 "data": "people[?@personal_identifier == PERSONAL_ID]"
 },
 "Next": "Replace"
 },
 "Replace": {
 "Type": "Data",
 "Data": {
 "replaced": "$jmespath.replace(outputs.Start.data,'PERSONAL_ID','123')"
 },
 "End": true
 }
 }
}
```

###### `merge`

Allow to concat 2 objects. Will merge two objects into one. All keys from `object2` will be present in result. For identical keys `object2` values will override `object1` values. This function does NOT do recursive merge.

`merge(object1, object2)`

```
{
 "name": "test",
 "definition": {
 "StartAt": "A",
 "States": {
 "A": {
 "Type": "MockData",
 "Data": {
 "f1": "A",
 "f2": "A"
 },
 "Next": "B"
 },
 "B": {
 "Type": "MockData",
 "Data": {
 "f2": "B",
 "f3": "B"
 },
 "Next": "C"
 },
 "C": {
 "Type": "Data",
 "Data": {
 "result": "$jmespath.merge(outputs.A,outputs.B)"
 },
 "End": true
 }
 }
 }
 }
```

###### `date_format`

Allow to format a date field formatting.

`date_format(date, from_format, to_format)`

```
"Projection": {
 "created_at": "$jmespath.created_at | date_format(@, '%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d')"
 }
```

###### `date_end_day`

Takes the date and make it end of the day.

`date_end_day(date, format)`

```
"Projection": {
 "created_at_end":"$jmespath.created_at | date_end_day(@, '%Y-%m-%dT%H:%M:%S.%f%z')"
 }
```

###### `date_start_day`

Takes the date and make it start of the day.

`date_start_day(date, format)`

```
"Projection": {
 "created_at_start":"$jmespath.created_at | date_start_day(@, '%Y-%m-%dT%H:%M:%S.%f%z')"
 }
```

###### `date_now`

Current datetime.

`date_now(format)`

```
"Projection": {
 "now": "$jmespath.date_now('%Y-%m-%d %H:%M:%S.%f')"
 }
```

###### `date_next_day`

Takes the date and make it the next day. Equvalent of +1 day operation

`date_next_day(date, format)`

```
"Projection": {
 "created_at_next": "$jmespath.created_at | date_next_day(@,'%Y-%m-%dT%H:%M:%S.%f%z') | date_format(@, '%Y-%m-%dT%H:%M:%S.%f%z','%Y-%m-%d %H:%M:%S')"
 }
```

###### `date_previous_day`

Takes the date and make it previoud day. Equvalent of -1 day operation

`date_next_day(date, format)`

```
"Projection": {
 "created_at_prev": "$jmespath.created_at | date_previous_day(@,'%Y-%m-%dT%H:%M:%S.%f%z') | date_format(@, '%Y-%m-%dT%H:%M:%S.%f%z','%Y-%m-%d %H:%M:%S')"
 }
```

Example using Intrinsic Functions

```
{
 "name": "test",
 "description": "Create Transaction",
 "definition": {
 "StartAt": "CreateTransaction",
 "States": {
 "CreateTransaction": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions",
 "Method": "POST",
 "RequestPayload": {},
 "Projection": {
 "transaction_id": "$jmespath.transaction_id",
 "created_at": "$jmespath.created_at",
 "created_at_next": "$jmespath.created_at | date_next_day(@,'%Y-%m-%dT%H:%M:%S.%f%z') | date_format(@, '%Y-%m-%dT%H:%M:%S.%f%z','%Y-%m-%d %H:%M:%S')",
 "created_at_prev": "$jmespath.created_at | date_previous_day(@,'%Y-%m-%dT%H:%M:%S.%f%z') | date_format(@, '%Y-%m-%dT%H:%M:%S.%f%z','%Y-%m-%d %H:%M:%S')", 
 "created_at_end":"$jmespath.created_at | date_end_day(@, '%Y-%m-%dT%H:%M:%S.%f%z')",
 "created_at_start":"$jmespath.created_at | date_start_day(@, '%Y-%m-%dT%H:%M:%S.%f%z')",
 "created_at_formatted": "$jmespath.created_at | date_format(@, '%Y-%m-%dT%H:%M:%S.%f%z','%Y-%m-%d %H:%M:%S')",
 "now": "$jmespath.date_now('%Y-%m-%d %H:%M:%S.%f')"
 },
 "End": true
 }
 }
 }
 }
```

Expected result

```
{

 "response_payload": {
 "transaction_id": "01GB858918AEZVTQMPAV5T1PF0",
 "created_at": "2022-08-24T10:49:11.465048-04:00",
 "created_at_next": "2022-08-25 10:49:11",
 "created_at_prev": "2022-08-23 10:49:11",
 "created_at_end": "2022-08-24T23:59:59.999999-0400",
 "created_at_start": "2022-08-24T00:00:00.000000-0400",
 "created_at_formatted": "2022-08-24 10:49:11",
 "now": "2022-08-24 14:49:11.494322"
 }

 }
```

###### `date_to_iso`

Takes the date and converts it to ISO format

`date_to_iso(date, from_format)`

###### `date_to_iso_tz`

Takes the date and converts it to ISO format by specifying TZ name

`date_to_iso_tz(date, from_format, tz_name)`

###### `date_from_iso`

Takes the date in ISO and converts it to `to_format`

`date_from_iso(date, to_format)`

###### `date_to_iso_tz` and `date_from_iso` example

```
name: test-20221119-15
definition:
 StartAt: A
 States:
 A:
 Type: Data
 Data:
 date_EST: "2022-11-17 10:00:22.466"
 date_EDT: "2022-06-17 10:00:22.466"
 iso_EST: "2022-11-17T10:00:22.466000-05:00"
 iso_EDT: "2022-06-17T10:00:22.466000-04:00"
 from_iso: "2022-06-17T10:00:22.466000-04:00"
 foo: bar
 Next: B
 B:
 Type: Data
 Data:
 result: >-
 $jmespath.outputs.A.{
 foo: foo, 
 date_EST_iso: date_to_iso(date_EST, '%Y-%m-%d %H:%M:%S.%f'), 
 date_EST: date_to_iso_tz(date_EST, '%Y-%m-%d %H:%M:%S.%f','America/New_York'), 
 date_EDT: date_to_iso_tz(date_EDT, '%Y-%m-%d %H:%M:%S.%f','America/New_York'), 
 iso_EST: date_from_iso(iso_EST,'%Y-%m-%d %H:%M:%S.%f TZ %z'), 
 iso_EDT: date_from_iso(iso_EDT,'%Y-%m-%d %H:%M:%S.%f TZ %z')
 }
 result_2: >-
 $jmespath.outputs.A.{
 date_EST: date_from_iso(
 date_to_iso_tz(date_EST, 
 '%Y-%m-%d %H:%M:%S.%f','America/New_York'),'%Y-%m-%d %H:%M:%S.%f')
 }
 from_iso: >-
 $jmespath.outputs.A.{from_iso: date_from_iso(from_iso, '%Y-%m-%d %H:%M:%S.%f TZ %z')}
 End: true
```

```
{
 "response_payload": {
 "result": {
 "date_EST_iso": "2022-11-17T10:00:22.466000",
 "date_EST": "2022-11-17T10:00:22.466000-05:00",
 "date_EDT": "2022-06-17T10:00:22.466000-04:00",
 "foo": "bar",
 "iso_EST": "2022-11-17 10:00:22.466000 TZ -05:00",
 "iso_EDT": "2022-06-17 10:00:22.466000 TZ -04:00"
 },
 "result_2": {
 "date_EST": "2022-11-17 10:00:22.466000"
 },
 "from_iso": {
 "from_iso": "2022-06-17 10:00:22.466000 TZ -04:00"
 }
 }
 }
```

#### States

##### InvokeProduct

Invoke product state is main state type in the job. An API call is made to one of the Staircase products in the InvokeProduct state. You must define the resource definition for the action you will take.

The following example demonstrates how to invoke Persistence Product to create a transaction

```
"CreateTransaction": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions",
 "Method": "POST",
 "RequestPayload": {}
 "Next": "CreateCollection"
 }
```

###### Path

Full path to a Staircase product api. Should NOT start from `/`. Can contain `{path_name}` path parameters and/or query parameters

```
{
 "Path": "code-health-checker/performance/metrics/products/{product_name}?start_date={start_date}&end_date={end_date}&status=failed&limit=10"
 }
```

###### PathParameters

```
{
 "Path": "console-pipeline/pipelines/{pipeline_name}/data/latest?sort_column=created_at",
 "PathParameters": {
 "pipeline_name": "$.outputs.Start.pipeline_name"
 } 
 }
```

###### EnvironmentSettings

Environment settings allow to invoke Staircase product on the other Staircase environment.

`EnvironmentSettings` consists of:

- `Host`
- `ApiKey`

It is NOT allowed to set static string values.

Both `Host` and `ApiKey` can contain on of following:

- JSON-path
- JMESPath
- `$$.CurrentValue`

In case `Host` and/or `ApiKey` use JSON-path or JMESPath, `Host` and `ApiKey` can ONLY refer to `$.request_payload`. `Host` and `ApiKey` can be defined while Executing a Job in `request_payload`.

Example of a job to create Transaction on other Staircase eenvironment.

```
{
 "definition": {
 "StartAt": "CreateTransaction",
 "States": {
 "CreateTransaction": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions",
 "EnvironmentSettings": {
 "Host": "$.request_payload.Host",
 "ApiKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
 },
 "Method": "POST",
 "RequestPayload": {
 "label":"$.request_payload.label"
 },
 "End": true
 }
 }
 }
 }
```

In case `Host` and/or `ApiKey` use `$$.CurrentValue`,

```
{
 "GetServiceKey": {
 "Type": "InvokeProduct",
 "Method": "GET",
 "Path": "environment-manager/service-key",
 "EnvironmentSettings": {
 "Host": "$$.CurrentValue"
 },
 "IterationSettings": {
 "IterateOverPath": "$.outputs.Subscribers.response_payload.subscribed_domains",
 "MaxConcurrency": 10
 },
 "Next": "SomeData"
 } 
}
```

###### Headers

Headers allow to add custom headers to the request. For example, `Authorization` header. It is possible to use JSON-path or JMESPath inside `Headers`.

Example of a job with `EnvironmentSettings` and `Headers`.

```
{
 "name": "test",
 "definition": {
 "StartAt": "Start",
 "States": {
 "Start": {
 "Type": "MockData",
 "Data": {
 "token": "bar"
 },
 "Next": "Product"
 },
 "Product": {
 "Type": "InvokeProduct",
 "Path": "administrator/costs",
 "Method": "GET",
 "EnvironmentSettings": {
 "Host": "$.request_payload.Host",
 "ApiKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
 },
 "Headers": {
 "Authorization": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
 },
 "End": true
 }
 }
 }
 }
```

###### QueryParameters

Query Paramerts allow to specify Query string of a HTTP request. Only non-null values will be added to a query string.

```
{
 "Type": "InvokeProduct",
 "Method": "GET",
 "Path": "code-health-checker/performance/metrics/products/{product_name}?status=failed",
 "QueryParameters": {
 "start_date": "$jmespath.(outputs.LatestData.response_payload.created_at || outputs.Start.date) | date_next_day(@,'%Y-%m-%d')",
 "end_date": "$jmespath.date_now('%Y-%m-%d') | date_previous_day(@,'%Y-%m-%d')",
 "limit": 10,
 "next_token": "$jmespath.outputs.Current_Step.response_payload.next_token || outputs.Start.next_token"
 },
 "PathParameters": {
 "product_name": "$.outputs.Start.product_name"
 }
 
 }
```

###### Method

Any valid HTTP method

###### RequestPayload

Can be an object,

```
{
 "RequestPayload": {
 "collection_without_soft_credit": "$.outputs.DeleteSoftCreditInformation.response_payload.collection_id",
 "hard_credit_collection": "$.outputs.PatchHardCreditCollectionSsn.response_payload.collection_id",
 "loan_collection": "$.outputs.CreateChosenLoanCollection.response_payload.collection_id",
 "transaction_id": "$.transaction_id"
 } 
}
```

Can be a string,

```
{
 RequestPayload": "$.outputs.Health.response_payload.metrics"
 }
```

Can be an array,

```
{
 "Product": {
 "Type": "InvokeProduct",
 "Path": "path/",
 "Method": "POST",
 "EnvironmentSettings": {
 "Host": "$.request_payload.Host"
 },
 "QueryParameters": {
 "foo": "$.outputs.Start.foo"
 },
 "RequestPayload": [
 "$jmespath.outputs.Start"
 ],
 "End": true
 } 
}
```

###### CallbackSettings

For callback settings, the expected path must be specified in the incoming callback message.

It can optionally be specified in the value corresponding to this path.

```
"Build": {
 "Type": "InvokeProduct",
 "Path": "infra-builder/builds",
 "Method": "POST",
 "RequestPayload": {
 "source_url": "$.outputs.RetrieveAssessResponse.response_payload.source_url"
 },
 "CallbackSettings": {
 "Path": "$.callback_url",
 },
 "Next": "NextState"
}
```

`Path` defines path to callback_url in request payload to Product. You can see default value above.

###### WaitForCallback

It can optionally be specified in the value corresponding to this path.

`WaitForCallback` can be `true`. In this case all default values will be applied.

The following example invoke Staircase Build product

```
"Build": {
 "Type": "InvokeProduct",
 "Path": "infra-builder/builds",
 "Method": "POST",
 "RequestPayload": {
 "source_url": "$.outputs.RetrieveAssessResponse.response_payload.source_url"
 },
 "WaitForCallback": {
 "ExpectedPath": "$.status",
 "ExpectedValues": ["SUCCEEDED"],
 "FailedValues": ["ERROR", "FAILED"]
 },
 "Next": "NextState"
}
```

`WaitForCallback` default values are

```
"ExpectedPath": "status",
"ExpectedValues": [
 "SUCCEEDED",
 "Succeeded",
 "COMPLETED",
 "Completed"
],
"FailedValues": [
 "CANCELLED",
 "Cancelled",
 "FAILED",
 "Failed",
 "ERROR",
 "Error",
 "TIME_OUT",
 "Time_out"
],
```

###### TimeoutSeconds

`TimeoutSeconds` (Optional). If the task runs longer than the specified seconds, this state fails with a Timeout. Must be a positive, non-zero integer. If not provided, the default value is 3600.

###### Retry

`Retry` (Optional). Retry logic if any error in InvokeProduct happens it does retry. Example of State with Retry usage:

```
"CreateCollection": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions/{transaction_id}/collections",
 "Method": "POST",
 "PathParameters": {
 "transaction_id": "$.transaction_id"
 },
 "RequestPayload": {
 "metadata": {
 "version": 2,
 "validation": true
 },
 "data": "$.request_payload.collection_data"
 },
 "Retry": {
 "IntervalSeconds": 10,
 "MaxAttempts": 10,
 },
 "Next": "MockData"
},
```

Both values are required and accepts int values.

###### After

`After` (Optional). Specifies type of action to execute after response from a product was received. Usually this is used when Product returns `data` instead of `response_collection_id`.

Supported after actions:

- `CreateCollection` will create a collection using Product response as a payload. Accepts `product_response_data_path` to prodive json path to response data
- `CreateReference` will create a reference to a dataset. Can be used later f.e. `IterationSettings` -> `Reference`

`CreateReference`

Accepts:

- `reference_name` (Optional). Name of the reference to be save. Going to available later in current Job Execution. If not specifed, Step name will be used.
- `product_response_data_path` (Optional). Path in the Product response to a data to be saved as a reference.
- `product_response_data_url` (Optional). Path in the Product response to a URL where data for a Reference is located. Job product will download the data and place and create new Reference.

It is possible to Get All saved references back from the Job Execution.

Example of After action that saves InvokeProduct response as a reference.

```
{
 "GetTelemetry": {
 "Type": "InvokeProduct",
 "Method": "POST",
 "Path": "job/stats",
 "Projection": "$.data",
 "After": [
 {
 "CreateReference": {
 "reference_name": "job_stats",
 "product_response_data_path": "$"
 }
 }
 ],
 "Next": "SaveTelemetry"
 }
 }
```

Example of After action that saves Connector response with URL as a reference.

```
{
 "ToJSON": {
 "Type": "InvokeProduct",
 "Path": "connector-jobs/transformations/csv-to-json/async",
 "Method": "PUT",
 "RequestPayload": {
 "transaction_id": "$.transaction_id",
 "urls": {
 "download_from_url": "$.outputs.RunSQL.response_payload.url"
 },
 "configuration": {
 "delimiter": ","
 }
 },
 "WaitForCallback": {
 "ExpectedPath": "$.status"
 },
 "After": [
 {
 "CreateReference": {
 "reference_name": "sql_results",
 "product_response_data_url": "$.result.temporary_url"
 }
 }
 ],
 "Next": "MoveToMortgage"
 }
 }
```

`CreateCollection` For example to be able to Translate payload and save to collection

Instead of

```
{
 "TranslateAssets": {
 "Method": "POST",
 "Next": "CreateCollectionV2Assets",
 "Path": "translator/translate",
 "RequestPayload": {
 "data": "$.outputs.CheckStatusAssets.response_payload.data",
 "lang_from": "staircase",
 "lang_to": "staircase",
 "metadata": {
 "transaction_id": "$.transaction_id"
 },
 "sc_version_from": 0,
 "sc_version_to": 2
 },
 "Type": "InvokeProduct"
 },
 "CreateCollectionV2Assets": {
 "Method": "POST",
 "Next": "InvokeSoftCredit",
 "Path": "persistence/transactions/{transaction_id}/collections",
 "PathParameters": {
 "transaction_id": "$.transaction_id"
 },
 "RequestPayload": {
 "data": "$.outputs.TranslateAssets.response_payload",
 "metadata": {
 "version": 2
 }
 },
 "Retry": {
 "IntervalSeconds": 3,
 "MaxAttempts": 2
 },
 "Type": "InvokeProduct"
 }
 }
```

it is recommended to use After action

```
"TranslateAssets": {
 "Method": "POST",
 "Next": "CreateCollectionV2Assets",
 "Path": "translator/translate",
 "RequestPayload": {
 "data": "$.outputs.CheckStatusAssets.response_payload.data",
 "lang_from": "staircase",
 "lang_to": "staircase",
 "metadata": {
 "transaction_id": "$.transaction_id"
 },
 "sc_version_from": 0,
 "sc_version_to": 2
 },
 "Type": "InvokeProduct",
 "After": [
 {
 "CreateCollection": {
 "product_response_data_path": "$.response_payload",
 "validation": false
 }
 }
 ]
 }
```

###### Projection

`Projection` (Optional). Specifies the field(s) to return. To return all fields, omit this parameter. Can be a String or an Object.

In case InvokeProduct has `CallbackSetting` Projection is going to be applied to callback response payload `$`, otherwise Projection is going to be applied to `$.response_payload`.

In case InvokeProduct has `IterationSettings` it is possible to use `$$.CurrentValue` inside projection.

Example of Projection as a String `"Projection":"$.collection_id"`. It will put only "$.collection_id" value in your response_payload object.

```
{
 "name": "demo-job-01",
 "description": "Demo demo-job-01",
 "definition": {
 "StartAt": "CreateCollection",
 "States": {
 "CreateCollection": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions/{transaction_id}/collections",
 "Method": "POST",
 "PathParameters": {
 "transaction_id": "$.transaction_id"
 },
 "RequestPayload": {
 "metadata": {
 "version": 2,
 "validation": true
 },
 "data": "$.request_payload.collection_data"
 
 },
 "Projection":"$.collection_id",
 "Next": "MockData"
 },
 "MockData": {
 "Type": "MockData",
 "Data": {
 "foo": "bar"
 },
 "Next": "Aggregation"
 },
 "Aggregation": {
 "Type": "OutputAggregate",
 "Aggregation": {
 "collection_id.$": "$.outputs.CreateCollection.response_payload",
 "mock_foo.$": "$.outputs.MockData.foo"
 },
 "End": true
 }
 }
 }
}
```

Example of Projection as a Object

```
"Projection": {"collection_id": "$.collection_id"}
```

It will put `my_collection_id` in your response_payload with a value of "$.collection_id".

```
{
 "name": "demo-job-01",
 "description": "Demo demo-job-01",
 "definition": {
 "StartAt": "CreateCollection",
 "States": {
 "CreateCollection": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions/{transaction_id}/collections",
 "Method": "POST",
 "PathParameters": {
 "transaction_id": "$.transaction_id"
 },
 "RequestPayload": {
 "metadata": {
 "version": 2,
 "validation": true
 },
 "data": "$.request_payload.collection_data"
 
 },
 "Projection": {"my_collection_id": "$.collection_id"},
 "Next": "MockData"
 },
 "MockData": {
 "Type": "MockData",
 "Data": {
 "foo": "bar"
 },
 "Next": "Aggregation"
 },
 "Aggregation": {
 "Type": "OutputAggregate",
 "Aggregation": {
 "collection_id.$": "$.outputs.CreateCollection.response_payload.my_collection_id",
 "mock_foo.$": "$.outputs.MockData.foo"
 },
 "End": true
 }
 }
 }
}
```

Example using `Projection` with `$$.CurrentValue`

```
{
 "GetServiceKey": {
 "Type": "InvokeProduct",
 "Method": "GET",
 "Path": "environment-manager/service-key",
 "Projection": {
 "domain_name": "$$.CurrentValue",
 "service_key": "$.service_key"
 },
 "IterationSettings": {
 "IterateOverPath": "$.outputs.Subscribers.response_payload.subscribed_domains",
 "MaxConcurrency": 10
 },
 "Next": "SomeData"
 } 
}
```

###### Projection Examples

Example of Projection for Invoke Product

```
"Projection": {
 "invocation_status": "$.invocation_status",
 "request_collection_id": "$.request_collection_id",
 "response_collection_id": "$.response_collection_id"
 }
```

Example of Projection for Execute Job

```
"Projection": {
 "response_payload": "$.response_payload",
 "execution_id": "$.execution_id"
 }
```

###### Iteration Settings

Job supports iteration settings for dynamic parallelism.

`IterationSettings` can be used to run a set of steps for each element of an input array or reference.

`IterationSettings` for an array If you add `IterationSettings` to you state, InvokeProduct state will execute the same steps for multiple entries of an array in the state input.

Accepts:

- `IterateOverPath` The IterateOverPath field's value is a reference path identifying where in the effective input the array field is found (Required)
- `MaxConcurrency` (Optional) The MaxConcurrency field's value is an integer that provides an upper bound on how many invocations of the Iterator may run in parallel. Default value is `4`.

For instance, a MaxConcurrency value of 10 will limit your Map state to 10 concurrent iterations running at one time. The value of 0, will places no limit on concurency. Step Functions invokes iterations as concurrently as possible.

There are two additional items available in the context object when processing a state with IterationSetting

The `$$.CurrentIndex` contains the index number for the arraIterationSettingsitem that is being processed in the current iteration The `$$.CurrentValue` contains the value for the array item that is being processed in the current iteration

```
"CreateCollection": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions/{transaction_id}/collections",
 "PathParameters": {
 "transaction_id": "$.outputs.CreateTransaction.response_payload.transaction_id"
 },
 "Method": "POST",
 "RequestPayload": {"data": "$$.CurrentValue"},
 "IterationSettings": {
 "IterateOverPath": "$.request_payload.items",
 "MaxConcurrency": 5,
 },
 "Next": "CreateTransaction2",
}
```

`IterationSettings` using Reference

Will use one the Saved References as an input for iteration. Iterating over Reference allow to expand limits of Job product, such as `events history size`, `state machine size` etc. It is important to make sure reference saved points to an array.

Accepts:

- `Reference` Name of the saved reference.
- `ReferenceType` Type of the saved reference `JSON` or `CSV`
- `BatchSize` (Optional) Batch size for single Iteration. Please make sure InvokeProduct enpoint can accepts array instead of object.
- `ToleratedFailureCount` (Optional) Error handling configuration where you can set count of errors to tolerate.
- `ToleratedFailurePercentage` (Optional) Error handling configuration where you can set percentage of errors to tolerate.
- `MaxConcurrency` (Optional) If you set it to zero, Job doesn't limit concurreny and runs 10,000 parallel child workflow executions. Default value is `4`.

Example of `IterationSettings` using Reference

```
{
 "SaveTelemetry": {
 "Method": "POST",
 "Path": "console-pipeline/pipelines/{pipeline_name}/datasets/main/data",
 "PathParameters": {
 "pipeline_name": "$.request_payload.pipeline_name"
 },
 "QueryParameters": {
 "account_name": "$.request_payload.domain_name",
 "transaction_id": "$.transaction_id",
 "created_at": "$jmespath.start_time | date_format(@, '%Y-%m-%dT%H:%M:%S.%f%z', '%Y-%m-%d %H:%M:%S')"
 },
 "RequestPayload": "$$.CurrentValue",
 "Type": "InvokeProduct",
 "IterationSettings": {
 "Reference": "job_stats",
 "BatchSize": 20,
 "ToleratedFailureCount": 100,
 "ToleratedFailurePercentage": 0
 },
 "Retry": {
 "IntervalSeconds": 10,
 "MaxAttempts": 5
 },
 "End": true
 }
 }
```

##### InvokeJob

`InvokeJob` initiates a direct synchronous call to another Job. Being inherently synchronous, `InvokeJob` will invariably wait for the other job to finish before proceeding.

The following example demonstrates how to invoke other Job

```
"FIPS": {
 "Type": "InvokeJob",
 "JobName": "get-data-fips",
 "RequestPayload": {}
 "Next": "SQL"
 }
```

###### JobName

Job Name to invoke. Job should be created before using Create Job

###### RequestPayload

Request Payload to be passed to Job execution. See `Request Payload` in Execute Job Should always be an object,

```
{
 "Create": {
 "Type": "InvokeJob",
 "JobName": "sql-execute-and-wait",
 "TransactionId": "$.transaction_id",
 "RequestPayload": {
 "sql": "$.outputs.Start.create_sql",
 "parameters": [
 "$.outputs.FIPS.fips_counties_prefixes_start"
 ]
 },
 "Next": "Insert"
 }
 }
```

###### TransactionId

TransactionID to be passed to Job execution. See `Transaction ID` in Execute Job If TransactionID was not provided, Job product will generate new Transaction ID.

###### Projection

Specifies the field(s) to return. To return all fields, omit this parameter. Should always be an object. Projection is going to be applied to `$.response_payload` of a Job. Projection does not support JMESPATH.

Example of Projection

```
{
 "Projection": {
 "fips_counties_prefixes_start": "$.fips_counties_prefixes_start",
 "fips_counties_prefixes_continue": "$.fips_counties_prefixes_continue"
 }
 }
```

```
{
 "FIPS": {
 "Type": "InvokeJob",
 "JobName": "get-data-fips",
 "TransactionId": "$.transaction_id",
 "Projection": {
 "fips_counties_prefixes_start": "$.fips_counties_prefixes_start",
 "fips_counties_prefixes_continue": "$.fips_counties_prefixes_continue"
 },
 "Next": "SQL"
 }
 }
```

##### AthenaStartQuery

This type allows invoking AWS Athena directly, without API invocations or additional job definitions. AthenaStartQuery is a synchronous operation, which means its state will be 'RUNNING' as soon as the SQL request starts running.

Accepts:

- `Query`. SQL query to execute. Should be a string
- `Parameters` (Optional). Arrays of SQL Query parameters to use
- `WorkGroup` (Optional). AWS Athena workgroup to use. Default value is: `primary`

Outputs:

- `QueryExecutionId`. ID of the query execution

The following example executes SQL and get results as URL or CSV Reference

```
{
 "name": "athena-test",
 "definition": {
 "StartAt": "Data",
 "States": {
 "Data": {
 "Type": "Data",
 "Next": "Start",
 "Data": {
 "params": [
 "NY"
 ]
 }
 },
 "Start": {
 "Type": "AthenaStartQuery",
 "Query": "SELECT * FROM \"db_name\".\"addresses\" WHERE state = ? limit 10",
 "Parameters": "$.outputs.Data.params",
 "Next": "Get"
 },
 "Get": {
 "Type": "AthenaGetResults",
 "QueryExecutionId": "$.outputs.Start.QueryExecutionId",
 "Next": "GetUrl"
 },
 "GetUrl": {
 "Type": "AthenaGetResultsAsUrl",
 "QueryExecutionId": "$.outputs.Start.QueryExecutionId",
 "Next": "GetReference"
 },
 "GetReference": {
 "Type": "AthenaGetResultsAsReference",
 "QueryExecutionId": "$.outputs.Start.QueryExecutionId",
 "ReferenceName": "reference_name_foo",
 "End": true
 }
 }
 }
 }
```

##### AthenaGetResults

Gets SQL Results as data inside the Job state machine

Accepts:

- `QueryExecutionId`. SQL query to execute. Should be a string

Outputs:

- `Data`. JSON array that represents rows from SQL query results

##### AthenaGetResultsAsUrl

Accepts:

- `QueryExecutionId`. SQL query to execute. Should be a string

Outputs:

- `URL`. Pre-signed url to download results. File is in the format of CSV

##### AthenaGetResultsAsReference

Accepts:

- `QueryExecutionId`. SQL query to execute. Should be a string
- `ReferenceName`. Reference name to be created in current Job execution. Similar to CreateReference

Outputs:

- Reference name that was created

The following example executes SQL, creates Reference and executes IterationSettings using Reference

```
{
 "name": "athena-test",
 "definition": {
 "StartAt": "Start",
 "States": {
 "Start": {
 "Type": "AthenaStartQuery",
 "Query": "SELECT * FROM \"batch-data-load\".\"sc-first-american-listings-unique\" limit 10000;",
 "Next": "GetReference"
 },
 "GetReference": {
 "Type": "AthenaGetResultsAsReference",
 "QueryExecutionId": "$.outputs.Start.QueryExecutionId",
 "ReferenceName": "listings",
 "Next": "InvokeJobs"
 },
 "InvokeJobs": {
 "Type": "InvokeProduct",
 "Path": "job/jobs/{job_name}/executions",
 "Method": "POST",
 "IterationSettings": {
 "IterateOverPath": "$",
 "Reference": "listings",
 "ReferenceType": "CSV",
 "BatchSize": 2,
 "ToleratedFailurePercentage": 5,
 "MaxConcurrency": 10
 },
 "PathParameters": {
 "job_name": "athena-test-empty"
 },
 "RequestPayload": {
 "transaction_id": "$.transaction_id",
 "request_payload": {
 "data": "$$.CurrentValue"
 }
 },
 "WaitForCallback": {
 "ExpectedPath": "$.status"
 },
 "End": true
 }
 }
 }
 }
```

##### Choice

A Choice state adds branching logic to a state machine.

`Choices` (Required): An array of Choice Rules that determines which state the state machine transitions to next

`Default` (Optional, Recommended): The name of the state to transition to if none of the transitions in Choices is taken

Choice Rules

A Choice state must have a Choices field whose value is a non-empty array, and whose every element is an object called a Choice Rule. A Choice Rule contains the following:

- A comparison - Two fields that specify an input variable to compare, the type of comparison, and the value to compare the variable to. Choice Rules support comparison between two variables. Within a Choice Rule, the value of Variable can be compared with another value from the state input by appending Path to name of supported comparison operators.
- A Next field - The value of this field must match a state name in the state machine.

The following example checks whether the numerical value is equal to 1.

```
{
 "Variable": "$.foo",
 "NumericEquals": 1,
 "Next": "FirstMatchState"
}
```

The following example checks whether the string is equal to MyString.

```
{
 "Variable": "$.foo",
 "StringEquals": "MyString",
 "Next": "FirstMatchState"
}
```

Supported Operations

The following comparison operators are supported:

- And
- BooleanEquals,BooleanEqualsPath
- IsBoolean
- IsNull
- IsNumeric
- IsPresent
- IsString
- IsTimestamp
- Not
- NumericEquals,NumericEqualsPath
- NumericGreaterThan,NumericGreaterThanPath
- NumericGreaterThanEquals,NumericGreaterThanEqualsPath
- NumericLessThan,NumericLessThanPath
- NumericLessThanEquals,NumericLessThanEqualsPath
- Or
- StringEquals,StringEqualsPath
- StringGreaterThan,StringGreaterThanPath
- StringGreaterThanEquals,StringGreaterThanEqualsPath
- StringLessThan,StringLessThanPath
- StringLessThanEquals,StringLessThanEqualsPath
- StringMatches
- TimestampEquals,TimestampEqualsPath
- TimestampGreaterThan,TimestampGreaterThanPath
- TimestampGreaterThanEquals,TimestampGreaterThanEqualsPath
- TimestampLessThan,TimestampLessThanPath
- TimestampLessThanEquals,TimestampLessThanEqualsPath

##### Wait

A Wait state delays the state machine from continuing for a specified time.

The following Wait state introduces a 10-second delay into a state machine

```
"wait_ten_seconds": {
 "Type": "Wait",
 "Seconds": 10,
 "Next": "NextState"
}
```

##### MockData

MockData could be used to generate and place some static data. Common usecase would be a usage of this step instead of InvokeProduct if it is not implemented.

```
"AddingSomeDataInsideJob": {
 "Type": "MockData",
 "Data": {
 "foo": "bar",
 },
 "Next": "NextState"
 }
```

Will produce following result

```
{
 "outputs": {
 "AddingSomeDataInsideJob": {
 "foo": "bar"
 }
 }
}
```

##### Data

Data could be used to generate new data from the `$.outputs.*`.

```
{
 "Start": {
 "Data": {
 "array": [
 "a",
 "b",
 "c",
 "d",
 "e"
 ]
 },
 "Next": "Data",
 "Type": "MockData"
 }, 
 "Data": {
 "Data": {
 "size.$": "States.ArrayLength($.outputs.Start.array)"
 },
 "End": true,
 "Type": "Data"
 },

 }
```

Will produce following result

```
{
 "Data": {
 "size": 5
 },
 "Start": {
 "array": [
 "a",
 "b",
 "c",
 "d",
 "e"
 ]
 }
 }
```

##### OutputAggregate

OutputAggregate is used to clear all state results from outputs and create new step data.

```
"AddingSomeDataInsideJob": {
 "Type": "OutputAggregate",
 "Aggregation": {
 "foo": "bar",
 "foo.$": "$.outputs.PreviousStep.foo" 
 },
 "Next": "NextState"
 }
```

`Aggregation` as an object allow to construct Step output with custom fields.

Example of MockData used together with OutputAggregate

```
{
 "name": "JobRandom",
 "description": "",
 "definition": {
 "StartAt": "State",
 "States": {
 "State": {
 "Type": "MockData",
 "Result": { "foo": "bar" },
 "Next": "State1"
 },
 "State1": {
 "Type": "MockData",
 "Result": { "bar": "bar" },
 "Next": "State2"
 },
 "State2": {
 "Type": "OutputAggregate",
 "Aggregation": { "foonew.$": "$.outputs.State.foo" },
 "End": true
 }
 }
 }
 }
```

`Aggregation` as a String allow to set object from from different step.

Example of OutputAggregate override state outputs with results from "State"

```
{
 "name": "JobRandom",
 "description": "",
 "definition": {
 "StartAt": "State",
 "States": {
 "State": {
 "Type": "MockData",
 "Result": { "foo": "bar" },
 "Next": "State1"
 },
 "State1": {
 "Type": "MockData",
 "Result": { "bar": "bar" },
 "Next": "State2"
 },
 "State2": {
 "Type": "OutputAggregate",
 "Aggregation": "$.outputs.State",
 "End": true
 }
 }
 }
 }
```

##### Wait for action

Wait for action allows to pause job execution and wait for resume action.

The following Wait for action will pause job execution

```
"wait_for_action": {
 "Type": "WaitForAction",
 "Next": "NextState"
}
```

##### Wait for callback

State waits for callback from a product. WaitForCallback can be used to specify success and/or failed values. This step behaviour is the same as waitforcallback in the InvokeProduct

`StepName` should point to a Step defined before with `CallbackSettings`

It is also possible to specify `Projection` in the WaitForCallback. In that case it will be applied to the to callback response payload `$`. See more details in the `InvokeProduct` section Projection

The following Wait for action will pause job execution

```
"WaitForCallback": {
 "Type": "WaitForCallback",
 "StepName": "step_name",
 "ExpectedPath": "$.status",
 "ExpectedValues": ["SUCCEEDED"],
 "FailedValues": ["ERROR", "FAILED"],
 "Next": "NextState"
}
```

##### Examples

###### Create Transaction Job Example

```
{
 "name": "CreateTransaction",
 "description": "Create Transaction",
 "definition": {
 "StartAt": "CreateTransaction",
 "States": {
 "CreateTransaction": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions",
 "Method": "POST",
 "RequestPayload": {}
 "End": true
 }
 }
 }
}
```

###### DevOps Pipeline Job

```
{
 "name": "pipeline",
 "description": "Devops Pipeline",
 "definition": {
 "StartAt": "Clone",
 "States": {
 "Clone": {
 "Type": "InvokeProduct",
 "Path": "code/clone",
 "Method": "POST",
 "RequestPayload": {
 "project_name": "$.request_payload.product_name",
 "branch": "$.request_payload.branch_name",
 "github_account": "GITHUB_ACCOUNT",
 "github_token": "GITHUB_TOKEN"
 },
 "Next": "WaitCloneStatus20Secs"
 },
 "WaitCloneStatus20Secs": {
 "Type": "Wait",
 "Seconds": 20,
 "Next": "RetrieveCloneStatus"
 },
 "RetrieveCloneStatus": {
 "Type": "InvokeProduct",
 "Path": "code/clone/{bundle_id}",
 "Method": "GET",
 "PathParameters": {
 "bundle_id": "$.outputs.Clone.response_payload.bundle_id"
 },
 "Next": "CheckCloneStatus"
 },
 "CheckCloneStatus": {
 "Type": "Choice",
 "Choices": [
 {
 "Variable": "$.outputs.RetrieveCloneStatus.response_payload.clone_status",
 "StringEquals": "SUCCEEDED",
 "Next": "Assess"
 },
 {
 "Variable": "$.outputs.RetrieveCloneStatus.response_payload.clone_status",
 "StringEquals": "FAILED",
 "Next": "FailState"
 },
 {
 "Variable": "$.outputs.RetrieveCloneStatus.response_payload.clone_status",
 "StringEquals": "IN_PROGRESS",
 "Next": "WaitCloneStatus20Secs"
 }
 ]
 },
 "Assess": {
 "Type": "InvokeProduct",
 "Path": "code-assessor/assessments",
 "Method": "POST",
 "RequestPayload": {
 "source_url": "$.outputs.RetrieveCloneStatus.response_payload.source_url"
 },
 "Next": "WaitAssessStatus30Secs"
 },
 "WaitAssessStatus30Secs": {
 "Type": "Wait",
 "Seconds": 30,
 "Next": "RetrieveAssessStatus"
 },
 "RetrieveAssessStatus": {
 "Type": "InvokeProduct",
 "Path": "code-assessor/assessments/{assessment_id}",
 "Method": "GET",
 "PathParameters": {
 "assessment_id": "$.outputs.Assess.response_payload.assessment_id"
 },
 "Next": "CheckAssessStatus"
 },
 "CheckAssessStatus": {
 "Type": "Choice",
 "Choices": [
 {
 "Variable": "$.outputs.RetrieveAssessStatus.response_payload.status",
 "StringEquals": "SUCCEEDED",
 "Next": "Build"
 },
 {
 "Variable": "$.outputs.RetrieveAssessStatus.response_payload.status",
 "StringEquals": "FAILED",
 "Next": "FailState"
 },
 {
 "Variable": "$.outputs.RetrieveAssessStatus.response_payload.status",
 "StringEquals": "IN_PROGRESS",
 "Next": "WaitAssessStatus30Secs"
 }
 ]
 },
 "Build": {
 "Type": "InvokeProduct",
 "Path": "infra-builder/builds",
 "Method": "POST",
 "RequestPayload": {
 "source_url": "$.outputs.RetrieveAssessStatus.response_payload.source_url"
 },
 "CallbackSettings": {
 "ExpectedPath": "$.status",
 "ExpectedValue": "SUCCEEDED"
 },
 "Next": "Wait10SecGetBuildResults"
 },
 "Wait10SecGetBuildResults": {
 "Type": "Wait",
 "Seconds": 10,
 "Next": "GetBuildResults"
 },
 "GetBuildResults": {
 "Type": "InvokeProduct",
 "Path": "infra-builder/builds/{build_id}",
 "Method": "GET",
 "PathParameters": {
 "build_id": "$.outputs.Build.response_payload.bundle_id"
 },
 "Next": "Deploy"
 },
 "Deploy": {
 "Type": "InvokeProduct",
 "Path": "infra-deployer/deploy-by-token",
 "Method": "POST",
 "RequestPayload": {
 "artifacts_url": "$.outputs.GetBuildResults.response_payload.artifacts_url",
 "environment_token": "$.request_payload.environment_token"
 },
 "CallbackSettings": {
 "ExpectedPath": "$.status",
 "ExpectedValue": "SUCCEEDED"
 },
 "Next": "Wait10SecGetDeployResults"
 },
 "Wait10SecGetDeployResults": {
 "Type": "Wait",
 "Seconds": 10,
 "Next": "GetDeployResults"
 },
 "GetDeployResults": {
 "Type": "InvokeProduct",
 "Path": "infra-deployer/deploy/{bundle_id}",
 "Method": "GET",
 "PathParameters": {
 "bundle_id": "$.outputs.Deploy.response_payload.bundle_id"
 },
 "End": true
 },
 "FailState": {
 "Type": "Fail",
 "Cause": "Failed.",
 "Error": "Failed"
 }
 }
 }
}
```

<!--/source-->

##### Request

<!--source:api-specifications-->
CreateTransactionDevOps Pipeline JobCreate Job With Iteration Settings
<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "name": "CreateTransaction",
 "description": "Create Transaction",
 "definition": {
 "StartAt": "CreateTransaction",
 "States": {
 "CreateTransaction": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions",
 "Method": "POST",
 "RequestPayload": {},
 "End": true
 }
 }
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "name": "pipeline",
 "description": "DevOps Pipeline",
 "definition": {
 "StartAt": "Clone",
 "States": {
 "Clone": {
 "Type": "InvokeProduct",
 "Path": "code/clone",
 "Method": "POST",
 "RequestPayload": {
 "project_name": "$.request_payload.product_name",
 "branch": "$.request_payload.branch_name",
 "github_account": "GITHUB_ACCOUNT",
 "github_token": "GITHUB_TOKEN"
 },
 "Next": "WaitCloneStatus20Secs"
 },
 "WaitCloneStatus20Secs": {
 "Type": "Wait",
 "Seconds": 20,
 "Next": "RetrieveCloneStatus"
 },
 "RetrieveCloneStatus": {
 "Type": "InvokeProduct",
 "Path": "code/clone/{bundle_id}",
 "Method": "GET",
 "PathParameters": {
 "bundle_id": "$.outputs.Clone.response_payload.bundle_id"
 },
 "Next": "CheckCloneStatus"
 },
 "CheckCloneStatus": {
 "Type": "Choice",
 "Choices": [
 {
 "Variable": "$.outputs.RetrieveCloneStatus.response_payload.clone_status",
 "StringEquals": "SUCCEEDED",
 "Next": "Assess"
 },
 {
 "Variable": "$.outputs.RetrieveCloneStatus.response_payload.clone_status",
 "StringEquals": "FAILED",
 "Next": "FailState"
 },
 {
 "Variable": "$.outputs.RetrieveCloneStatus.response_payload.clone_status",
 "StringEquals": "IN_PROGRESS",
 "Next": "WaitCloneStatus20Secs"
 }
 ]
 },
 "Assess": {
 "Type": "InvokeProduct",
 "Path": "code-assessor/assessments",
 "Method": "POST",
 "RequestPayload": {
 "source_url": "$.outputs.RetrieveCloneStatus.response_payload.source_url"
 },
 "Next": "WaitAssessStatus30Secs"
 },
 "WaitAssessStatus30Secs": {
 "Type": "Wait",
 "Seconds": 30,
 "Next": "RetrieveAssessStatus"
 },
 "RetrieveAssessStatus": {
 "Type": "InvokeProduct",
 "Path": "code-assessor/assessments/{assessment_id}",
 "Method": "GET",
 "PathParameters": {
 "assessment_id": "$.outputs.Assess.response_payload.assessment_id"
 },
 "Next": "CheckAssessStatus"
 },
 "CheckAssessStatus": {
 "Type": "Choice",
 "Choices": [
 {
 "Variable": "$.outputs.RetrieveAssessStatus.response_payload.status",
 "StringEquals": "SUCCEEDED",
 "Next": "Build"
 },
 {
 "Variable": "$.outputs.RetrieveAssessStatus.response_payload.status",
 "StringEquals": "FAILED",
 "Next": "FailState"
 },
 {
 "Variable": "$.outputs.RetrieveAssessStatus.response_payload.status",
 "StringEquals": "IN_PROGRESS",
 "Next": "WaitAssessStatus30Secs"
 }
 ]
 },
 "Build": {
 "Type": "InvokeProduct",
 "Path": "infra-builder/builds",
 "Method": "POST",
 "RequestPayload": {
 "source_url": "$.outputs.RetrieveAssessStatus.response_payload.source_url"
 },
 "CallbackSettings": {
 "ExpectedPath": "status",
 "ExpectedValue": "SUCCEEDED"
 },
 "Next": "Wait10SecGetBuildResults"
 },
 "Wait10SecGetBuildResults": {
 "Type": "Wait",
 "Seconds": 10,
 "Next": "GetBuildResults"
 },
 "GetBuildResults": {
 "Type": "InvokeProduct",
 "Path": "infra-builder/builds/{build_id}",
 "Method": "GET",
 "PathParameters": {
 "build_id": "$.outputs.Build.response_payload.bundle_id"
 },
 "Next": "Deploy"
 },
 "Deploy": {
 "Type": "InvokeProduct",
 "Path": "infra-deployer/deploy-by-token",
 "Method": "POST",
 "RequestPayload": {
 "artifacts_url": "$.outputs.GetBuildResults.response_payload.artifacts_url",
 "environment_token": "$.request_payload.environment_token"
 },
 "CallbackSettings": {
 "ExpectedPath": "status",
 "ExpectedValue": "SUCCEEDED"
 },
 "Next": "Wait10SecGetDeployResults"
 },
 "Wait10SecGetDeployResults": {
 "Type": "Wait",
 "Seconds": 10,
 "Next": "GetDeployResults"
 },
 "GetDeployResults": {
 "Type": "InvokeProduct",
 "Path": "infra-deployer/deploy/{bundle_id}",
 "Method": "GET",
 "PathParameters": {
 "bundle_id": "$.outputs.Deploy.response_payload.bundle_id"
 },
 "End": true
 },
 "FailState": {
 "Type": "Fail",
 "Cause": "Failed.",
 "Error": "Failed"
 }
 }
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "name": "Dynamic Parallelism",
 "description": "MAP",
 "definition": {
 "StartAt": "CreateTransaction",
 "States": {
 "CreateTransaction": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions",
 "Method": "POST",
 "RequestPayload": {},
 "Next": "CreateCollection"
 },
 "CreateCollection": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions/{transaction_id}/collections",
 "PathParameters": {
 "transaction_id": "$.outputs.CreateTransaction.response_payload.transaction_id"
 },
 "Method": "POST",
 "RequestPayload": {
 "data": "$$.CurrentValue.data"
 },
 "IterationSettings": {
 "IterateOverPath": "$.request_payload.items",
 "MaxConcurrency": 5
 },
 "End": true
 }
 }
 }
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
201400 Already Exist400 Invalid Job Name400 Invalid Job Definition403500503
<!--/source-->

<!--source:api-specifications-->
application/json Copy Create Job API Triggered Successfully

```
{
 "name": "Job name",
 "description": "Job Description",
 "product_name": "Product",
 "definition": {
 "StartAt": "CreateTransaction",
 "States": {
 "CreateTransaction": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions",
 "Method": "POST",
 "RequestPayload": {},
 "Retry": {
 "MaxAttempts": 3,
 "IntervalSeconds": 5
 },
 "End": true
 }
 }
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request

```
{
 "message": "Job {job_name} is exist!"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request

```
{
 "message": "Invalid job name!"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request

```
{
 "message": "Invalid job definition!"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Service Unavailable

```
{
 "message": "Job is in deleting process! Try after a few seconds"
}
```

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `name`required | `string` | <!--source:api-specifications-->Job Name<!--/source--> |
| `description`required | `string` | <!--source:api-specifications-->Job Description<!--/source--> |
| `product_name` | `string` | <!--source:api-specifications-->Product Name<!--/source--> |
| `definition`required | `object` | <!--source:api-specifications-->Job Definition<!--/source--> |
| `StartAt`required | `string` | <!--source:api-specifications-->The first state<!--/source--> |
| `States`required | `object` | <!--source:api-specifications-->Job States<!--/source--> |
| `STATE_NAME` | `object` | <!--source:api-specifications-->Name of the State<!--/source--> |
| `Method` | `string` | <!--source:api-specifications-->Method<!--/source--> |
| `Path` | `string` | <!--source:api-specifications-->Path<!--/source--> |
| `PathParameters` | `object` | <!--source:api-specifications-->PathParameters<!--/source--> |
| `QueryParameters` | `object` | <!--source:api-specifications-->QueryParameters<!--/source--> |
| `RequestPayload` | `object` | <!--source:api-specifications-->RequestPayload<!--/source--> |
| `CallbackSettings` | `object` | <!--source:api-specifications-->CallbackSettings<!--/source--> |
| `WaitForCallback` | `object` | <!--source:api-specifications-->WaitForCallback<!--/source--> |
| `Projection` | `object` | <!--source:api-specifications-->Projection<!--/source--> |
| `After` | `object` | <!--source:api-specifications-->After Action<!--/source--> |
| `Type`required | `string` | <!--source:api-specifications-->State type<!--/source-->`Choice``Data``Fail``InvokeProduct``MockData``OutputAggregate``Pass``Succeed``Wait``WaitForAction``WaitForCallback` |
| `End` | `boolean` | <!--source:api-specifications-->End of the job definition<!--/source--> |
| `Next` | `string` | <!--source:api-specifications-->Next State Name<!--/source--> |
| `ExceptNext` | `string` | <!--source:api-specifications-->Next State if any error occurs<!--/source--> |
| `Retry` | `object` | <!--source:api-specifications-->Retry Settings<!--/source--> |
| `TimeoutSeconds` | `integer` | <!--source:api-specifications-->If the task runs longer than the specified seconds, this state fails with a Timeout. Must be a positive, non-zero integer. If not provided, the default value is 3600.<!--/source--> |
| `IterationSettings` | `object` | <!--source:api-specifications-->If you add IterationSetting to you state, InvokeProduct state will execute the same steps for multiple entries of an array in the state input<!--/source--> |

##### Response `201``application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->
<!--source:api-specifications-->
Create Job API Triggered Successfully
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `name` | `string` | <!--source:api-specifications-->Job Name<!--/source--> |
| `description` | `string` | <!--source:api-specifications-->Job Description<!--/source--> |
| `product_name` | `string` | <!--source:api-specifications-->Name of product<!--/source--> |
| `definition` | `object` | <!--source:api-specifications-->Job Definition<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

##### Response `503``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Service Unavailable
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

`GET` `/jobs`

<!--source:api-specifications-->

#### Retrieve All Jobs
<!--/source-->

`listJobs`

<!--source:api-specifications-->
Retrieves Existing Jobs

<!--/source-->

##### Response

<!--source:api-specifications-->
200403500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Retrieve Jobs

```
[
 {
 "$ref": "#/components/examples/GetJobResp"
 }
]
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Response `200``application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->
<!--source:api-specifications-->
Retrieve Jobs
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `name` | `string` | <!--source:api-specifications-->Job Name<!--/source--> |
| `description` | `string` | <!--source:api-specifications-->Job Description<!--/source--> |
| `product_name` | `string` | <!--source:api-specifications-->Name of product<!--/source--> |
| `definition` | `object` | <!--source:api-specifications-->Job Definition<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

`GET` `/jobs/{job_name}`

<!--source:api-specifications-->

#### Retrieve Job
<!--/source-->

`getJob`

<!--source:api-specifications-->
Retrieve Job returns the content of a given job.

<!--/source-->

##### Response

<!--source:api-specifications-->
200400403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Retrieve Job

```
{
 "name": "Job name",
 "description": "Job Description",
 "product_name": "Product",
 "definition": {
 "StartAt": "CreateTransaction",
 "States": {
 "CreateTransaction": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions",
 "Method": "POST",
 "RequestPayload": {},
 "Retry": {
 "MaxAttempts": 3,
 "IntervalSeconds": 5
 },
 "End": true
 }
 }
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request

```
{
 "message": "Bad Request!"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found

```
{
 "value": {
 "message": "Job not found"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_name` required | `string` path | `ExampleJobName` | <!--source:api-specifications-->Job Name<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->
<!--source:api-specifications-->
Retrieve Job
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `name` | `string` | <!--source:api-specifications-->Job Name<!--/source--> |
| `description` | `string` | <!--source:api-specifications-->Job Description<!--/source--> |
| `product_name` | `string` | <!--source:api-specifications-->Name of product<!--/source--> |
| `definition` | `object` | <!--source:api-specifications-->Job Definition<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

`GET` `/jobs/executions`

<!--source:api-specifications-->

#### Create Job[new]
<!--/source-->

`retrieveExecutionsMetrics`

<!--source:api-specifications-->
Retrieve Executions Metrics
<!--/source-->

##### Response

<!--source:api-specifications-->
200403500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Retrieve Executions Metrics

```
[
 {
 "name": "job-name-1",
 "datapoints": [
 {
 "Timestamp": "2023-11-24T10:00:00.000000Z",
 "Sum": 1
 }
 ]
 },
 {
 "name": "job-name-2",
 "datapoints": [
 {
 "Timestamp": "2023-11-24T12:00:00.000000Z",
 "Sum": 3
 }
 ]
 }
]
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `start_time` | `string` query | `2023-11-24T00:00:00` | <!--source:api-specifications-->Start time<!--/source--> |
| `end_time` | `string` query | `2023-11-25T00:00:00` | <!--source:api-specifications-->End time<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Retrieve Executions Metrics
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `name` | `string` | <!--source:api-specifications-->Job Name<!--/source--> |
| `datapoints` | `object[]` | <!--source:api-specifications-->datapoints<!--/source--> |
| `Timestamp` | `string` | <!--source:api-specifications-->Timestamp<!--/source--> |
| `Sum` | `string` | <!--source:api-specifications-->Sum<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

`PUT` `/jobs/{job_name}`

<!--source:api-specifications-->

#### Update Job
<!--/source-->

`updateJob`

<!--source:api-specifications-->
Update Job returns the content of an updated job.

<!--/source-->

##### Request

<!--source:api-specifications-->
CreateCollectionDevOps Pipeline Job
<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "name": "CreateCollection",
 "description": "CreateCollection",
 "definition": {
 "StartAt": "CreateTransaction",
 "States": {
 "CreateTransaction": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions",
 "Method": "POST",
 "RequestPayload": {},
 "Next": "CreateCollection"
 },
 "CreateCollection": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions/{transaction_id}/collections",
 "Method": "POST",
 "PathParameters": {
 "transaction_id": "$.outputs.CreateTransaction.response_payload.transaction_id"
 }
 }
 }
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "name": "pipeline",
 "description": "DevOps Pipeline",
 "definition": {
 "StartAt": "Clone",
 "States": {
 "Clone": {
 "Type": "InvokeProduct",
 "Path": "code/clone",
 "Method": "POST",
 "RequestPayload": {
 "project_name": "$.request_payload.product_name",
 "branch": "$.request_payload.branch_name",
 "github_account": "GITHUB_ACCOUNT",
 "github_token": "GITHUB_TOKEN"
 },
 "Next": "WaitCloneStatus20Secs"
 },
 "WaitCloneStatus20Secs": {
 "Type": "Wait",
 "Seconds": 20,
 "Next": "RetrieveCloneStatus"
 },
 "RetrieveCloneStatus": {
 "Type": "InvokeProduct",
 "Path": "code/clone/{bundle_id}",
 "Method": "GET",
 "PathParameters": {
 "bundle_id": "$.outputs.Clone.response_payload.bundle_id"
 },
 "Next": "CheckCloneStatus"
 },
 "CheckCloneStatus": {
 "Type": "Choice",
 "Choices": [
 {
 "Variable": "$.outputs.RetrieveCloneStatus.response_payload.clone_status",
 "StringEquals": "SUCCEEDED",
 "Next": "Assess"
 },
 {
 "Variable": "$.outputs.RetrieveCloneStatus.response_payload.clone_status",
 "StringEquals": "FAILED",
 "Next": "FailState"
 },
 {
 "Variable": "$.outputs.RetrieveCloneStatus.response_payload.clone_status",
 "StringEquals": "IN_PROGRESS",
 "Next": "WaitCloneStatus20Secs"
 }
 ]
 },
 "Assess": {
 "Type": "InvokeProduct",
 "Path": "code-assessor/assessments",
 "Method": "POST",
 "RequestPayload": {
 "source_url": "$.outputs.RetrieveCloneStatus.response_payload.source_url"
 },
 "Next": "WaitAssessStatus30Secs"
 },
 "WaitAssessStatus30Secs": {
 "Type": "Wait",
 "Seconds": 30,
 "Next": "RetrieveAssessStatus"
 },
 "RetrieveAssessStatus": {
 "Type": "InvokeProduct",
 "Path": "code-assessor/assessments/{assessment_id}",
 "Method": "GET",
 "PathParameters": {
 "assessment_id": "$.outputs.Assess.response_payload.assessment_id"
 },
 "Next": "CheckAssessStatus"
 },
 "CheckAssessStatus": {
 "Type": "Choice",
 "Choices": [
 {
 "Variable": "$.outputs.RetrieveAssessStatus.response_payload.status",
 "StringEquals": "SUCCEEDED",
 "Next": "Build"
 },
 {
 "Variable": "$.outputs.RetrieveAssessStatus.response_payload.status",
 "StringEquals": "FAILED",
 "Next": "FailState"
 },
 {
 "Variable": "$.outputs.RetrieveAssessStatus.response_payload.status",
 "StringEquals": "IN_PROGRESS",
 "Next": "WaitAssessStatus30Secs"
 }
 ]
 },
 "Build": {
 "Type": "InvokeProduct",
 "Path": "infra-builder/builds",
 "Method": "POST",
 "RequestPayload": {
 "source_url": "$.outputs.RetrieveAssessStatus.response_payload.source_url"
 },
 "CallbackSettings": {
 "ExpectedPath": "status",
 "ExpectedValue": "SUCCEEDED"
 },
 "Next": "Wait10SecGetBuildResults"
 },
 "Wait10SecGetBuildResults": {
 "Type": "Wait",
 "Seconds": 10,
 "Next": "GetBuildResults"
 },
 "GetBuildResults": {
 "Type": "InvokeProduct",
 "Path": "infra-builder/builds/{build_id}",
 "Method": "GET",
 "PathParameters": {
 "build_id": "$.outputs.Build.response_payload.bundle_id"
 },
 "Next": "Deploy"
 },
 "Deploy": {
 "Type": "InvokeProduct",
 "Path": "infra-deployer/deploy-by-token",
 "Method": "POST",
 "RequestPayload": {
 "artifacts_url": "$.outputs.GetBuildResults.response_payload.artifacts_url",
 "environment_token": "$.request_payload.environment_token"
 },
 "CallbackSettings": {
 "ExpectedPath": "status",
 "ExpectedValue": "SUCCEEDED"
 },
 "Next": "Wait10SecGetDeployResults"
 },
 "Wait10SecGetDeployResults": {
 "Type": "Wait",
 "Seconds": 10,
 "Next": "GetDeployResults"
 },
 "GetDeployResults": {
 "Type": "InvokeProduct",
 "Path": "infra-deployer/deploy/{bundle_id}",
 "Method": "GET",
 "PathParameters": {
 "bundle_id": "$.outputs.Deploy.response_payload.bundle_id"
 },
 "End": true
 },
 "FailState": {
 "Type": "Fail",
 "Cause": "Failed.",
 "Error": "Failed"
 }
 }
 }
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Update Job

```
{
 "name": "Job name",
 "description": "Job Description",
 "product_name": "Product",
 "definition": {
 "StartAt": "CreateTransaction",
 "States": {
 "CreateTransaction": {
 "Type": "InvokeProduct",
 "Path": "persistence/transactions",
 "Method": "POST",
 "RequestPayload": {},
 "Retry": {
 "MaxAttempts": 3,
 "IntervalSeconds": 5
 },
 "End": true
 }
 }
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request

```
{
 "message": "Bad Request!"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found

```
{
 "value": {
 "message": "Job not found"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_name` required | `string` path | `ExampleJobName` | <!--source:api-specifications-->Job Name<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `name`required | `string` | <!--source:api-specifications-->Job Name<!--/source--> |
| `description`required | `string` | <!--source:api-specifications-->Job Description<!--/source--> |
| `product_name` | `string` | <!--source:api-specifications-->Product Name<!--/source--> |
| `definition`required | `object` | <!--source:api-specifications-->Job Definition<!--/source--> |
| `StartAt`required | `string` | <!--source:api-specifications-->The first state<!--/source--> |
| `States`required | `object` | <!--source:api-specifications-->Job States<!--/source--> |
| `STATE_NAME` | `object` | <!--source:api-specifications-->Name of the State<!--/source--> |
| `Method` | `string` | <!--source:api-specifications-->Method<!--/source--> |
| `Path` | `string` | <!--source:api-specifications-->Path<!--/source--> |
| `PathParameters` | `object` | <!--source:api-specifications-->PathParameters<!--/source--> |
| `QueryParameters` | `object` | <!--source:api-specifications-->QueryParameters<!--/source--> |
| `RequestPayload` | `object` | <!--source:api-specifications-->RequestPayload<!--/source--> |
| `CallbackSettings` | `object` | <!--source:api-specifications-->CallbackSettings<!--/source--> |
| `WaitForCallback` | `object` | <!--source:api-specifications-->WaitForCallback<!--/source--> |
| `Projection` | `object` | <!--source:api-specifications-->Projection<!--/source--> |
| `After` | `object` | <!--source:api-specifications-->After Action<!--/source--> |
| `Type`required | `string` | <!--source:api-specifications-->State type<!--/source-->`Choice``Data``Fail``InvokeProduct``MockData``OutputAggregate``Pass``Succeed``Wait``WaitForAction``WaitForCallback` |
| `End` | `boolean` | <!--source:api-specifications-->End of the job definition<!--/source--> |
| `Next` | `string` | <!--source:api-specifications-->Next State Name<!--/source--> |
| `ExceptNext` | `string` | <!--source:api-specifications-->Next State if any error occurs<!--/source--> |
| `Retry` | `object` | <!--source:api-specifications-->Retry Settings<!--/source--> |
| `TimeoutSeconds` | `integer` | <!--source:api-specifications-->If the task runs longer than the specified seconds, this state fails with a Timeout. Must be a positive, non-zero integer. If not provided, the default value is 3600.<!--/source--> |
| `IterationSettings` | `object` | <!--source:api-specifications-->If you add IterationSetting to you state, InvokeProduct state will execute the same steps for multiple entries of an array in the state input<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->
<!--source:api-specifications-->
Update Job
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `name` | `string` | <!--source:api-specifications-->Job Name<!--/source--> |
| `description` | `string` | <!--source:api-specifications-->Job Description<!--/source--> |
| `product_name` | `string` | <!--source:api-specifications-->Name of product<!--/source--> |
| `definition` | `object` | <!--source:api-specifications-->Job Definition<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

`DELETE` `/jobs/{job_name}`

<!--source:api-specifications-->

#### Delete Job
<!--/source-->

`deleteJob`

<!--source:api-specifications-->
Delete Job

<!--/source-->

##### Response

<!--source:api-specifications-->
202400403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Delete Job

```
{
 "message": "Job is deleted!"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request

```
{
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found

```
{
 "value": {
 "message": "Job did not found!"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_name` required | `string` path | `ExampleJobName` | <!--source:api-specifications-->Job Name<!--/source--> |

##### Response `202``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Delete Job
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Response Message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

<!--source:api-specifications-->

### Execution Iterations[new]
<!--/source-->

`GET` `/jobs/{job_name}/executions/{execution_id}/iterations/{step_name}`

<!--source:api-specifications-->

#### Retrieve All
<!--/source-->

`getExecutionIterationsStep`

<!--source:api-specifications-->
Get all Job Execution step iterations
<!--/source-->

##### Response

<!--source:api-specifications-->
403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found

```
{
 "value": {
 "message": "Job {job_name} not found!"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
3
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_name` required | `string` path | `ExampleJobName` | <!--source:api-specifications-->Job Name<!--/source--> |
| `execution_id` required | `string` path | `01FEK7TACV6XP1CMBX44MJE4G3` | <!--source:api-specifications-->Execution ID<!--/source--> |
| `step_name` required | `string` path | `InvokeHealth` | <!--source:api-specifications-->Job Step Name<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

##### Other responses

`200`

`GET` `/jobs/{job_name}/executions/{execution_id}/iterations/{step_name}/status`

<!--source:api-specifications-->

#### Retrieve Iteration Status
<!--/source-->

`getExecutionIterationsStepLatestStatus`

<!--source:api-specifications-->
Get Job Execution step iteration status
<!--/source-->

##### Response

<!--source:api-specifications-->
403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found

```
{
 "value": {
 "message": "Job {job_name} not found!"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
3
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_name` required | `string` path | `ExampleJobName` | <!--source:api-specifications-->Job Name<!--/source--> |
| `execution_id` required | `string` path | `01FEK7TACV6XP1CMBX44MJE4G3` | <!--source:api-specifications-->Execution ID<!--/source--> |
| `step_name` required | `string` path | `InvokeHealth` | <!--source:api-specifications-->Job Step Name<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
8 fields
<!--/source-->
<!--source:api-specifications-->
Get all Job Execution step iterations
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `status` | `string` | — |
| `startDate` | `string` | — |
| `stopDate` | `string` | — |
| `maxConcurrency` | `integer` | — |
| `toleratedFailurePercentage` | `string` | — |
| `toleratedFailureCount` | `integer` | — |
| `itemCounts` | `object` | — |
| `pending` | `integer` | — |
| `running` | `integer` | — |
| `succeeded` | `integer` | — |
| `failed` | `integer` | — |
| `timedOut` | `integer` | — |
| `aborted` | `integer` | — |
| `total` | `integer` | — |
| `resultsWritten` | `integer` | — |
| `executionCounts` | `object` | — |
| `pending` | `integer` | — |
| `running` | `integer` | — |
| `succeeded` | `integer` | — |
| `failed` | `integer` | — |
| `timedOut` | `integer` | — |
| `aborted` | `integer` | — |
| `total` | `integer` | — |
| `resultsWritten` | `integer` | — |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

`GET` `/jobs/{job_name}/executions/{execution_id}/iterations/{step_name}/results`

<!--source:api-specifications-->

#### Retrieve Iteration Results
<!--/source-->

`getExecutionIterationsStepLatestResults`

<!--source:api-specifications-->
Get Job Execution step iteration results
<!--/source-->

##### Response

<!--source:api-specifications-->
403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found

```
{
 "value": {
 "message": "Job {job_name} not found!"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
4
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_name` required | `string` path | `ExampleJobName` | <!--source:api-specifications-->Job Name<!--/source--> |
| `execution_id` required | `string` path | `01FEK7TACV6XP1CMBX44MJE4G3` | <!--source:api-specifications-->Execution ID<!--/source--> |
| `step_name` required | `string` path | `InvokeHealth` | <!--source:api-specifications-->Job Step Name<!--/source--> |
| `iteration` | `string` query | `iterationID` | <!--source:api-specifications-->Iteration ID. If not set, latest will be used<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

##### Other responses

`200`

<!--source:api-specifications-->

### Execution References[new]
<!--/source-->

`GET` `/jobs/{job_name}/executions/{execution_id}/references`

<!--source:api-specifications-->

#### Retrieve All
<!--/source-->

`getExecutionReferences`

<!--source:api-specifications-->
Get Execution References
<!--/source-->

##### Response

<!--source:api-specifications-->
403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found

```
{
 "value": {
 "message": "Job {job_name} not found!"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_name` required | `string` path | `ExampleJobName` | <!--source:api-specifications-->Job Name<!--/source--> |
| `execution_id` required | `string` path | `01FEK7TACV6XP1CMBX44MJE4G3` | <!--source:api-specifications-->Execution ID<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

##### Other responses

`200`

<!--source:api-specifications-->

### Execution
<!--/source-->

`POST` `/jobs/{job_name}/executions/{execution_id}/resume`

<!--source:api-specifications-->

#### Resume Execution
<!--/source-->

`resumeExecution`

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "foo": "bar"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found

```
{
 "value": {
 "message": "Execution not found!"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_name` required | `string` path | `ExampleJobName` | <!--source:api-specifications-->Job Name<!--/source--> |
| `execution_id` required | `string` path | `01FEK7TACV6XP1CMBX44MJE4G3` | <!--source:api-specifications-->Execution ID<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

##### Other responses

`200`

`POST` `/jobs/{job_name}/executions/{execution_id}/stop`

<!--source:api-specifications-->

#### Stop Execution
<!--/source-->

`stopExecution`

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "foo": "bar"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found

```
{
 "value": {
 "message": "Execution not found!"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_name` required | `string` path | `ExampleJobName` | <!--source:api-specifications-->Job Name<!--/source--> |
| `execution_id` required | `string` path | `01FEK7TACV6XP1CMBX44MJE4G3` | <!--source:api-specifications-->Execution ID<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

##### Other responses

`200`

<!--source:api-specifications-->

### Addendum Signed Document
<!--/source-->

`POST` `/jobs/AddendumSignedDocument/executions`

<!--source:api-specifications-->

#### Run Addendum Signed Document
<!--/source-->

`runAddendumSignedDocument`

<!--source:api-specifications-->
Set Addendum Signed Document
<!--/source-->

<!--source:api-specifications-->
Set Addendum Signed Document Run after dddendum is signed. Request example:

```
{
 "request_payload": {
 "loan_id": "87376716-9351-4abb-93d6-ddd08364f897",
 "blob_id": "01GGZQN05WG6GJX2HVQJHRNQER",
 "transaction_id": "01GG54QMC4GCQBQ5YY91VVDCVP"
 }
}
```

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "request_payload": {
 "loan_id": "87376716-9351-4abb-93d6-ddd08364f897",
 "blob_id": "01GGZQN05WG6GJX2HVQJHRNQER",
 "transaction_id": "01GG54QMC4GCQBQ5YY91VVDCVP"
 }
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
application/json Copy Bad request

```
{
 "message": {
 "schema_type": [
 "Must be one of: create, update."
 ]
 }
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `request_payload`required | `object` | <!--source:api-specifications-->Addendum Payload<!--/source--> |
| `loan_id` | `string` | <!--source:api-specifications-->loan_id<!--/source--> |
| `blob_id` | `string` | <!--source:api-specifications-->blob_id<!--/source--> |
| `transaction_id` | `string` | <!--source:api-specifications-->transaction_id<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Return Job ID
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `one of` | <!--source:api-specifications-->Either message or object with additional properties.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Request forbidden -- authorization will not help<!--/source--> |
| `url` | `string (url)` | <!--source:api-specifications-->Indicates at which url the error occurs<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Partner not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `job_id` | `string` | <!--source:api-specifications-->Nothing matches the given URI<!--/source--> |

`GET` `/jobs/AddendumSignedDocument/executions/{job_id}`

<!--source:api-specifications-->

#### Get Addendum Signed Document
<!--/source-->

`getAddendumSignedDocument`

<!--source:api-specifications-->
Get Addendum Signed Document Get Execution Status for addendum job.

<!--/source-->

##### Response

<!--source:api-specifications-->
application/json Copy Bad request

```
{
 "message": {
 "schema_type": [
 "Must be one of: create, update."
 ]
 }
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_id` required | `string (uuid)` path | `7c668252-d2ba-job-id-896d-1f73236287d9` | <!--source:api-specifications-->Execution ID<!--/source--> |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Return Job ID
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `one of` | <!--source:api-specifications-->Either message or object with additional properties.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Request forbidden -- authorization will not help<!--/source--> |
| `url` | `string (url)` | <!--source:api-specifications-->Indicates at which url the error occurs<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Partner not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `job_id` | `string` | <!--source:api-specifications-->Nothing matches the given URI<!--/source--> |

<!--source:api-specifications-->

### PreOfferValuation
<!--/source-->

`POST` `/jobs/PreOfferValuation/executions`

<!--source:api-specifications-->

#### Run PreOfferValuation
<!--/source-->

`runPreOfferValuation`

<!--source:api-specifications-->
Run PreOfferValuation Run PreOfferValuation Request example:

```
{
 "request_payload": {
 "form_data": {
 "buyer_name": "Buyer Name",
 "buyer_2_name": "Co Buyer Name",
 "agent_name": "Agent-Name",
 "agent_email": "agent@staircase.co",
 "brokerage_name": "remax",
 "brokerage_phone": "34342342",
 "loan_officer_email": "lo@staircase.co",
 "loan_officer_name": "LO",
 "property_street_address": "209 N Highway 45",
 "property_city": "Bonanza",
 "property_state": "AR",
 "property_zip_coShow the restde": "72916",
 "down_payment_amount": 45000,
 "down_payment_percent": 5,
 "offer_amount": 120000,
 "loan_id": "87376716-9351-4abb-93d6-ddd08364f897",
 "preapproval_loan_amount": 114000,
 "loan_officer_phone": "",
 "lender_organization_name": "envoymortgage"
 },
 "transaction_id": "01GG54QMC4GCQBQ5YY91VVDCVP",
 }
}
```

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "request_payload": {
 "form_data": {
 "buyer_name": "Buyer Name",
 "buyer_2_name": "Co Buyer Name",
 "agent_name": "Agent-Name",
 "agent_email": "agent@staircase.co",
 "brokerage_name": "remax",
 "brokerage_phone": "34342342",
 "loan_officer_email": "lo@staircase.co",
 "loan_officer_name": "LO",
 "property_street_address": "209 N Highway 45",
 "property_city": "Bonanza",
 "property_state": "AR",
 "property_zip_code": "72916",
 "down_payment_amount": 45000,
 "down_payment_percent": 5,
 "offer_amount": 120000,
 "loan_id": "87376716-9351-4abb-93d6-ddd08364f897",
 "preapproval_loan_amount": 114000,
 "loan_officer_phone": "",
 "lender_organization_name": "envoymortgage"
 },
 "blob_id": "01GGZQN05WG6GJX2HVQJHRNQER",
 "transaction_id": "01GG54QMC4GCQBQ5YY91VVDCVP"
 }
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
application/json Copy Bad request

```
{
 "message": {
 "schema_type": [
 "Must be one of: create, update."
 ]
 }
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `request_payload`required | `object` | <!--source:api-specifications-->PreOfferValuation Payload<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Return Job ID
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `job_id` | `string` | <!--source:api-specifications-->message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `one of` | <!--source:api-specifications-->Either message or object with additional properties.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Request forbidden -- authorization will not help<!--/source--> |
| `url` | `string (url)` | <!--source:api-specifications-->Indicates at which url the error occurs<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Partner not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Nothing matches the given URI<!--/source--> |

`GET` `/jobs/PreOfferValuation/executions/{job_id}`

<!--source:api-specifications-->

#### Get PreOfferValuation
<!--/source-->

`getPreOfferValuation`

<!--source:api-specifications-->
Get PreOfferValuation Get PreOfferValuation

<!--/source-->

##### Response

<!--source:api-specifications-->
application/json Copy Bad request

```
{
 "message": {
 "schema_type": [
 "Must be one of: create, update."
 ]
 }
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |
| `job_id` required | `string (uuid)` path | `7c668252-d2ba-job-id-896d-1f73236287d9` | <!--source:api-specifications-->Execution ID<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Return Job Status
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `job_id` | `string` | <!--source:api-specifications-->message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `one of` | <!--source:api-specifications-->Either message or object with additional properties.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Request forbidden -- authorization will not help<!--/source--> |
| `url` | `string (url)` | <!--source:api-specifications-->Indicates at which url the error occurs<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Partner not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Nothing matches the given URI<!--/source--> |

<!--source:api-specifications-->

### CheckEligibility
<!--/source-->

`POST` `/jobs/CheckEligibilityStatus/executions`

<!--source:api-specifications-->

#### Run CheckEligibility
<!--/source-->

`runCheckEligibility`

<!--source:api-specifications-->
Run CheckEligibility Run CheckEligibility Request example:

```
{
 "request_payload": {
 "metadata": {
 "version": 2,
 "validation": true
 },
 "data": {
 "loan_identifiers": [
 {
 "@type": "loan_identifier",
 "@id": "01GEB6TJ17H9V8F0VZCP80242X",
 "has_loan_identifier_value": {
 "has_value": "87376716-9351-4abb-93d6-ddd08364f897"
 }
 }
 ]
 }
 }
 }
```

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "request_payload": {}
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
application/json Copy Bad request

```
{
 "message": {
 "schema_type": [
 "Must be one of: create, update."
 ]
 }
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `request_payload`required | `object` | <!--source:api-specifications-->PreOfferValuation Payload<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Return Job ID
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `job_id` | `string` | <!--source:api-specifications-->message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `one of` | <!--source:api-specifications-->Either message or object with additional properties.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Request forbidden -- authorization will not help<!--/source--> |
| `url` | `string (url)` | <!--source:api-specifications-->Indicates at which url the error occurs<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Partner not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Nothing matches the given URI<!--/source--> |

`POST` `/jobs/CheckEligibilityStatus/executions/{job_id}`

<!--source:api-specifications-->

#### Get CheckEligibility
<!--/source-->

`getCheckEligibility`

<!--source:api-specifications-->
Get CheckEligibility Get CheckEligibility

<!--/source-->

##### Response

<!--source:api-specifications-->
application/json Copy Bad request

```
{
 "message": {
 "schema_type": [
 "Must be one of: create, update."
 ]
 }
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |
| `job_id` required | `string (uuid)` path | `7c668252-d2ba-job-id-896d-1f73236287d9` | <!--source:api-specifications-->Execution ID<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Return Job ID
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `job_id` | `string` | <!--source:api-specifications-->message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `one of` | <!--source:api-specifications-->Either message or object with additional properties.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Request forbidden -- authorization will not help<!--/source--> |
| `url` | `string (url)` | <!--source:api-specifications-->Indicates at which url the error occurs<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Partner not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Nothing matches the given URI<!--/source--> |

<!--source:api-specifications-->

### LeadoffExecuteContract
<!--/source-->

`POST` `/jobs/LeadOffExecuteContract/executions`

<!--source:api-specifications-->

#### Run LeadoffExecuteContract
<!--/source-->

`runLeadoffExecuteContract`

<!--source:api-specifications-->
Run LeadoffExecuteContract Run LeadoffExecuteContract Request example:

```
{
 "request_payload": {
 "loan_id": "87376716-9351-4abb-93d6-ddd08364f897",
 "blob_id": "01GGWA56R823XGMMCSQ1SMF9YK",
 "transaction_id": "01GGQ79GFCBVT0RFDC5YRD5FW4"
 }
}
```

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "request_payload": {
 "loan_id": "87376716-9351-4abb-93d6-ddd08364f897",
 "blob_id": "01GGZQN05WG6GJX2HVQJHRNQER",
 "transaction_id": "01GG54QMC4GCQBQ5YY91VVDCVP"
 }
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
application/json Copy Bad request

```
{
 "message": {
 "schema_type": [
 "Must be one of: create, update."
 ]
 }
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `request_payload`required | `object` | <!--source:api-specifications-->PreOfferValuation Payload<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Return Job ID
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `job_id` | `string` | <!--source:api-specifications-->message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `one of` | <!--source:api-specifications-->Either message or object with additional properties.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Request forbidden -- authorization will not help<!--/source--> |
| `url` | `string (url)` | <!--source:api-specifications-->Indicates at which url the error occurs<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Partner not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Nothing matches the given URI<!--/source--> |

`GET` `/jobs/LeadOffExecuteContract/executions/{job_id}`

<!--source:api-specifications-->

#### Get LeadoffExecuteContract
<!--/source-->

`getLeadoffExecuteContract`

<!--source:api-specifications-->
Get LeadoffExecuteContract Get LeadoffExecuteContract

<!--/source-->

##### Response

<!--source:api-specifications-->
application/json Copy Bad request

```
{
 "message": {
 "schema_type": [
 "Must be one of: create, update."
 ]
 }
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->Environment API Key.<!--/source--> |
| `job_id` required | `string (uuid)` path | `7c668252-d2ba-job-id-896d-1f73236287d9` | <!--source:api-specifications-->Execution ID<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Return Job ID
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `job_id` | `string` | <!--source:api-specifications-->message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `one of` | <!--source:api-specifications-->Either message or object with additional properties.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Request forbidden -- authorization will not help<!--/source--> |
| `url` | `string (url)` | <!--source:api-specifications-->Indicates at which url the error occurs<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Partner not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Nothing matches the given URI<!--/source--> |

<!--source:api-specifications-->

### Executions
<!--/source-->

`POST` `/jobs/{job_name}/executions`

<!--source:api-specifications-->

#### Execute Job
<!--/source-->

`executeJob`

<!--source:api-specifications-->
Execute Job operation will create and run new Execution of a Job. To create a new Execution, you need to provide the below information:

- Request Payload
- Transaction ID. Will be used both for Job product to report operation to Health and as part of Request Payload. (Optional)
- Callback URL (Optional)

#### Runtime Variables

`$.transaction_id` is always going to be available for any step in a flow. If Transaction ID was not provided in the Request Body, Job product will generate new Transaction ID. `$.job_name` represents Job Name. Can be used to Retrieve List of Executions. `$.execution_id` represents Job Executions ID. Can be used to Retrieve Execution Detail. `$.start_time` represents the Job start time. Can be used for logging or as a parameter invoking other Staircase products. For example, can be used for Console product Put Data saving default values. `$.api_key` have current environment `API_KEY` of the Job runtime. `$.host` have current environment `HOSTNAME` of the Job runtime.

Show the rest Example of using runtime variables

```
{
 "definition": {
 "StartAt": "A",
 "States": {
 "A": {
 "Data": {
 "execution_id": "$.execution_id",
 "start_time": "$.start_time",
 "transaction_id": "$.transaction_id"
 },
 "End": true,
 "Type": "Data"
 }
 }
 },
 "name": "test"
 }
```

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "request_payload": {
 "key": "value"
 },
 "transaction_id": "uuid",
 "callback_url": "https://webhook.site/6e36e3f0-f95a-4dec-b306-a97843095267"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
202400403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Create Job Execution Successfully

```
{
 "execution_id": "01F0KHK7DN3H5JZ4QJKMYAM6GB"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request

```
{
 "message": "request_payload is a required property"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found

```
{
 "value": {
 "message": "Job {job_name} not found!"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_name` required | `string` path | `ExampleJobName` | <!--source:api-specifications-->Job Name<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
3 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `request_payload`required | `object` | <!--source:api-specifications-->Request Payload<!--/source--> |
| `transaction_id` | `string` | <!--source:api-specifications-->Transaction ID in Staircase.<!--/source--> |
| `callback_url` | `string` | <!--source:api-specifications-->Callback URL used by Job product when execution completes<!--/source--> |

##### Response `202``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Create Job Execution Successfully
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `execution_id` | `string (ulid)` | <!--source:api-specifications-->Job Execution ID<!--/source-->Example `01F0KHK7DN3H5JZ4QJKMYAM6GB` |
| `job_name` | `string` | <!--source:api-specifications-->Job Name<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

`GET` `/jobs/{job_name}/executions`

<!--source:api-specifications-->

#### Retrieve All Executions
<!--/source-->

`listExecutions`

<!--source:api-specifications-->
Retrieve All Executions

- `next_token`
- `transaction_id` - Filter executions by Transaction ID
- `sort` - Sort order `asc` or `desc`
- `limit` - Limit number of executions in the response
- `status` - Filter by Execution status `ABORTED`, `FAILED`, `RUNNING`, `SUCCEEDED`, `TIMED_OUT`
- `start_date` - Filter by start date. Can be expression like `gt+2023-01-01T04:22:48.340000-04:00` or `gt+2023-01-01` or similar
- `stop_date` - Filter by stop date

<!--/source-->

##### Response

<!--source:api-specifications-->
200400403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Retrieve All Executions

```
{
 "results": [
 {
 "name": "Job name 1",
 "status": "SUCCEEDED",
 "start_time": "2021-08-11T17:06:47.000Z",
 "stop_time": "2021-08-11T17:07:40.000Z"
 },
 {
 "name": "Job name 2",
 "status": "FAILED",
 "start_time": "2021-08-11T15:54:47.000Z",
 "stop_time": "2021-08-11T15:54:59.000Z"
 }
 ],
 "next_token": "string"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request

```
{
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found

```
{
 "value": {
 "message": "Job {job_name} not found!"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
8
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `next_token` | `string` query | `NextToken` | <!--source:api-specifications-->If next_token is returned, there are more results available. The value of next_token is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.<!--/source--> |
| `transaction_id` | `string` query | `FJSARJREJQ12` | <!--source:api-specifications-->You can filter executions by transaction_id<!--/source--> |
| `sort` | `string` query | `asc` | <!--source:api-specifications-->Sorting<!--/source--> |
| `limit` | `integer` query | `5` | <!--source:api-specifications-->Limit results<!--/source--> |
| `status` | `string` query | `RUNNING` | <!--source:api-specifications-->You can use this to filter jobs by status<!--/source--> |
| `start_date` | `string` query | `gt+2022-08-24T01:00:00.000000-04:00` | <!--source:api-specifications-->Filter by job Start Date<!--/source--> |
| `stop_date` | `string` query | `lt+2022-08-24T01:00:00.000000-04:00` | <!--source:api-specifications-->Filter by job Stop Date<!--/source--> |
| `job_name` required | `string` path | `ExampleJobName` | <!--source:api-specifications-->Job Name<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Retrieve All Executions
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `next_token` | `string` | <!--source:api-specifications-->Pagination Token<!--/source--> |
| `results` | `object[]` | <!--source:api-specifications-->Array of executions<!--/source--> |
| `name` | `string` | <!--source:api-specifications-->Execution Name<!--/source--> |
| `status` | `string` | <!--source:api-specifications-->Execution status<!--/source-->`ABORTED``FAILED``RUNNING``SUCCEEDED``TIMED_OUT` |
| `start_date` | `string` | <!--source:api-specifications-->ISO 8601 format with UTC<!--/source--> |
| `stop_date` | `string` | <!--source:api-specifications-->ISO 8601 format with UTC<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

`GET` `/jobs/{job_name}/executions/{execution_id}`

<!--source:api-specifications-->

#### Retrieve Execution Detail
<!--/source-->

`getExecution`

##### Response

<!--source:api-specifications-->
200 Get Job Execution Detail Succeeded200 Execution Details with Detailed=True200 Get Job Execution Detail Failed400403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Retrieve Execution Detail

```
{
 "status": "SUCCEEDED",
 "start_time": "2021-08-11T17:06:47.000Z",
 "stop_time": "2021-08-11T17:07:40.000Z",
 "health_logs_url": "https://documentation.staircaseapi.com/code-health-checker/metric/01FDCEJT790J22PY13MCP0B90K"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Retrieve Execution Detail

```
{
 "start_date": "2021-12-21 13:19:53",
 "stop_date": "2021-12-21 13:19:58",
 "current_step": "CreateCollection",
 "status": "SUCCEEDED",
 "health_logs_url": "https://documentation.staircaseapi.com/code-health-checker/metric/01FQEJBYERMWGJEQDBFMG1X2D0",
 "execution_output": {
 "status": "COMPLETED",
 "response_payload": {
 "data": {
 "loans": [
 {
 "@id": "01FQ02RXN84KR9V9DR5VW1CGE5",
 "@type": "loan",
 "has_borrower_requested_loan_amount": {
 "has_value": 12345
 }
 }
 ]
 },
 "metadata": {
 "validation": false,
 "created_at": "2021-12-21T08:19:56.364778-05:00"
 },
 "collection_id": "01FQEJC1EC11NTSE76WJJ574P5",
 "transaction_id": "01FQEJBYQN1RWAGWCTR8R2M827"
 },
 "request_payload": {
 "loans": [
 {
 "@id": "01FQ02RXN84KR9V9DR5VW1CGE5",
 "@type": "loan",
 "has_borrower_requested_loan_amount": {
 "has_value": 12345
 }
 }
 ]
 }
 },
 "execution_data": [
 {
 "event_id": 16,
 "event_type": "stateExitedEventDetails",
 "event_name": "CompleteState",
 "timestamp": "2021-12-21 13:19:58.335000+00:00",
 "previous_event_id": 15,
 "output": {
 "status": "COMPLETED",
 "response_payload": {
 "data": {
 "loans": [
 {
 "@id": "01FQ02RXN84KR9V9DR5VW1CGE5",
 "@type": "loan",
 "has_borrower_requested_loan_amount": {
 "has_value": 12345
 }
 }
 ]
 },
 "metadata": {
 "validation": false,
 "created_at": "2021-12-21T08:19:56.364778-05:00"
 },
 "collection_id": "01FQEJC1EC11NTSE76WJJ574P5",
 "transaction_id": "01FQEJBYQN1RWAGWCTR8R2M827"
 },
 "request_payload": {
 "loans": [
 {
 "@id": "01FQ02RXN84KR9V9DR5VW1CGE5",
 "@type": "loan",
 "has_borrower_requested_loan_amount": {
 "has_value": 12345
 }
 }
 ]
 }
 }
 },
 {
 "event_id": 12,
 "event_type": "stateEnteredEventDetails",
 "event_name": "CompleteState",
 "timestamp": "2021-12-21 13:19:56.484000+00:00",
 "previous_event_id": 11,
 "input": {
 "hit_count_map": {
 "CreateTransaction": 1,
 "CreateCollection": 1
 },
 "outputs": {
 "CreateTransaction": {
 "status_code": 201,
 "response_payload": {
 "transaction_id": "01FQEJBYQN1RWAGWCTR8R2M827",
 "_links": {
 "collections": "https://documentation.staircaseapi.com/persistence/transactions/01FQEJBYQN1RWAGWCTR8R2M827/collections"
 }
 }
 },
 "response_payload": {
 "data": {
 "loans": [
 {
 "@id": "01FQ02RXN84KR9V9DR5VW1CGE5",
 "@type": "loan",
 "has_borrower_requested_loan_amount": {
 "has_value": 12345
 }
 }
 ]
 },
 "metadata": {
 "validation": false,
 "created_at": "2021-12-21T08:19:56.364778-05:00"
 },
 "collection_id": "01FQEJC1EC11NTSE76WJJ574P5",
 "transaction_id": "01FQEJBYQN1RWAGWCTR8R2M827"
 },
 "CreateCollection": {
 "status_code": 201,
 "response_payload": {
 "data": {
 "loans": [
 {
 "@id": "01FQ02RXN84KR9V9DR5VW1CGE5",
 "@type": "loan",
 "has_borrower_requested_loan_amount": {
 "has_value": 12345
 }
 }
 ]
 },
 "metadata": {
 "validation": false,
 "created_at": "2021-12-21T08:19:56.364778-05:00"
 },
 "collection_id": "01FQEJC1EC11NTSE76WJJ574P5",
 "transaction_id": "01FQEJBYQN1RWAGWCTR8R2M827"
 }
 }
 },
 "request_payload": {
 "loans": [
 {
 "@id": "01FQ02RXN84KR9V9DR5VW1CGE5",
 "@type": "loan",
 "has_borrower_requested_loan_amount": {
 "has_value": 12345
 }
 }
 ]
 },
 "callback_url": "https://calball_url_site"
 }
 },
 {
 "event_id": 11,
 "event_type": "stateExitedEventDetails",
 "event_name": "CreateCollection",
 "timestamp": "2021-12-21 13:19:56.475000+00:00",
 "previous_event_id": 10,
 "output": {
 "hit_count_map": {
 "CreateTransaction": 1,
 "CreateCollection": 1
 },
 "outputs": {
 "CreateTransaction": {
 "status_code": 201,
 "response_payload": {
 "transaction_id": "01FQEJBYQN1RWAGWCTR8R2M827",
 "_links": {
 "collections": "https://documentation.staircaseapi.com/persistence/transactions/01FQEJBYQN1RWAGWCTR8R2M827/collections"
 }
 }
 },
 "response_payload": {
 "data": {
 "loans": [
 {
 "@id": "01FQ02RXN84KR9V9DR5VW1CGE5",
 "@type": "loan",
 "has_borrower_requested_loan_amount": {
 "has_value": 12345
 }
 }
 ]
 },
 "metadata": {
 "validation": false,
 "created_at": "2021-12-21T08:19:56.364778-05:00"
 },
 "collection_id": "01FQEJC1EC11NTSE76WJJ574P5",
 "transaction_id": "01FQEJBYQN1RWAGWCTR8R2M827"
 },
 "CreateCollection": {
 "status_code": 201,
 "response_payload": {
 "data": {
 "loans": [
 {
 "@id": "01FQ02RXN84KR9V9DR5VW1CGE5",
 "@type": "loan",
 "has_borrower_requested_loan_amount": {
 "has_value": 12345
 }
 }
 ]
 },
 "metadata": {
 "validation": false,
 "created_at": "2021-12-21T08:19:56.364778-05:00"
 },
 "collection_id": "01FQEJC1EC11NTSE76WJJ574P5",
 "transaction_id": "01FQEJBYQN1RWAGWCTR8R2M827"
 }
 }
 },
 "request_payload": {
 "loans": [
 {
 "@id": "01FQ02RXN84KR9V9DR5VW1CGE5",
 "@type": "loan",
 "has_borrower_requested_loan_amount": {
 "has_value": 12345
 }
 }
 ]
 },
 "callback_url": "https://calball_url_site"
 }
 },
 {
 "event_id": 7,
 "event_type": "stateEnteredEventDetails",
 "event_name": "CreateCollection",
 "timestamp": "2021-12-21 13:19:53.783000+00:00",
 "previous_event_id": 6,
 "input": {
 "hit_count_map": {
 "CreateTransaction": 1
 },
 "outputs": {
 "CreateTransaction": {
 "status_code": 201,
 "response_payload": {
 "transaction_id": "01FQEJBYQN1RWAGWCTR8R2M827",
 "_links": {
 "collections": "https://documentation.staircaseapi.com/persistence/transactions/01FQEJBYQN1RWAGWCTR8R2M827/collections"
 }
 }
 },
 "response_payload": {
 "transaction_id": "01FQEJBYQN1RWAGWCTR8R2M827",
 "_links": {
 "collections": "https://documentation.staircaseapi.com/persistence/transactions/01FQEJBYQN1RWAGWCTR8R2M827/collections"
 }
 }
 },
 "request_payload": {
 "loans": [
 {
 "@id": "01FQ02RXN84KR9V9DR5VW1CGE5",
 "@type": "loan",
 "has_borrower_requested_loan_amount": {
 "has_value": 12345
 }
 }
 ]
 },
 "callback_url": "https://calball_url_site"
 }
 },
 {
 "event_id": 6,
 "event_type": "stateExitedEventDetails",
 "event_name": "CreateTransaction",
 "timestamp": "2021-12-21 13:19:53.775000+00:00",
 "previous_event_id": 5,
 "output": {
 "hit_count_map": {
 "CreateTransaction": 1
 },
 "outputs": {
 "CreateTransaction": {
 "status_code": 201,
 "response_payload": {
 "transaction_id": "01FQEJBYQN1RWAGWCTR8R2M827",
 "_links": {
 "collections": "https://documentation.staircaseapi.com/persistence/transactions/01FQEJBYQN1RWAGWCTR8R2M827/collections"
 }
 }
 },
 "response_payload": {
 "transaction_id": "01FQEJBYQN1RWAGWCTR8R2M827",
 "_links": {
 "collections": "https://documentation.staircaseapi.com/persistence/transactions/01FQEJBYQN1RWAGWCTR8R2M827/collections"
 }
 }
 },
 "request_payload": {
 "loans": [
 {
 "@id": "01FQ02RXN84KR9V9DR5VW1CGE5",
 "@type": "loan",
 "has_borrower_requested_loan_amount": {
 "has_value": 12345
 }
 }
 ]
 },
 "callback_url": "https://calball_url_site"
 }
 },
 {
 "event_id": 2,
 "event_type": "stateEnteredEventDetails",
 "event_name": "CreateTransaction",
 "timestamp": "2021-12-21 13:19:53.420000+00:00",
 "previous_event_id": 0,
 "input": {
 "request_payload": {
 "loans": [
 {
 "@id": "01FQ02RXN84KR9V9DR5VW1CGE5",
 "@type": "loan",
 "has_borrower_requested_loan_amount": {
 "has_value": 12345
 }
 }
 ]
 },
 "callback_url": "https://calball_url_site",
 "trigger_name": ""
 }
 }
 ]
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Retrieve Execution Detail

```
{
 "status": "FAILED",
 "start_time": "2021-08-11T15:54:47.000Z",
 "stop_time": "2021-08-11T15:54:59.000Z",
 "health_logs_url": "https://documentation.staircaseapi.com/code-health-checker/metric/01FDCEJT790J22PY13MCP0B90K"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request

```
{
 "message": "Bad Request"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found

```
{
 "value": {
 "message": "Job {job_name} not found!"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
4
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `next_token` | `string` query | `NextToken` | <!--source:api-specifications-->If next_token is returned, there are more results available. The value of next_token is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.<!--/source--> |
| `detailed` | `string` query | `false` | <!--source:api-specifications-->You can select whether execution data (input or output of a history event) is returned. The default is false<!--/source--> |
| `job_name` required | `string` path | `ExampleJobName` | <!--source:api-specifications-->Job Name<!--/source--> |
| `execution_id` required | `string` path | `01FEK7TACV6XP1CMBX44MJE4G3` | <!--source:api-specifications-->Execution ID<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
7 fields
<!--/source-->
<!--source:api-specifications-->
Retrieve Execution Detail
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `status` | `string` | <!--source:api-specifications-->Job Execution Status<!--/source-->`ABORTED``FAILED``RUNNING``SUCCEEDED``TIMED_OUT``WAIT_FOR_ACTION` |
| `start_time` | `string` | <!--source:api-specifications-->ISO 8601 format with UTC<!--/source--> |
| `stop_time` | `string` | <!--source:api-specifications-->ISO 8601 format with UTC<!--/source--> |
| `health_logs_url` | `string` | <!--source:api-specifications-->Health URL for execution<!--/source--> |
| `execution_output` | `object` | <!--source:api-specifications-->Contains status, response_payload, request_payload.<!--/source--> |
| `execution_data` | `—` | <!--source:api-specifications-->Description<!--/source--> |
| `next_token` | `string` | <!--source:api-specifications-->If next_token is returned, there are more results available.<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

<!--source:api-specifications-->

### Triggers
<!--/source-->

`POST` `/triggers`

<!--source:api-specifications-->

#### Create Trigger
<!--/source-->

`createTrigger`

<!--source:api-specifications-->
You can create rules that self-trigger on an automated schedule in Job Product using CRON or rate expressions. All scheduled events use UTC time zone. With using create trigger endpoint, you can create a custom triggers for you job executions

#### Trigger:

You can define your trigger type for job

#### Trigger Types

##### SCHEDULE

You can schedule event for you jobs

```
{
"type": "SCHEDULE",
"schedule_expression": "rate(5 minutes)"
}
```

###### Schedule Expression:

- Cron Expressions
- Rate Expressions

##### EVENT

You can trigger the jobs from the messages arrived to jobs webhooks.

Show the rest You can filter the messages and invoke your jobs according to your business needs

```
{
"type": "EVENT",
"filter_expression": {
"source_name": ["LOS_NAME"],
"event_type": ["LOAN_CREATED","LOAN_MODIFIED"]
}
}
```

###### Filter Expression:

You can only add filter expressions for the string elements in the message or the partner name

-

###### Exact Matching

Exact matching occurs when a filter expression value matches one or more message values.

Consider the following policy attribute:

```
"football_team": ["liverpool", "chelsea"]
```

It matches the following message:

```
{
"football_team": "liverpool",
"players": [
"Salah",
"Mane",
"Firmino"
]
}
```

However, it doesn't match the following message:

```
{
"football_team": "man_united",
"players": [
"Cavani",
"Rashford",
"Ronaldo"
]
}
```

-

###### Prefix matching

When a filter expression includes the keyword prefix, it matches any message value that begins with the specified characters.

Consider the following policy attribute:

```
"sport": [{"prefix": "bas"}]
```

It matches either of the following messages:

```
{
"sport": "baseball"
}
```

```
{
"sport": "basketball"
}
```

However, it doesn't match the following message:

```
{
"sport": "rugby"
}
```

-

###### Anything-but matching

When a filter expression includes the keyword anything-but, it matches any message that doesn't include any of the filter expression values.

Consider the following policy attribute:

```
"sport": [{"anything-but": ["rugby", "tennis"]}]
```

It matches either of the following message attributes:

```
{
"sport": "baseball"
}
```

```
{
"sport": "football"
}
```

However, it doesn't match the following message:

```
{
"sport": "rugby"
}
```

<!--/source-->

##### Request

<!--source:api-specifications-->
CreteTriggerWithCronCreteTriggerWithRateCreateTriggerWithEventExample1CreateTriggerWithEventExample2CreateTriggerWithEventExample3
<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "name": "trigger-1",
 "description": "Cron Trigger",
 "type": "SCHEDULE",
 "schedule_expression": "cron(0 * * * ? *)",
 "actions": {
 "target_jobs": [
 {
 "name": "job-1",
 "request_payload": {
 "foo": null
 }
 }
 ]
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "name": "trigger-2",
 "description": "Create Transaction every 5 minutes",
 "type": "SCHEDULE",
 "schedule_expression": "rate(5 minutes)",
 "actions": {
 "target_jobs": [
 {
 "name": "job-1"
 }
 ]
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "name": "trigger-3",
 "description": "Event Based Trigger",
 "type": "EVENT",
 "filter_expression": {
 "source_name": [
 "los_name"
 ],
 "event_type": [
 "LOAN_MODIFIED",
 "NEW_DOCUMENT_ADDED"
 ]
 },
 "actions": {
 "target_jobs": [
 {
 "name": "job-1"
 },
 {
 "name": "job-2"
 }
 ]
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "name": "trigger-4",
 "description": "Event Based Trigger",
 "type": "EVENT",
 "filter_expression": {
 "source_name": [
 "staircase"
 ],
 "event_type": [
 "CONNECTOR_RETURNED_RESPONSE"
 ]
 },
 "actions": {
 "target_jobs": [
 {
 "name": "call_translator_job"
 }
 ]
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "name": "trigger-5",
 "description": "Event Based Trigger",
 "type": "EVENT",
 "filter_expression": {
 "source_name": [
 "staircase"
 ],
 "event_type": [
 "MARKETPLACE_UPDATED"
 ],
 "product_name": [
 "Code",
 "Build",
 "Assess",
 "Deploy"
 ]
 },
 "actions": {
 "target_jobs": [
 {
 "name": "update_environment_job"
 }
 ]
 }
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
201400 Already Exist400 Invalid Definition403404500503 Service Unavailable503 Exceeds The Limit
<!--/source-->

<!--source:api-specifications-->
application/json Copy Create Trigger API Response

```
{
 "message": "Triggers are created!"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request

```
{
 "message": "A trigger/job pair with this name already exists"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request

```
{
 "message": "Indicates that a request parameter does not comply with the associated constraints. Check your filter expression"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found

```
{
 "value": {
 "message": "Job {job_name} not found!"
 }
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Service Unavailable

```
{
 "message": "You must wait 60 seconds after deleting a trigger before you can create another with the same name."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Service Unavailable

```
{
 "message": "Indicates that the number of filter polices in your account exceeds the limit."
}
```

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
7 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `name` | `string` | <!--source:api-specifications-->Name of a trigger<!--/source--> |
| `description` | `string` | <!--source:api-specifications-->Description of a trigger<!--/source--> |
| `type` | `string` | <!--source:api-specifications-->The trigger type<!--/source-->`EVENT``SCHEDULE` |
| `schedule_expression` | `string` | <!--source:api-specifications-->Schedule Expression<!--/source-->Example `rate(5 minutes), cron(0 * * * ? *)` |
| `filter_expression` | `object` | <!--source:api-specifications-->Filter Expression<!--/source--> |
| `key` | `string` | <!--source:api-specifications-->Parameter from event request payload<!--/source--> |
| `value` | `string[]` | <!--source:api-specifications-->Filter values for the key<!--/source--> |
| `actions` | `object` | <!--source:api-specifications-->Actions<!--/source--> |
| `target_jobs` | `object[]` | <!--source:api-specifications-->Job Names<!--/source--> |
| `name` | `string` | <!--source:api-specifications-->Name of job<!--/source--> |
| `request_payload` | `object` | <!--source:api-specifications-->Request Payload<!--/source--> |
| `callback_url` | `string` | <!--source:api-specifications-->Callback URL<!--/source--> |

##### Response `201``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Create Trigger API Response
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Response Message<!--/source-->Example `Triggers are created!` |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

##### Response `503``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Service Unavailable
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

`GET` `/triggers`

<!--source:api-specifications-->

#### Retrieve Triggers
<!--/source-->

`getTrigger`

<!--source:api-specifications-->
Retrieve Trigger
<!--/source-->

<!--source:api-specifications-->
Retrieves Triggers. Possible to filter by trigger name or job name

<!--/source-->

##### Response

<!--source:api-specifications-->
200400403500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Retrieve Triggers

```
{
 "triggers": [
 {
 "trigger_name": "",
 "job_name": "",
 "description": "",
 "type": "SCHEDULE",
 "schedule_expression": "rate(2 minutes)"
 }
 ]
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request

```
{
 "message": "job_name or trigger_name should be on the query parameters"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_name` | `string` query | `jobName` | <!--source:api-specifications-->Job name<!--/source--> |
| `trigger_name` | `string` query | `triggerNmae` | <!--source:api-specifications-->Trigger name<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Retrieve Triggers
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `triggers` | `array` | <!--source:api-specifications-->Found triggers<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

`DELETE` `/triggers/{trigger_name}`

<!--source:api-specifications-->

#### Delete Trigger
<!--/source-->

`deleteTrigger`

##### Response

<!--source:api-specifications-->
202400403500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Retrieve Triggers

```
{
 "message": "Trigger is deleted"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request!

```
{
 "message": "Bad Request!"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `trigger_name` required | `string` path | `trigger_name` | <!--source:api-specifications-->Trigger Name<!--/source--> |

##### Response `202``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Retrieve Triggers
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Response Message<!--/source-->Example `Trigger is deleted` |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request!
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Response message<!--/source-->Example `Bad Request!` |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

<!--source:api-specifications-->

### Webhooks
<!--/source-->

`POST` `/webhooks/{source_name}`

<!--source:api-specifications-->

#### Send Event
<!--/source-->

`sendEvent`

<!--source:api-specifications-->
This endpoint allows you to send events to trigger event-based jobs.

<!--/source-->

##### Request

<!--source:api-specifications-->
LOSEventExampleCustomEventExample1CustomEventExample2CustomEventExample3
<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "los_name": "LOS NAME",
 "event_type": "LOAN_CREATED",
 "loan_id": "LOAN ID"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "event_type": "TOKEN_EXPIRED"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "event_type": "MARKETPLACE_UPDATED"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy
```
{
 "event_type": "NEW_ENVIRONMENT_CREATED",
 "domain": "DOMAIN_NAME"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
202400403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Event is accepted!

```
{
 "message": "Event is accepted!"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request!

```
{
 "message": "Invalid Parameter!"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Invalid key for service

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Found!

```
{
 "message": "Not Found!"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy The product has encountered an internal server error

```
{
 "message": "The product has encountered an internal server error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `source_name` required | `string` path | `partnerName` | <!--source:api-specifications-->Source name of the event<!--/source--> |

##### Response `202``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Event is accepted!
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Response message<!--/source-->Example `Event is accepted!` |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request!
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Response message<!--/source-->Example `Invalid Parameter!` |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Invalid key for service
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | — |
| `url` | `string` | — |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Found!
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Not Found!<!--/source-->Example `Not Found!` |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
The product has encountered an internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message<!--/source--> |

<!--source:api-specifications-->

### Operations
<!--/source-->

`DELETE` `/jobs/{name}`

<!--source:api-specifications-->

#### Delete job
<!--/source-->

`deleteJob`

<!--source:api-specifications-->
Delete an existing job and delete all job execution data

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Description |
| --- | --- | --- |
| `name` required | `string` path | <!--source:api-specifications-->Job name<!--/source--> |

##### Other responses

`200`

`GET` `/jobs/{name}`

<!--source:api-specifications-->

#### Get job
<!--/source-->

`getJob`

<!--source:api-specifications-->
Returns specific job details

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Description |
| --- | --- | --- |
| `name` required | `string` path | <!--source:api-specifications-->Job name<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
5 fields
<!--/source-->
<!--source:api-specifications-->
Job
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `name`required | `string` | <!--source:api-specifications-->Job name<!--/source--> |
| `description`required | `string` | <!--source:api-specifications-->Textual description of the job entry<!--/source--> |
| `definition` | `array` | <!--source:api-specifications-->Job Workflow Steps<!--/source--> |
| `cron`required | `string` | <!--source:api-specifications-->Cron expressions have six required fields, which are separated by white space.<!--/source--> |
| `status`required | `string` | <!--source:api-specifications-->Status<!--/source-->`CREATING``DESTROYING``DISABLED``ENABLED``PENDING` |

`PUT` `/jobs/{name}`

<!--source:api-specifications-->

#### Update job
<!--/source-->

`updateJob`

<!--source:api-specifications-->
Update an existing job parameters

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Description |
| --- | --- | --- |
| `name` required | `string` path | <!--source:api-specifications-->Job name<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
3 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `description`required | `string` | <!--source:api-specifications-->Textual description of the job entry<!--/source--> |
| `definition` | `array` | <!--source:api-specifications-->Job Workflow Steps<!--/source--> |
| `cron`required | `string` | <!--source:api-specifications-->Cron expressions have six required fields, which are separated by white space.<!--/source--> |

##### Other responses

`200`

`POST` `/jobs/disable/{job_name}`

<!--source:api-specifications-->

#### Disable job
<!--/source-->

`disableJob`

<!--source:api-specifications-->
Disable a job to stop upcoming cron executions

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Description |
| --- | --- | --- |
| `job_name` required | `string` path | <!--source:api-specifications-->Job name<!--/source--> |

##### Other responses

`200`

`POST` `/jobs/enable/{job_name}`

<!--source:api-specifications-->

#### Enable job
<!--/source-->

`enableJob`

<!--source:api-specifications-->
Enable a job to allow cron executions

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Description |
| --- | --- | --- |
| `job_name` required | `string` path | <!--source:api-specifications-->Job name<!--/source--> |

##### Other responses

`200`

`POST` `/jobs/execute/{job_name}`

<!--source:api-specifications-->

#### Execute job on demand
<!--/source-->

`executeJob`

<!--source:api-specifications-->
Execute a job manually

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Description |
| --- | --- | --- |
| `job_name` required | `string` path | <!--source:api-specifications-->Job name<!--/source--> |

##### Other responses

`200`

`GET` `/jobs/execution/{job_execution_id}`

<!--source:api-specifications-->

#### Get job execution
<!--/source-->

`getJobExecution`

<!--source:api-specifications-->
Returns a Job Execution Details

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Description |
| --- | --- | --- |
| `job_execution_id` required | `string` path | <!--source:api-specifications-->Job Execution Id<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
6 fields
<!--/source-->
<!--source:api-specifications-->
Job Execution Details
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `job_execution_id` | `string` | <!--source:api-specifications-->Job execution UID<!--/source--> |
| `job_name`required | `string` | <!--source:api-specifications-->Job name<!--/source--> |
| `executed` | `string (date-time)` | <!--source:api-specifications-->Date-time of execution<!--/source--> |
| `finished` | `string (date-time)` | <!--source:api-specifications-->Date-time of completion<!--/source--> |
| `status` | `string` | <!--source:api-specifications-->Job execution status<!--/source-->`ERROR``PENDING``RUNNING``SUCCESS` |
| `flow_step_data` | `string` | <!--source:api-specifications-->Workflow data store<!--/source--> |

`GET` `/jobs/executions/{job_name}`

<!--source:api-specifications-->

#### Get job executions
<!--/source-->

`getJobExecutions`

<!--source:api-specifications-->
Returns a list of job executions for specific job

<!--/source-->

##### Parameters

<!--source:api-specifications-->
3
<!--/source-->

| Parameter | Type | Description |
| --- | --- | --- |
| `job_name` required | `string` path | <!--source:api-specifications-->Job name<!--/source--> |
| `page` | `number` query | <!--source:api-specifications-->Start from page<!--/source--> |
| `limit` | `number` query | <!--source:api-specifications-->Page limit<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Paginated list of Job executions
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `data` | `array` | <!--source:api-specifications-->List of Job Executions<!--/source--> |
| `totalCount`required | `number` | <!--source:api-specifications-->Total number of Job Executions<!--/source--> |

## Errors

`400``403``404``500``503`

## More in Integration

- Previous product: Connection
- Next product: Product
