---
title: "Update a space type"
---

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

# Update a space type

Path: CloudRaker Workspace API › Workspace Spaces

`PATCH /space-types/{spaceTypeId}`

Updates a space type's ontology extraction configuration: `ontology.prompt` (freeform guidance appended to the extraction instructions, max 4000 chars), `ontology.entities` (allowed entity types as `{ key, description? }` — when non-empty this list replaces the built-in types and extracted entities are validated against it), and `ontology.includeDateTime` (includes the current date and time for relative-date normalization). Configuration takes effect on future ingests only — re-ingest files to apply it. Authorization: organization administrators only — other callers get 403. Returns 200 `{ spaceType }`; 404 if the space type does not exist.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceTypeId` (`updateSpaceType.path.spaceTypeId`; string, required)

## Request body

_Required._

- `ontology` (`updateSpaceType.ontology`; object, required)
  - `prompt` (`updateSpaceType.ontology.prompt`; string, optional) — Freeform guidance appended to the extraction instructions.
    - maxLength 4000
  - `entities` (`updateSpaceType.ontology.entities`; array<object>, optional) — Allowed entity types. When non-empty this list REPLACES the built-in types; extracted entities are validated against these keys.
    - `key` (`updateSpaceType.ontology.entities.key`; string, required)
      - pattern `^[a-z][a-z0-9_-]{0,63}$`; example `"vendor"`
    - `description` (`updateSpaceType.ontology.entities.description`; string, optional)
      - maxLength 500; example `"A supplier organization"`
  - `includeDateTime` (`updateSpaceType.ontology.includeDateTime`; boolean, optional) — Include the current date and time during extraction.

## Example request

```json
{
  "ontology": {
    "prompt": "string",
    "entities": [
      {
        "key": "vendor",
        "description": "A supplier organization"
      }
    ],
    "includeDateTime": true
  }
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.cloudraker.com/space-types/<spaceTypeId>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "ontology": {
    "prompt": "string",
    "entities": [
      {
        "key": "vendor",
        "description": "A supplier organization"
      }
    ],
    "includeDateTime": true
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/space-types/<spaceTypeId>';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    ontology: {
      prompt: 'string',
      entities: [{key: 'vendor', description: 'A supplier organization'}],
      includeDateTime: true
    }
  })
};

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/space-types/<spaceTypeId>"

payload = { "ontology": {
        "prompt": "string",
        "entities": [
            {
                "key": "vendor",
                "description": "A supplier organization"
            }
        ],
        "includeDateTime": True
    } }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

The updated space type.

#### Example

```json
{
  "spaceType": {
    "identifier": "legal",
    "title": "Legal",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "createdBy": "string",
    "ontology": {
      "prompt": "string",
      "entities": [
        {
          "key": "vendor",
          "description": "A supplier organization"
        }
      ],
      "includeDateTime": true
    }
  }
}
```

- `spaceType` (`updateSpaceType.response.200.spaceType`; object, required)
  - `identifier` (`updateSpaceType.response.200.spaceType.identifier`; string, required) — The stable lowercase key.
    - example `"legal"`
  - `title` (`updateSpaceType.response.200.spaceType.title`; string, required)
    - example `"Legal"`
  - `createdAt` (`updateSpaceType.response.200.spaceType.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` (`updateSpaceType.response.200.spaceType.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` (`updateSpaceType.response.200.spaceType.createdBy`; string, optional) — User id of the creator.
  - `ontology` (`updateSpaceType.response.200.spaceType.ontology`; object, optional) — Per-space-type extraction configuration, applied to future ingests.
    - `prompt` (`updateSpaceType.response.200.spaceType.ontology.prompt`; string, optional) — Freeform guidance appended to the extraction instructions.
      - maxLength 4000
    - `entities` (`updateSpaceType.response.200.spaceType.ontology.entities`; array<object>, optional) — Allowed entity types. When non-empty this list REPLACES the built-in types; extracted entities are validated against these keys.
      - `key` (`updateSpaceType.response.200.spaceType.ontology.entities.key`; string, required)
        - pattern `^[a-z][a-z0-9_-]{0,63}$`; example `"vendor"`
      - `description` (`updateSpaceType.response.200.spaceType.ontology.entities.description`; string, optional)
        - maxLength 500; example `"A supplier organization"`
    - `includeDateTime` (`updateSpaceType.response.200.spaceType.ontology.includeDateTime`; boolean, optional) — Include the current date and time during extraction.

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`updateSpaceType.response.400.success`; boolean, required)
  - one of `false`
- `error` (`updateSpaceType.response.400.error`; array<unknown>, required)
- `data` (`updateSpaceType.response.400.data`; unknown, required)

### 404

`not_found` — the space type does not exist.


Source: https://docs.cloudraker.com/workspace/api/workspace-spaces/update-space-type/index.md
