Webhooks
Download API definition:
GET https://api.bentley.com/webhooks/

Retrieves a list of all webhooks that have been created by the calling user.

Authentication

The Webhooks API V2 can only be called by Service Applications. This request requires an Authorization header with a valid Bearer token with the webhooks:read scope. For more information on Service Applications and how to obtain an access token can be found here. A list of your Service Applications can be found here.

Authorization

The Service Application must have the webhooks_maintainer permission assigned at the iTwin level or be an Organization Administrator for the Organization that owns a given iTwin.

An Organization Administrator must have at least one of the following roles assigned in User Management: Account Administrator, Co-Administrator, or CONNECT Services Administrator. For more information about User Management please visit our Bentley Communities Licensing, Cloud, and Web Services wiki page.

Request headers

Name
Required?
Description
Authorization
Yes

OAuth access token with itwin-platform scope

Accept
Yes

Setting to application/vnd.bentley.itwin-platform.v2+json is recommended.

Response 200 OK

OK

json
{
    "webhooks": [{
        "id": "e6989b43-53ab-45e2-a610-560c6f7e879e",
        "scope": "Account",
        "scopeId": "5c9d64cf-d22f-4149-ad08-c24ff395c3a0",
        "active": false,
        "callbackUrl": "https://some-callback.example.com",
        "eventTypes": ["iModels.iModelDeleted.v1"],
        "created": "2023-10-02T14:55:00.463Z",
        "modified": "2023-10-06T20:03:15.562Z"
    }]
}

Response 401 Unauthorized

This response indicates that request lacks valid authentication credentials. Access token might not been provided, issued by the wrong issuer, does not have required scopes or request headers were malformed.

json
{
    "error": {
        "code": "HeaderNotFound",
        "message": "Header Authorization was not found in the request. Access denied."
    }
}

Response 429 Too many requests

This response indicates that the client sent more requests than allowed by this API for the current tier of the client.

json
{
    "error": {
        "code": "RateLimitExceeded",
        "message": "The client sent more requests than allowed by this API for the current tier of the client."
    }
}

Response headers

Name
Description
retry-after

Number of seconds to wait until client is allowed to make more requests.

webhooks-response

Name
Type
Description
webhooks

List of webhooks.

webhook-scope

Scope of the webhook. Possible values: 'Account', 'iTwin'.

Name
Type
Description
Account
String
iTwin
String

Webhook

Common property representation of a webhook.

Name
Type
Description
id
String

Globally unique identifier of the webhook.

scopeId
String

Globally unique identifier of the acount of the webhook.

active
Boolean

An indicator showing webhook activity. If true, webhook is actively forwarding the events. If false, webhook events are stopped.

callbackUrl
String

URL where webhook events are sent.

eventTypes
String[]

List of event types the webhook is subscribed to.

created
String

When the webhook was created.

modified
String

When the webhook was modified.

Error

Contains error information.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error information.

Was this page helpful?