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

# curl

> Bare-metal usage when an SDK isn't an option.

The API is plain HTTPS + JSON. Anything that speaks both can call it.

<Snippet file="base-url.mdx" />

<Snippet file="auth-header.mdx" />

## List yield opportunities

```bash theme={null}
curl -H "Authorization: Bearer $ALTERSCOPE_API_KEY" \
     -H "Accept: application/json" \
  "https://api.alterscope.org/v2/yield/opportunities?limit=10&risk_band=1"
```

## Get a single opportunity

```bash theme={null}
curl -H "Authorization: Bearer $ALTERSCOPE_API_KEY" \
  "https://api.alterscope.org/v2/yield/opportunities/hyperliquid-btc-basis"
```

## Analyze a portfolio (POST with body)

```bash theme={null}
curl -H "Authorization: Bearer $ALTERSCOPE_API_KEY" \
     -H "Content-Type: application/json" \
     -X POST \
     -d '{
       "positions": [
         { "opportunity_id": "hyperliquid-btc-basis", "notional_usd": 50000 },
         { "opportunity_id": "aave-usdc-lending",     "notional_usd": 50000 }
       ],
       "include_scenarios": true
     }' \
  "https://api.alterscope.org/v2/yield/portfolio/analyze"
```

## Subscribe to a webhook

```bash theme={null}
curl -H "Authorization: Bearer $ALTERSCOPE_API_KEY" \
     -H "Content-Type: application/json" \
     -X POST \
     -d '{
       "url": "https://your.app/alterscope-webhook",
       "events": ["peg.depeg.start", "vault.cap.changed"]
     }' \
  "https://api.alterscope.org/v2/webhooks"
```

The signing secret is server-generated — you cannot supply it in the request body. It is returned once in the `201` response as `data.signing_secret` (prefixed `whsec_`). Store it then; rotate later via `POST /v2/webhooks/{id}/rotate-secret`.

## Read a rate-limit window

```bash theme={null}
curl -sI -H "Authorization: Bearer $ALTERSCOPE_API_KEY" \
  "https://api.alterscope.org/v2/yield/opportunities?limit=1" \
  | grep -i "X-RateLimit"
```
