---
title: "Set or remove one tool rule"
method: PUT
path: "/v1/org/tool-permissions/rule"
tags: ["Tool permissions"]
---

# Set or remove one tool rule

`PUT /v1/org/tool-permissions/rule`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/v1/org/tool-permissions/rule`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Admins only. Sets one tool's rule for the organization, a team or a member, or removes it. Returns the rules for that connection.

## Request body

- SetToolPermissionRule
  - `subject` union, required
    - object
      - `kind` 'organization', required
    - object
      - `kind` 'team', required
      - `id` string, required
    - object
      - `kind` 'member', required
      - `id` string, required
  - `connectionId` string, required
  - `toolName` string, required
  - `rule` 'allow' | 'ask' | 'block', nullable, required

## Response `200`

Success.

- ToolPermissions
  - `rules` ToolPermissionRule[], required
    - `id` string, required
    - `subject` object, required
      - `kind` 'organization' | 'team' | 'member', required
      - `id` string, nullable, required: The team or member; null for the whole organization.
      - `name` string, required: The team's or person's name, or the organization's.
    - `connectionId` string, required
    - `toolName` string, required: "*" for every tool of the connection, which can only be blocked.
    - `rule` 'allow' | 'ask' | 'block', required
    - `updatedAt` string, date-time, required
  - `writtenRules` string, required: What the organization tells every run to follow first, in the admin's words.

## Other responses

- `400`: Invalid request.
- `401`: Sign in first.
- `403`: This caller cannot use this operation.
- `404`: Tool permissions are off or the requested resource does not belong to this organization or caller.
- `409`: The organization has reached its tool rule limit.

## Changes

- **2026-11-26** `bc0092687a7b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/org/tool-permissions/rule/put.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) - [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openworklabs/apis/den-api/revisions/84fb0f99fb95?raw)
