# Post scheduled events to Datadog

Post events to your [Datadog](https://www.datadoghq.com) event stream on a schedule: daily business numbers to overlay on dashboards, markers for batch jobs, and check results.

## Example: daily signups as an event

```json
{
  "name": "Daily signups to Datadog",
  "cron": { "expression": "5 0 * * *", "time_zone": "UTC" },
  "nodes": [
    { "id": "stats", "request": { "method": "GET", "endpoint": "https://api.acme.com/internal/stats/yesterday", "credential_id": "YOUR_INTERNAL_TOKEN_ID" } },
    { "id": "event", "datadog_post_event": {
        "credential_id": "YOUR_DATADOG_KEY_ID",
        "title": "Signups {{ format(now() - days(1), \"YYYY-MM-DD\") }}: {{ $.signups }}",
        "text": "Signups: {{ $.signups }}, activations: {{ $.activations }}",
        "alert_type": "info" } }
  ]
}
```

## Set up

Create an API key under **Organization Settings → API Keys** and save it with your Datadog site (such as `datadoghq.com` or `datadoghq.eu`) as a `datadog` credential.

## Reference

### Post a Datadog event: `datadog_post_event`

**Sends** POST `https://api.<site>/api/v1/events` with header `DD-API-KEY`. **Output** for the next step: The created event.

| Field | Type | Notes |
| --- | --- | --- |
| `credential_id` | string, required | The id of a `datadog` credential holding an API key and your Datadog site. |
| `title` | string, required | Up to 100 characters. Placeholders allowed. |
| `text` | string, required | Up to 4,000 characters. Placeholders allowed. |
| `alert_type` | string | `error`, `warning`, `info` or `success`. Omit for `info`. |
