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

# Create job

> Create a job to query sequence enrollments.

## Overview

Create a query job to query and export enrollments. Use the request body to
optionally filter or sort the results.

See [Using query jobs](/developers/guides/request-data/query-jobs) for an
overview of using jobs to query data.


## OpenAPI

````yaml POST /sequences/v1/enrollments/query-jobs
openapi: 3.1.0
info:
  title: Unify Sequences API
  summary: Interact with sequences and sequence enrollments within the Unify platform.
  version: '1'
  termsOfService: https://www.unifygtm.com/legal/terms-and-conditions
  contact:
    name: Unify Support
    url: https://www.unifygtm.com/support
    email: support@unifygtm.com
servers:
  - url: https://api.unifygtm.com
    variables: {}
security:
  - ApiKeyAuth: []
tags:
  - name: Sequences
  - name: Sequence Enrollment Steps
  - name: Sequence Enrollments
paths:
  /sequences/v1/enrollments/query-jobs:
    post:
      tags:
        - Sequences
        - Sequence Enrollments
      description: |-
        Start an asynchronous query job to export sequence enrollments. Poll the
        job until it is `FINISHED`, then page through the results.
      operationId: create_sequence_enrollment_query_job
      parameters: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBulkApiSequenceEnrollmentsJobRequest'
      responses:
        '201':
          description: Response returned when creating a query job.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateBulkApiJobSuccessResponse'
        '400':
          description: Response for any operation that results in a bad request error.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                properties:
                  status:
                    type: string
                    enum:
                      - bad_request
                  errors:
                    type: array
                    items:
                      $ref: '#/components/schemas/UResponses.BadRequestError'
                  message:
                    type: string
                description: >-
                  Response for any operation that results in a bad request
                  error.
        '401':
          description: Response for any operation that results in an unauthorized error.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - message
                properties:
                  status:
                    type: string
                    enum:
                      - unauthorized
                  message:
                    type: string
                description: >-
                  Response for any operation that results in an unauthorized
                  error.
        '429':
          description: Response for any operation that exceeds a rate limit.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - message
                properties:
                  status:
                    type: string
                    enum:
                      - rate_limited
                  message:
                    type: string
                description: Response for any operation that exceeds a rate limit.
        '500':
          description: Response for any operation that results in an internal server error.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - message
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                description: >-
                  Response for any operation that results in an internal server
                  error.
