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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
owner | path | string | yes | The user or organization that owns the database. |
database | path | string | yes | The database name, unique within the owner. |
page_token | query | string | no | Opaque 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
| Status | Description | Schema |
|---|---|---|
200 | The database’s async operations. | Operation[] |
400 | The request was malformed or failed input validation. | Problem |
401 | Authentication credentials were missing or invalid. | Problem |
404 | The requested resource does not exist. | Problem |
405 | The HTTP method is not supported for this resource. | Problem |
500 | An 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
operation_id | path | string | yes | The 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
| Status | Description | Schema |
|---|---|---|
200 | The current state of the operation. | Operation |
401 | Authentication credentials were missing or invalid. | Problem |
403 | Authenticated, but not permitted to perform this action. | Problem |
404 | The requested resource does not exist. | Problem |
405 | The HTTP method is not supported for this resource. | Problem |
500 | An unexpected server error occurred. | Problem |