# Submit Custom Metric Values

`POST /api/custom-metrics`

Upserts daily custom-metric values for one or more locations, keyed by the location's `external_id`. Locations not found for the tenant are skipped (logged, not errored). Requires the `create` ability.

## Request body

```json
{
    "metric": "custom:loyalty_signups",
    "businessDateOn": "2026-06-01",
    "locationValues": [
        {
            "locationId": 1024,
            "value": 37
        },
        {
            "locationId": 1025,
            "value": 12
        }
    ]
}
```

## Example request

```bash
curl -X POST "https://app.franchisesee.com/api/custom-metrics" \
  -H "Authorization: Bearer $FRANCHISESEE_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "metric": "custom:loyalty_signups",
    "businessDateOn": "2026-06-01",
    "locationValues": [
        {
            "locationId": 1024,
            "value": 37
        },
        {
            "locationId": 1025,
            "value": 12
        }
    ]
}'
```

## Responses

### 200 Values accepted and upserted. Empty body.

### 401 Authentication failed or missing.

```json
{
    "message": "Unauthenticated."
}
```

### 403 The token lacks the required ability or the caller is not permitted.

```json
{
    "message": "This API token does not have the 'create' ability."
}
```

### 422 Validation failed.

```json
{
    "message": "The name field is required.",
    "errors": {
        "name": [
            "The name field is required."
        ]
    }
}
```
