---
title: "Get a data-object definition"
---

> 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.

# Get a data-object definition

Path: CloudRaker Workspace API › Data Objects

`GET /objects/definitions/{definitionId}`

Fetches one org-level definition by id, including its full field list, groups, labels, and current `version`. Authorization: any authenticated org member. Unknown id returns 404.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `definitionId` (`getObjectDefinition.path.definitionId`; string, required)

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.cloudraker.com/objects/definitions/<definitionId>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/objects/definitions/<definitionId>';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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/objects/definitions/<definitionId>"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The definition.

#### Example

```json
{
  "definition": {
    "_id": "def_contract",
    "nameSingular": "contract",
    "namePlural": "contracts",
    "labelSingular": "Contract",
    "labelPlural": "Contracts",
    "description": "string",
    "icon": "string",
    "color": "string",
    "labelFieldKey": "string",
    "fields": [
      {
        "property1": null,
        "property2": null
      }
    ],
    "fieldGroups": [
      {
        "property1": null,
        "property2": null
      }
    ],
    "version": 0,
    "archivedAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "createdBy": "string"
  }
}
```

- `definition` (`getObjectDefinition.response.200.definition`; object, required)
  - `_id` (`getObjectDefinition.response.200.definition._id`; string, required)
    - example `"def_contract"`
  - `nameSingular` (`getObjectDefinition.response.200.definition.nameSingular`; string, required)
    - example `"contract"`
  - `namePlural` (`getObjectDefinition.response.200.definition.namePlural`; string, required)
    - example `"contracts"`
  - `labelSingular` (`getObjectDefinition.response.200.definition.labelSingular`; string, required)
    - example `"Contract"`
  - `labelPlural` (`getObjectDefinition.response.200.definition.labelPlural`; string, required)
    - example `"Contracts"`
  - `description` (`getObjectDefinition.response.200.definition.description`; string, required)
  - `icon` (`getObjectDefinition.response.200.definition.icon`; string, required)
  - `color` (`getObjectDefinition.response.200.definition.color`; string | null, required)
  - `labelFieldKey` (`getObjectDefinition.response.200.definition.labelFieldKey`; string, required) — Field key whose value is the object’s display label.
  - `fields` (`getObjectDefinition.response.200.definition.fields`; array<map<unknown>>, required) — The type-discriminated field model (13 field types plus composites). Emitted permissively so the resource stays navigable.
  - `fieldGroups` (`getObjectDefinition.response.200.definition.fieldGroups`; array<map<unknown>>, required)
  - `version` (`getObjectDefinition.response.200.definition.version`; number, required) — Bumps only on a schema-affecting change.
  - `archivedAt` (`getObjectDefinition.response.200.definition.archivedAt`; any of, required)
    - any of: `string`, `null`
  - `createdAt` (`getObjectDefinition.response.200.definition.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` (`getObjectDefinition.response.200.definition.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` (`getObjectDefinition.response.200.definition.createdBy`; string, required)

### 404

No definition with that id.


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