# API deployment pipeline

If you wish to integrate your custom deployment or CI & CD pipelines with ilert's deployment events, you can use the generic API deployment pipeline to generate an `integrationKey` and process your own events.&#x20;

## Setting up

### Creating your deployment pipeline in ilert

To create the pipeline and generate a new `integrationKey` required to route deployment events when they occur. Head to your ilert account and navigate to **Alert sources -> Deployment events**

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fe0teT2TLIzifVBddzcF2%2Fimage.png?alt=media&#x26;token=49445b69-be3b-4778-aca6-8db9406adb0b" alt=""><figcaption></figcaption></figure>

Head over to the deployment pipelines tab and click on **Create new pipeline**

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FeU6XgAFwATXNZ401oul7%2Fimage.png?alt=media&#x26;token=1eb88dea-4c49-40c1-9cf9-a1bbb220344c" alt=""><figcaption></figcaption></figure>

Provide a name for your pipeline

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fzva2nMg4h9nBbTgfWilE%2Fimage.png?alt=media&#x26;token=3c73791c-ca4e-45f7-a3a0-2a6afac6b070" alt=""><figcaption></figcaption></figure>

Clicking on **Create** you should end up on the detail view of your new API deployment pipeline.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FiDZi9DrfGRgL5VZjyWs2%2Fimage.png?alt=media&#x26;token=5a1030e7-b32b-402a-9891-02c1e602a078" alt=""><figcaption></figcaption></figure>

Providing you with a freshly generated `integrationKey` and the copy & pastable **URL** ready for your client setup.

### Sending deployment events

To send deployment events to ilert and **POST HTTP** request is needed containing the `integrationKey` as body field. The full API docs can be found here: <https://api.ilert.com/api-docs/#tag/deployment-events/post/deployment-events>

A sample curl request might look like this:

```sh
curl --request POST \
  --url https://api.ilert.com/api/deployment-events \
  --header 'Content-Type: application/json' \
  --data '{
  "integrationKey": "ilapid11124e2c79adac1ed4454890db0a7d3c20c66ba",
  "summary": "My custom deployment event",
  "timestamp": "2024-11-05T22:17:38Z",
  "customDetails": { "some": "customData" },
  "links": [
    {
      "href": "http://google.com",
      "text": "A custom link to the source of this deployment event"
    }
  ]
}'
```

Note that only the `integrationKey` and `summary` fields are required. All others are optional. The `timestamp` fields support epochSeconds, epochMilliseconds or ISO8601 datetime strings.
