client.imports.post_batches

A method of the Imports endpoint.

post_batches(file_ids: List[int], schema: str, table: str, remote_host_id: int, credential_id: int, *, column_delimiter: str = None, first_row_is_header: bool = None, compression: str = None, hidden: bool = None) Response

Upload multiple files to Civis

API URL: POST /imports/batches

import civis
client = civis.APIClient()
response = client.imports.post_batches(...)
Parameters:
file_idsList[int]

The file IDs for the import.

schemastr

The destination schema name. This schema must already exist in Redshift.

tablestr

The destination table name, without the schema prefix. This table must already exist in Redshift.

remote_host_idint

The ID of the destination database host.

credential_idint

The ID of the credentials to be used when performing the database import.

column_delimiterstr, optional

The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. If unspecified, defaults to “comma”.

first_row_is_headerbool, optional

A boolean value indicating whether or not the first row is a header row. If unspecified, defaults to false.

compressionstr, optional

The type of compression. Valid arguments are “gzip”, “zip”, and “none”. If unspecified, defaults to “gzip”.

hiddenbool, optional

The hidden status of the item.

Returns:
civis.Response
  • idint

    The ID for the import.

  • schemastr

    The destination schema name. This schema must already exist in Redshift.

  • tablestr

    The destination table name, without the schema prefix. This table must already exist in Redshift.

  • remote_host_idint

    The ID of the destination database host.

  • statestr

    The state of the run; one of “queued”, “running”, “succeeded”, “failed”, or “cancelled”.

  • started_atstr (time)

    The time the last run started at.

  • finished_atstr (time)

    The time the last run completed.

  • errorstr

    The error returned by the run, if any.

  • hiddenbool

    The hidden status of the item.