curl -X POST \
-H "X-API-Key: $PARTICLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production",
"url": "https://example.com/particle-webhooks"
}' \
"https://api.particle.pro/v1/projects/{projectId}/webhooks/connections"{
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"project_id": "<string>",
"secret": "<string>",
"secret_prefix": "<string>",
"surface": "PLATFORM",
"url": "<string>",
"created_by": {
"id": "<string>",
"name": "<string>"
},
"name": "<string>",
"revoked_at": "2023-11-07T05:31:56Z"
}{
"detail": "Property foo is required but is missing.",
"error_code": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"resolve": {
"message": "<string>",
"action": "<string>",
"endpoint": "<string>",
"method": "<string>",
"url": "<string>"
},
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Create a webhook connection
Creates a webhook connection (a destination URL plus a generated HMAC signing secret) that alerts can target as a WEBHOOK notification channel. The signing secret is returned only in this response — store it securely; it cannot be retrieved again. The URL must be https and must resolve to a public address. Send an Idempotency-Key to retry safely: a retry under the same key returns the same connection and secret instead of creating another.
curl -X POST \
-H "X-API-Key: $PARTICLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production",
"url": "https://example.com/particle-webhooks"
}' \
"https://api.particle.pro/v1/projects/{projectId}/webhooks/connections"{
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"project_id": "<string>",
"secret": "<string>",
"secret_prefix": "<string>",
"surface": "PLATFORM",
"url": "<string>",
"created_by": {
"id": "<string>",
"name": "<string>"
},
"name": "<string>",
"revoked_at": "2023-11-07T05:31:56Z"
}{
"detail": "Property foo is required but is missing.",
"error_code": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"resolve": {
"message": "<string>",
"action": "<string>",
"endpoint": "<string>",
"method": "<string>",
"url": "<string>"
},
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Authorizations
Headers
A key you choose, such as a UUID, to retry this request safely. Resend the same key with the same request and the first response is returned with Idempotent-Replayed: true instead of the request running again, for 24 hours after it succeeded. The same key with a different request returns 422 idempotency_key_reused; a retry while the first request is still running returns 409 idempotency_key_in_use. A request that fails does not use up its key.
8 - 128Body
Response
OK
Which Particle surface created this connection. Fixed at create time and inferred from the caller's authenticated surface context. Provenance only — an alert on either surface can deliver through it. Render it to show where the endpoint was registered.
PLATFORM, RADAR Was this page helpful?