Update Policy State
  • 07 May 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

Update Policy State

  • Dark
    Light
  • PDF

Article Summary

Patch
/api/2.0/policies/{envId}

Update Policy State.
Note - for the older version, see Policy State V1.

Notice

Accessing the Policy Management APIs is through a dedicated domain/URL, according to your PlainID Tenant Location
  • United States (US) - https://api.us1.plainid.io
  • Canada (CA) - https://api.ca1.plainid.io
  • Europe (EU) - https://api.eu1.plainid.io
  • Local PAA - https://api.plainid.local


  • Headers

    *Required
    NameValue
    Accepttext/plain;language=rego
    Content-Typetext/plain;language=rego

    Security
    HTTP
    Type bearer

    For more details about Administration API Authentication, check out the Authentication APIs documentation
    Provide your bearer token in the Authorization header when making requests to protected resources.
    Example: Authorization: Bearer 123

    Path parameters
    envId
    string (uuid) Required

    The Environment ID can be found under the Details tab in the Environment Settings.

    Query parameters
    filter[authWsId]
    string (uuid) Required

    Authorization Workspace ID

    filter[id]
    stringRequired

    Policy ID Filter

    Body parameters
    Switch Policy State
    [
      {
        "op": "replace",
        "path": "/state",
        "value": true
      }
    ]
    Array of object
    object
    op
    string Required
    Valid values[ "\"replace\"" ]
    path
    string Required
    Valid values[ "\"/state\"" ]
    value
    boolean Required
    Default"True"
    Responses
    204

    Success - No Content

    Headers
    x-request-id
    string
    400

    bad request

    Headers
    x-request-id
    string
    Authorization WS not found
    {
      "errors": [
        {
          "args": {
            "0": "ceef5853-1491-4d1c-ae52-2f2a1729b3a4"
          },
          "code": "PAC-001",
          "id": "EWWOTR",
          "message": "AuthorizationWs: [ceef5853-1491-4d1c-ae52-2f2a1729b3a4] not found",
          "name": "AuthorizationWsNotFound",
          "status": 400
        }
      ]
    }
    Expand All
    object
    errors
    Array of object (error)
    object
    args
    object
    path
    string
    code
    string
    id
    string
    message
    string
    name
    string
    status
    integer
    401

    Unauthorized

    Headers
    x-request-id
    string
    404

    not found

    Headers
    x-request-id
    string
    Policy not found
    {
      "errors": [
        {
          "args": {
            "0": "a0a455bb-7dc3-4cd3-b0d2-86631ac75379",
            "1": "ceef5853-1491-4d1c-ae52-2f2a1729b3a4"
          },
          "code": "PUA-033",
          "id": "E7WJBB",
          "message": "Policy Id doesn't exist in the environment",
          "name": "PolicyNotFoundError",
          "status": 404
        }
      ]
    }
    Expand All
    object
    errors
    Array of object (error)
    object
    args
    object
    path
    string
    code
    string
    id
    string
    message
    string
    name
    string
    status
    integer
    422

    Validation Failed - Invalid UUID

    Headers
    x-request-id
    string
    Invalid ID Format
    {
      "errors": [
        {
          "args": {
            "0": "ed252aa5-9d0c-4193-838-60bf20b13109",
            "1": "uuid"
          },
          "code": "V-032",
          "id": "EEJQMA",
          "message": "$: test is an invalid uuid",
          "name": "UnprocessableEntityError",
          "status": 422
        }
      ]
    }
    Expand All
    object
    errors
    Array of object (error)
    object
    args
    object
    path
    string
    code
    string
    id
    string
    message
    string
    name
    string
    status
    integer

    Was this article helpful?