To create a table and upload a file to be queried:
Use the create table endpoint to set the table's schema, which defines the standards for imported files.
To upload a CSV or TSV file that adheres to the schema, use the upload file endpoint. To reduce the file size before upload, you can also upload a ZIP file with a single CSV or TSV. If the ZIP contains multiple files, the endpoint randomly chooses one. The response contains an
idfield with the file's unique identifier.
After the file uploads, it needs to be imported into the table. Importing validates the file and converts it into a format that's smaller and faster to query. At this point, you can add data—such as tags—to the import, and map the uploaded data to the table's columns. To import data, use the import file endpoint. This endpoint returns a file meta entity that contains a status. Assuming the import endpoint returns a success status, the file meta's status should be IMPORTING.
To poll on the status of the import, use the get file meta endpoint. Once done, the file meta entity's status is either IMPORTED, when the import succeeds, or STAGED, which indicates an issue with the import. To indicate errors, the file meta entity use the
numErrorsfield. If this field is greater than 0, make a call to the get import errors endpoint to retrieve a list of errors.