# Create a metaobject

> Create a record of a metaobject definition.

`POST /rest/api/metaobjects`

Creates a Metaobject resource.

Creates a metaobject - one record of a [definition](/api/product-management/metaobject-definitions/). Reference the `definition`, give it a `handle` (a unique slug within its type), and supply the `fields` values. Each field is validated against the definition's `fieldDefinitions`.

## Headers

| Name                         | Type     | Required | Description                                                                                                                                      |
| ---------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `X-Flowkiwi-Organization-Id` | `string` | Yes      | The organization the request acts as. Determines the identity, permissions and ownership applied when reading or modifying data on the instance. |

## Request body

| Property     | Type                                                   | Required | Description                                                         |
| ------------ | ------------------------------------------------------ | -------- | ------------------------------------------------------------------- |
| `definition` | `MetaobjectDefinition.MetaobjectDefinitionCreateInput` | Yes      | The `MetaobjectDefinition` (IRI) this metaobject is a record of.    |
| `handle`     | `string`                                               | Yes      | The metaobject's unique slug within its definition type.            |
| `status`     | `"DRAFT" \| "ACTIVE"`                                  | -        | The publication status of the metaobject.                           |
| `fields`     | `MetaobjectFieldInput[]`                               | -        | The field values of the metaobject, one entry per field definition. |

## Response

**201** - Metaobject resource created

| Property      | Type                  | Required | Description                                                                                  |
| ------------- | --------------------- | -------- | -------------------------------------------------------------------------------------------- |
| `@context`    | `object`              | -        |                                                                                              |
| `@id`         | `string`              | Yes      |                                                                                              |
| `@type`       | `string`              | Yes      |                                                                                              |
| `id`          | `string`              | -        | The resource's unique identifier (UUID).                                                     |
| `definition`  | `string`              | -        | The `MetaobjectDefinition` (IRI) this metaobject is a record of.                             |
| `handle`      | `string`              | -        | The metaobject's unique slug within its definition type.                                     |
| `status`      | `"DRAFT" \| "ACTIVE"` | -        | The publication status of the metaobject.                                                    |
| `displayName` | `string \| null`      | -        | The human-readable label, derived from the field named by the definition's displayNameField. |

## Errors

**400** - Invalid input

| Property   | Type             | Required | Description                                                                                                                          |
| ---------- | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `@context` | `object`         | -        |                                                                                                                                      |
| `@id`      | `string`         | Yes      |                                                                                                                                      |
| `@type`    | `string`         | Yes      |                                                                                                                                      |
| `title`    | `string \| null` | -        | A short, human-readable summary of the problem.                                                                                      |
| `detail`   | `string \| null` | -        | A human-readable explanation specific to this occurrence of the problem.                                                             |
| `status`   | `number \| null` | -        |                                                                                                                                      |
| `instance` | `string \| null` | -        | A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. |
| `type`     | `string`         | -        | A URI reference that identifies the problem type                                                                                     |

**403** - Access denied. The caller is missing one or more identity permissions required for this operation.

| Property             | Type       | Required | Description                                                                                                                                |
| -------------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `@context`           | `object`   | -        |                                                                                                                                            |
| `@id`                | `string`   | Yes      |                                                                                                                                            |
| `@type`              | `string`   | Yes      |                                                                                                                                            |
| `type`               | `string`   | -        |                                                                                                                                            |
| `title`              | `string`   | -        |                                                                                                                                            |
| `status`             | `integer`  | -        |                                                                                                                                            |
| `detail`             | `string`   | -        |                                                                                                                                            |
| `missingPermissions` | `string[]` | -        | Identity permissions that the caller is missing for this operation. Present only when the 403 is caused by a denied identity:* permission. |

**422** - An error occurred

| Property     | Type             | Required | Description |
| ------------ | ---------------- | -------- | ----------- |
| `@context`   | `object`         | -        |             |
| `@id`        | `string`         | Yes      |             |
| `@type`      | `string`         | Yes      |             |
| `status`     | `integer`        | -        |             |
| `violations` | `object[]`       | -        |             |
| `detail`     | `string`         | -        |             |
| `type`       | `string`         | -        |             |
| `title`      | `string \| null` | -        |             |
| `instance`   | `string \| null` | -        |             |

## Examples

### Example request

```bash
curl -X POST 'https://<tenant>.product-management.flowkiwi.net/rest/api/metaobjects' \
  -H 'Authorization: Bearer {token}' \
  -H 'X-Flowkiwi-Organization-Id: <org_id>' \
  -H 'Accept: application/ld+json' \
  -H 'Content-Type: application/ld+json' \
  -d '{
  "definition": "/rest/api/metaobject_definitions/019afc01-1a2b-7c3d-8e4f-0a1b2c3d4e5f",
  "handle": "mens-shoes-eu",
  "status": "ACTIVE",
  "fields": [
    {
      "key": "title",
      "value": "EU men's shoes"
    },
    {
      "key": "body",
      "value": "EU 40 = 25.5 cm, EU 41 = 26.2 cm, EU 42 = 27 cm"
    }
  ]
}'
```

### Example response

```json
{
  "@context": "/contexts/Metaobject",
  "@id": "/rest/api/metaobjects/019afc10-4d5e-7f60-9b71-3c4d5e6f7081",
  "@type": "Metaobject",
  "id": "019afc10-4d5e-7f60-9b71-3c4d5e6f7081",
  "definition": "/rest/api/metaobject_definitions/019afc01-1a2b-7c3d-8e4f-0a1b2c3d4e5f",
  "handle": "mens-shoes-eu",
  "status": "ACTIVE",
  "displayName": "EU men's shoes",
  "fields": [
    {
      "key": "title",
      "value": "EU men's shoes",
      "type": "/rest/api/metafield_definition_types/single_line_text_field",
      "metaobject": []
    },
    {
      "key": "body",
      "value": "EU 40 = 25.5 cm, EU 41 = 26.2 cm, EU 42 = 27 cm",
      "type": "/rest/api/metafield_definition_types/multi_line_text_field",
      "metaobject": []
    }
  ],
  "createdAt": "2026-01-15T09:30:00+00:00",
  "updatedAt": "2026-02-03T14:45:12+00:00"
}
```
