> ## Documentation Index
> Fetch the complete documentation index at: https://developer.fabric.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Jobs

> Get a paginated list of jobs related to products and collections by specifying the request body. You need to specify the criteria for the search such as job `id`, `type`, `status`, `collectionId`, `inputFileId`.



## OpenAPI

````yaml files-jobs.openapi post /product-jobs/search
openapi: 3.0.0
info:
  description: >-
    fabric's **Files** and **Jobs** APIs support bulk import and export of
    items, attributes, and bundles. To begin with importing, download the
    appropriate template for the specific `type` of import. A standardized
    template ensures consistency in data structure and formatting. It also helps
    enforce data validation rules to ensure imported data meets the specified
    criteria and reduces the chance of incorrect and inaccurate information.
    Once you have completed filling out the import details in the template, add
    the file name and `type` in the request body of the `POST /files/product`
    endpoint. The response will provide you with the URL where you can upload
    the file for importing. After successfully importing the file, you can use
    the job exports endpoints to export the imported products and attributes
    based on specified criteria.
  title: Products - Files and Jobs
  version: 3.0.0
  x-audience: external-public
  contact:
    email: support@fabric.inc
    name: Product team
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
  termsOfService: https://fabric.inc/terms-of-use
servers:
  - url: https://api.fabric.inc/v3
    description: Production URL
security:
  - authorization: []
tags:
  - name: Files
    description: >-
      Files endpoints interact with the file object, which is associated with
      (and points to) a job.
  - name: Jobs
    description: >-
      Bulk import of attributes must be in a standardized format. This endpoint
      gets the template required to bulk import attributes.
externalDocs:
  description: Find out more about Products (previously called PIM)
  url: https://developer.fabric.inc/docs/products-overview
