Jobs

POST Search Job Executions

POST /organizations/{organizationId}/job-execution-search

Operation ID: searchJobExecutions. Security: AmOAuth2 (sfcc.jobs, sfcc.jobs.rw).

Searches for job executions.

The query attribute specifies a complex query that can be used to narrow down the search. This is the list of searchable attributes:

  • id - String
  • jobId - String
  • status - String
  • startTime - DateTime
  • endTime - DateTime

The output of the query can also be sorted. These are the list of sortable attributes:

  • id - String
  • jobId - String
  • status - String
  • startTime - DateTime
  • endTime - DateTime

Parameters

  • organizationId (path, OrganizationId, required) An identifier for the organization the request is being made by

    Example

    f_ecom_zzxy_prd

Request body (required)

The search request document for job executions

Media type: application/json. Schema: JobExecutionSearchRequest.

Example: SearchByJobId Search job executions by job ID

Example of searching for job executions by their job ID using a term query

{
  "query": {
    "termQuery": {
      "fields": [
        "jobId"
      ],
      "operator": "is",
      "values": [
        "my-custom-job"
      ]
    }
  },
  "limit": 10,
  "offset": 0
}

Example: SearchByStatus Search job executions by status

Example of searching for job executions by their execution status

{
  "query": {
    "termQuery": {
      "fields": [
        "status"
      ],
      "operator": "is",
      "values": [
        "running"
      ]
    }
  },
  "limit": 25,
  "offset": 0,
  "sorts": [
    {
      "field": "startTime",
      "sortOrder": "desc"
    }
  ]
}

Example: SearchByStartTime Search job executions by start time range

Example of searching for job executions within a specific start time range using a bool query

{
  "query": {
    "boolQuery": {
      "must": [
        {
          "termQuery": {
            "fields": [
              "status"
            ],
            "operator": "is",
            "values": [
              "finished"
            ]
          }
        },
        {
          "textQuery": {
            "fields": [
              "jobId"
            ],
            "searchPhrase": "export"
          }
        }
      ]
    }
  },
  "limit": 20,
  "offset": 0,
  "sorts": [
    {
      "field": "startTime",
      "sortOrder": "desc"
    }
  ]
}

