Operations#

Long-running async operations. Every async mutation returns an OperationRef; poll this resource to track progress.

List a database’s async operations#

GET /api/v2/databases/{owner}/{database}/operations

Returns the async operations (imports, merges, SQL writes, forks, …) recorded against the database {owner}/{database}, ordered by the backend. Cursor-paginated via page_token (request) / meta.next_page_token (response); when next_page_token is absent or empty there are no further pages. Public databases are readable without authentication; private databases require a credential with access (and return 404 otherwise, so their existence isn’t leaked). Each entry is the same Operation shape GET /api/v2/operations/{id} returns — data[i].id is what you pass to that endpoint to re-poll a single operation.

Parameters

NameInTypeRequiredDescription
ownerpathstringyesThe user or organization that owns the database.
databasepathstringyesThe database name, unique within the owner.
page_tokenquerystringnoOpaque cursor returned in a prior response’s meta.next_page_token. Pass it back to fetch the next page; omit it on the first request. The token format is server-defined — clients must treat it as an opaque string.

Example request

curl -X GET 'https://www.dolthub.com/api/v2/databases/{owner}/{database}/operations' \
  -H 'Authorization: Bearer YOUR_TOKEN'

Responses

StatusDescriptionSchema
200The database’s async operations.Operation[]
400The request was malformed or failed input validation.Problem
401Authentication credentials were missing or invalid.Problem
404The requested resource does not exist.Problem
405The HTTP method is not supported for this resource.Problem
500An unexpected server error occurred.Problem

Get an async operation#

GET /api/v2/operations/{operation_id}

Polls a long-running operation by its id. Every async mutation (SQL write, import, merge, fork) returns an OperationRef in its 202 response; clients poll this endpoint until status is succeeded or failed. The id is the job resource name returned by the backend.

Parameters

NameInTypeRequiredDescription
operation_idpathstringyesThe operation ID returned in an OperationRef.

Example request

curl -X GET 'https://www.dolthub.com/api/v2/operations/{operation_id}' \
  -H 'Authorization: Bearer YOUR_TOKEN'

Responses

StatusDescriptionSchema
200The current state of the operation.Operation
401Authentication credentials were missing or invalid.Problem
403Authenticated, but not permitted to perform this action.Problem
404The requested resource does not exist.Problem
405The HTTP method is not supported for this resource.Problem
500An unexpected server error occurred.Problem