Webhooks

Creates a webhook

POST
/api/v2/webhooks

Create a new webhook.

Authorization

ApiKey read, write
Authorization<token>

In: header

Scope: read, write

Request Body

application/json

name?string

A human-readable name for your webhook

url*string

The URL of the remote webhook

secret?string

If sign is true, and the secret attribute is omitted, LaunchDarkly automatically generates a secret for you.

statements?array<>

Represents a Custom role policy, defining a resource kinds filter the webhook should respond to.

sign*boolean

If sign is false, the webhook does not include a signature header, and the secret can be omitted.

on*boolean

Whether or not this webhook is enabled.

tags?array<string>

List of tags for this webhook

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v2/webhooks" \  -H "Content-Type: application/json" \  -d '{    "name": "apidocs test webhook",    "on": true,    "sign": false,    "statements": [      {        "actions": [          "*"        ],        "effect": "allow",        "resources": [          "proj/test"        ]      }    ],    "tags": [      "example-tag"    ],    "url": "https://example.com"  }'
{  "_links": {    "property1": {      "href": "string",      "type": "string"    },    "property2": {      "href": "string",      "type": "string"    }  },  "_id": "57be1db38b75bf0772d11384",  "name": "Example hook",  "url": "http://www.example.com",  "secret": "frobozz",  "statements": [    {      "resources": [        "proj/*:env/*;qa_*:/flag/*"      ],      "notResources": [        "string"      ],      "actions": [        "*"      ],      "notActions": [        "string"      ],      "effect": "allow"    }  ],  "on": true,  "tags": [    "examples"  ],  "_access": {    "denied": [      {        "action": "string",        "reason": {          "resources": [            "proj/*:env/*;qa_*:/flag/*"          ],          "notResources": [            "string"          ],          "actions": [            "*"          ],          "notActions": [            "string"          ],          "effect": "allow",          "role_name": "string"        }      }    ],    "allowed": [      {        "action": "string",        "reason": {          "resources": [            "proj/*:env/*;qa_*:/flag/*"          ],          "notResources": [            "string"          ],          "actions": [            "*"          ],          "notActions": [            "string"          ],          "effect": "allow",          "role_name": "string"        }      }    ]  }}