# Set result export

Sets the results of a specified job ID.

Endpoint: POST /job/result_export/{job_id}
Version: 3
Security: ApiKeyAuth

## Path parameters:

  - `job_id` (integer, required)
    the job id

## Request fields (application/x-www-form-urlencoded):

  - `domain_key` (string)
    Example: domain_key_123

  - `pool_name` (string)
    resource pool name
    Example: pool_1

  - `priority` (integer)
    job execution priority
    Example: 0

  - `query` (string)
    the raw SQL query
    Example: SELECT * FROM my_table;

  - `retry_limit` (integer)
    automatically retry this many times on failure
    Example: 3

  - `scheduled_time` (string)
    Datetime in ISO 8601 format (`2020-12-31T11:22:33-05:00` or `2020-12-31T11:22:33Z` for UTC)
    Example: 2020-12-31T11:22:33Z

  - `target_job_id` (integer)
    unique identifier of job
    Example: 19

  - `result_connection_id` (integer)
    the connection id
    Example: 17

  - `result` (string)
    ...?

  - `database` (string)
    database name
    Example: Alpha

  - `table` (string)
    Example: Bravo

## Response 200 fields (application/json):

  - `cpu_time` (integer, required)

  - `created_at` (string, required)
    Datetime in custom format (`2020-12-31 11:22:33 -0500` or `2020-12-31 11:22:33 UTC` for UTC)
    Example: 2020-12-31 11:22:33 UTC

  - `database` (string, required)
    database name

  - `duration` (integer, required)
    Duration
    Example: 10

  - `end_at` (any, required)

  - `hive_result_schema` (string, required)
    the schema for the job's result table

  - `job_id` (string, required)
    unique identifier of job
    Example: 19

  - `linked_result_export_job_id` (any, required)

  - `num_records` (integer, required)
    the number of records in the result. Will be `null` until job has finished, and may not be set for all query types
    Example: 100

  - `organization` (string, required)
    always "null"

  - `priority` (integer, required)
    job execution priority
    Example: 0

  - `query` (any, required)

  - `query.in` (object)

  - `query.in.connection_prop` (string)
    Example: connection_prop

  - `query.in.connection_secret` (string)
    Example: secret

  - `query.in.basic_prop` (string)
    Example: basic

  - `query.in.basic_secret` (string)
    Example: secret

  - `query.in.advanced_prop` (string)
    Example: advanced

  - `query.in.advanced_secret` (string)
    Example: secret

  - `query.in.type` (string)
    Example: some_type

  - `query.in.td_authentication_id` (integer)
    Example: 1234

  - `query.filters` (array)

  - `query.exec` (object)

  - `query.exec.type` (string)
    Example: some_type

  - `query.exec.basic_prop` (string)
    Example: basic

  - `query.exec.secret_prop` (string)
    Example: secret

  - `query.out` (object)

  - `query.out.type` (string)
    Example: some_type

  - `query.out.mode` (string)
    Example: mode

  - `query.out.plazma_dataset` (string)
    Example: plazma

  - `query.out.time_column` (string)
    Example: time

  - `result` (string)
    ...?

  - `result_export_target_job_id` (any, required)

  - `result_size` (integer, required)
    size in bytes of the job's result, in `msgpack.gz` format
    Example: 1048576

  - `retry_limit` (integer, required)
    automatically retry this many times on failure
    Example: 3

  - `start_at` (any, required)

  - `status` (string, required)
    current status of the job
    Enum: "queued", "running", "killed", "success", "error"

  - `type` (string, required)
    Example: presto

  - `url` (string, required)

  - `user_name` (string, required)
    user's full name or email
    Example: Treasure Data

  - `debug` (object, required)

  - `debug.cmdout` (string, required)

  - `debug.stderr` (string, required)

