---
title: "Add Detail View"
method: POST
path: "/{databaseId}/detailviews/"
tags: ["User-Item Interactions"]
---

# Add Detail View

`POST /{databaseId}/detailviews/`

Adds a detail view of the given item made by the given user.

## Path parameters

- `databaseId` string, required

## Request body

- DetailView
  - `userId` string, required — User who viewed the item
  - `itemId` string, required — Viewed item
  - `timestamp` union — UTC timestamp of the view as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
    - string, double
    - number, double
  - `duration` integer — Duration of the view
  - `cascadeCreate` boolean — Sets whether the given user/item should be created if not present in the database.
  - `recommId` string — If this detail view is based on a recommendation request, `recommId` is the id of the clicked recommendation.
  - `additionalData` object — A dictionary of additional data for the interaction.
  - `autoPresented` boolean — Indicates whether the item was automatically presented to the user (e.g., in a swiping feed) or explicitly requested by the user (e.g., by clicking on a link). Defaults to `false`.

## Response `200`

Successful operation.

## Other responses

- `400` — Given `userId` or `itemId` does not match ^[a-zA-Z0-9_\-:@\.]+$. `timestamp` or `duration` is not a real number ≥ 0.
- `404` — The `cascadeCreate` is not set true and the `userId` or the `itemId` were found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.
- `409` — A detail view of the exact same `userId`, `itemId`, and `timestamp` is already present in the database. Note that a user may view an item's details multiple times, yet triplets (`userId`, `itemId`, `timestamp`) must be unique. In many cases, you may consider this code a success – it only tells you that nothing has been written to the database.

---

[API](https://skmtc.dev/recombee/apis/recombee-api.md) · [All operations](https://skmtc.dev/recombee/apis/recombee-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/recombee/recombee-api/revisions/a9c9c33eb2e8/schema)
