Update Policy Based on Policy ID

put

/iam/governance/selfservice/api/v1/policies/{policyid}

Updates the policy with the attributes passed in the payload. In scenarios where the "action" query parameter is used to validate the policy the response will capture the "errorMessage" when the validation fails. The validation is supported for password and username policy types.

Request

Supported Media Types
Path Parameters
Query Parameters
  • Action against policy ID. Current release supports "validate" action. for example /policies/{policyid}?action=validate. The query parameter is supported for password and username policies only. When the URI is invoked with action query the contents in the payload will be used to check the validation. For example in case of password policy the request payload should have the password which is to be validated. All the other attributes even if specified will be ignored. None of the attributes mentioned in the request payload will be updated with query parameter "action".
  • Policy type of the policy ID which is being returned. If the policy ID does not match to the Policy Type then no updates will be performed.
Body ()
Attributes of the policy to be updated.
Root Schema : IndividualPolicyPutRequest
Type: object
Show Source
Nested Schema : attributes
Type: object
Show Source
Back to Top

Response

Supported Media Types

200 Response

Successful
Headers
Body ()
Root Schema : IndividualPolicyPutResponse
Type: object
Show Source
Nested Schema : LinkDataInstances
Type: object
Show Source

401 Response

Unauthorized

404 Response

Requested entity not found

500 Response

Internal Server Error

Default Response

Unexpected error
Back to Top

Examples

This example demonstrates the ability to check that the password meets policies. The information shown here is against a pseudo system and serves as a prototype.

cURL Example

curl -H "Content-Type: application/json"  -H "X-Requested-By: <anyvalue>"  -X PUT  -u 
username:password  -d @put.json 
https://pseudo.com/iam/governance/selfservice/api/v1/policies/1?
policyType=passwordPolicy&action=validate

Example of PUT Request Body

The following example shows the contents of the request body in JSON format.

{
   "requestId": "1001",
   "attributes" : [
      {
         "name" : "password",
         "value" : "PASSWORD"
      }
   ]
}

Example of PUT Response Body

The following example shows the contents of the response body in JSON format.

{
    "links": [
        {
            "rel": "self",
            "href": "http://pseudo.com:PORT/iam/governance/selfservice/api/v1/policies/1?
policyType=passwordPolicy"
        }
    ],
    "requestId": "1001",
    "status": "Valid Password"
}
Back to Top