v1

latestOpenAPI 3.0.32026-08-06138294578.6 KB
Permissions

Create Policy

Creates a new policy.

A policy binds one or more roles to a set of resources, granting members who hold those roles the actions defined by them. Roles must already exist before they are referenced in a policy; create roles using POST /api/permissions/roles.

post/api/permissions/policies

Headers

X-Polytomic-Versionstring

Request body

namestring required
organization_idstring uuid nullable

Example request

{
  "name": "Custom",
  "organization_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
  "policy_actions": [
    {
      "action": "read",
      "role_ids": [
        "248df4b7-aa70-47b8-a036-33ac447e668d"
      ]
    }
  ]
}

Response

OK

Example response

{
  "data": {
    "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
    "name": "Policy",
    "organization_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
    "policy_actions": [
      {
        "action": "read",
        "role_ids": [
          "248df4b7-aa70-47b8-a036-33ac447e668d"
        ]
      }
    ]
  }
}