CopyHero

Create Outbound Webhook For Agent

POST
/api/v1/webhooks/outbound/agent

Create a webhook target. Returns no signing secret; refuses secret (422).

A secret never passes through the agent: to verify signatures, the user rotates the secret in CopyHero Settings > Webhooks, which shows the new one once.

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Request Body

application/json
  1. body
name*Name
Length1 <= length <= 100
url*Url
headers?|

Custom request headers. Write-only.

secret?|

Optional whsec_ signing secret; Svix generates one if omitted.

filters?|null

Response Body

Successful Response

application/json
  1. response
id*Id
name*Name
url*Url
status*OutboundWebhookStatus
Value in"active""paused""disabled_after_failures"
filters*

A target's filter, ANDed; an empty list means all. store_ids and milestones apply to product.ordered only; a milestone is the N-th order of a product counted over all stores. Stored as the JSON string metadata["rules"] (format: go/cmd/webhooks/testdata/rules.json) and evaluated by the Go webhooks worker.

created_at*Created At
Formatdate-time
updated_at*Updated At
Formatdate-time
Example Request
curl -X POST 'https://app.copyhero.app/api/v1/webhooks/outbound/agent' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "url": "string"}'
Example Response
{  "id": "string",  "name": "string",  "url": "string",  "status": "active",  "filters": {    "event_types": [      "workflow.completed"    ],    "store_ids": [      1    ],    "milestones": [      1    ]  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}