---
title: "Update a style profile"
---

> 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 style profile

Path: CloudRaker Workspace API › Style profiles

`PATCH /style-profiles/{profileId}`

Replaces the top-level fields the body names — a nested object it names is replaced whole, never deep-merged, so a partial `colors` re-defaults the colours it omits. Any change drops the compiled template so the next composition re-caches. Authorization: org admin.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `profileId` (`updateStyleProfile.path.profileId`; string, required)
  - minLength 1; maxLength 128

## Request body

_Required._

- `name` (`updateStyleProfile.name`; string, optional)
  - minLength 1; maxLength 120
- `logoFileId` (`updateStyleProfile.logoFileId`; any of, optional)
  - any of: `string`, `null`
- `colors` (`updateStyleProfile.colors`; object, optional)
  - `primary` (`updateStyleProfile.colors.primary`; string, optional)
    - pattern `^#[0-9a-fA-F]{6}$`; default `"#1F6FEB"`; example `"#1F6FEB"`
  - `secondary` (`updateStyleProfile.colors.secondary`; string, optional)
    - pattern `^#[0-9a-fA-F]{6}$`; default `"#6E7781"`; example `"#1F6FEB"`
  - `text` (`updateStyleProfile.colors.text`; string, optional)
    - pattern `^#[0-9a-fA-F]{6}$`; default `"#111111"`; example `"#1F6FEB"`
- `fonts` (`updateStyleProfile.fonts`; object, optional)
  - `body` (`updateStyleProfile.fonts.body`; string, optional)
    - minLength 1; maxLength 64; default `"Noto Serif"`
  - `heading` (`updateStyleProfile.fonts.heading`; string, optional)
    - minLength 1; maxLength 64; default `"Roboto"`
  - `baseSize` (`updateStyleProfile.fonts.baseSize`; number, optional)
    - min 7; max 18; default `10.5`
- `page` (`updateStyleProfile.page`; object, optional)
  - `paper` (`updateStyleProfile.page.paper`; string, optional)
    - one of `"a4"`, `"us-letter"`; default `"a4"`
  - `margins` (`updateStyleProfile.page.margins`; object, optional)
    - default `{}`
    - `top` (`updateStyleProfile.page.margins.top`; number, optional)
      - min 1; max 5; default `2.2`
    - `bottom` (`updateStyleProfile.page.margins.bottom`; number, optional)
      - min 1; max 5; default `2.2`
    - `left` (`updateStyleProfile.page.margins.left`; number, optional)
      - min 1; max 5; default `2`
    - `right` (`updateStyleProfile.page.margins.right`; number, optional)
      - min 1; max 5; default `2`
  - `headerText` (`updateStyleProfile.page.headerText`; string, optional)
    - maxLength 200; default `""`
  - `footerText` (`updateStyleProfile.page.footerText`; string, optional)
    - maxLength 200; default `""`
  - `pageNumbers` (`updateStyleProfile.page.pageNumbers`; boolean, optional)
    - default `true`
- `headings` (`updateStyleProfile.headings`; object, optional)
  - `numbered` (`updateStyleProfile.headings.numbered`; boolean, optional)
    - default `false`
  - `color` (`updateStyleProfile.headings.color`; string, optional)
    - one of `"primary"`, `"text"`; default `"primary"`
- `table` (`updateStyleProfile.table`; object, optional)
  - `headerFill` (`updateStyleProfile.table.headerFill`; string, optional)
    - one of `"primary"`, `"secondary"`, `"none"`; default `"secondary"`
  - `stroke` (`updateStyleProfile.table.stroke`; boolean, optional)
    - default `true`
- `isDefault` (`updateStyleProfile.isDefault`; boolean, optional)

## Example request