components:
  schemas:
    CreateBulkApiSequenceEnrollmentsJobRequest:
      type: object
      properties:
        filter:
          $ref: '#/components/schemas/CreateBulkApiSequenceEnrollmentsJobFilter'
          description: |-
            Filters that select the enrollments to export. Omit to export all
            enrollments.
      description: Request body for creating a sequence enrollment query jobs query job.
    CreateBulkApiJobSuccessResponse:
      type: object
      required:
        - job_id
        - status
        - expires_at
      properties:
        job_id:
          type: string
        status:
          type: string
          enum:
            - IN_PROGRESS
        expires_at:
          type: string
          description: Time the job and its results expire, 24 hours after creation.
      description: Response returned when creating a query job.
    UResponses.BadRequestError:
      type: object
      required:
        - code
      properties:
        code:
          type: string
        path:
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        object_api_name:
          type: string
        attribute_api_name:
          type: string
      allOf:
        - type: object
          unevaluatedProperties: {}
      description: Validation error detail returned for bad request responses.
    CreateBulkApiSequenceEnrollmentsJobFilter:
      type: object
      properties:
        status:
          anyOf:
            - type: object
              required:
                - in
              properties:
                in:
                  type: array
                  items:
                    $ref: '#/components/schemas/SequenceEnrollmentStatus'
                  minItems: 1
                not_in:
                  type: array
                  items:
                    $ref: '#/components/schemas/SequenceEnrollmentStatus'
                  minItems: 1
              description: Filter matching values included in a set.
            - type: object
              required:
                - not_in
              properties:
                in:
                  type: array
                  items:
                    $ref: '#/components/schemas/SequenceEnrollmentStatus'
                  minItems: 1
                not_in:
                  type: array
                  items:
                    $ref: '#/components/schemas/SequenceEnrollmentStatus'
                  minItems: 1
              description: Filter matching values excluded from a set.
        enrolled_by_play:
          anyOf:
            - type: object
              required:
                - in
              properties:
                in:
                  type: array
                  items:
                    type: string
                  minItems: 1
                not_in:
                  type: array
                  items:
                    type: string
                  minItems: 1
              description: Filter matching values included in a set.
            - type: object
              required:
                - not_in
              properties:
                in:
                  type: array
                  items:
                    type: string
                  minItems: 1
                not_in:
                  type: array
                  items:
                    type: string
                  minItems: 1
              description: Filter matching values excluded from a set.
          description: Filter by the play that created the enrollment.
      allOf:
        - $ref: '#/components/schemas/BulkApiCommonQueryFilter'
      description: Filters accepted when querying sequence enrollments.
    SequenceEnrollmentStatus:
      type: string
      enum:
        - DRAFT
        - IN_PROGRESS
        - FINISHED
      description: Status of a sequence enrollment.
    BulkApiCommonQueryFilter:
      type: object
      properties:
        updated_at:
          $ref: '#/components/schemas/BulkApiDatetimeRangeFilter'
        sequence:
          $ref: '#/components/schemas/BulkApiUuidFilter'
        person:
          $ref: '#/components/schemas/BulkApiUuidFilter'
        company:
          $ref: '#/components/schemas/BulkApiUuidFilter'
        mailbox:
          anyOf:
            - $ref: '#/components/schemas/BulkApiMailboxIdFilter'
            - $ref: '#/components/schemas/BulkApiMailboxEmailAddressFilter'
        started_at:
          $ref: '#/components/schemas/BulkApiDatetimeRangeFilter'
        ended_at:
          $ref: '#/components/schemas/BulkApiDatetimeRangeFilter'
        id:
          anyOf:
            - type: object
              required:
                - in
              properties:
                in:
                  type: array
                  items:
                    type: string
                  minItems: 1
                not_in:
                  type: array
                  items:
                    type: string
                  minItems: 1
              description: Filter matching values included in a set.
            - type: object
              required:
                - not_in
              properties:
                in:
                  type: array
                  items:
                    type: string
                  minItems: 1
                not_in:
                  type: array
                  items:
                    type: string
                  minItems: 1
              description: Filter matching values excluded from a set.
        is_blocked:
          type: boolean
        is_bounced:
          type: boolean
        is_canceled:
          type: boolean
        is_opted_out:
          type: boolean
        is_paused:
          type: boolean
        is_replied:
          type: boolean
      description: Filters shared by sequence enrollment and enrollment step query jobs.
    BulkApiDatetimeRangeFilter:
      type: object
      properties:
        gt:
          type: string
          description: Exclusive lower bound. Cannot be combined with `gte`.
        gte:
          type: string
          description: Inclusive lower bound. Cannot be combined with `gt`.
        lt:
          type: string
          description: Exclusive upper bound. Cannot be combined with `lte`.
        lte:
          type: string
          description: Inclusive upper bound. Cannot be combined with `lt`.
      description: Filter by a datetime range. At least one bound is required.
    BulkApiUuidFilter:
      type: object
      required:
        - id
      properties:
        id:
          type: string
      description: Filter matching a resource by ID.
    BulkApiMailboxIdFilter:
      type: object
      required:
        - id
      properties:
        id:
          type: string
        email_address:
          type: string
      description: Filter matching a mailbox by ID.
    BulkApiMailboxEmailAddressFilter:
      type: object
      required:
        - email_address
      properties:
        id:
          type: string
        email_address:
          type: string
      description: Filter matching a mailbox by email address.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.