> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sublay.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Check Entity Saved

> Check whether an entity is saved in any of the current user's collections

> [!NOTE]
>
> **Requires the `entities` bundle.** A project without the entities bundle returns `403 database/tables-not-available`. See [Bundles](https://docs.sublay.io/v8/bundles.md).

Returns whether the specified entity is saved in any collection belonging to the authenticated user, along with the list of matching collections.

## Path Parameters

**entityId** `string` *required*

The ID of the entity to check.

## Query Parameters

**actingUserId** `string`

Service key only, and required with one: the user this request acts as, whose collections are checked. A user token always acts as its own user and must not send it (`400 collection/acting-user-not-allowed`).

## Response

**isSaved** `boolean`

`true` if the entity is saved in at least one collection.

**collections** `Array\<\{ id: string; name: string \}\>`

List of collections (by ID and name) that contain this entity.

```json theme={null}
{
  "isSaved": true,
  "collections": [
    { "id": "col_abc", "name": "To Read" },
    { "id": "col_xyz", "name": "Favorites" }
  ]
}
```

## Error Responses

> [accordion] Invalid Params — 400
>
> Returned when `entityId` isn't a valid UUID.
>
> ```json theme={null}
> { "error": "Invalid entity id: expected a UUID.", "code": "entity/invalid-params" }
> ```

> [accordion] Entity Id in the Query — 400
>
> The request sent `entityId` in the query string. The entity is the one in the path.
>
> ```json theme={null}
> {
>   "error": "`entityId` isn't accepted here: the entity is the one in the path.",
>   "code": "entity/unsupported-param",
>   "param": "entityId"
> }
> ```

> [accordion] Missing User — 400
>
> A service key sent no `actingUserId`.
>
> ```json theme={null}
> { "error": "A service key must send actingUserId: the user this request acts as.", "code": "collection/missing-user-id" }
> ```

> [accordion] Acting User Not Allowed — 400
>
> A user token sent `actingUserId`, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
>
> ```json theme={null}
> { "error": "actingUserId is only accepted with a service key. A user's own token always acts as that user.", "code": "collection/acting-user-not-allowed" }
> ```

> [accordion] User Not Found — 404
>
> Returned when a service key names an `actingUserId` that isn't a user in this project.
>
> ```json theme={null}
> { "error": "No user with this actingUserId exists in this project.", "code": "collection/user-not-found" }
> ```

> [accordion] Unsupported Parameter — 400
>
> The request sent `userId`. On this route the user a service key acts as is `actingUserId`.
>
> With a service key:
>
> ```json theme={null}
> {
>   "error": "`userId` was renamed to `actingUserId`: send the user this service key acts as in `actingUserId`.",
>   "code": "collection/unsupported-param",
>   "param": "userId"
> }
> ```
>
> With a user token, or with no credentials:
>
> ```json theme={null}
> {
>   "error": "`userId` isn't accepted here: a user's own token always acts as that user.",
>   "code": "collection/unsupported-param",
>   "param": "userId"
> }
> ```

> [accordion] Server Error — 500
>
> ```json theme={null}
> { "error": "Internal server error.", "code": "collection/server-error" }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.