# Content API

Every content call: what to send, what comes back, and copy-ready examples.

## Content report

`GET /content` (scope: content:read)

```bash
curl "https://api.usetotems.com/v1/content?from=2026-11-01&to=2026-11-30&all_models=true" \
  -H "Authorization: Bearer $TOTEMS_KEY"
```

```json
{
  "data": [
    {
      "content_id": "6f1e0523-3b47-4c0e-9a55-1f2e3d4c5b6a",
      "title": "My first sales call, start to finish",
      "kind": "youtube_video",
      "channel": "youtube",
      "url": "https://customer.example/demo/2",
      "thumbnail_url": null,
      "published_at": "2026-09-09T20:00:00.000Z",
      "views": 19132,
      "clicks": 40,
      "forms": 6,
      "bookings": 1,
      "sales": 7,
      "cents": 490060,
      "first_cents": 490060,
      "last_cents": 285021,
      "cents_per_1000": 25615,
      "label": null,
      "why": null,
      "cents_by_model": {
        "first": 490060,
        "last": 285021,
        "even": 377118,
        "position": 375039,
        "decay": 299474
      }
    }
  ],
  "request_id": "req_..."
}
```

## Add custom content

`POST /content` (scope: links:write)

```bash
curl -X POST "https://api.usetotems.com/v1/content" \
  -H "Authorization: Bearer $TOTEMS_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "How I plan my week",
    "kind": "youtube_video",
    "channel": "youtube",
    "url": "https://www.youtube.com/watch?v=abc123"
  }'
```

```json
{
  "data": {
    "id": "2a6e1d9c-7c15-4e2b-8d44-5b6a7c8d9e0f",
    "title": "How I plan my week",
    "kind": "youtube_video",
    "channel": "youtube",
    "url": "https://www.youtube.com/watch?v=abc123",
    "thumbnail_url": null,
    "published_at": null,
    "metrics": {},
    "metrics_at": null,
    "connection_id": null,
    "archived_at": null
  },
  "request_id": "req_..."
}
```

## One item

`GET /content/{id}` (scope: content:read)

```bash
curl "https://api.usetotems.com/v1/content/6f1d2c9a-3b47-4c0e-9a55-1f2e3d4c5b6a" \
  -H "Authorization: Bearer $TOTEMS_KEY"
```

```json
{
  "data": {
    "id": "6f1e0523-3b47-4c0e-9a55-1f2e3d4c5b6a",
    "title": "My first sales call, start to finish",
    "kind": "youtube_video",
    "channel": "youtube",
    "url": "https://customer.example/demo/2",
    "thumbnail_url": null,
    "published_at": "2026-09-09T20:00:00.000Z",
    "metrics": {
      "likes": 58,
      "views": 19132
    },
    "metrics_at": "2026-12-03T19:57:17.879Z",
    "connection_id": "6f1e4301-3b47-4c0e-9a55-1f2e3d4c5b6a",
    "archived_at": null,
    "report": {
      "content_id": "6f1e0523-3b47-4c0e-9a55-1f2e3d4c5b6a",
      "title": "My first sales call, start to finish",
      "kind": "youtube_video",
      "channel": "youtube",
      "url": "https://customer.example/demo/2",
      "thumbnail_url": null,
      "published_at": "2026-09-09T20:00:00.000Z",
      "views": 19132,
      "clicks": 40,
      "forms": 6,
      "bookings": 1,
      "sales": 7,
      "cents": 490060,
      "first_cents": 490060,
      "last_cents": 285021,
      "cents_per_1000": 25615,
      "label": null,
      "why": null
    }
  },
  "request_id": "req_..."
}
```

## Edit custom content

`PATCH /content/{id}` (scope: links:write)

```bash
curl -X PATCH "https://api.usetotems.com/v1/content/6f1d2c9a-3b47-4c0e-9a55-1f2e3d4c5b6a" \
  -H "Authorization: Bearer $TOTEMS_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "How I plan my week (new cut)"
  }'
```

```json
{
  "data": {
    "id": "2a6e1d9c-7c15-4e2b-8d44-5b6a7c8d9e0f",
    "title": "How I plan my week (new cut)",
    "kind": "youtube_video",
    "channel": "youtube",
    "url": "https://www.youtube.com/watch?v=abc123",
    "thumbnail_url": null,
    "published_at": null,
    "metrics": {},
    "metrics_at": null,
    "connection_id": null,
    "archived_at": null
  },
  "request_id": "req_..."
}
```
