# Query entries with a typed filter

`POST /cms/query` · Rivier · content

Query entries with a typed filter.

- Scope: content:read
- Mcp: rivier_cms_query
- Graphql: Query.contentEntryQuery
- Sdk: content.entry.query
- Cli: content entry query

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{0,39}$"
    },
    "locale": {
      "type": "string",
      "maxLength": 20
    },
    "where": {
      "type": "object",
      "additionalProperties": {}
    },
    "search": {
      "type": "string",
      "maxLength": 300
    },
    "sort": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "maxLength": 100
          },
          "dir": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ],
            "default": "asc"
          }
        },
        "required": [
          "field"
        ],
        "additionalProperties": false
      },
      "maxItems": 3
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 25
    },
    "offset": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000,
      "default": 0
    },
    "select": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 100
      },
      "maxItems": 60
    },
    "expand": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1,
      "default": 0
    },
    "state": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "draft",
          "in_review",
          "approved",
          "scheduled",
          "published",
          "archived"
        ]
      },
      "maxItems": 6
    },
    "site": {
      "type": "string",
      "maxLength": 80
    }
  },
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/cms/query' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "string",
  "locale": "string",
  "where": {},
  "search": "string",
  "sort": [
    {
      "field": "string"
    }
  ],
  "limit": 25,
  "offset": 0,
  "select": [
    "string"
  ]
}'
```
