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

# Event sources

> Send platform events such as deploys, mail, assets, databases and dead-lettered jobs into a queue.

> [!TIP]
>
> **Live.** This area is documented as current, user-reliable behavior.

## Goal

Have StackShift put chosen platform events on a queue for your consumer.

## Prerequisites

* A queue
* Event types from the Events catalog

## Workflow

**Step 1**

Open the queue and choose Sources.

**Step 2**

Add a source and pick the event types, for example deploy.succeeded and deploy.failed.

**Step 3**

Optionally limit it to some projects.

**Step 4**

Save. Matching events arrive as JSON messages with the standard event envelope as the body.

## API

* GET /queues/\{queue}/sources lists sources with events, project\_ids, last\_delivery\_at and last\_status.
* DELETE /queues/\{queue}/sources/\{id} removes one.

```bash POST /api/v1/queues/{queue}/sources theme={null}
curl -X POST https://api.stackshift.cloud/api/v1/queues/orders/sources \
  -H "Authorization: Bearer $STACKSHIFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"events": ["deploy.succeeded", "deploy.failed", "job.dead_lettered"], "project_ids": ["p_789"]}'
```

## Sources and Events rules

* A source is an Events rule with the Message queue target. It also shows in Events, Rules and in Deliveries.
* The Events target that starts a Durable Job is called Job. Use Job to start a job run per event, and Message queue to collect events for your own consumer.

## Expected result

> [!TIP]
>
> The source shows the time and status of its last delivery, and the events appear as messages on the queue.

## Related guides

> [card] [Targets](https://docs.stackshift.cloud/events/targets.md)
>
> Send a matched event to a webhook, a Function, a message queue, a Durable Job or waiting job, a hosted agent or Stackie, Slack, email or the dashboard, or an automation.

> [card] [Consumers and Function consumers](https://docs.stackshift.cloud/queues/consumers.md)
>
> Each queue has one consumer: a Function, an HTTPS endpoint, or pull. Function consumers are chosen in the dashboard or API, not in code.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.