
# fob-mdm objects

An object is a kind of record your organization keeps, such as Vendor. Commands that take an object accept its id or its slug. See [Objects and Fields](/docs/concepts/objects-and-fields).

```
fob-mdm objects <action> [target] [options]
```

| Action | Description |
|---|---|
| [`list`](#objects-list) | List objects, A to Z |
| [`show`](#objects-show) | Show one object |
| [`create`](#objects-create) | Create an object |
| [`edit`](#objects-edit) | Rename an object (the slug can't change) |
| [`delete`](#objects-delete) | Delete an object with all its fields, records and history |

## objects list

List objects, A to Z.

```
fob-mdm objects list [options]
```

| Argument or option | Required | Default | Description |
|---|---|---|---|
| `--page <n>` |  | `1` | Page number. |
| `--limit <n>` |  | `100` | Rows per page (max 500). |
| `--all` |  |  | Fetch every page (up to 15000 rows). |
| `--json` |  |  | Print the raw JSON response. |
| `--q <text>` |  |  | Match part of the label. |

```bash
fob-mdm objects list
fob-mdm objects list --q vend
fob-mdm objects list --json
```

```
ID  SLUG      LABEL
----------------------
2   customer  Customer
1   vendor    Vendor
```

API: [List Objects](/docs/api/endpoints/objects/list)

## objects show

Show one object.

```
fob-mdm objects show <object> [options]
```

| Argument or option | Required | Default | Description |
|---|---|---|---|
| `<object>` | Yes |  | Object id or slug. |
| `--json` |  |  | Print the raw JSON response. |

```bash
fob-mdm objects show vendor
fob-mdm objects show 1 --json
```

API: [Get Object](/docs/api/endpoints/objects/get)

## objects create

Create an object.

```
fob-mdm objects create --slug <slug> --label <label> [options]
```

| Argument or option | Required | Default | Description |
|---|---|---|---|
| `--slug <slug>` | Yes |  | Machine name, e.g. vendor. Can't be changed later. |
| `--label <label>` | Yes |  | Display name, e.g. Vendor. |
| `--json` |  |  | Print the raw JSON response. |

```bash
fob-mdm objects create --slug vendor --label Vendor
```

Add its fields next with [`fob-mdm fields create`](/docs/cli/fields#fields-create).

API: [Create Object](/docs/api/endpoints/objects/create)

## objects edit

Rename an object (the slug can't change).

```
fob-mdm objects edit <object> --label <label> [options]
```

| Argument or option | Required | Default | Description |
|---|---|---|---|
| `<object>` | Yes |  | Object id or slug. |
| `--label <label>` | Yes |  | New display name. |
| `--json` |  |  | Print the raw JSON response. |

```bash
fob-mdm objects edit vendor --label Supplier
```

API: [Update Object](/docs/api/endpoints/objects/update)

## objects delete

Delete an object with all its fields, records and history.

```
fob-mdm objects delete <object> [options]
```

| Argument or option | Required | Default | Description |
|---|---|---|---|
| `<object>` | Yes |  | Object id or slug. |
| `-y, --yes` |  |  | Skip the confirmation. |

```bash
fob-mdm objects delete vendor
fob-mdm objects delete vendor --yes
```

Deletes the object with all its fields, records, values and history. This can't be undone. It asks first unless you pass `--yes`.

API: [Delete Object](/docs/api/endpoints/objects/delete)

Every command also takes `--profile <name>` and `--help`. See [Command-line Interface](/docs/cli).
