---
title: "Create an object"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an object

Path: CloudRaker Workspace API › Data Objects

`POST /spaces/{spaceId}/objects/{definitionId}`

Creates one object of a definition within a space. Authorization: requires `space:contribute` on `:spaceId` — lacking it gives **403** (no `space:read` → 404). Body: `{ data, fieldMeta? }` — `data` is field values keyed by field key (validated against the definition via JSON Schema; defaults applied); optional `fieldMeta` accepts only `source`/`locked` per key. A `unique`-field collision returns 409 `duplicate_value` (with `fieldKey`); invalid data → 422 `validation_failed`. Returns 201 with `{ object }`.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`createObject.path.spaceId`; string, required)
- `definitionId` (`createObject.path.definitionId`; string, required)

## Request body

_Required._

- `data` (`createObject.data`; map<unknown>, required) — Field values keyed by field key.
- `fieldMeta` (`createObject.fieldMeta`; map<map<unknown>>, optional) — Per-field metadata keyed by field key. Only `source` and `locked` are accepted.

## Example request

```json
{
  "data": {
    "property1": null,
    "property2": null
  },
  "fieldMeta": {
    "property1": {
      "property1": null,
      "property2": null
    },
    "property2": {
      "property1": null,
      "property2": null
    }
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/spaces/<spaceId>/objects/<definitionId>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "data": {
    "property1": null,
    "property2": null
  },
  "fieldMeta": {
    "property1": {
      "property1": null,
      "property2": null
    },
    "property2": {
      "property1": null,
      "property2": null
    }
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/spaces/<spaceId>/objects/<definitionId>';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    data: {property1: null, property2: null},
    fieldMeta: {
      property1: {property1: null, property2: null},
      property2: {property1: null, property2: null}
    }
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/spaces/<spaceId>/objects/<definitionId>"

payload = {
    "data": {
        "property1": None,
        "property2": None
    },
    "fieldMeta": {
        "property1": {
            "property1": None,
            "property2": None
        },
        "property2": {
            "property1": None,
            "property2": None
        }
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

The created object.

#### Example

```json
{
  "object": {
    "_id": "string",
    "spaceId": "string",
    "definitionId": "string",
    "definitionVersion": 0,
    "data": {
      "property1": null,
      "property2": null
    },
    "fieldMeta": {
      "property1": {
        "modifiedBy": "string",
        "modifiedAt": "2019-08-24T14:15:22Z",
        "source": "string",
        "locked": true
      },
      "property2": {
        "modifiedBy": "string",
        "modifiedAt": "2019-08-24T14:15:22Z",
        "source": "string",
        "locked": true
      }
    },
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "createdBy": "string",
    "updatedBy": "string",
    "deletedAt": "2019-08-24T14:15:22Z",
    "provenance": {
      "property1": [
        {
          "property1": null,
          "property2": null
        }
      ],
      "property2": [
        {
          "property1": null,
          "property2": null
        }
      ]
    },
    "review": {
      "property1": {
        "status": "pending",
        "by": "string",
        "at": "2019-08-24T14:15:22Z",
        "note": "string"
      },
      "property2": {
        "status": "pending",
        "by": "string",
        "at": "2019-08-24T14:15:22Z",
        "note": "string"
      }
    },
    "origin": {
      "actionRunId": "string",
      "playbookRunId": "string"
    }
  }
}
```

- `object` (`createObject.response.201.object`; object, required)
  - `_id` (`createObject.response.201.object._id`; string, required)
  - `spaceId` (`createObject.response.201.object.spaceId`; string, required)
  - `definitionId` (`createObject.response.201.object.definitionId`; string, required)
  - `definitionVersion` (`createObject.response.201.object.definitionVersion`; number, required)
  - `data` (`createObject.response.201.object.data`; map<unknown>, required) — Field values keyed by field key.
  - `fieldMeta` (`createObject.response.201.object.fieldMeta`; map<object>, required)
  - `createdAt` (`createObject.response.201.object.createdAt`; string, required)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
  - `updatedAt` (`createObject.response.201.object.updatedAt`; string, required)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
  - `createdBy` (`createObject.response.201.object.createdBy`; string, required)
  - `updatedBy` (`createObject.response.201.object.updatedBy`; string, required)
  - `deletedAt` (`createObject.response.201.object.deletedAt`; any of, required)
    - any of: `string`, `null`
  - `provenance` (`createObject.response.201.object.provenance`; map<array<map<unknown>>>, optional) — Per-field grounding: field key → citation pointers, imported verbatim from the extraction feed.
  - `review` (`createObject.response.201.object.review`; map<object>, optional) — Per-field review state. An approved or rejected field is locked against edits.
  - `origin` (`createObject.response.201.object.origin`; object, optional) — Set on create, never patchable.
    - `actionRunId` (`createObject.response.201.object.origin.actionRunId`; string, optional)
    - `playbookRunId` (`createObject.response.201.object.origin.playbookRunId`; string, optional) — Set only when a playbook dispatched the run; callers cannot claim it.

### 403

Missing `space:contribute`.

### 409

`duplicate_value` — a unique-field collision.

### 422

`validation_failed` — `data` fails the definition schema.


Source: https://docs.cloudraker.com/workspace/api/data-objects/create-object/index.md
