# Resource

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

> A Resource is a Thing whose home is at a Source, such as a Stripe Invoice, with a mode that says which side leads.

A Resource is a [Thing](/business/nouns/thing) whose home is at a [Source](/business/nouns/source), such as a Stripe [Invoice](/business/nouns/invoice), with a mode that says which side leads.

## Properties
| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `source` | [Source](/business/nouns/source) | Yes | The Source it lives at. |
| `mode` | `string` | Yes | One of `upstream` (the Source leads, read through and mirrored), `mirrored` (copied from a read-only Source) or `owned` (db.sb leads). |
| `noun` | [Noun](/business/nouns/noun) | Yes | The Noun it is a Thing of, such as Invoice. |
| `mirroredAt` | `datetime` | No | When db.sb last copied it from its Source. |

## Object
```json
{
  "$id": "https://api.sb/ratebook.dev/resources/resource_hIVWDprAyZ",
  "$type": "Resource",
  "source": "source_DIdhfB6mF5",
  "mode": "upstream",
  "noun": "noun_iXkcYZtTJh",
  "mirroredAt": "2026-10-22T12:00:00Z"
}
```

## Relationships
- <a id="rel-datasets"></a>A Resource **has** many [Datasets](/business/nouns/dataset): a [Dataset](/business/nouns/dataset) is built from Resources at its [Sources](/business/nouns/source), plus enrichment. `datasets`, inverse [`builtFrom`](/business/nouns/dataset#rel-built-from).
- <a id="rel-lives-at"></a>A Resource **lives at** one [Source](/business/nouns/source): each Resource lives at one [Source](/business/nouns/source), and a Source holds many Resources. `livesAt`, inverse [`resources`](/business/nouns/source#rel-resources).

## Verbs
| Verb | Description | Subject | Event | Class |
| --- | --- | --- | --- | --- |
| <a id="get"></a>[Resource.get](/business/nouns/resource/get) | Returns one Resource by id. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="list"></a>[Resource.list](/business/nouns/resource/list) | Returns Resources, newest first, one page at a time. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |

A Resource is kept forever and never edited: it has no `update` or `delete`.

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

| Operation | `owner` | `admin` | `member` | `viewer` |
| --- | --- | --- | --- | --- |
| `Resource.get` | Yes | Yes | Yes | Yes |
| `Resource.list` | Yes | Yes | Yes | Yes |

## Call it
In code: [API](/code/api/resource) · [SDK](/code/sdk/resource) · [CLI](/code/cli/resource) · [MCP](/code/mcp/resource).

**Ask**

```text
Show me the latest resource.
```

**API**

```bash
curl https://api.sb/ratebook.dev/resources/resource_hIVWDprAyZ \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/ratebook.dev",
  "$type": "Resource",
  "$id": "https://api.sb/ratebook.dev/resources/resource_hIVWDprAyZ",
  "resource": {
    "$id": "https://api.sb/ratebook.dev/resources/resource_hIVWDprAyZ",
    "$type": "Resource",
    "source": "source_DIdhfB6mF5",
    "mode": "upstream",
    "noun": "noun_iXkcYZtTJh"
  },
  "links": {
    "self": "https://api.sb/ratebook.dev/resources/resource_hIVWDprAyZ",
    "up": "https://api.sb/ratebook.dev/resources"
  }
}
```

**SDK**

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

const resource = await $.Resource.get({ id: 'resource_hIVWDprAyZ' })
```

**CLI**

```bash
npx startup-builder do Resource.get --json '{"id":"resource_hIVWDprAyZ"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Resource.get({ id: 'resource_hIVWDprAyZ' })"
  }
}
```

## Works with
| With | Links |
| --- | --- |
| Teams | [Engineering Team](/agents/engineering) |

## Example
Stripe leads every [Invoice](/business/nouns/invoice), so each Invoice is an `upstream` Resource at the Stripe Source. A read goes through to Stripe, and [db.sb](/code/platform/db-sb) keeps a mirror that Stripe's webhooks update.