> ## 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 records.

## Overview

Create a query job to query and export records from an object. Use the request
body to select which attributes to return and 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 /data/v1/objects/{object_name}/query-jobs
openapi: 3.1.0
info:
  title: Unify Data API
  summary: Interact with objects, attributes, and records 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: Data
  - name: Object Record Query Jobs
  - name: Event Query Jobs
  - name: Lists
  - name: List Entries
  - name: Objects
  - name: Object Attributes
  - name: Object Attribute Options
  - name: Object Records
paths:
  /data/v1/objects/{object_name}/query-jobs:
    post:
      tags:
        - Data
        - Object Record Query Jobs
      description: |-
        Start an asynchronous query job to export records of an object. Poll the
        job until it is `FINISHED`, then page through the results.
      operationId: create_object_record_query_job
      parameters:
        - name: object_name
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/UObjects.UObjectName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBulkApiObjectRecordsJobRequest'
      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.
        '404':
          description: Response returned when the object being queried cannot be found.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CreateBulkApiObjectRecordsJobObjectNotFoundResponse
        '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:
    UObjects.UObjectName:
      type: string
      description: |-
        The API name of an object, e.g. `company`, `person`, `opportunity`, or a
        custom object's API name.
    CreateBulkApiObjectRecordsJobRequest:
      type: object
      required:
        - query
      properties:
        query:
          $ref: '#/components/schemas/BulkApiObjectRecordsQuery'
      description: Request body for creating an object records 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.
    CreateBulkApiObjectRecordsJobObjectNotFoundResponse:
      type: object
      allOf:
        - type: object
          required:
            - status
            - message
          properties:
            status:
              type: string
              enum:
                - not_found
            message:
              type: string
          description: Response for any operation that results in a not found error.
      description: Response returned when the object being queried cannot be found.
    BulkApiObjectRecordsQuery:
      type: object
      required:
        - select
      properties:
        where:
          $ref: '#/components/schemas/SearchRecordsWhere'
          description: >-
            Filter by attribute values. Omit to include records regardless of
            their

            attributes.
        select:
          $ref: '#/components/schemas/SearchRecordsSelect'
          description: |-
            Attributes to return. Nested selections expand records referenced by
            single-reference attributes.
        sort_by:
          $ref: '#/components/schemas/SearchRecordsMetadataSortBy'
          description: >-
            Order of the results. For incremental exports, sort by the same
            timestamp

            used in `metadata`.
        metadata:
          $ref: '#/components/schemas/SearchRecordsMetadataFilter'
          description: Filter by record creation or update time.
      description: Query describing which object records to return and how to shape them.
    SearchRecordsWhere:
      type: object
      unevaluatedProperties:
        anyOf:
          - $ref: '#/components/schemas/SearchRecordsAttributeWhere'
          - $ref: '#/components/schemas/SearchRecordsWhere'
      description: >-
        Filter records by one or more attribute conditions.


        Each key is an attribute API name on the queried object. A value of

        `{ "equals": ... }` matches the attribute directly, while a nested
        object of

        further conditions filters through a single-reference attribute on the

        referenced object.
    SearchRecordsSelect:
      type: object
      unevaluatedProperties:
        anyOf:
          - type: boolean
            enum:
              - true
          - $ref: '#/components/schemas/SearchRecordsNestedSelect'
      description: >-
        Select the attributes to return for each record.


        Each key is an attribute API name on the queried object. A value of
        `true`

        returns the attribute directly, while `{ "select": ... }` expands a

        single-reference attribute and selects attributes on the referenced
        object.


        Nested selects may be at most three levels deep, counting the root
        select as

        level one (so the root plus at most two levels of nested reference
        selects).

        Requests exceeding this depth are rejected with a `400`.
    SearchRecordsMetadataSortBy:
      type: object
      required:
        - field
        - direction
      properties:
        field:
          $ref: '#/components/schemas/SearchRecordsMetadataSortField'
        direction:
          $ref: '#/components/schemas/SearchRecordsSortDirection'
      description: Sort records by a base record field.
    SearchRecordsMetadataFilter:
      type: object
      properties:
        created_at:
          $ref: '#/components/schemas/SearchRecordsTimestampFilter'
        updated_at:
          $ref: '#/components/schemas/SearchRecordsTimestampFilter'
      description: Filter records by when they were created or last updated.
    SearchRecordsMetadataSortField:
      type: string
      enum:
        - id
        - created_at
        - updated_at
      description: Base record field to sort by.
    SearchRecordsSortDirection:
      type: string
      enum:
        - ASCENDING
        - DESCENDING
      description: Direction in which to sort records.
    SearchRecordsTimestampFilter:
      type: object
      properties:
        gt:
          $ref: '#/components/schemas/UValues.UDatetime'
          description: Exclusive lower bound. Cannot be combined with `gte`.
        gte:
          $ref: '#/components/schemas/UValues.UDatetime'
          description: Inclusive lower bound. Cannot be combined with `gt`.
        lt:
          $ref: '#/components/schemas/UValues.UDatetime'
          description: Exclusive upper bound. Cannot be combined with `lte`.
        lte:
          $ref: '#/components/schemas/UValues.UDatetime'
          description: Inclusive upper bound. Cannot be combined with `lt`.
      description: |-
        Filter a record timestamp by an ISO 8601 datetime range in UTC. At least
        one bound is required.
    UValues.UDatetime:
      type: string
      description: |-
        String value representing a UTC datetime in ISO 8601 format
        (`YYYY-MM-DDTHH:mm:ss.sssZ`).
      title: UDatetime
  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.