Skip to main content
POST
/
projects
/
{projectIdOrName}
/
notifications
/
targets
Create a notification target
curl --request POST \
  --url https://api.withampersand.com/v1/projects/{projectIdOrName}/notifications/targets \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '{
  "label": "Production Slack Alerts",
  "type": "webhook",
  "metadata": {
    "url": "https://webhooks.mailmonkey.com/salesforce-lead-converted",
    "headers": {
      "Authorization": "Bearer 1234"
    }
  },
  "secrets": {}
}'
{
  "id": "<string>",
  "label": "Production Slack Alerts",
  "type": "webhook",
  "metadata": {
    "url": "https://webhooks.mailmonkey.com/salesforce-lead-converted",
    "headers": {
      "Authorization": "Bearer 1234"
    }
  },
  "secrets": {},
  "createTime": "2023-11-07T05:31:56Z",
  "updateTime": "2023-11-07T05:31:56Z"
}

Authorizations

X-Api-Key
string
header
required

Path Parameters

projectIdOrName
string
required

The Ampersand project ID or project name.

Body

application/json
label
string
required

A human-readable label for the notification target.

Example:

"Production Slack Alerts"

type
enum<string>
required

The type of notification target.

Available options:
webhook
Example:

"webhook"

metadata
object
required
secrets
object

Secrets for the target.

Response

Created

id
string
required

The notification target ID.

label
string
required

A human-readable label for the notification target.

Example:

"Production Slack Alerts"

type
enum<string>
required

The type of notification target.

Available options:
webhook
Example:

"webhook"

metadata
object
required
createTime
string<date-time>
required

The time when the notification target was created.

secrets
object

Secrets for the target.

updateTime
string<date-time>

The time when the notification target was last updated.

I