Skip to content

CreateListingRolePolicy

POST/api/v1/listings/{listing}/roles/{role}/policies

Add a policy to a listing role, setting who may request it and what has to happen before they get it.

Example request

curl -X POST \
-H "Authorization: Bearer ${OBLIQUE_API_KEY}" \
-H "Content-Type: application/json" \
-d '{ "group": "string", "team": "string", "justificationRequired": false, "justificationPrompt": "string", "defaultExpiry": "string" }' \
"https://us.oblique.security/api/v1/listings/{listing}/roles/{role}/policies"

Set OBLIQUE_API_KEY to your API key.

Path parameters

  • parentstringrequired

    Format: listings/{listing}/roles/{role}

Query parameters

  • listingRolePolicyIdstring

    ID of the listing role policy to create. This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/.

Request body

  • namestring

    Assigned by Oblique. Name of the policy of the form listings/{listing}/roles/{role}/policies/{listing_role_policy}

  • createTimestring (date-time)read-only

    The time when this policy was created.

  • updateTimestring (date-time)read-only

    The time when this policy was last updated.

  • deleteTimestring (date-time)read-only

    ListingRolePolicies can only be soft-deleted to preserve logs and history. If this field is present, the policy has been deleted and won’t be returned in lists.

  • One of

    • groupstring

      Set once, when the resource is created.

  • justificationRequiredboolean

    Set once, when the resource is created. If true, users will be required to provide a justification when requesting auto-approved access. The justification response will be stored on the resulting request.

  • justificationPromptstring

    Set once, when the resource is created. Admins can specify a custom question for the justification field to show users.

  • defaultExpirystring (duration)

    Set once, when the resource is created. If present, users can only self-serve access to a role for this duration. Otherwise, users can select how long they would like to have access to the role.

  • managementManagement

    How this policy is managed. Inherited from the grandparent listing (via the parent role): policies under a Terraform-managed listing are themselves Terraform managed and can only be created, updated, or deleted through the Terraform provider; manage the listing to change this. Omitted from responses when the listing is manually managed (the default).

    • managerstring
      Allowed values: TERRAFORM

      How the resource is managed. Set automatically by the server based on the caller: Terraform clients produce TERRAFORM; for all other clients the management field is left unset on the response.

    • repoUristring

      URI of the VCS repository that holds the Terraform configuration for this resource. Populated by the Oblique Terraform provider.

    • repoDirstring

      Optionally, the subdirectory within repo_uri that holds the Terraform configuration for this resource. Populated by the Oblique Terraform provider.

Response

200ListingRolePolicy

A ListingRolePolicy defines a policy for auto-approved access to a role. Right now it is just groups/teams that can be designated as eligible groups, this may expand in the future. A role can have multiple ListingRolePolicies, each ListingRolePolicy corresponds to one group/team and one expiry.

  • namestring

    Assigned by Oblique. Name of the policy of the form listings/{listing}/roles/{role}/policies/{listing_role_policy}

  • createTimestring (date-time)read-only

    The time when this policy was created.

  • updateTimestring (date-time)read-only

    The time when this policy was last updated.

  • deleteTimestring (date-time)read-only

    ListingRolePolicies can only be soft-deleted to preserve logs and history. If this field is present, the policy has been deleted and won’t be returned in lists.

  • One of

    • groupstring

      Set once, when the resource is created.

  • justificationRequiredboolean

    Set once, when the resource is created. If true, users will be required to provide a justification when requesting auto-approved access. The justification response will be stored on the resulting request.

  • justificationPromptstring

    Set once, when the resource is created. Admins can specify a custom question for the justification field to show users.

  • defaultExpirystring (duration)

    Set once, when the resource is created. If present, users can only self-serve access to a role for this duration. Otherwise, users can select how long they would like to have access to the role.

  • managementManagement

    How this policy is managed. Inherited from the grandparent listing (via the parent role): policies under a Terraform-managed listing are themselves Terraform managed and can only be created, updated, or deleted through the Terraform provider; manage the listing to change this. Omitted from responses when the listing is manually managed (the default).

    • managerstring
      Allowed values: TERRAFORM

      How the resource is managed. Set automatically by the server based on the caller: Terraform clients produce TERRAFORM; for all other clients the management field is left unset on the response.

    • repoUristring

      URI of the VCS repository that holds the Terraform configuration for this resource. Populated by the Oblique Terraform provider.

    • repoDirstring

      Optionally, the subdirectory within repo_uri that holds the Terraform configuration for this resource. Populated by the Oblique Terraform provider.

Errors

StatusMeaning
400Malformed request
401Missing or invalid API key
403Not allowed for this API key
404Not found
429Too many requests
500Internal server error