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

# Send Events from CI/CD Pipelines

> Post build and deploy events from your CI/CD pipelines to Costory using the Events API.

Post build and deploy events directly from your pipelines using a simple curl call.

### Example: curl from a CI / CD pipeline

```bash theme={null}
curl -X POST "https://app-api.costory.io/events" \
  -H "Authorization: Bearer $COSTORY_EVENTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Deploy complete",
    "timestamp": "2026-03-04T14:25:00Z",
    "category": "TECHNICAL",
    "source": "ci-cd",
    "environment": "prod",
    "service": "api",
    "labels": ["release", "backend"],
    "metadata": {
      "commit": "1b2c3d4",
      "pipeline": "github-actions",
      "url": "https://github.com/acme/api/actions/runs/123"
    }
  }'
```

### Recommended event fields

| Field         | Required | Description                                             |
| ------------- | -------- | ------------------------------------------------------- |
| `name`        | Yes      | Event title shown in the timeline.                      |
| `timestamp`   | Yes      | ISO-8601 UTC timestamp for the event.                   |
| `category`    | Yes      | BUSINESS, TECHNICAL, or PROVIDER.                       |
| `source`      | Yes      | A short identifier like `custom`, `ci-cd`, or `github`. |
| `environment` | No       | `prod`, `staging`, or another environment label.        |
| `service`     | No       | Service or application name.                            |
| `labels`      | No       | Reusable tags for filtering in Costory.                 |
| `metadata`    | No       | JSON object with URLs, commit SHAs, or context.         |

<Tip>
  Use consistent labels and environments so filters work across teams. For example: `prod`, `staging`, `api`, `frontend`.
</Tip>