Responses

  • 200 Returns job execution search results

    Media type: application/json. Schema: JobExecutionSearchResult.

    Example: JobExecutionSearchResultSuccess Successful job execution search result

    Example of a successful job execution search returning multiple results

    {
      "limit": 2,
      "offset": 0,
      "total": 2,
      "query": {
        "textQuery": {
          "fields": [
            "jobId"
          ],
          "searchPhrase": "JobExecutionTestJob1"
        }
      },
      "hits": [
        {
          "id": "1",
          "jobId": "JobExecutionTestJob1",
          "jobDescription": "Test job for WAPI",
          "clientId": "scapi",
          "status": "OK",
          "executionStatus": "finished",
          "startTime": "2026-02-24T13:47:23.249Z",
          "endTime": "2026-02-24T13:47:23.420Z",
          "creationDate": "2026-02-24T13:47:23.000Z",
          "duration": 171,
          "effectiveDuration": 92,
          "modificationTime": "2026-02-24T13:47:23.433Z",
          "executedServerId": "192.168.1.2-0",
          "executionScopes": [
            "Organization",
            "TestWapi-Customization"
          ],
          "exitStatus": {
            "code": "OK",
            "status": "ok"
          },
          "statusMetadata": {
            "clientId": "scapi",
            "reason": "Completed successfully",
            "userLogin": "admin"
          },
          "isLogFileExisting": true,
          "isRestart": false,
          "logFilePath": "/Sites/LOGS/jobs/JobExecutionTestJob1/Job-JobExecutionTestJob1-02c585c2a242c8eee74bd1ba51.log",
          "parameters": [
            {
              "name": "SiteScope",
              "value": "{\"all_storefront_sites\":true}"
            }
          ],
          "stepExecutions": [
            {
              "id": "4",
              "stepId": "Step1",
              "stepDescription": "A step that executes a pipeline that can be configured via a parameter",
              "stepTypeId": "ExecutePipeline",
              "stepTypeInfo": "TestWAPIJobPipeline-StartEnd",
              "executionScope": "Organization",
              "executionStatus": "finished",
              "status": "OK",
              "startTime": "2026-02-24T13:47:23.311Z",
              "endTime": "2026-02-24T13:47:23.332Z",
              "duration": 21,
              "modificationTime": "2026-02-24T13:47:23.332Z",
              "isChunkOriented": false,
              "exitStatus": {
                "code": "OK",
                "message": "",
                "status": "ok"
              }
            },
            {
              "id": "5",
              "stepId": "Step2",
              "stepDescription": "A step that executes a script module function that can be configured via a parameter",
              "stepTypeId": "ExecuteScriptModule",
              "stepTypeInfo": "test_bc_wapi/cartridge/scripts/test/schedulejob/testScriptModuleStep.ds#execute",
              "executionScope": "Organization",
              "executionStatus": "finished",
              "status": "OK",
              "startTime": "2026-02-24T13:47:23.337Z",
              "endTime": "2026-02-24T13:47:23.359Z",
              "duration": 22,
              "modificationTime": "2026-02-24T13:47:23.359Z",
              "isChunkOriented": false,
              "exitStatus": {
                "code": "OK",
                "message": "",
                "status": "ok"
              }
            }
          ]
        },
        {
          "id": "0",
          "jobId": "JobExecutionTestJob1",
          "jobDescription": "Test job for WAPI",
          "clientId": "scapi",
          "status": "ERROR",
          "executionStatus": "finished",
          "startTime": "2026-02-24T13:46:24.316Z",
          "endTime": "2026-02-24T13:46:25.084Z",
          "creationDate": "2026-02-24T13:46:24.000Z",
          "duration": 768,
          "effectiveDuration": 143,
          "modificationTime": "2026-02-24T13:46:25.101Z",
          "executedServerId": "192.168.1.2-0",
          "executionScopes": [
            "Organization"
          ],
          "exitStatus": {
            "code": "ERROR",
            "message": "Job failed due to an import error.",
            "status": "error"
          },
          "isLogFileExisting": true,
          "isRestart": false,
          "logFilePath": "/Sites/LOGS/jobs/JobExecutionTestJob1/Job-JobExecutionTestJob1-21a391164b090c6c12957a292e.log",
          "retryInformation": {
            "currentRetryAttempt": 1,
            "maxRetries": 3
          },
          "stepExecutions": [
            {
              "id": "0",
              "stepId": "Step1",
              "stepDescription": "A step that executes a pipeline that can be configured via a parameter",
              "stepTypeId": "ExecutePipeline",
              "stepTypeInfo": "TestWAPIJobPipeline-StartEnd",
              "executionScope": "Organization",
              "executionStatus": "finished",
              "status": "ERROR",
              "startTime": "2026-02-24T13:46:24.920Z",
              "endTime": "2026-02-24T13:46:25.084Z",
              "duration": 164,
              "modificationTime": "2026-02-24T13:46:25.084Z",
              "isChunkOriented": true,
              "chunkSize": 100,
              "itemWriteCount": 42,
              "itemFilterCount": 3,
              "totalItemCount": 500,
              "statusMetadata": {
                "clientId": "scapi",
                "reason": "Import file not found",
                "userLogin": "admin"
              },
              "exitStatus": {
                "code": "ERROR",
                "message": "Import file not found",
                "status": "error"
              }
            }
          ]
        }
      ]
    }
  • 400 Bad Request - Malformed search query or invalid parameters

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: MalformedSearchParameter Malformed search query

    Example of an error when the search query is malformed or invalid

    {
      "title": "Malformed Search Parameter",
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/malformed-search-parameter",
      "detail": "The search query contains invalid syntax. Please check the query structure and try again."
    }

    Example: UnqueryableField Unqueryable Field

    Example of an error when an invalid field name is used in the search query

    {
      "title": "Unqueryable Field",
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/unqueryable-field",
      "detail": "The field 'invalid_field' is not a searchable attribute for job executions. Valid fields are: id, jobId, status, startTime, endTime."
    }
  • 401 Your access token is invalid or expired and can’t be used to identify a user.

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: UnauthorizedExample

    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/unauthorized",
      "title": "Unauthorized",
      "detail": "Your access token is invalid or expired and can’t be used to identify a user."
    }
  • 403 Forbidden. Your access token is valid, but you don’t have the required permissions to access the resource.

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: ForbiddenExample

    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/forbidden",
      "title": "Forbidden",
      "detail": "Your access token is valid, but you don’t have the required permissions to access the resource."
    }