# Relationship

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

> A Relationship is a standing Action between two Things, read in the present tense and typed by a Verb whose forms give its reverse.

A Relationship is a standing link between two [Things](/business/nouns/thing), typed by a [Verb](/business/nouns/verb), declared once and read from both ends.

## Properties
| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `predicate` | `string` | Yes | The name read from the source, such as `makes`. |
| `inverse` | `string` | Yes | The name read from the target, such as `madeBy`. |
| `provenance` | `string` | No | Who asserted it: `Stated`, `Ratified`, `Inferred`, or `Observed`. |

## Object
```json
{
  "$id": "https://api.sb/tutorloop.com/relationships/relationship_1",
  "$type": "Relationship",
  "predicate": "Example predicate",
  "inverse": "Example inverse",
  "provenance": "Stated"
}
```

## Relationships
- <a id="rel-typed-by"></a>A Relationship **is typed by** one [Verb](/business/nouns/verb): a Relationship reads through a [Verb](/business/nouns/verb) whose forms name it from each side, such as `makes` and `madeBy`. `typedBy`, inverse [`types`](/business/nouns/verb#rel-types).

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

## Call it

**Ask**

```text
Add a relationship to QuietCopy.
```

**API**

```bash
curl -X POST https://api.sb/quietcopy.com/relationships \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"predicate":"Example predicate","inverse":"Example inverse"}'
```

```json
{
  "api": "https://api.sb/quietcopy.com",
  "relationship": {
    "$id": "https://api.sb/quietcopy.com/relationships/relationship_1",
    "$type": "Relationship",
    "predicate": "Example predicate",
    "inverse": "Example inverse"
  },
  "action": {
    "$id": "https://api.sb/quietcopy.com/actions/action_1",
    "operation": "Relationship.create",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/quietcopy.com/actions/action_1"
  }
}
```

**SDK**

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

const relationship = await $.Relationship.create({ predicate: 'Example predicate', inverse: 'Example inverse' })
```

**CLI**

```bash
npx startup-builder do Relationship.create --json '{"predicate":"Example predicate","inverse":"Example inverse"}'
```

**MCP**

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

## Example
`Customer accepts Offer` is one Relationship, declared once. The [Customer](/business/nouns/customer) page shows `accepts`, and the [Offer](/business/nouns/offer) page shows `acceptedBy`.