API Reference

Creating a table and uploading data

To create a table and upload a file to be queried:

  1. Use the create table endpoint to set the table's schema, which defines the standards for imported files.

  2. 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 id field with the file's unique identifier.

  3. 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.

  4. 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 numErrors field. If this field is greater than 0, make a call to the get import errors endpoint to retrieve a list of errors.