Skip to main content

PUT /v1beta1/policies/

The Frontier API does not currently support updating existing policies. To modify a policy, you must delete the existing policy and create a new one with the desired configuration.

Alternative Approach

To effectively “update” a policy:
  1. Delete the existing policy using the DELETE /v1beta1/policies/ endpoint
  2. Create a new policy with the updated configuration using the POST /v1beta1/policies endpoint

Example Workflow

# Step 1: Delete the existing policy
curl -X DELETE 'https://api.frontier.example.com/v1beta1/policies/550e8400-e29b-41d4-a716-446655440000' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'

# Step 2: Create a new policy with updated configuration
curl -X POST 'https://api.frontier.example.com/v1beta1/policies' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "body": {
      "role_id": "new-role-id",
      "resource": "app/organization:org-123",
      "principal": "app/user:user-456",
      "metadata": {
        "description": "Updated policy configuration"
      }
    }
  }'

Important Considerations

  • Timing: There will be a brief moment between deletion and creation where the policy doesn’t exist
  • Audit Trail: Both deletion and creation events are logged separately in the audit log
  • Policy ID: The new policy will have a different ID from the original
  • Atomicity: This is not an atomic operation - if the creation fails after deletion, you may need to handle recovery

Build docs developers (and LLMs) love