policies
Use this resource to create a new policy.
Method summary
| HTTP Method | Path | Description |
|---|---|---|
| POST | /bwl/policies | Creates a new policy. |
POST /policies
- Description
- Use this method to create a policy.
- Resource information
-
Requirements Description Response format JSON Requires authentication Yes Supports OAuth 2 client credentials Yes using a User Service ID containing Artifact Authoring Category Rate limited IBM Blueworks Live applies a rate limit that determines how often this API can be called within a specific period. The allowed rate is 200 requests per hour. The rate limit is applied to the whole account. Even if different authentication methods are used, the single account-wide rate is applied across all users.
When the rate limit for the API is exceeded for the account, the next request is rejected with status code 429 and response header
Retry-After, which indicates the number of seconds when the next request can be made.
- Parameters
-
Name Location Description Required Type Content-Type Header The value must be application/json.Yes String X-On-Behalf-Of Header The user context. The value must be a username in the account. The user must have permission to create a policy in the account and to the specified parent space, if any. Required if Service ID OAuth credentials are used. Not required when using User Service ID OAuth credential. String - Request JSON body
- The request body is a JSON object containing the following properties:
Name Location Description Required Type policyName JSON body The new name to give the policy. Yes String spaceId JSON body The ID of the space to create the policy. Yes String
- Response
- Example input
-
- Create a policy with the name "New Policy" in a space.
-
- Using User Service ID OAuth 2 client credentials:
curl -i --request POST \ --url https://your_server_url/bwl/policies \ --header 'Authorization: Bearer access_token' \ --header 'content-type: application/json' \ --data '{"policyName" : "New Policy","spaceId" : "5f6000cc60034"}' - Using Service ID OAuth 2 client credentials:
ccurl -i --request POST \ --url https://your_server_url/bwl/policies \ --header 'Authorization: Bearer access_token' \ --header 'X-On-Behalf-Of: user_name@domain.com' \ --header 'content-type: application/json' \ --data '{"policyName" : "New Policy","spaceId" : "5f6000cc60034"}'
- Using User Service ID OAuth 2 client credentials:
- Example output
-
The new policy is created.
{ "id" : "5f6000cc60034", "name" : "New Policy" }
- Response properties
- id
The ID of the new policy.
- Response headers
-
Header name Description Retry-After When the next request can be made, in a number of seconds.
- Response messages
-
HTTP code Reason 200 The request was completed successfully.
400 There was an error processing the request. A policy ID doesn't exist in the account, the JSON body is missing from the request, or a required parameter is missing.
401 This user didn't pass authentication. This response could appear for the following reasons:- An invalid username or password was provided.
- This user belongs to multiple accounts and an account wasn't specified in the request.
403 Access is forbidden. 404 The space-id is invalid. 429 The request exceeded the rate limit of the API for this account.
For more information, see OpenAPI specification.