```json
{
  "name": "string",
  "logoFileId": "string",
  "colors": {
    "primary": "#1F6FEB",
    "secondary": "#1F6FEB",
    "text": "#1F6FEB"
  },
  "fonts": {
    "body": "Noto Serif",
    "heading": "Roboto",
    "baseSize": 10.5
  },
  "page": {
    "paper": "a4",
    "margins": {},
    "headerText": "",
    "footerText": "",
    "pageNumbers": true
  },
  "headings": {
    "numbered": false,
    "color": "primary"
  },
  "table": {
    "headerFill": "primary",
    "stroke": true
  },
  "isDefault": true
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.cloudraker.com/style-profiles/<profileId>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "string",
  "logoFileId": "string",
  "colors": {
    "primary": "#1F6FEB",
    "secondary": "#1F6FEB",
    "text": "#1F6FEB"
  },
  "fonts": {
    "body": "Noto Serif",
    "heading": "Roboto",
    "baseSize": 10.5
  },
  "page": {
    "paper": "a4",
    "margins": {},
    "headerText": "",
    "footerText": "",
    "pageNumbers": true
  },
  "headings": {
    "numbered": false,
    "color": "primary"
  },
  "table": {
    "headerFill": "primary",
    "stroke": true
  },
  "isDefault": true
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/style-profiles/<profileId>';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    name: 'string',
    logoFileId: 'string',
    colors: {primary: '#1F6FEB', secondary: '#1F6FEB', text: '#1F6FEB'},
    fonts: {body: 'Noto Serif', heading: 'Roboto', baseSize: 10.5},
    page: {paper: 'a4', margins: {}, headerText: '', footerText: '', pageNumbers: true},
    headings: {numbered: false, color: 'primary'},
    table: {headerFill: 'primary', stroke: true},
    isDefault: 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/style-profiles/<profileId>"

payload = {
    "name": "string",
    "logoFileId": "string",
    "colors": {
        "primary": "#1F6FEB",
        "secondary": "#1F6FEB",
        "text": "#1F6FEB"
    },
    "fonts": {
        "body": "Noto Serif",
        "heading": "Roboto",
        "baseSize": 10.5
    },
    "page": {
        "paper": "a4",
        "margins": {},
        "headerText": "",
        "footerText": "",
        "pageNumbers": True
    },
    "headings": {
        "numbered": False,
        "color": "primary"
    },
    "table": {
        "headerFill": "primary",
        "stroke": True
    },
    "isDefault": True
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

The updated profile.

#### Example

```json
{
  "data": {
    "name": "string",
    "logoFileId": null,
    "colors": {},
    "fonts": {},
    "page": {},
    "headings": {},
    "table": {},
    "isDefault": false,
    "id": "sty_01J9ZQ8YV3K7M2N4P6R8T0W2X4",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "createdBy": "string"
  }
}
```

- `data` (`updateStyleProfile.response.200.data`; object, required)
  - `name` (`updateStyleProfile.response.200.data.name`; string, required)
    - minLength 1; maxLength 120
  - `id` (`updateStyleProfile.response.200.data.id`; string, required)
    - example `"sty_01J9ZQ8YV3K7M2N4P6R8T0W2X4"`
  - `createdAt` (`updateStyleProfile.response.200.data.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` (`updateStyleProfile.response.200.data.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` (`updateStyleProfile.response.200.data.createdBy`; string, required)
  - `logoFileId` (`updateStyleProfile.response.200.data.logoFileId`; any of, optional)
    - default `null`
    - any of: `string`, `null`
  - `colors` (`updateStyleProfile.response.200.data.colors`; object, optional)
    - default `{}`
    - `primary` (`updateStyleProfile.response.200.data.colors.primary`; string, optional)
      - pattern `^#[0-9a-fA-F]{6}$`; default `"#1F6FEB"`; example `"#1F6FEB"`
    - `secondary` (`updateStyleProfile.response.200.data.colors.secondary`; string, optional)
      - pattern `^#[0-9a-fA-F]{6}$`; default `"#6E7781"`; example `"#1F6FEB"`
    - `text` (`updateStyleProfile.response.200.data.colors.text`; string, optional)
      - pattern `^#[0-9a-fA-F]{6}$`; default `"#111111"`; example `"#1F6FEB"`
  - `fonts` (`updateStyleProfile.response.200.data.fonts`; object, optional)
    - default `{}`
    - `body` (`updateStyleProfile.response.200.data.fonts.body`; string, optional)
      - minLength 1; maxLength 64; default `"Noto Serif"`
    - `heading` (`updateStyleProfile.response.200.data.fonts.heading`; string, optional)
      - minLength 1; maxLength 64; default `"Roboto"`
    - `baseSize` (`updateStyleProfile.response.200.data.fonts.baseSize`; number, optional)
      - min 7; max 18; default `10.5`
  - `page` (`updateStyleProfile.response.200.data.page`; object, optional)
    - default `{}`
    - `paper` (`updateStyleProfile.response.200.data.page.paper`; string, optional)
      - one of `"a4"`, `"us-letter"`; default `"a4"`
    - `margins` (`updateStyleProfile.response.200.data.page.margins`; object, optional)
      - default `{}`
      - `top` (`updateStyleProfile.response.200.data.page.margins.top`; number, optional)
        - min 1; max 5; default `2.2`
      - `bottom` (`updateStyleProfile.response.200.data.page.margins.bottom`; number, optional)
        - min 1; max 5; default `2.2`
      - `left` (`updateStyleProfile.response.200.data.page.margins.left`; number, optional)
        - min 1; max 5; default `2`
      - `right` (`updateStyleProfile.response.200.data.page.margins.right`; number, optional)
        - min 1; max 5; default `2`
    - `headerText` (`updateStyleProfile.response.200.data.page.headerText`; string, optional)
      - maxLength 200; default `""`
    - `footerText` (`updateStyleProfile.response.200.data.page.footerText`; string, optional)
      - maxLength 200; default `""`
    - `pageNumbers` (`updateStyleProfile.response.200.data.page.pageNumbers`; boolean, optional)
      - default `true`
  - `headings` (`updateStyleProfile.response.200.data.headings`; object, optional)
    - default `{}`
    - `numbered` (`updateStyleProfile.response.200.data.headings.numbered`; boolean, optional)
      - default `false`
    - `color` (`updateStyleProfile.response.200.data.headings.color`; string, optional)
      - one of `"primary"`, `"text"`; default `"primary"`
  - `table` (`updateStyleProfile.response.200.data.table`; object, optional)
    - default `{}`
    - `headerFill` (`updateStyleProfile.response.200.data.table.headerFill`; string, optional)
      - one of `"primary"`, `"secondary"`, `"none"`; default `"secondary"`
    - `stroke` (`updateStyleProfile.response.200.data.table.stroke`; boolean, optional)
      - default `true`
  - `isDefault` (`updateStyleProfile.response.200.data.isDefault`; boolean, optional)
    - default `false`

