# List saved searches

`POST /v1/list_saved_searches`

Lists the saved searches you can use, with their parameters, and returns the first
page: in every scope you can use (see *Saved searches and scopes*), or in those that
`scopeIn` names. Each carries its `scope`, so the list can show which are your own and
which are shared. They are ordered by scope, then by name, both by Unicode code point
(so `Z` comes before `a`). Use `next` with [`POST /v1/continue_list_saved_searches`](/docs/v1/continue-list-saved-searches.md) for
the following pages.

A scope in `scopeIn` that does not exist is refused with `400` ([`invalid-request`](/docs/v1/problems/invalid-request.md)),
with `errors` pointing at it, and one your organization's agreement leaves out with
`403` ([`scope-not-entitled`](/docs/v1/problems/scope-not-entitled.md)).

## Request

### Body

- `scopeIn` · list

  Listed values: `account`, `organization`.

  List only the saved searches in these scopes. Without it, every scope you can use
  is listed.

- `pageSize` · integer, 1 to 100 · default `10`

  How many entries each page holds.

## Samples

The spec's example, every scope you can use. The Python and Node samples run on a client logged in as the login pages show, and curl reads an access token from $TOKEN.

Logging in: [Logging in](/docs/login.md), or for a script, [Creating a token for a script](/docs/login/script-token.md).

Every API host serves these pages for its own API. The samples are written for production, https://api.reconnectchina.org, as the pages are before they know their host. On another host, such as the sandbox, use that host instead: in curl's URL and the Shell samples' `login=` line, and as `server` for the Python and Node clients, which log in there too.

### Python

```python
page = client.list_saved_searches()
```

### curl

```sh
curl -X POST 'https://api.reconnectchina.org/v1/list_saved_searches' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  --data-raw '{}'
```

### Node

```js
const page = await client.listSavedSearches();
```

## Responses

### 200 · Success

The first page of saved searches.

- `searches` · list of objects

  One page of saved searches, ordered by scope, then by name (both by Unicode code
  point).

- `searches[].scope` · string

  The scope it lives in. With `name`, it is the search's address:
  `/v1/saved_searches/{scope}/{name}`.

- `searches[].name` · string, up to 64 characters

  1 to 64 letters, combining marks, digits, `_` and `-`, in any script. Case-sensitive,
  compared after Unicode NFC normalization.

- `searches[].title` · string · may be absent

  The title it was saved with. Absent when none was.

- `searches[].description` · string · may be absent

  The description it was saved with. Absent when none was.

- `searches[].changedAt` · string

  When the search was last saved.

- `searches[].parameters` · object

  The parameters as they were saved, as [`POST /v1/search`](/docs/v1/search.md) takes them, date math
  unevaluated. They may
  have been saved by a newer client than yours, so a parameter, a `strategy`, a
  `dateField`, an issuer or a histogram may be one you do not know yet.

- `searches[].parameters.term` · string · may be absent

- `searches[].parameters.strategy` · string · may be absent

- `searches[].parameters.typeIn` · list of strings · may be absent

  Only documents of these kinds. Without it, all kinds.

- `searches[].parameters.levelIn` · list of strings · may be absent

  Only documents issued at these levels. Without it, all levels.

- `searches[].parameters.issuerIn` · list of strings · may be absent

- `searches[].parameters.topicIn` · list of strings · may be absent

  Only documents on these topics. Without it, all topics.

- `searches[].parameters.from` · string · may be absent

- `searches[].parameters.to` · string · may be absent

- `searches[].parameters.dateField` · string · may be absent

- `searches[].parameters.pageSize` · integer · may be absent

- `searches[].parameters.histograms` · object · may be absent

- `next` · string · may be absent

  Opaque. Absent when there is nothing more. Send it back unchanged, from the account
  that received it.

### Errors

Every error is a problem document with the fields below. Its `type` names the problem, and is the address of the problem's page.

- `400` · [`invalid-request`](/docs/v1/problems/invalid-request.md)

  The request is not valid ([`invalid-request`](/docs/v1/problems/invalid-request.md)): a path that cannot be read, a body that
  is not JSON or does not match the schema, an unknown field, a `from` or `to` that is
  not a valid instant expression (an unknown time zone, or a time of day the zone skips,
  included), a `from` that is not earlier than `to`, a `term` that does not parse or is
  longer than your organization's agreement allows, an unknown issuer, a scope in the
  body that does not exist, or a saved search's name that breaks the naming rule.
  `errors` names each offending part: a `pointer` into the body (for the run of a saved
  search, into `parameters` as it ran), or the `parameter` of the path (see
  [problem types](/docs/v1/problems.md)).