paths:
  /product-jobs/search:
    post:
      tags:
        - Jobs
      summary: Search Jobs
      description: >-
        Get a paginated list of jobs related to products and collections by
        specifying the request body. You need to specify the criteria for the
        search such as job `id`, `type`, `status`, `collectionId`,
        `inputFileId`.
      operationId: getJobsBySearchCriteria
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      requestBody:
        $ref: '#/components/requestBodies/jobSearchRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/jobs'
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/x-fabric-request-id-header'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/notAuthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internalServerError'
components:
  parameters:
    x-fabric-tenant-id:
      name: x-fabric-tenant-id
      in: header
      description: >-
        A header used by fabric to identify the tenant making the request. You
        must include tenant id in the authentication header for an API request
        to access any of fabric’s endpoints. You can retrieve the tenant id ,
        which is also called account id, from
        [Copilot](/v3/platform/settings/account-details/getting-the-account-id).
        This header is required.
      schema:
        type: string
        example: 517fa9dfd42d8b00g1o3k312
    x-fabric-request-id:
      name: x-fabric-request-id
      in: header
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
      required: false
  requestBodies:
    jobSearchRequest:
      content:
        application/json:
          schema:
            type: object
            required:
              - match
            description: Request for a job search.
            properties:
              sort:
                type: string
                description: >-
                  Sorting criteria. Sorting is supported on `id`, `type`,
                  `status`, `completedAt` and `createdAt`. `-` refers to
                  descending while `+` refers to ascending order.
                example: +id,-type
              match:
                $ref: '#/components/schemas/jobSearchRequestMatch'
              offset:
                description: >-
                  Number of records to skip before returning records. For
                  example, `offset=20, limit=10` returns records 21-30.
                type: integer
                format: int32
                default: 0
                example: 2
              limit:
                description: Maximum number of records per page
                type: integer
                format: int32
                default: 10
                example: 10
  schemas:
    jobs:
      description: Details of jobs
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/job'
        offset:
          description: >-
            Number of records to skip before returning records. For example,
            `offset=20, limit=10` returns records 21-30.
          type: integer
          format: int32
          default: 0
          example: 5
        limit:
          description: Maximum number of records per page
          type: integer
          format: int32
          default: 10
          example: 10
        count:
          description: Total number of records
          type: integer
          format: int32
          example: 100
    jobSearchRequestMatch:
      minProperties: 1
      additionalProperties: false
      description: Search criteria to match jobs.
      type: object
      properties:
        id:
          $ref: '#/components/schemas/simpleMultiIdSearchOperation'
          description: job id search
        inputFileId:
          $ref: '#/components/schemas/simpleMultiIdSearchOperation'
          description: Search based on input file ID
        name:
          $ref: '#/components/schemas/stringSearchWithNullableOperation'
          description: Search based on job name
        keyword:
          description: Search based on either job name or job ID
          anyOf:
            - $ref: '#/components/schemas/containsStringSearchOperation'
            - $ref: '#/components/schemas/simpleMultiStringSearchOperation'
        type:
          $ref: '#/components/schemas/multiJobType'
          description: Search based on job type
        status:
          $ref: '#/components/schemas/multiJobStatuses'
          description: Search based on job status
        createdAt:
          $ref: '#/components/schemas/datetimeSearchOperation'
          description: Search based on job creation time
        completedAt:
          $ref: '#/components/schemas/datetimeSearchOperation'
          description: Search based on job completion Time
    job:
      type: object
      description: Job details
      properties:
        id:
          type: string
          description: 24-character system-generated job ID
          example: 877f1f77bcf86cd799439087
        type:
          $ref: '#/components/schemas/jobTypes'
        inputFileId:
          type: string
          example: 327f1f77bcf86cd799439045
          description: File ID that needs to be processed through the job
        outputFiles:
          type: array
          items:
            type: string
            description: >-
              Output file IDs. For import and export jobs, the output files show
              the exported products (items, variant and/or bundle) based on the
              job type.
            example: 507f1f77bcf86cd7994390163, 967f1f77bcf86cd799439058
        errorFiles:
          type: array
          items:
            type: string
            description: >-
              File IDs that show error details of the products that couldn't be
              imported or exported.
            example: 887f1f77bcf86cd799439011, 997f1f77bcf86cd799439074
        progressTracker:
          type: object
          properties:
            updatedAt:
              type: string
              description: Time of last update to tracker (UTC)
              example: '2023-02-14T22:10:30.618Z'
            totalCount:
              type: integer
              format: int32
              description: Total number of records to be processed through the job
              example: 100000
            processedCount:
              type: integer
              format: int32
              description: Total number of records to be processed
              example: 40000
            errorCount:
              type: integer
              format: int32
              description: Total number of errors
              example: 10
        status:
          $ref: '#/components/schemas/jobStatuses'
        statusMessage:
          description: User-friendly message corresponding to the current job status
          type: string
          example: 100% completed
        additionalDetails:
          type: object
          properties:
            itemsCreated:
              type: integer
              format: int32
              description: >-
                Number of items created. Only applicable when the job `type` is
                `ITEM_VARIANT_IMPORT`.
              example: 10
            itemsUpdated:
              type: integer
              format: int32
              description: >-
                Number of items updated. Only applicable when the job `type` is
                `ITEM_VARIANT_IMPORT`.
              example: 10
            variantsCreated:
              type: integer
              format: int32
              description: >-
                Number of variants created. Only applicable when the job `type`
                is `ITEM_VARIANT_IMPORT`.
              example: 10
            variantsUpdated:
              type: integer
              format: int32
              description: >-
                Number of variants updated. Only applicable when the job `type`
                is `ITEM_VARIANT_IMPORT`.
              example: 10
            bundlesCreated:
              type: integer
              format: int32
              description: >-
                Number of bundles created. Only applicable when the job `type`
                is `BUNDLE_IMPORT`.
              example: 10
            bundlesUpdated:
              type: integer
              format: int32
              description: >-
                Number of bundles updated. Only applicable when the job `type`
                is `BUNDLE_IMPORT`.
              example: 10
            attributeCreated:
              type: integer
              format: int32
              description: >-
                Number of attributes created. Only applicable when the job
                `type` is `ATTRIBUTE_IMPORT`.
              example: 10
            attributeUpdated:
              type: integer
              format: int32
              description: >-
                Number of attributes updated. Only applicable when the job
                `type` is `ATTRIBUTE_IMPORT`.
              example: 10
            categoriesCreated:
              type: integer
              format: int32
              description: >-
                Number of categories created. Only applicable when the job
                `type` - `CATEGORY_IMPORT`.
              example: 10
            categoriesUpdated:
              type: integer
              format: int32
              description: >-
                Number of categories updated. Only applicable when the job
                `type` is `CATEGORY_IMPORT`.
              example: 10
            collectionCreated:
              type: integer
              format: int32
              example: 5
              description: >-
                Number of collections created. Only applicable when the job
                `type` is `COLLECTION_IMPORT`.
            collectionUpdated:
              type: integer
              format: int32
              description: >-
                Number of collections updated. Only applicable when the job
                `type` is `COLLECTION_IMPORT`.
              example: 10
        createdAt:
          type: string
          description: Time of job creation (UTC)
          example: '2021-09-14T22:10:30.618Z'
        completedAt:
          type: string
          description: Time of job completion (UTC)
          example: '2021-09-14T22:10:30.618Z'
        updatedBy:
          type: string
          description: Email of the user who last updated the job
          example: test@email.com
        updatedAt:
          type: string
          description: Time of last update to job (UTC)
          example: '2021-09-14T22:10:30.618Z'
    genericError:
      type: object
      description: Error details
      properties:
        message:
          type: string
          description: Placeholder error message for all the 4xx, 5xx errors
          example: Request is invalid
        type:
          type: string
          description: Placeholder error type for all the 4xx, 5xx errors
          example: Bad request
        errors:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                description: Error type
                example: CLIENT_ERROR
              message:
                type: string
                description: Error message
                example: Invalid request. Unable to find/create product
    simpleMultiIdSearchOperation:
      type: object
      description: A simple multi-string search operation.
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: Operations that can be performed on a `string` type
          example: IN
          enum:
            - IN
        value:
          type: array
          items:
            $ref: '#/components/schemas/idSchema'
    stringSearchWithNullableOperation:
      type: object
      description: String search
      anyOf:
        - $ref: '#/components/schemas/simpleMultiStringWithNullableSearchOperation'
        - $ref: '#/components/schemas/containsStringSearchOperation'
    containsStringSearchOperation:
      type: object
      description: An operation used to define string search.
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: Search operation that can be performed on a `string` type
          example: CONTAINS
          enum:
            - CONTAINS
        value:
          $ref: '#/components/schemas/stringSchema'
    simpleMultiStringSearchOperation:
      type: object
      description: Simple multi-string search
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: Operations that can be performed on a `string` type
          example: IN
          enum:
            - IN
        value:
          type: array
          items:
            $ref: '#/components/schemas/stringSchema'
    multiJobType:
      type: object
      description: >-
        Search jobs using multiple job types. For example, `ITEM_VARIANT_IMPORT,
        BUNDLE_EXPORT`.
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: Operations that can be performed on a `string` type
          example: IN
          enum:
            - IN
        value:
          type: array
          items:
            $ref: '#/components/schemas/jobTypes'
    multiJobStatuses:
      type: object
      required:
        - op
        - value
      description: >-
        Search jobs using multiple job types. For example, `COMPLETED,
        SCHEDULED`.
      properties:
        op:
          type: string
          description: Operations that can be performed on a `string` type
          example: IN
          enum:
            - IN
        value:
          type: array
          items:
            $ref: '#/components/schemas/jobStatuses'
    datetimeSearchOperation:
      type: object
      description: Date-time search
      anyOf:
        - $ref: '#/components/schemas/datetimeRangeOperation'
        - $ref: '#/components/schemas/datetimeInOperation'
        - $ref: '#/components/schemas/datetimeOperation'
    jobTypes:
      oneOf:
        - $ref: '#/components/schemas/pimJobTypes'
        - $ref: '#/components/schemas/catalogConnectorJobTypes'
    jobStatuses:
      type: string
      enum:
        - SCHEDULED
        - COMPLETED_PARTIALLY
        - IN_PROGRESS
        - COMPLETED
        - FAILED
        - UPDATING_SEARCH_INDEX
        - CANCELLATION_IN_PROGRESS
        - CANCELLED
      description: Job status
      example: COMPLETED
    idSchema:
      type: string
      description: The schema id.
      example: 5fc100f1dd0c5900750c04b1
    simpleMultiStringWithNullableSearchOperation:
      type: object
      description: Simple multi-string search
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: Operations that can be performed on a `string` type
          example: IN
          enum:
            - IN
        value:
          type: array
          items:
            $ref: '#/components/schemas/stringSchema'
    stringSchema:
      type: string
      description: Sample string schema
      example: blue
    datetimeRangeOperation:
      type: object
      description: Date range search
      required:
        - op
        - fromValue
        - toValue
      properties:
        op:
          type: string
          description: Search operation performed on a date range
          example: RANGE
          enum:
            - RANGE
        fromValue:
          type: string
          description: Starting range (UTC)
          example: '2022-04-20T10:24:36.162Z'
        toValue:
          type: string
          description: Ending range (UTC)
          example: '2023-04-20T10:24:36.162Z'
    datetimeInOperation:
      type: object
      description: IN operation on date-time
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: >-
            Operations that can be performed on a `number` type such as equals,
            less than (LT), Greater than (GT), Less than or equal to (LTE),
            Greater than or equal to (GTE), etc.
          example: IN
          enum:
            - IN
        value:
          type: array
          items:
            type: string
            description: Timestamp to be searched (UTC)
            example: '2023-04-20T10:24:36.162Z'
    datetimeOperation:
      type: object
      description: Date-time search
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: >-
            Operations that can be performed on a `number` type such as equals,
            less than (LT), Greater than (GT), Less than or equal to (LTE),
            Greater than or equal to (GTE).
          example: GTE
          enum:
            - EQUALS
            - LTE
            - GTE
            - LT
            - GT
        value:
          type: string
          description: Timestamp to be searched (UTC)
          example: '2023-04-20T10:24:36.162Z'
    pimJobTypes:
      type: string
      enum:
        - ITEM_VARIANT_EXPORT
        - ITEM_VARIANT_IMPORT
        - BUNDLE_EXPORT
        - BUNDLE_IMPORT
        - ATTRIBUTE_IMPORT
        - ATTRIBUTE_EXPORT
        - CATEGORY_IMPORT
        - CATEGORY_EXPORT
        - COLLECTION_IMPORT
        - COLLECTION_EXPORT
        - ATTRIBUTE_JOB
        - PRODUCT_JOB
        - CATEGORY_JOB
        - COLLECTION_JOB
        - PRODUCT_BULK_CATEGORY_UPDATE
        - PRODUCT_DENORM_JOB
      description: Supported job types
      example: ITEM_VARIANT_EXPORT
    catalogConnectorJobTypes:
      type: string
      enum:
        - CATALOG_CONN_ITEM_VARIANT_IMPORT
        - CATALOG_CONN_BUNDLE_IMPORT
        - CATALOG_CONN_ITEM_VARIANT_EXPORT
        - CATALOG_CONN_BUNDLE_EXPORT
      description: Catalog Connector job types
      example: CATALOG_CONN_ITEM_VARIANT_IMPORT
  headers:
    x-fabric-request-id-header:
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
  responses:
    badRequest:
      description: Request is invalid or malformed
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
    notAuthorized:
      description: Requester is unauthorized
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
          example:
            type: UNAUTHORIZED_ERROR
            message: Requester is unauthorized
    forbidden:
      description: User isn't allowed to perform the action
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
          example:
            type: REQUEST_DENIED
            message: User doesn't have the required permission
    internalServerError:
      description: Internal server error
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
          example:
            type: SERVER_ERROR
            message: Internal Server Error
  securitySchemes:
    authorization:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: S2S access token (JWT) from fabric Identity service (during login)

````