Skip to content
getgeolens.com

Import a table from a database connection

POST
/services/databases/{connection}/imports/
curl --request POST \
--url https://example.com/api/services/databases/example/imports/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "schema_name": "example", "table_name": "example", "title": "example", "summary": "example", "visibility": "private", "srid_override": 1 }'

Copy one listed table or view into a new dataset, as an ingest job.

The table must be one the connection’s listing returns for this request. A second import of the same table by the same user answers 409 duplicate_source naming the existing dataset; refresh that one instead.

connection
required
Connection

Connection name.

string
<= 64 characters

Connection name.

Media type application/json
DatabaseImportRequest
object
schema_name
required
Schema Name

Schema of the table, as listed.

string
>= 1 characters <= 128 characters
table_name
required
Table Name

Table or view name, as listed.

string
>= 1 characters <= 128 characters
title
Any of:
string
>= 1 characters <= 500 characters
summary
Any of:
string
<= 5000 characters
visibility
Visibility

Dataset visibility: private, restricted, internal or public.

string
default: private
Allowed values: private restricted internal public
srid_override
Any of:
integer
>= 1 <= 998999

Successful Response

Media type application/json
DatabaseImportResponse
object
job_id
required
Job Id

Ingest job that copies the table.

string format: uuid
status
required
Status

Status of the new job.

string
Allowed value: pending
message
required
Message

What happened.

string

Example

{
"status": "pending"
}

Bad request — invalid payload

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
code
Code

A machine-readable code for the problem, on the errors that carry one, such as catalog_lock_conflict on a 409 for a row another request holds. Absent otherwise.

string
action
Action

The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.

string
shared_maps
Shared Maps

The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.

Array<object>
object
key
additional properties
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
code
Code

A machine-readable code for the problem, on the errors that carry one, such as catalog_lock_conflict on a 409 for a row another request holds. Absent otherwise.

string
action
Action

The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.

string
shared_maps
Shared Maps

The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.

Array<object>
object
key
additional properties
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks write access

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
code
Code

A machine-readable code for the problem, on the errors that carry one, such as catalog_lock_conflict on a 409 for a row another request holds. Absent otherwise.

string
action
Action

The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.

string
shared_maps
Shared Maps

The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.

Array<object>
object
key
additional properties
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
code
Code

A machine-readable code for the problem, on the errors that carry one, such as catalog_lock_conflict on a 409 for a row another request holds. Absent otherwise.

string
action
Action

The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.

string
shared_maps
Shared Maps

The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.

Array<object>
object
key
additional properties
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Conflict — resource state prevents the operation

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
code
Code

A machine-readable code for the problem, on the errors that carry one, such as catalog_lock_conflict on a 409 for a row another request holds. Absent otherwise.

string
action
Action

The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.

string
shared_maps
Shared Maps

The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.

Array<object>
object
key
additional properties
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
code
Code

A machine-readable code for the problem, on the errors that carry one, such as catalog_lock_conflict on a 409 for a row another request holds. Absent otherwise.

string
action
Action

The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.

string
shared_maps
Shared Maps

The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.

Array<object>
object
key
additional properties
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
code
Code

A machine-readable code for the problem, on the errors that carry one, such as catalog_lock_conflict on a 409 for a row another request holds. Absent otherwise.

string
action
Action

The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.

string
shared_maps
Shared Maps

The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.

Array<object>
object
key
additional properties
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
code
Code

A machine-readable code for the problem, on the errors that carry one, such as catalog_lock_conflict on a 409 for a row another request holds. Absent otherwise.

string
action
Action

The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.

string
shared_maps
Shared Maps

The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.

Array<object>
object
key
additional properties
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Bad gateway — an upstream provider failed

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
code
Code

A machine-readable code for the problem, on the errors that carry one, such as catalog_lock_conflict on a 409 for a row another request holds. Absent otherwise.

string
action
Action

The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.

string
shared_maps
Shared Maps

The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.

Array<object>
object
key
additional properties
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
code
Code

A machine-readable code for the problem, on the errors that carry one, such as catalog_lock_conflict on a 409 for a row another request holds. Absent otherwise.

string
action
Action

The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.

string
shared_maps
Shared Maps

The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.

Array<object>
object
key
additional properties
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}