### 400

`validation_failed` — a field is outside its allowed value space.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`updateStyleProfile.response.400.error`; string, required) — The sentence a human reads.
- `error_code` (`updateStyleProfile.response.400.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`updateStyleProfile.response.400.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`updateStyleProfile.response.400.issues.path`; string, required)
  - `code` (`updateStyleProfile.response.400.issues.code`; string, required)
  - `message` (`updateStyleProfile.response.400.issues.message`; string, required)

### 403

`forbidden` — changing the organization’s brand is an admin action.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`updateStyleProfile.response.403.error`; string, required) — The sentence a human reads.
- `error_code` (`updateStyleProfile.response.403.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`updateStyleProfile.response.403.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`updateStyleProfile.response.403.issues.path`; string, required)
  - `code` (`updateStyleProfile.response.403.issues.code`; string, required)
  - `message` (`updateStyleProfile.response.403.issues.message`; string, required)

### 404

`not_found` — no such style profile in this organization.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`updateStyleProfile.response.404.error`; string, required) — The sentence a human reads.
- `error_code` (`updateStyleProfile.response.404.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`updateStyleProfile.response.404.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`updateStyleProfile.response.404.issues.path`; string, required)
  - `code` (`updateStyleProfile.response.404.issues.code`; string, required)
  - `message` (`updateStyleProfile.response.404.issues.message`; string, required)

### 422

`unknown_font_family` — the family is not one the renderer carries (the sentence lists the legal ones); `logo_too_large` / `logo_unavailable` — the logo file is over 2 MiB or has no stored bytes; `template_render_failed` — the profile does not compile, with the typst diagnostic.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`updateStyleProfile.response.422.error`; string, required) — The sentence a human reads.
- `error_code` (`updateStyleProfile.response.422.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`updateStyleProfile.response.422.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`updateStyleProfile.response.422.issues.path`; string, required)
  - `code` (`updateStyleProfile.response.422.issues.code`; string, required)
  - `message` (`updateStyleProfile.response.422.issues.message`; string, required)


Source: https://docs.cloudraker.com/workspace/api/style-profiles/update-style-profile/index.md
