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

# First call in 5 minutes

> From API key to redemption webhook, in the sandbox

<Warning>
  Draft: specification in progress. Endpoints and fields may change.
</Warning>

This walkthrough uses the sandbox, with no real funds. The URLs are proposals and are not live yet, and all values are illustrative.

<Steps>
  <Step title="Get an API key">
    Request access at [contact@t3sa.com](mailto:contact@t3sa.com?subject=TESA%20API%20key%20request). After onboarding, an administrator creates the key in the dashboard. Sandbox keys start with `tesa_test_`.

    ```bash theme={null}
    export TESA_API_KEY="tesa_test_..."
    ```
  </Step>

  <Step title="Read positions">
    ```bash theme={null}
    curl https://sandbox.api.t3sa.com/v1/posicoes \
      -H "Authorization: Bearer $TESA_API_KEY"
    ```

    ```json Response 200 theme={null}
    {
      "total": "1284530.00",
      "rendendo": "842110.00",
      "disponivel": "442420.00",
      "por_ativo": [
        { "ativo": "USDY", "valor": "505266.00", "percentual": 60.00 },
        { "ativo": "BUIDL", "valor": "336844.00", "percentual": 40.00 }
      ],
      "yield_acumulado": "18432.55",
      "atualizado_em": "2026-09-01T12:00:00Z"
    }
    ```
  </Step>

  <Step title="Create a redemption">
    A redemption always goes to a linked wallet owned by the company and requires an `Idempotency-Key`.

    ```bash theme={null}
    curl -X POST https://sandbox.api.t3sa.com/v1/resgates \
      -H "Authorization: Bearer $TESA_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{"valor":"150000.00","carteira_destino_id":"cart_3k9d","referencia_interna":"folha-2026-09"}'
    ```

    The redemption starts as `pendente`. A key with `admin` scope, or an approver in the dashboard, approves it with `POST /resgates/res_4t7x/aprovar`.
  </Step>

  <Step title="Sign with the custodian">
    After approval, the redemption moves to `aguardando_assinatura` and includes the transactions in `transacoes[].payload_nao_assinado`. Send that payload to the company's custodian, which signs and broadcasts it. TESA never sees the key.
  </Step>

  <Step title="Receive the webhook">
    Register a destination with `POST /webhooks`. When the transaction confirms on-chain, this event arrives:

    ```json theme={null}
    {
      "id": "evt_9k2m4p",
      "tipo": "resgate.concluido",
      "criado_em": "2026-09-01T14:07:12Z",
      "ambiente": "sandbox",
      "organizacao_id": "org_1a2b",
      "dados": { "id": "res_4t7x", "status": "concluido", "valor": "150000.00" }
    }
    ```

    Verify the signature before processing. See [Webhooks](/docs/en/api/webhooks).
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Architecture" icon="network" href="/docs/en/api/arquitetura">
    Who holds the keys and how each operation moves from preparation to record.
  </Card>

  <Card title="Redemption guide" icon="arrow-down-to-line" href="/docs/en/api/guias/resgate">
    The complete redemption flow, with error handling.
  </Card>
</CardGroup>
