---
title: "Create 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.

# Create a style profile

Path: CloudRaker Workspace API › Style profiles

`POST /style-profiles`

Creates a profile: logo, colours, fonts, page, heading and table rules. Every field but `name` has a default, so the smallest legal body is `{"name": "House style"}` and it already composes. `isDefault: true` clears the flag on every other profile. Authorization: org admin.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Request body

_Required._

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

## Example request

```json
{
  "name": "string",
  "logoFileId": null,
  "colors": {},
  "fonts": {},
  "page": {},
  "headings": {},
  "table": {},
  "isDefault": false
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.cloudraker.com/style-profiles \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "string",
  "logoFileId": null,
  "colors": {},
  "fonts": {},
  "page": {},
  "headings": {},
  "table": {},
  "isDefault": false
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/style-profiles';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    name: 'string',
    logoFileId: null,
    colors: {},
    fonts: {},
    page: {},
    headings: {},
    table: {},
    isDefault: false
  })
};

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"

payload = {
    "name": "string",
    "logoFileId": None,
    "colors": {},
    "fonts": {},
    "page": {},
    "headings": {},
    "table": {},
    "isDefault": False
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 201

The new 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` (`createStyleProfile.response.201.data`; object, required)
  - `name` (`createStyleProfile.response.201.data.name`; string, required)
    - minLength 1; maxLength 120
  - `id` (`createStyleProfile.response.201.data.id`; string, required)
    - example `"sty_01J9ZQ8YV3K7M2N4P6R8T0W2X4"`
  - `createdAt` (`createStyleProfile.response.201.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` (`createStyleProfile.response.201.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` (`createStyleProfile.response.201.data.createdBy`; string, required)
  - `logoFileId` (`createStyleProfile.response.201.data.logoFileId`; any of, optional)
    - default `null`
    - any of: `string`, `null`
  - `colors` (`createStyleProfile.response.201.data.colors`; object, optional)
    - default `{}`
    - `primary` (`createStyleProfile.response.201.data.colors.primary`; string, optional)
      - pattern `^#[0-9a-fA-F]{6}$`; default `"#1F6FEB"`; example `"#1F6FEB"`
    - `secondary` (`createStyleProfile.response.201.data.colors.secondary`; string, optional)
      - pattern `^#[0-9a-fA-F]{6}$`; default `"#6E7781"`; example `"#1F6FEB"`
    - `text` (`createStyleProfile.response.201.data.colors.text`; string, optional)
      - pattern `^#[0-9a-fA-F]{6}$`; default `"#111111"`; example `"#1F6FEB"`
  - `fonts` (`createStyleProfile.response.201.data.fonts`; object, optional)
    - default `{}`
    - `body` (`createStyleProfile.response.201.data.fonts.body`; string, optional)
      - minLength 1; maxLength 64; default `"Noto Serif"`
    - `heading` (`createStyleProfile.response.201.data.fonts.heading`; string, optional)
      - minLength 1; maxLength 64; default `"Roboto"`
    - `baseSize` (`createStyleProfile.response.201.data.fonts.baseSize`; number, optional)
      - min 7; max 18; default `10.5`
  - `page` (`createStyleProfile.response.201.data.page`; object, optional)
    - default `{}`
    - `paper` (`createStyleProfile.response.201.data.page.paper`; string, optional)
      - one of `"a4"`, `"us-letter"`; default `"a4"`
    - `margins` (`createStyleProfile.response.201.data.page.margins`; object, optional)
      - default `{}`
      - `top` (`createStyleProfile.response.201.data.page.margins.top`; number, optional)
        - min 1; max 5; default `2.2`
      - `bottom` (`createStyleProfile.response.201.data.page.margins.bottom`; number, optional)
        - min 1; max 5; default `2.2`
      - `left` (`createStyleProfile.response.201.data.page.margins.left`; number, optional)
        - min 1; max 5; default `2`
      - `right` (`createStyleProfile.response.201.data.page.margins.right`; number, optional)
        - min 1; max 5; default `2`
    - `headerText` (`createStyleProfile.response.201.data.page.headerText`; string, optional)
      - maxLength 200; default `""`
    - `footerText` (`createStyleProfile.response.201.data.page.footerText`; string, optional)
      - maxLength 200; default `""`
    - `pageNumbers` (`createStyleProfile.response.201.data.page.pageNumbers`; boolean, optional)
      - default `true`
  - `headings` (`createStyleProfile.response.201.data.headings`; object, optional)
    - default `{}`
    - `numbered` (`createStyleProfile.response.201.data.headings.numbered`; boolean, optional)
      - default `false`
    - `color` (`createStyleProfile.response.201.data.headings.color`; string, optional)
      - one of `"primary"`, `"text"`; default `"primary"`
  - `table` (`createStyleProfile.response.201.data.table`; object, optional)
    - default `{}`
    - `headerFill` (`createStyleProfile.response.201.data.table.headerFill`; string, optional)
      - one of `"primary"`, `"secondary"`, `"none"`; default `"secondary"`
    - `stroke` (`createStyleProfile.response.201.data.table.stroke`; boolean, optional)
      - default `true`
  - `isDefault` (`createStyleProfile.response.201.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` (`createStyleProfile.response.400.error`; string, required) — The sentence a human reads.
- `error_code` (`createStyleProfile.response.400.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`createStyleProfile.response.400.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`createStyleProfile.response.400.issues.path`; string, required)
  - `code` (`createStyleProfile.response.400.issues.code`; string, required)
  - `message` (`createStyleProfile.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` (`createStyleProfile.response.403.error`; string, required) — The sentence a human reads.
- `error_code` (`createStyleProfile.response.403.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`createStyleProfile.response.403.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`createStyleProfile.response.403.issues.path`; string, required)
  - `code` (`createStyleProfile.response.403.issues.code`; string, required)
  - `message` (`createStyleProfile.response.403.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` (`createStyleProfile.response.422.error`; string, required) — The sentence a human reads.
- `error_code` (`createStyleProfile.response.422.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`createStyleProfile.response.422.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`createStyleProfile.response.422.issues.path`; string, required)
  - `code` (`createStyleProfile.response.422.issues.code`; string, required)
  - `message` (`createStyleProfile.response.422.issues.message`; string, required)


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