Import a table from a database connection
const url = 'https://example.com/api/services/databases/example/imports/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"schema_name":"example","table_name":"example","title":"example","summary":"example","visibility":"private","srid_override":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Connection name.
Connection name.
Request Bodyrequired
Section titled “ Request Bodyrequired ”object
Schema of the table, as listed.
Table or view name, as listed.
Dataset visibility: private, restricted, internal or public.
Responses
Section titled “ Responses ”Successful Response
object
Ingest job that copies the table.
Status of the new job.
What happened.
Example
{ "status": "pending"}Bad request — invalid payload
object
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.
The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.
The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.
object
Example
{ "detail": "Dataset not found", "status": 404, "title": "Not Found", "type": "about:blank"}Unauthorized — missing or invalid credentials
object
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.
The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.
The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.
object
Example
{ "detail": "Dataset not found", "status": 404, "title": "Not Found", "type": "about:blank"}Forbidden — caller lacks write access
object
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.
The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.
The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.
object
Example
{ "detail": "Dataset not found", "status": 404, "title": "Not Found", "type": "about:blank"}Not found
object
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.
The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.
The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.
object
Example
{ "detail": "Dataset not found", "status": 404, "title": "Not Found", "type": "about:blank"}Conflict — resource state prevents the operation
object
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.
The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.
The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.
object
Example
{ "detail": "Dataset not found", "status": 404, "title": "Not Found", "type": "about:blank"}Validation error
object
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.
The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.
The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.
object
Example
{ "detail": "Dataset not found", "status": 404, "title": "Not Found", "type": "about:blank"}Too many requests — retry after the advertised interval
object
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.
The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.
The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.
object
Example
{ "detail": "Dataset not found", "status": 404, "title": "Not Found", "type": "about:blank"}Headers
Section titled “ Headers ”Seconds until the request may be retried
Internal server error
object
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.
The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.
The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.
object
Example
{ "detail": "Dataset not found", "status": 404, "title": "Not Found", "type": "about:blank"}Bad gateway — an upstream provider failed
object
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.
The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.
The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.
object
Example
{ "detail": "Dataset not found", "status": 404, "title": "Not Found", "type": "about:blank"}Service unavailable — the database could not serve the request
object
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.
The refused change, on a dataset_in_shared_maps 422: unpublish, restrict_visibility or delete. Absent otherwise.
The shared maps behind a dataset_in_shared_maps 422, as {"id", "name"} pairs. Absent otherwise.
object
Example
{ "detail": "Dataset not found", "status": 404, "title": "Not Found", "type": "about:blank"}