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

# API Overview

> The APIs behind Depict for headless merchants: the Portal API used by the merchant portal, and the Storefront API that serves search, listings and recommendations to your shop.

Depict exposes two APIs, each with a different audience:

<CardGroup cols={2}>
  <Card title="Portal API" icon="table-columns">
    The REST API behind the merchant portal. Manage merchants, products,
    collections and curation, and read the metrics and analytics that power the
    portal dashboards: collection metrics, dead stock, pinned-vs-auto
    performance, merchant-wide analytics and search insights.
  </Card>

  <Card title="Storefront API" icon="store">
    The public product-discovery API served from `api.depict.ai`. Fetch search
    results, query suggestions, product listings and recommendations, and send
    tracking events from your storefront.
  </Card>
</CardGroup>

## Authentication

**Portal API** endpoints require a bearer token issued by Depict's Auth0 tenant.
Requests are authorized per merchant: the authenticated user must have access to
the `merchant_id` in the path.

```bash theme={null}
curl https://<portal-host>/api/v1/merchants/{merchant_id}/collections \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

**Storefront API** endpoints identify your shop through the `merchant` and
`market` parameters that are part of each request body or query string. They are
designed to be called directly from the browser.

## Conventions

* All endpoints accept and return JSON unless noted otherwise.
* Time ranges on metrics endpoints use Unix timestamps (`start_timestamp`,
  `end_timestamp`). When omitted, most metrics endpoints default to the last
  30 days compared against the previous 30 days.
* Metric values that compare against a previous period return a `value`
  together with a `delta_pct` (relative change) or `delta_pts` (percentage-point
  change for rates such as CTR).
