# Query data

Use `GET` requests to query information about your Ripple Custody environment. Each entity has corresponding list and detail queries.

## List queries

Use list queries to list the instances of a particular entity.

For example, the following operation returns a list of domains:


```sh
GET {baseURL}/domains
```

By default, up to 100 items are returned, which is also the maximum.

Response objects from list queries all contain the following information:

- `items`: A list of all the items returned.
- `count`: An integer representing a count of the entities.
- `currentStartingAfter`: The ID of the last item returned by the previous query.
- `nextStartingAfter`: The ID of the last item returned by the query.


Use the values in `currentStartingAfter` and `nextStartingAfter` to create pagination.

### Query parameters

Use query parameters to apply filters to the list of entities returned by the query.

The common query parameters applicable to all list requests are:

| Parameter | Description |
|  --- | --- |
| `limit` | Maximum number of results to be returned in the response body |
| `startingAfter` | ID from which to start reporting results, for pagination |
| `sortBy` | Property to use for sorting, varies by object |
| `sortOrder` | Order in which items are returned, can be either ascending `ASC` or descending `DESC` |
| `lock` | Returns only entities matching the specified lock status -- `Unlocked`, `Locked`, or `Archived` (archived items are permanently deactivated items that cannot be reactivated) |
| `alias` | Returns only the entities with the specified alias |


You can also use entity-specific filters, such as returning assets or transactions for a particular blockchain ledger. For more information, see the [API reference](../api/reference/openapi.json.

## Detail queries

Use detail queries to list a single instance of a particular entity.

For example, the following operation queries the detail of a specific domain:


```sh
GET /{baseURL}/domains/{domainId}
```

Responses to detail queries contain a `data` object and the entity's `signature` string.

The `data` object includes the properties specific to the given object, plus a `metadata` object.

Every entity type relies on a common pattern exposing the following fields:

| Field | Description |
|  --- | --- |
| `id` | Identifier in the form of a globally unique identifier (GUID or UUID); once defined, an `id` cannot be changed. |
| `alias` | A mandatory descriptive text field. |
| `domainId` | The ID of the domain to which the entity belongs; for domains, this field is called `parentId` and refers to the parent domain |
| `metadata` | Metadata object that contains custom information that was specified about the entity, to extend its definition to include, for example, data that can be leveraged by policies to implement specific governance scenarios, or identifiers of entities which are not in Ripple Custody to be used by external system integrations such as core banking systems. The object contains the following information:`metadata.description`: An optional descriptive text field`metadata.revision`: A revision number set to 1 upon the creation of the entity, and incremented at every entity update`createdAt`: Timestamp of creation`createdBy`: ID of the user who created the entity`lastModifiedAt`: Timestamp of the last update`lastModifiedBy`: ID of the last user to update the entity`metadata.customProperties`: An optional key-value storeEach of these fields is user-defined at the creation or update of an entity. To obtain detailed information about the entity, make a call using the UUID. |
| `lock` | A boolean `lock` flag, to indicate whether the entity is active or inactive. The `lock` property is inherited, which means that subdomains of locked parents are also locked. This flag is present in all entities apart from transaction entities. |


Together, the `id` and `metadata.revision` are the basis of the anti-replay model in Ripple Custody.
For more information about the Ripple Custody anti-replay model, see [Anti-rewind file](/products/custody/v1.26/overview/architecture/security#anti-rewind-file).