---
search:
  tags:
    - analytics
    - POST
seo:
  description: >-
    Records cache usage analytics events. The body of this request is an…
    Reference for the POST /artifacts/events endpoint in the Turborepo Remote
    Cache API.
sidebar:
  label: Record cache usage events
  badge: POST
title: Record cache usage events
type: openapi-operation
---
Records cache usage analytics events. The body of this request is an array of cache usage events.

This endpoint is optional but enables cache hit/miss analytics. Implementers can use this data to track cache effectiveness and optimize storage.

Event types:
- `HIT`: A cached artifact was found and used
- `MISS`: No cached artifact was found for the given hash

Source types:
- `LOCAL`: The cache event was on the user's local filesystem cache
- `REMOTE`: The cache event is for the remote cache

`POST /artifacts/events`

**Request body** (`application/json`, required)

Request body example:

```json
[
  {
    "sessionId": "f6567dd8-e069-418e-8893-7d22fcf12459",
    "source": "LOCAL",
    "event": "HIT",
    "hash": "string",
    "duration": 0
  }
]
```

**Responses**

- `200` — Events recorded successfully
- `400` — Bad request. One or more of the provided values in the request query, headers, or body is invalid.
- `401` — Unauthorized. The request is missing a valid authentication token or the token is invalid.
- `403` — Forbidden. The authenticated user does not have permission to access this resource.
