# Get decision

Polls a slot for the selected sponsored asset and render metadata.

Call this after job creation only for advanced flows. Filled decisions include placement.render so the hosted renderer can own media, sizing, click, and beacon behavior.

| Method | Path | Authentication | Stability |
| --- | --- | --- | --- |
| GET | /v1/decisions/{slot_id} | Secret key or browser activation token | advanced |

## Request fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| slot_id | string | Yes | Slot ID returned from POST /v1/jobs. |
| wait_ms | integer | No | Optional long-poll wait time in milliseconds. |

## Response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| status | string | Yes | Decision state, usually pending, ready, or no_fill. |
| placement | object \| null | Yes | Hosted-render placement descriptor when a fill is ready. |
| placement.render | object | No | Hosted frame descriptor with frame_url, script_url, media_type, dimensions, label, sponsor, and click URL. |
| decision | object \| null | Yes | Canonical decision payload retained for compatibility and debugging. |

## Errors

| Status | Code | Description |
| --- | --- | --- |
| 401 | unauthorized | Missing auth. |
| 404 | not_found | Slot does not exist or belongs to another project. |
| 429 | rate_limited | Polling rate exceeded. |

## Response example

```json
{
  "status": "ready",
  "slot_id": "slot_demo_123",
  "placement": {
    "image_url": "https://api.wavebird.ai/v1/test-assets/banner?...",
    "click_url": "https://sponsor.example",
    "sponsor_name": "Demo Sponsor",
    "width": 728,
    "height": 90,
    "format": "banner",
    "asset_token": "wbat_asset_demo",
    "ad_label_text": "Sponsored",
    "render": {
      "strategy": "hosted_frame",
      "frame_url": "https://api.wavebird.ai/v1/render/wbat_asset_demo",
      "script_url": "https://api.wavebird.ai/v1/render.js",
      "media_type": "image",
      "width": 728,
      "height": 90,
      "aspect_ratio": "728/90",
      "label_text": "Sponsored",
      "sponsor_name": "Demo Sponsor",
      "click_url": "https://sponsor.example"
    }
  },
  "decision": {
    "fill": true,
    "format": "banner",
    "asset_token": "wbat_asset_demo"
  }
}
```

## cURL

```bash
curl "https://api.wavebird.ai/v1/decisions/slot_demo_123?wait_ms=1500" \
  -H "Authorization: Bearer sk_test_wavebird_demo_secret"
```

## Node

```javascript
const response = await fetch("https://api.wavebird.ai/v1/decisions/slot_demo_123?wait_ms=1500", {
  headers: { Authorization: "Bearer sk_test_wavebird_demo_secret" }
});

console.log(await response.json());
```

## Python

```python
import urllib.request

request = urllib.request.Request(
    "https://api.wavebird.ai/v1/decisions/slot_demo_123?wait_ms=1500",
    headers={"Authorization": "Bearer sk_test_wavebird_demo_secret"},
)

with urllib.request.urlopen(request) as response:
    print(response.read().decode("utf-8"))
```
