Skip to main content

Update an existing template

PATCH 

/templates/{templateId}

This endpoint updates an existing template, performing all necessary validations on the updated object.
Note: Currently, only Webhook templates are supported.

A valid PATCH request contains an array of PATCH operation objects.

Click for more details on the PATCH Request Object Structure

These objects can be:

  • For REPLACE Operation:
    {
      "op": "REPLACE",
      "path": "<path for replacement>",
      "value": "<new value for the property>"
    }
    • path: Can be an editable property of the webhook template or the ID of a filter constraint or request header ("path": "<nested object id>/<nested object property to be edited>") along with the property to be edited.
    • value: Mandatory.
  • For REMOVE Operation:
    {
      "op": "REMOVE",
      "path": "<path_for_removal>"
    }
    • path: Can be a nullable property of the webhook template or the ID ("path": "<nested object id>") of an existing filter constraint or request header.
    • No value should be set.
  • For ADD operation
    • For simple properties:
      {
        "op": "ADD",
        "path": "<property_to_add_value_for>",
        "value": "<value_for_the_property>"
      }
      • path: Can be a template property.
    • For new request headers or filter constraints:
      {
        "op": "ADD",
        "path": "headers/<header property>",
        "value": "<value to be added for specified property for the new header>"
      }
    • {
        "op": "ADD",
        "path": "filterConstraints/<filter constraint property>",
        "value": "<value to be added for specified property for the new filter constraint>"
      }
  • In a single PATCH call, you can add only one new request header and one new filter constraint. If multiple attempts are made to add within the same array, only the last value for each type will be populated in the newly added nested object of each type.
  • For nested objects inside the template with PATCH, ADD works for addition only (given the custom syntax with the headers or filterConstraints identifiers) and REPLACE is the one used for the replacement of the values of the nested objects' properties.
"

Request

Responses

The template was successfully updated.