v1

latestOpenAPI 3.0.02026-07-141,4077,1665.2 MB
Synthetics

Patch a global variable

Patch a global variable using JSON Patch (RFC 6902). This endpoint allows partial updates to a global variable by specifying only the fields to modify.

Common operations include:

  • Replace field values: {"op": "replace", "path": "/name", "value": "new_name"}
  • Update nested values: {"op": "replace", "path": "/value/value", "value": "new_value"}
  • Add/update tags: {"op": "add", "path": "/tags/-", "value": "new_tag"}
  • Remove fields: {"op": "remove", "path": "/description"}
patch/api/v2/synthetics/variables/{variable_id}/jsonpatch

Path parameters

variable_idstring required

The ID of the global variable.

Request body

Example request

{
  "data": {
    "attributes": {
      "json_patch": [
        {
          "op": "add",
          "path": "/name"
        }
      ]
    }
  }
}

Response

OK

Example response

{
  "data": {
    "attributes": {
      "attributes": {
        "restricted_roles": [
          "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        ]
      },
      "description": "Example description",
      "name": "MY_VARIABLE",
      "parse_test_options": {
        "field": "content-type",
        "localVariableName": "LOCAL_VARIABLE",
        "parser": {
          "type": "regex",
          "value": ".*"
        },
        "type": "http_body"
      },
      "parse_test_public_id": "abc-def-123",
      "tags": [
        "team:front",
        "test:workflow-1"
      ],
      "value": {
        "secure": true,
        "value": "value"
      }
    }
  }
}