# Service

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

> A Service is a Product that warrants an outcome, delivered by Agents and Humans under an Outcome Contract.

A Service is a [Product](/business/nouns/product) that warrants an outcome, delivered by [Agents](/business/nouns/agent) and [Humans](/business/nouns/human) under an [Outcome Contract](/business/nouns/outcome-contract).

## Properties
| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `floor` | `string` | No | The human floor: `none`, `sign`, or `practice`. |

<details>
<summary>Inherited from [Product](/business/nouns/product): 3 properties</summary>

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | `string` | Yes | The name of the Product. |
| `promise` | `text` | Yes | What the Customer can rely on. |
| `status` | `string` | Yes | One of `draft`, `selling` or `retired`, set by its Offers. |

</details>

## Object
```json
{
  "$id": "https://api.sb/routewise.dev/services/service_1",
  "$type": "Service",
  "name": "RouteWise",
  "promise": "A route plan for 500 stops in under two seconds.",
  "status": "draft",
  "floor": "none"
}
```

## Relationships
- <a id="rel-requires"></a>A Service **requires** many [Workers](/business/nouns/worker): a Service’s outcome is delivered by the [Agents](/business/nouns/agent) and [Humans](/business/nouns/human) who fill its [Roles](/business/nouns/role). `requires`, inverse [`staffs`](/business/nouns/worker#rel-staffs).
- <a id="rel-supplied-by"></a>A Service **is supplied by** many [Suppliers](/business/nouns/supplier): [Suppliers](/business/nouns/supplier) staff Services through the [Startup](/business/nouns/startup)’s human supply. `suppliedBy`, inverse [`delivers`](/business/nouns/supplier#rel-delivers).

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

## Call it

**Ask**

```text
Add a service to LedgerLark.
```

**API**

```bash
curl -X POST https://api.sb/ledgerlark.com/services \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"LedgerLark","promise":"Books closed by the fifth of each month."}'
```

```json
{
  "api": "https://api.sb/ledgerlark.com",
  "service": {
    "$id": "https://api.sb/ledgerlark.com/services/service_1",
    "$type": "Service",
    "name": "LedgerLark",
    "promise": "Books closed by the fifth of each month.",
    "status": "draft"
  },
  "action": {
    "$id": "https://api.sb/ledgerlark.com/actions/action_1",
    "operation": "Service.create",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/ledgerlark.com/actions/action_1"
  }
}
```

**SDK**

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

const service = await $.Service.create({ name: 'LedgerLark', promise: 'Books closed by the fifth of each month.' })
```

**CLI**

```bash
npx startup-builder do Service.create --json '{"name":"LedgerLark","promise":"Books closed by the fifth of each month."}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Service.create({ name: 'LedgerLark', promise: 'Books closed by the fifth of each month.' })"
  }
}
```

## Example
A bookkeeping Service warrants a reconciled month by the fifth working day. Agents do the matching, and a Human accountant reviews exceptions.