Request

Response

    Update a Webhook
    PATCH

    webhooks/v1/systems/{system}/events/{event}/hooks/{hook_id}

    Updates the webhook specified by the hook_id parameter.

    See the request body documentation for the complete list of fields you can update.

    Resource Information

    Method and URI
    PATCH
    https://developer.api.autodesk.com/webhooks/v1/systems/{system}/events/{event}/hooks/{hook_id}
    Authentication Context
    User context optional
    Required OAuth Scopes
    data:read data:write
    Data Format
    JSON

    Request

    Headers

    Authorization*
    string
    Must be Bearer <token>, where <token> is a two-legged access token obtained via a Client Credentials Grant flow, or a three-legged access token obtained via an Authorization Code flow or a Secure Service Account (SSA) flow.

    The SSA flow is designed for headless server-to-server operations. While it functions like a two-legged flow (no user interaction), it is classified as three-legged because it preserves user context.

    region
    string
    The geographical location (region) of the server the request must be executed on. This also corresponds to the region where Webhook data is stored. It is also the location of the server that will make requests to your callback URL. Possible values:
    • US - (Default) Data center dedicated to serve the United States region.
    • EMEA - Data center dedicated to serve the European Union, Middle East, and Africa regions.
    • AUS - Data center dedicated to serve the Australia region.
    • CAN - Data center dedicated to serve the Canada region.
    • DEU - Data center dedicated to serve the Germany region.
    • IND - Data center dedicated to serve the India region.
    • JPN - Data center dedicated to serve the Japan region.
    • GBR - Data center dedicated to serve the United Kingdom region.

    Note: You can specify the region using three methods: the region header, the x-ads-region header, and the region query parameter. The region header takes precedence over the x-ads-region header, and the x-ads-region header takes precedence over the region query parameter.

    x-ads-region
    string
    The geographical location (region) of the server the request must be executed on. This also corresponds to the region where Webhook data is stored. It is also the location of the server that will make requests to your callback URL. Possible values:
    • US - (Default) Data center dedicated to serve the United States region.
    • EMEA - Data center dedicated to serve the European Union, Middle East, and Africa regions.
    • AUS - Data center dedicated to serve the Australia region.
    • CAN - Data center dedicated to serve the Canada region.
    • DEU - Data center dedicated to serve the Germany region.
    • IND - Data center dedicated to serve the India region.
    • JPN - Data center dedicated to serve the Japan region.
    • GBR - Data center dedicated to serve the United Kingdom region.

    Note: You can specify the region using three methods: the region header, the x-ads-region header, and the region query parameter. The region header takes precedence over the x-ads-region header, and the x-ads-region header takes precedence over the region query parameter.

    Content-Type*
    string
    Must be application/json
    * Required

    Request

    URI Parameters

    system
    string
    The ID of the system the webhook applies to. For example data for Data Management. See Supported Events for a full list of supported systems and their IDs.
    event
    string
    The event type the webhook subscribes to. See Supported Events for a full list of events.
    hook_id
    string
    The ID of the webhook.

    Request

    Query String Parameters

    region
    enum:string
    The geographical location (region) of the server the request must be executed on. This also corresponds to the region where Webhook data is stored. It is also the location of the server that will make request to your callback URL. Possible values:
    • US - (Default) Data center dedicated to serve the United States region.
    • EMEA - Data center dedicated to serve the European Union, Middle East, and Africa regions.
    • AUS - Data center dedicated to serve the Australia region.
    • CAN - Data center dedicated to serve the Canada region.
    • DEU - Data center dedicated to serve the Germany region.
    • IND - Data center dedicated to serve the India region.
    • JPN - Data center dedicated to serve the Japan region.
    • GBR - Data center dedicated to serve the United Kingdom region.

    Note: You can specify the region using three methods: the region header, the x-ads-region header, and the region query parameter. The region header takes precedence over the x-ads-region header, and the x-ads-region header takes precedence over the region query parameter.

    Request

    Body Structure

    Expand all
    status
    object
    Sets the current state of the webhook. Possible values:
    • active - Activates webhook.
    • inactive - Deactivates webhook.
    autoReactivateHook
    boolean
    true: Automatically reactivate the webhook if it becomes inactive.

    false: (Default) Do not reactivate the webhook if it becomes inactive.

    See Event Delivery Guarantees for more information on how the webhooks service handles reactivation.

    filter
    string
    A Jsonpath expression that you can use to filter the callbacks you receive.

    See Callback Filtering for more information.

    hookAttribute
    object
    Contains a JSON object for storing user-defined custom information. The maximum size of this object must be less than 1KB.
    *
    object
    Contains a user-defined JSON object for storing custom information. The maximum size of this object must be less than 1KB.
    token
    string
    A secret token that is used to generate a hash signature, which is passed along with notification requests to the callback URL.

    See the Secret Token section in API Basics for more information.

    hookExpiry
    string
    The date and time the webhook will expire, formatted as an ISO 8601 date/time string. If you set this to null, the webhook will never expire.

    Response

    HTTP Status Code Summary

    200
    OK
    The webhook was updated successfully.
    400
    Bad Request
    The request could not be processed due to invalid or malformed data. Check the request parameters, body format, and required fields before retrying.
    401
    Unauthorized
    The supplied authorization header was invalid or the token scope was not acceptable. Verify your authentication credentials and try again.
    403
    Forbidden
    The request was valid but lacked the necessary permissions. Verify your credentials and permissions before sending the request again.
    404
    Not Found
    The requested resource could not be found on the server. Review the request and try again.
    500
    Internal Server Error
    An unexpected error occurred on the server. Please try again later.

    Response

    Body Structure (200)

    Response for 200 has no body.

    Example 1

    Successful Patch of a webhook:

    Request

    curl -X 'PATCH'
         -v 'https://developer.api.autodesk.com/webhooks/v1/systems/data/events/dm.version.added/hooks/05f10350-991a-11e7-8cd7-91969336b9c2'
         -H 'Content-Type: application/json'
         -H 'Authorization: Bearer 0X6mpTyg5IbH6YI8Okz2XJGpEDeK'
         -d '{
                "status": "active",
                "autoReactivateHook": false,
                "filter": "$[?(@.ext=='txt')]",
                "hookAttribute": {
                     /* Custom metadata */
                     "myfoo": 34,
                     "projectId": "someURN",
                     "myobject": {
                          "nested": true
                     }
                }
          }'
    
    Show More

    Response

    HTTP/1.1 204
    Date: Fri, 15 Sep 2017 19:11:00 GMT
    Content-Length: 0
    Connection: keep-alive
    

    Example 2

    Successful deactivation of a webhook:

    Request

    curl -X 'PATCH'
         -v 'https://developer.api.autodesk.com/webhooks/v1/systems/data/events/dm.version.added/hooks/05f10350-991a-11e7-8cd7-91969336b9c2'
         -H 'Content-Type: application/json'
         -H 'Authorization: Bearer 0X6mpTyg5IbH6YI8Okz2XJGpEDeK'
         -d '{
                "status": "inactive"
          }'
    

    Response

    HTTP/1.1 204
    Date: Fri, 15 Sep 2017 19:11:00 GMT
    Content-Length: 0
    Connection: keep-alive
    

    Example 3

    Successful removal of existing filter and hook attributes:

    Request

    curl -X 'PATCH'
         -v 'https://developer.api.autodesk.com/webhooks/v1/systems/data/events/dm.version.added/hooks/05f10350-991a-11e7-8cd7-91969336b9c2'
         -H 'Content-Type: application/json'
         -H 'Authorization: Bearer 0X6mpTyg5IbH6YI8Okz2XJGpEDeK'
         -d '{
                "filter": null,
                "hookAttribute": null
          }'
    
    Show More

    Response

    HTTP/1.1 204
    Date: Fri, 15 Sep 2017 19:11:00 GMT
    Content-Length: 0
    Connection: keep-alive
    

    Example 4

    Successful update of hook expiry to a later date and time:

    Request

    curl -X 'PATCH'
         -v 'https://developer.api.autodesk.com/webhooks/v1/systems/data/events/dm.version.added/hooks/05f10350-991a-11e7-8cd7-91969336b9c2'
         -H 'Content-Type: application/json'
         -H 'Authorization: Bearer 0X6mpTyg5IbH6YI8Okz2XJGpEDeK'
         -d '{
                "hookExpiry": ""2017-09-22T17:04:10.444Z""
          }'
    

    Response

    HTTP/1.1 204
    Date: Fri, 15 Sep 2017 19:11:00 GMT
    Content-Length: 0
    Connection: keep-alive