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

# Refresh demos from CI

Trigger project refreshes after successful deploys.

Refresh webhooks let your deploy pipeline queue new recordings for a project after a release.

Webhook refreshes only re-record demos generated by LittleDemo. Uploaded local recordings are skipped; update those by recording locally again and uploading the new video.

## Endpoint

```text
POST https://littledemo.com/api/v1/webhooks/projects/{projectId}/refresh
```

Authenticate with the project webhook secret:

```bash
curl -X POST https://littledemo.com/api/v1/webhooks/projects/proj_abc123/refresh \
  -H "X-Webhook-Secret: whsec_xxx"
```

## GitHub Actions

```yaml
name: Deploy

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Deploy app
        run: npm run deploy

      - name: Refresh LittleDemo demos
        run: |
          curl -X POST \
            "https://littledemo.com/api/v1/webhooks/projects/${{ secrets.LITTLEDEMO_PROJECT_ID }}/refresh" \
            -H "X-Webhook-Secret: ${{ secrets.LITTLEDEMO_WEBHOOK_SECRET }}"
        continue-on-error: true
```

Use `continue-on-error` if demo refreshes should not block production deploys.

## Generic pipeline step

```bash
if [ "$DEPLOY_STATUS" = "success" ]; then
  curl -X POST "https://littledemo.com/api/v1/webhooks/projects/$LITTLEDEMO_PROJECT_ID/refresh" \
    -H "X-Webhook-Secret: $LITTLEDEMO_WEBHOOK_SECRET"
fi
```

## Response

```json
{
  "refreshed": 2,
  "jobs": [
    { "demoId": "demo_abc", "jobId": "job_123" },
    { "demoId": "demo_def", "jobId": "job_456" }
  ]
}
```