# Craftwork Assets API

Public, read-only access to published individual design assets and their catalog facets. Responses
contain public metadata and previews, but never protected source-file download URLs.

## Endpoints

### Browse the catalog

```http
GET https://craftwork.design/api/v2/assets/catalog
```

Supports `page`, `limit`, `search`, `categorySlug`, comma-separated `categoryIds`,
`subCategories`, `tagIds`, and `tagSlugs`, plus `filterByPrice`, `sort`, and `sortOrder`.

```bash
curl "https://craftwork.design/api/v2/assets/catalog?categorySlug=illustrations&sort=recent&limit=24"
```

Agents should add `taste=1`. With it, `popular` and `trending` results lean toward packs our editors
rate highly for visual quality, so close calls go to the better-looking pack.

### Search assets

```http
GET https://craftwork.design/api/v2/assets/search
```

Use `q` or `query` for the search text. Optional parameters are `limit`, `offset`, `categoryIds`,
`subcategoryIds`, and `taste=1`, which lets equally relevant assets from highly rated packs rank
first.

### List assets in a product or pack

```http
GET https://craftwork.design/api/v2/assets/by-product?productId=456&page=1&limit=100
```

`productId` is required. Public requests only return published assets.

### Discover catalog facets

```http
GET https://craftwork.design/api/v2/assets/categories
GET https://craftwork.design/api/v2/assets/subcategories
```

The subcategories endpoint accepts an optional category `slug`.

## Response and access rules

Catalog responses use a JSON envelope with `success`, `data`, and `timestamp`. Paginated responses
include `page`, `limit`, `total`, `totalPages`, `hasNextPage`, and `hasPrevPage`.

No authentication is required for these read-only endpoints. Asset cards expose availability flags
such as `hasAssetLink`, `hasFigmaLink`, and `hasFramerLink`; use Craftwork's authenticated download
flow to retrieve source files.

The machine-readable OpenAPI description is available at
[`/.well-known/openapi/assets.json`](https://craftwork.design/.well-known/openapi/assets.json).
