Note the following points when you create a request:

  • Note that you cannot simply use the JSON from the response of a similar object. If the object contains references to other resources (for example, a Channel policy references a Time policy), then the JSON object contains an embedded meta object. To get a valid JSON that you can use, you have to replace this embedded object with the ID (key) of the referenced object. For example, the following is a reference to a Time policy:

    "time_policy": {
            "key": "-100",
            "meta": {
                "href": "/api/configuration/policies/time_policies/-100"
            }
        }

    In a POST or PUT request, you have to change it to the following:

    "time_policy": "-100",

    Starting with version 6.1.0, when querying a list of objects, the API response includes the body of the referenced objects as well, not only its reference key, but only if they are immediate child nodes.

  • You have to include empty fields in the object as well, for example:

    "users": [
            { "certificates": [], "passwords": [ "<reference-to-password>" ], "public_keys": [], "username": "myusername" }
            ]
  • The API ignores any unrecognized or nonexistent keys that appear in the body of POST and PUT requests. For example, if you mistype the name of an optional key, it will be silently ignored.

  • The body wrapper that is displayed in the response is not needed when you create or modify an object, for example:

    {
        "name": "my-local-user-database",
        "users": [
            { "certificates": [], "passwords": [ "<reference-to-password>" ], "public_keys": [], "username": "myusername" }
            ]
    }