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

# Montar um reporter

> Crie um agente que analisa fontes com um workflow.

Um **reporter** analisa fontes rodando um **workflow** — uma lista ordenada de
**steps**, cada um uma tool mais um prompt inline. Este guia monta um e roda.

## 1. Crie o reporter

```bash theme={null}
curl -X POST https://api.clipping.cc/v1/reporters \
  -H "Authorization: Bearer ck_live_…" -H "Content-Type: application/json" \
  -d '{ "name": "Analista de IA" }'
```

```json theme={null}
{ "reporter": { "reporter_id": "rep_…", "name": "Analista de IA" } }
```

## 2. Crie um workflow

Um workflow tem um `target_kind` — contra o quê ele roda (`youtube_video`,
`youtube_channel` ou `collection`):

```bash theme={null}
curl -X POST https://api.clipping.cc/v1/reporters/rep_123/workflows \
  -H "Authorization: Bearer ck_live_…" -H "Content-Type: application/json" \
  -d '{ "name": "Resumir vídeos", "target_kind": "youtube_video" }'
```

## 3. Adicione steps

Cada step é um `tool_id` mais um `prompt_text` inline (e `params` opcionais).
Veja as tools disponíveis em `GET /v1/tools`:

```bash theme={null}
curl -X POST https://api.clipping.cc/v1/reporters/rep_123/workflows/wf_123/steps \
  -H "Authorization: Bearer ck_live_…" -H "Content-Type: application/json" \
  -d '{
        "tool_id": "summary_review",
        "prompt_text": "Resuma as principais afirmações e quem as fez."
      }'
```

<Tip>
  Reordenando por drag-and-drop? Mande a lista inteira de uma vez com
  `PUT /v1/reporters/{id}/workflows/{wid}/steps` e um array `steps: [...]` — ele
  substitui todos os steps na ordem.
</Tip>

## 4. Rode

Rodar é [assíncrono](/pt/async-operations) — você recebe um `202` + uma execution.
Aponte pra um `source` (URL/handle resolvido como item). Omita `workflow_id` pra
usar o workflow padrão do reporter:

```bash theme={null}
curl -X POST https://api.clipping.cc/v1/reporters/rep_123/process \
  -H "Authorization: Bearer ck_live_…" -H "Content-Type: application/json" \
  -d '{ "source": "https://youtube.com/watch?v=…", "workflow_id": "wf_123" }'
```

```json theme={null}
{ "execution": { "execution_id": "exc_…", "status": "pending" } }
```

Acompanhe a execution até concluir; a saída vira **documents**
(`GET /v1/documents?reporter_id=rep_123`). Inspecione uma rodada concluída com
`GET /v1/executions/{id}` pra ver input/output de cada step.

## 5. (Opcional) anexe coleções

Anexe coleções ao reporter pra ele ter um conjunto de trabalho, e rode um
workflow na coleção inteira com `POST /v1/reporters/{id}/process-collection`:

```bash theme={null}
curl -X POST https://api.clipping.cc/v1/reporters/rep_123/collections \
  -H "Authorization: Bearer ck_live_…" -H "Content-Type: application/json" \
  -d '{ "collection_id": "col_123" }'
```

## Próximo

<Card title="Agende" icon="clock" href="/pt/guides/schedule-runs">
  Rode o workflow automaticamente sobre vídeos novos numa cadência.
</Card>
