# 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
    Example: 19

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

  - `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)
    URL of the result output destination

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

  - `table` (string)
    Example: "Bravo"

## Response 200 fields (application/json):

  - `cpu_time` (integer,null, 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,null, required)
    database name

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

  - `end_at` (any, required)

  - `hive_result_schema` (string,null, 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,null, 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

  - `priority` (integer, required)
    job execution priority

  - `query` (any, required)
    - `in` (object)
    - `in.connection_prop` (string)
      Example: "connection_prop"
    - `in.connection_secret` (string)
      Example: "secret"
    - `in.basic_prop` (string)
      Example: "basic"
    - `in.basic_secret` (string)
      Example: "secret"
    - `in.advanced_prop` (string)
      Example: "advanced"
    - `in.advanced_secret` (string)
      Example: "secret"
    - `in.type` (string)
      Example: "some_type"
    - `in.td_authentication_id` (integer)
      Example: 1234
    - `filters` (array)
    - `exec` (object)
    - `exec.type` (string)
      Example: "some_type"
    - `exec.basic_prop` (string)
      Example: "basic"
    - `exec.secret_prop` (string)
      Example: "secret"
    - `out` (object)
    - `out.type` (string)
      Example: "some_type"
    - `out.mode` (string)
      Example: "mode"
    - `out.plazma_dataset` (string)
      Example: "plazma"
    - `out.time_column` (string)
      Example: "time"

  - `result` (string)
    URL of the result output destination

  - `result_export_target_job_id` (any, required)

  - `result_size` (integer,null, 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"

  - `updated_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"

  - `url` (string, required)

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

  - `debug` (object, required)

  - `debug.cmdout` (string,null, required)

  - `debug.stderr` (string,null, required)

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


