---
title: "Get a definition compiled to JSON Schema"
---

> 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 definition compiled to JSON Schema

Path: CloudRaker Workspace API › Data Objects

`GET /objects/definitions/{definitionId}/schema`

Returns the definition compiled to a JSON Schema (`{ schema }`) describing the shape objects of this definition must satisfy — useful for validating object `data` before a create/patch. Authorization: any authenticated org member. Unknown id returns 404.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

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

## Code samples

### cURL

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

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/objects/definitions/<definitionId>/schema';
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>/schema"

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

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

print(response.text)
```

## Responses

### 200

The compiled JSON Schema.

#### Example

```json
{
  "schema": {
    "property1": null,
    "property2": null
  }
}
```

- `schema` (`getObjectDefinitionSchema.response.200.schema`; map<unknown>, required) — JSON Schema an object’s `data` must satisfy for this definition.

### 404

No definition with that id.


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