# Policy

URL: /business/nouns/policy · Id: `noun:policy`

> A Policy is a ruling a Startup declares on how its numbers are computed or its choices made, such as revenue recognition.

A Policy is a ruling a [Startup](/business/nouns/startup) declares on how its numbers are computed or its choices made, such as revenue recognition.

## Properties
| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `rule` | `text` | Yes | The ruling, stated so code can apply it. |

## Object
```json
{
  "$id": "https://api.sb/quietcopy.com/policies/policy_1",
  "$type": "Policy",
  "rule": "Example rule"
}
```

## Relationships
- <a id="rel-computes"></a>A Policy **computes** many [Metrics](/business/nouns/metric): a Policy rules how [Metrics](/business/nouns/metric) are computed, such as revenue under revenue recognition. `computes`, inverse [`computedUnder`](/business/nouns/metric#rel-computed-under).

## Verbs
| Verb | Description | Subject | Event | Class |
| --- | --- | --- | --- | --- |
| <a id="create"></a>[Policy.create](/business/nouns/policy/create) | Creates a Policy. Inherited from [Noun](/business/nouns/noun). | None. | `Policy.created` | Two-way: `try`, `send`, `do` |
| <a id="get"></a>[Policy.get](/business/nouns/policy/get) | Returns one Policy by id. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="list"></a>[Policy.list](/business/nouns/policy/list) | Returns Policies, newest first, one page at a time. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="update"></a>[Policy.update](/business/nouns/policy/update) | Changes the given properties of a Policy. Inherited from [Noun](/business/nouns/noun). | None. | `Policy.updated` | Two-way: `try`, `send`, `do` |
| <a id="delete"></a>[Policy.delete](/business/nouns/policy/delete) | Deletes a Policy; its history is kept. Inherited from [Noun](/business/nouns/noun). | None. | `Policy.deleted` | One-way: `send`, `do` |

## Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.

| Operation | `owner` | `admin` | `member` | `viewer` |
| --- | --- | --- | --- | --- |
| `Policy.create` | Yes | Yes | No | No |
| `Policy.get` | Yes | Yes | Yes | Yes |
| `Policy.list` | Yes | Yes | Yes | Yes |
| `Policy.update` | Yes | Yes | No | No |
| `Policy.delete` | Yes | Yes | No | No |

## Call it

**Ask**

```text
Add a policy to TutorLoop.
```

**API**

```bash
curl -X POST https://api.sb/tutorloop.com/policies \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rule":"Example rule"}'
```

```json
{
  "api": "https://api.sb/tutorloop.com",
  "policy": {
    "$id": "https://api.sb/tutorloop.com/policies/policy_1",
    "$type": "Policy",
    "rule": "Example rule"
  },
  "action": {
    "$id": "https://api.sb/tutorloop.com/actions/action_1",
    "operation": "Policy.create",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/tutorloop.com/actions/action_1"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const policy = await $.Policy.create({ rule: 'Example rule' })
```

**CLI**

```bash
npx startup-builder do Policy.create --json '{"rule":"Example rule"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Policy.create({ rule: 'Example rule' })"
  }
}
```

## Example
The revenue recognition Policy of a bookkeeping service recognizes each $2,400 catch-up engagement month by month as the books are delivered, not at payment.