---
title: "Set the organization's written tool rules"
method: PUT
path: "/v1/org/tool-permissions/written-rules"
tags: ["Tool permissions"]
---

# Set the organization's written tool rules

`PUT /v1/org/tool-permissions/written-rules`

## Request

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

Admins only. Replaces the written rules, in the admin's own words, that every run follows first.

## Request body

- SetToolPermissionWrittenRules
  - `rules` string, 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.

## Changes

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

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/org/tool-permissions/written-rules/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)
