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

# cURL cookbook

> Practical curl recipes for Public API v1

# cURL cookbook

Assume:

```bash theme={null}
export CICINI_API_KEY="cic_test_…"
export CICINI_BASE="https://cicini.com"   # local: http://localhost:3000
```

## Health check auth

```bash theme={null}
curl -sS -o /tmp/out.json -w "%{http_code}\n" \
  -H "Authorization: Bearer $CICINI_API_KEY" \
  "$CICINI_BASE/api/public/v1/customers?limit=1"
# expect 200
```

## List first page of customers

```bash theme={null}
curl -sS \
  -H "Authorization: Bearer $CICINI_API_KEY" \
  -H "Accept: application/json" \
  "$CICINI_BASE/api/public/v1/customers?limit=10" | jq .
```

## List confirmed appointments this month

```bash theme={null}
curl -sS \
  -H "Authorization: Bearer $CICINI_API_KEY" \
  "$CICINI_BASE/api/public/v1/appointments?status=confirmed&startDate=2026-07-01T00:00:00.000Z&endDate=2026-08-01T00:00:00.000Z&limit=50" \
  | jq '{count: (.data|length), total: .pagination.total, hasMore: .pagination.hasMore}'
```

## Pretty-print one customer row

```bash theme={null}
curl -sS \
  -H "Authorization: Bearer $CICINI_API_KEY" \
  "$CICINI_BASE/api/public/v1/customers?limit=1" \
  | jq '.data[0] | {id, displayName, email, phone}'
```

## Intentionally invalid query (expect 400)

```bash theme={null}
curl -sS \
  -H "Authorization: Bearer $CICINI_API_KEY" \
  "$CICINI_BASE/api/public/v1/customers?limit=999" | jq .
```

## Missing auth (expect 401)

```bash theme={null}
curl -sS "$CICINI_BASE/api/public/v1/customers?limit=1" | jq .
```

## Download OpenAPI

```bash theme={null}
curl -sS "$CICINI_BASE/openapi.json" -o openapi.json
```
