Add parameters

POST /api/synthetics/params

Spaces method and path for this operation:

post /s/{space_id}/api/synthetics/params

Refer to Spaces for more information.

Add one or more parameters to the Synthetics app. You must have all privileges for the Synthetics feature in the Observability section of the Kibana feature privileges.

application/json

Body array[object] | object Required

The request body can contain either a single parameter object or an array of parameter objects.

One of:
Hide attributes Show attributes object
  • description string

    A description of the parameter.

  • key string Required

    The key of the parameter.

  • share_across_spaces boolean

    Specify whether the parameter should be shared across spaces.

  • tags array[string]

    An array of tags to categorize the parameter.

  • value string Required

    The value associated with the parameter.

Responses

  • 200 application/json

    A successful response.

    One of:
    Hide attributes Show attributes object
    • description string

      A description of the parameter.

    • id string

      The unique identifier for the parameter.

    • key string

      The parameter key.

    • share_across_spaces boolean

      Indicates whether the parameter is shared across spaces.

    • tags array[string]

      An array of tags associated with the parameter.

    • value string

      The value associated with the parameter.

POST /api/synthetics/params
curl \
 --request POST 'http://localhost:5601/api/synthetics/params' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '"{\n  \"key\": \"your-key-name\",\n  \"value\": \"your-parameter-value\",\n  \"description\": \"Param to use in browser monitor\",\n  \"tags\": [\"authentication\", \"security\"],\n  \"share_across_spaces\": true\n}"'
Request examples
Add a single parameter.
{
  "key": "your-key-name",
  "value": "your-parameter-value",
  "description": "Param to use in browser monitor",
  "tags": ["authentication", "security"],
  "share_across_spaces": true
}
Add multiple parameters.
[
  {
    "key": "param1",
    "value": "value1"
  },
  {
    "key": "param2",
    "value": "value2"
  }
]
Response examples (200)
A successful response for a single added parameter.
{
  "id": "unique-parameter-id",
  "key": "your-key-name",
  "value": "your-param-value",
  "description": "Param to use in browser monitor",
  "tags": ["authentication", "security"],
  "share_across_spaces": true
}
A successful response for multiple added parameters.
[
  {
    "id": "param1-id",
    "key": "param1",
    "value": "value1"
  },
  {
    "id": "param2-id",
    "key": "param2",
    "value": "value2"
  }
]