Tables

Create new table from CSV file

DEPRECATED, use Create table asynchronously instead.

Creates a new table in a bucket. The CSV file must follow the RFC 4180 Specification. More information about the requirements can be found in the Manual. Column names are extracted from the CSV file header; spaces and any other special characters in column names are replaced with an underscore. This API call should be used only for tables which can be safely transferred in a single HTTP request; for large tables use the asynchronous call.

The table data must be supplied through exactly one of data (file upload) or dataString (inline CSV).

post/v2/storage/branch/{branchId}/buckets/{bucketId}/tables

Request

Path parameters

bucketIdstring required

Bucket Id.

branchIdstring required

Request body multipart/form-data

namestring required

The name of a bucket or a table.

  • Allowed characters: A-Z, a-z, 0-9, dash - and underscore _. Anything else — a space, a dot, an accented letter — is rejected, not transliterated.
  • 1 to 96 characters.
  • Cannot start with an underscore. A dash or a digit as the first character is fine.
  • Registered (external) buckets follow this same rule, dashes included.
  • Uniqueness is case-insensitive within a stage: creating MyBucket next to mybucket fails with storage.buckets.alreadyExists, and for tables with storage.buckets.tableAlreadyExists or storage.validation.tableAlreadyExists.
  • To turn arbitrary user input into a name that satisfies this rule, call POST /v2/storage/webalize/display-name instead of reimplementing the transformation. It unaccents the input, replaces every run of disallowed characters with a single -, trims - from both ends, strips leading underscores, and truncates to 96 characters.
datastring binary

CSV file containing data for import. The data have to be encoded in UTF-8. The file can be raw or gzipped; gzipped files must have the extension .gz. Required unless dataString is provided.

dataStringstring

Inline CSV data. Used when no data file is uploaded.

primaryKeystring

Primary key of the table. If set, updates can be done on the table (see CSV incremental import). Multiple columns must be separated by a comma.

delimiterstring

Field delimiter used in the CSV file. Default ,. Use '\t' or type the char for the tabulator.

enclosurestring

Field enclosure used in the CSV file. Default ". Specify either enclosure or escapedBy, not both.

escapedBystring

Escape character used in the CSV file. Default empty - no escape character is used. Specify either enclosure or escapedBy, not both.

columnsstring

Comma separated list of column names, used when the file has no header.

withoutHeadersboolean

When true, the first row is treated as data, not as a header.

Example request

{
  "name": "my-bucket",
  "primaryKey": "id",
  "delimiter": ",",
  "enclosure": "\""
}

Response

The created table detail, including its columns and the parent bucket detail.

uristring required

Table API URI

idstring required

Table ID

namestring required

Table name

displayNamestring required

Table display name

transactionalboolean required

Is transactional

primaryKeystring[] required

Primary key columns

indexTypestring nullable required

Index type

indexKeystring[] required

Index key columns

distributionTypestring nullable required

Distribution type

distributionKeystring[] required

Distribution key columns

syntheticPrimaryKeyEnabledboolean required

Synthetic primary key enabled

createdstring nullable required

Created timestamp, ISO 8601 with a +hhmm offset.

lastImportDatestring nullable required

Last import date, ISO 8601 with a +hhmm offset.

lastChangeDatestring nullable required

Last change date, ISO 8601 with a +hhmm offset.

rowsCountinteger nullable required

Rows count

dataSizeBytesinteger nullable required

Data size in bytes

isAliasboolean required

Is alias

isAliasableboolean required

Is aliasable

isTypedboolean required

Is typed table

isDescriptionSystemManagedboolean required

Whether the description is managed by the system

timestampType'MANAGED' | 'SELFMANAGED' | 'NONE' required

How the _timestamp column is managed

tableTypestring required

Table type

pathstring required

Table path

columnsstring[] required

List of column names.

aliasColumnsAutoSyncboolean

Alias columns auto sync. Present only for simple aliases.

selectSqlstring

Custom SQL of the alias. Present only for custom SQL aliases.

isPersistedboolean

Whether the alias is persisted as a table in the backend. Present only for aliases.

Example response

{
  "created": "2017-02-13T12:01:05+0100",
  "lastImportDate": "2017-02-13T12:01:05+0100",
  "lastChangeDate": "2017-02-13T12:01:05+0100",
  "bucket": {
    "uri": "https://connection.keboola.com/v2/storage/buckets/in.c-my-new-bucket",
    "id": "in.c-my-new-bucket",
    "name": "c-my-new-bucket",
    "displayName": "my-new-bucket",
    "idBranch": 1234,
    "stage": "in",
    "description": "Some Description",
    "tables": "https://connection.keboola.com/v2/storage/buckets/in.c-my-new-bucket",
    "created": "2017-02-13T12:01:05+0100",
    "updated": "2024-11-28T13:03:13+0100",
    "backend": "snowflake",
    "path": "database_name.c-my-new-bucket",
    "bucketSharingAllowed": true,
    "sharingParameters": {
      "projects": [
        {
          "id": 321,
          "name": "Some Project"
        }
      ],
      "users": [
        {
          "id": 5,
          "name": "Jan Developer",
          "email": "jan.dev@keboola.com"
        }
      ]
    },
    "sharedBy": {
      "id": 5,
      "name": "dev@keboola.com",
      "date": "2020-02-03T14:58:29+0100"
    },
    "owner": {
      "id": 123,
      "name": "Jan Developer",
      "email": "jan.dev@keboola.com"
    },
    "sourceBucket": {
      "id": "in.c-main",
      "name": "c-main",
      "displayName": "main",
      "stage": "in",
      "description": "Organization shared data",
      "sharing": "organization-project",
      "created": "2020-01-12T18:28:31+0100",
      "lastChangeDate": "2020-01-12T18:31:49+0100",
      "dataSizeBytes": 1536,
      "rowsCount": 32,
      "backend": "snowflake",
      "path": "database_name.c-main",
      "project": {
        "id": 123,
        "name": "Project name"
      },
      "tables": [
        {
          "id": "in.c-main.languages",
          "name": "languages",
          "displayName": "languages-display-name",
          "path": "/1234-languages"
        }
      ],
      "sharingParameters": {
        "projects": [
          {
            "id": 321,
            "name": "Some Project"
          }
        ],
        "users": [
          {
            "id": 5,
            "name": "Jan Developer",
            "email": "jan.dev@keboola.com"
          }
        ]
      },
      "sharedBy": {
        "id": 5,
        "name": "dev@keboola.com",
        "date": "2020-02-03T14:58:29+0100"
      },
      "owner": {
        "id": 123,
        "name": "Jan Developer",
        "email": "jan.dev@keboola.com"
      },
      "metadata": [
        {
          "id": "19509",
          "key": "some-key",
          "value": "Some value",
          "provider": "test-component",
          "timestamp": "2017-02-13T23:36:10+0100"
        }
      ]
    },
    "backendPath": [
      "KBC_PRJ_123",
      "in.c-my-new-bucket"
    ],
    "metadata": [
      {
        "id": "19509",
        "key": "some-key",
        "value": "Some value",
        "provider": "test-component",
        "timestamp": "2017-02-13T23:36:10+0100"
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.