Skip to content

Create new subscription

POST https://api.prosperworks.com/developer_api/v1/webhooks

Valid values

Field Details
type "lead", "person", "company", "opportunity", "project", "task"
event "new", "update", "delete"

Also, you may specify an optional hash object called "secret" containing custom key/value pairs that is sent with every notification. Using this secret, your notification endpoint can authenticate the request to make sure it is coming from a trusted source.

See the Webhook properties section for more details.

This example shows the creation of a new notification for events when existing Leads are updated.

Request body

1
2
3
4
5
6
7
8
9
{
  "target": "https://your.endpoint.here",
  "type": "lead",
  "event": "update",
  "secret": {
    "secret": "hook_source",
    "key": "copper_notifications"
  }
}

Example Requests

Create subscription

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
curl --location --request POST "https://api.prosperworks.com/developer_api/v1/webhooks" \
  --header "X-PW-AccessToken: YOUR_TOKEN_HERE" \
  --header "X-PW-Application: developer_api" \
  --header "X-PW-UserEmail: YOUR_EMAIL_HERE" \
  --header "Content-Type: application/json" \
  --data "{
  \"target\": \"https://your.endpoint.here\",
  \"type\": \"lead\",
  \"event\": \"update\",
  \"secret\": {
    \"secret\": \"hook_source\",
    \"key\": \"copper_notifications\"
  }
}"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
  "id": 17065,
  "target": "https://your.endpoint.here",
  "type": "lead",
  "event": "update",
  "secret": {
    "secret": "hook_source",
    "key": "copper_notifications"
  },
  "created_at": 1489173015
}