Skip to content
EleforkDocs
Internal preview. Elefork is not publicly available yet; APIs and hostnames may change.

Upload a dataset

POST
/v1/projects/{id}/datasets
curl --request POST \
--url 'https://api.elefork.com/v1/projects/example/datasets?name=example&format=sql' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--data binary

The request body is the raw file: a plain-format pg_dump of one database (format=sql; COPY ... FROM stdin blocks are supported, psql meta-commands other than \restrict are not) or a CSV file with a header row (format=csv; the table is created with text columns if it does not exist). Size is capped by the server (default 256 MiB).

id
required
string
name
required
string
/^[a-z0-9][a-z0-9_.-]{0,62}$/
format
required
string
Allowed values: sql csv
table
string

Target table for csv (name or schema.name)

string format: binary

Stored

Media typeapplication/json
object
id
required
string
org_id
required
string
project_id
required
string
name
required
string
format
required
string
Allowed values: sql csv
csv_table
string
size_bytes
required
integer format: int64
sha256
required
string
state
required
string
Allowed values: uploaded building ready failed
error
string
base_template_id
required
One of:
string
template_id
required

The org template built from it

One of:
string
created_at
required
string format: date-time
built_at
required
One of:
string format: date-time

Example

{
"format": "sql",
"state": "uploaded"
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Temporarily unavailable; retry after the Retry-After seconds. Codes: database_unavailable (the metadata database is failing over) and cube_admission (a compute node runs a sandbox shim below the platform minimum, so creates, forks, checkpoints and resets are refused until it is upgraded).

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}
Retry-After
integer