- `401` · [`unauthenticated`](/docs/v1/problems/unauthenticated.md)

  No access token, or one that is invalid or has expired ([`unauthenticated`](/docs/v1/problems/unauthenticated.md)). Refresh
  the access token and try again.

  Header `WWW-Authenticate`

  `Bearer`, as [RFC 6750](https://www.rfc-editor.org/rfc/rfc6750) specifies.

- `403` · [`no-organization`](/docs/v1/problems/no-organization.md) · [`multiple-organizations`](/docs/v1/problems/multiple-organizations.md) · [`organization-not-registered`](/docs/v1/problems/organization-not-registered.md) · [`not-entitled`](/docs/v1/problems/not-entitled.md) · [`access-ended`](/docs/v1/problems/access-ended.md) · [`tier-served-elsewhere`](/docs/v1/problems/tier-served-elsewhere.md) · [`scope-not-entitled`](/docs/v1/problems/scope-not-entitled.md) · [`suspended`](/docs/v1/problems/suspended.md)

  The account may not do this. `type` says why: a refusal every operation can meet
  ([`no-organization`](/docs/v1/problems/no-organization.md), [`multiple-organizations`](/docs/v1/problems/multiple-organizations.md), [`organization-not-registered`](/docs/v1/problems/organization-not-registered.md),
  [`not-entitled`](/docs/v1/problems/not-entitled.md), [`access-ended`](/docs/v1/problems/access-ended.md), [`tier-served-elsewhere`](/docs/v1/problems/tier-served-elsewhere.md) or [`suspended`](/docs/v1/problems/suspended.md), see *Problem
  types*), or the organization's agreement, or this server, does not include the scope
  ([`scope-not-entitled`](/docs/v1/problems/scope-not-entitled.md)).

- `413` · [`payload-too-large`](/docs/v1/problems/payload-too-large.md)

  The request body is too large ([`payload-too-large`](/docs/v1/problems/payload-too-large.md)).

- `415` · [`unsupported-media-type`](/docs/v1/problems/unsupported-media-type.md)

  The request body is not `application/json` ([`unsupported-media-type`](/docs/v1/problems/unsupported-media-type.md)).

- `429` · [`rate-limited`](/docs/v1/problems/rate-limited.md)

  Too many requests, or too many at the same time ([`rate-limited`](/docs/v1/problems/rate-limited.md)), from your account,
  your organization, or your network address. Wait for `Retry-After` seconds, then send
  the same request again.

  Header `Retry-After`

  How many seconds to wait before sending the same request again.

- `431` · [`headers-too-large`](/docs/v1/problems/headers-too-large.md)

  The request's headers are too large ([`headers-too-large`](/docs/v1/problems/headers-too-large.md)). An access token is far
  below the limit, so look for a header your client adds.

- `503` · [`unavailable`](/docs/v1/problems/unavailable.md)

  The API is temporarily unavailable ([`unavailable`](/docs/v1/problems/unavailable.md)), because our servers are under
  pressure or briefly out of service. Wait for `Retry-After` seconds, then send the same
  request again.

  Header `Retry-After`

  How many seconds to wait before sending the same request again.

- `Any other` · [`internal`](/docs/v1/problems/internal.md)

  Any other error, as a problem document. Includes [`internal`](/docs/v1/problems/internal.md) (500), a failure on our
  side.

#### A problem document's fields

- `type` · string

  Identifies the problem; branch on this. One of the problem types under
  `https://api.reconnectchina.org/docs/v1/problems/`, named in each response's
  description and its `x-problem-types`, and listed in *Problem types*, for example
  `https://api.reconnectchina.org/docs/v1/problems/continuation-expired`. The URL is
  also the type's documentation.

- `title` · string

  A short, human-readable summary of the problem type.

- `status` · integer

  The HTTP status code.

- `detail` · string · may be absent

  A human-readable explanation of this occurrence.

- `errors` · list of objects · may be absent

  For [`invalid-request`](/docs/v1/problems/invalid-request.md), each part of the request that is not valid, and for
  [`range-not-entitled`](/docs/v1/problems/range-not-entitled.md), each end of the range that reaches too far. Each names
  the part in exactly one way: `pointer` for a part of the body, `parameter` for a
  part of the path. A part with several mistakes in it, such as a `term`, has an
  entry for each, and `span` says where in it each one is.

- `errors[].parameter` · string · may be absent

  The name of the path parameter, as this document names it, for example
  `name` in `/v1/saved_searches/{scope}/{name}`.

- `errors[].pointer` · string · may be absent

  A JSON Pointer ([RFC 6901](https://www.rfc-editor.org/rfc/rfc6901)) into
  the request body, for example `/levelIn/0`. Empty for the body as a whole.
  For the run of a saved search, it points into the search as it ran, as
  if the body had been `{"parameters": …}` with the saved parameters and
  your overrides: `/parameters/from` whether `from` was saved or sent.

- `errors[].span` · object · may be absent

  Where in a string a problem is: the characters from `start` up to, not including,
  `end`, counting from 0. Characters are Unicode code points, as `maxLength` counts
  them, so `低空经济` is four; a program that marks text in another unit converts, such
  as a browser, whose strings count a character outside the Basic Multilingual Plane
  as two. Equal `start` and `end` mark the place where something is missing, such as
  the end of a term that stops after `&&`.

- `errors[].span.start` · integer, at least 0

- `errors[].span.end` · integer, at least 0

- `errors[].detail` · string

- `earliestFrom` · string, up to 128 characters · may be absent

  For [`range-not-entitled`](/docs/v1/problems/range-not-entitled.md), the earliest `from` your organization may use, as an
  instant expression such as `now-1y` or `1900-01-01`.

- `latestTo` · string, up to 128 characters · may be absent

  For [`range-not-entitled`](/docs/v1/problems/range-not-entitled.md), the latest `to` your organization may use, as an
  instant expression such as `3000-01-01`.

- `server` · string · may be absent

  For [`tier-served-elsewhere`](/docs/v1/problems/tier-served-elsewhere.md), the server of this API that your account may use,
  one of `servers`, such as `https://sandbox.api.reconnectchina.org`.

### Example responses

200 · One of your own, and one shared in your organization

```json
{
  "searches": [
    {
      "scope": "account",
      "name": "low-altitude-monthly",
      "title": "Low-altitude economy, last month",
      "description": "Laws, regulations, notices and plans on the low-altitude economy in the last calendar month\nin Berlin, per Berlin day. The monthly report starts from this one.",
      "changedAt": "2026-09-01T06:30:00Z",
      "parameters": {
        "term": "低空经济 || \"low-altitude economy\"",
        "strategy": "body",
        "typeIn": [
          "law/decree",
          "regulation",
          "notice/announcement",
          "opinion/plan"
        ],
        "from": "now[Europe/Berlin]-M/M",
        "to": "now[Europe/Berlin]/M",
        "histograms": {
          "time": {
            "timeZone": "Europe/Berlin"
          }
        }
      }
    },
    {
      "scope": "organization",
      "name": "低空经济",
      "title": "Low-altitude economy, last 30 days",
      "description": "Laws, regulations, notices and plans on the low-altitude economy in the last month, by\nlevel. The weekly briefing starts from this one.",
      "changedAt": "2026-09-20T08:12:44Z",
      "parameters": {
        "term": "低空经济 || \"low-altitude economy\"",
        "strategy": "body",
        "typeIn": [
          "law/decree",
          "regulation",
          "notice/announcement",
          "opinion/plan"
        ],
        "from": "now-30d/d",
        "histograms": {
          "level": {}
        }
      }
    }
  ]
}
```

200 · The searches shared in your organization

```json
{
  "searches": [
    {
      "scope": "organization",
      "name": "低空经济",
      "title": "Low-altitude economy, last 30 days",
      "description": "Laws, regulations, notices and plans on the low-altitude economy in the last month, by\nlevel. The weekly briefing starts from this one.",
      "changedAt": "2026-09-20T08:12:44Z",
      "parameters": {
        "term": "低空经济 || \"low-altitude economy\"",
        "strategy": "body",
        "typeIn": [
          "law/decree",
          "regulation",
          "notice/announcement",
          "opinion/plan"
        ],
        "from": "now-30d/d",
        "histograms": {
          "level": {}
        }
      }
    }
  ]
}
```

400 · No \`strategy\` with \`term\`, and an unknown level

```json
{
  "detail": "The request is not valid in 2 places; `errors` says where.",
  "errors": [
    {
      "detail": "\"strategy\" is a required property",
      "pointer": ""
    },
    {
      "detail": "value is not one of \"centre\", \"provinces\" or 2 other candidates",
      "pointer": "/levelIn/0"
    }
  ],
  "status": 400,
  "title": "Invalid request",
  "type": "https://api.reconnectchina.org/docs/v1/problems/invalid-request"
}
```

400 · A saved search's name with a space in it

```json
{
  "type": "https://api.reconnectchina.org/docs/v1/problems/invalid-request",
  "title": "Invalid request",
  "status": 400,
  "detail": "The request is not valid; `errors` says where.",
  "errors": [
    {
      "detail": "A saved search's name is 1 to 64 letters, combining marks, digits, `_` and `-`.",
      "parameter": "name"
    }
  ]
}
```

400 · A term with two mistakes: \`低空经济 && )\`

```json
{
  "type": "https://api.reconnectchina.org/docs/v1/problems/invalid-request",
  "title": "Invalid request",
  "status": 400,
  "detail": "The request is not valid in 2 places; `errors` says where.",
  "errors": [
    {
      "detail": "`&&` needs a term on each side.",
      "pointer": "/term",
      "span": {
        "start": 5,
        "end": 7
      }
    },
    {
      "detail": "This `)` closes no `(`.",
      "pointer": "/term",
      "span": {
        "start": 8,
        "end": 9
      }
    }
  ]
}
```

400 · A \`from\` of \`2026-13-01\`, which has no month 13

```json
{
  "type": "https://api.reconnectchina.org/docs/v1/problems/invalid-request",
  "title": "Invalid request",
  "status": 400,
  "detail": "The request is not valid; `errors` says where.",
  "errors": [
    {
      "detail": "`13` is not a valid month.",
      "pointer": "/from",
      "span": {
        "start": 5,
        "end": 7
      }
    }
  ]
}
```

401 · No access token

```json
{
  "type": "https://api.reconnectchina.org/docs/v1/problems/unauthenticated",
  "title": "Unauthenticated",
  "status": 401,
  "detail": "The request carries no access token."
}
```

403 · Organization scope on the sandbox

```json
{
  "type": "https://api.reconnectchina.org/docs/v1/problems/scope-not-entitled",
  "title": "Scope not entitled",
  "status": 403,
  "detail": "Saved searches in the scope \"organization\" are not available on this server."
}
```

403 · An organization with sandbox access only, on production

```json
{
  "type": "https://api.reconnectchina.org/docs/v1/problems/tier-served-elsewhere",
  "title": "Served elsewhere",
  "status": 403,
  "detail": "Your organization's access is to https://sandbox.api.reconnectchina.org, not to this server.",
  "server": "https://sandbox.api.reconnectchina.org"
}
```

403 · An account whose application is still under review

```json
{
  "type": "https://api.reconnectchina.org/docs/v1/problems/no-organization",
  "title": "No organization",
  "status": 403,
  "detail": "Your account belongs to no organization."
}
```

413 · A body over the limit

```json
{
  "type": "https://api.reconnectchina.org/docs/v1/problems/payload-too-large",
  "title": "Payload too large",
  "status": 413,
  "detail": "The request body is too large."
}
```

415 · A body without \`Content-Type: application/json\`

```json
{
  "type": "https://api.reconnectchina.org/docs/v1/problems/unsupported-media-type",
  "title": "Unsupported media type",
  "status": 415,
  "detail": "The request body has to be JSON, sent as `Content-Type: application/json`."
}
```

429 · Too many requests from one address

```json
{
  "type": "https://api.reconnectchina.org/docs/v1/problems/rate-limited",
  "title": "Rate limited",
  "status": 429,
  "detail": "This address has sent too many requests."
}
```

431 · Headers over the limit

```json
{
  "type": "https://api.reconnectchina.org/docs/v1/problems/headers-too-large",
  "title": "Headers too large",
  "status": 431,
  "detail": "The request's headers are too large."
}
```

503 · The API cannot take the request now

```json
{
  "type": "https://api.reconnectchina.org/docs/v1/problems/unavailable",
  "title": "Unavailable",
  "status": 503,
  "detail": "The API cannot take this request at the moment."
}
```

default · An error on our side

```json
{
  "type": "https://api.reconnectchina.org/docs/v1/problems/internal",
  "title": "Internal error",
  "status": 500,
  "detail": "The request could not be processed."
}
```
