Skip to main content

Listing block models

List all block models within the workspace workspace_id using the List all block models in a workspace endpoint, or list all block models in the organization org_id using the List all block models in an organization endpoint. While they are different endpoints, the request and response bodies are the same.

Request

MethodRequest URLDescription
GET/orgs/{org_id}/workspaces/{workspace_id}/block-modelsList all block models in the workspace workspace_id.
GET/orgs/{org_id}/block-modelsList all block models in the organization org_id.

Query parameters

Query parameterDescription
deletedOptional. The boolean parameter deleted specifies whether the response will only list block models that were deleted via the Delete block model endpoint. This list will not include block models that are within deleted workspaces. Default value is false.
offsetOptional. Integer index of the first item to return. Default value is 0.
limitOptional. Maximum number of items to return in the list. Must be greater than 0 and less than or equal to 100. Default value is 50.

Response

On success, the API will respond with the HTTP status code 200 OK and a response body containing the PaginatedResponse[BlockModel] object.

Response Body

The PaginatedResponse[BlockModel] object contains the list of block models as well as metadata pertaining to pagination.

PaginatedResponse[BlockModel]
{
"results": list[BlockModel],
"count": int,
"total": int,
"limit": int,
"offset": int
}
Schema fieldDescription
resultsList of block models. Empty if no results can be returned.
countThe number of block models returned in results.
totalTotal number of block models in the full list without pagination.
limitMaximum number of items requested.
offsetIndex of the first item in results with respect to the full list without pagination.

Example: List block models in workspace with pagination

If the workspace workspace_id contains an unknown number of block models, you will likely wish to paginate the results for easier digestion.
You may retrieve a list of the first 10 block models in the workspace workspace_id using the following request.

MethodRequest URL
GET/orgs/{org_id}/workspaces/{workspace_id}/block-models/?limit=10

Since the offset query parameter has not been provided, the API will use the default value of 0, and will return the first 10 block models in the full list.

Response body, first 10 results
{
"results": list[BlockModel],
"count": 10,
"total": 134,
"limit": 10,
"offset": 0
}

From the response body, we see that the total number of block models is 134, and that the API has returned 10 items in the results list. The requested limit and offset is also shown in the response.

To page through the next 10 block models, you may use the following request.

MethodRequest URL
GET/orgs/{org_id}/workspaces/{workspace_id}/block-models/?limit=10&offset=10
Response body, second page of 10 results
{
"results": list[BlockModel],
"count": 10,
"total": 134,
"limit": 10,
"offset": 10
}

© Seequent, The Bentley Subsurface Company