> This page is for Workspace app.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cloudraker.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cloudraker.com/_mcp/server.

# Update a style profile

PATCH https://api.cloudraker.com/style-profiles/{profileId}
Content-Type: application/json

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.

Reference: https://docs.cloudraker.com/workspace/api/style-profiles/update-style-profile

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `profileId` (string, required)

### Body (application/json)

This endpoint expects a PatchStyleProfileBody.

- `name` (string, optional)
- `logoFileId` (string, optional, nullable)
- `colors` (PatchStyleProfileBodyColors, optional)
- `fonts` (PatchStyleProfileBodyFonts, optional)
- `page` (PatchStyleProfileBodyPage, optional)
- `headings` (PatchStyleProfileBodyHeadings, optional)
- `table` (PatchStyleProfileBodyTable, optional)
- `isDefault` (boolean, optional)

## Response

### 200

The updated profile.

- `data` (StyleProfile, required)

## Errors

### 400 Bad Request Error

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

- `error` (string, required) — The sentence a human reads.
- `error_code` (string, required) — The stable snake_case branch key.
- `issues` (list of ErrorEnvelopeIssuesItems, optional) — Per-field detail, present only on a validation failure.

### 403 Forbidden Error

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

- `error` (string, required) — The sentence a human reads.
- `error_code` (string, required) — The stable snake_case branch key.
- `issues` (list of ErrorEnvelopeIssuesItems, optional) — Per-field detail, present only on a validation failure.

### 404 Not Found Error

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

- `error` (string, required) — The sentence a human reads.
- `error_code` (string, required) — The stable snake_case branch key.
- `issues` (list of ErrorEnvelopeIssuesItems, optional) — Per-field detail, present only on a validation failure.

### 422 Unprocessable Entity Error

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

- `error` (string, required) — The sentence a human reads.
- `error_code` (string, required) — The stable snake_case branch key.
- `issues` (list of ErrorEnvelopeIssuesItems, optional) — Per-field detail, present only on a validation failure.

## Types

### PatchStyleProfileBodyColors

- `primary` (string, optional, default: #1F6FEB)
- `secondary` (string, optional, default: #6E7781)
- `text` (string, optional, default: #111111)

### PatchStyleProfileBodyFonts

- `body` (string, optional, default: Noto Serif)
- `heading` (string, optional, default: Roboto)
- `baseSize` (double, optional, default: 10.5)

### PatchStyleProfileBodyPage

- `paper` (enum, optional, default: a4)
  - Allowed values: `a4`, `us-letter`
- `margins` (PatchStyleProfileBodyPageMargins, optional, default: {})
- `headerText` (string, optional, default: )
- `footerText` (string, optional, default: )
- `pageNumbers` (boolean, optional, default: true)

### PatchStyleProfileBodyHeadings

- `numbered` (boolean, optional, default: false)
- `color` (enum, optional, default: primary)
  - Allowed values: `primary`, `text`

### PatchStyleProfileBodyTable

- `headerFill` (enum, optional, default: secondary)
  - Allowed values: `primary`, `secondary`, `none`
- `stroke` (boolean, optional, default: true)

### StyleProfile

- `name` (string, required)
- `id` (string, required)
- `createdAt` (datetime, required)
- `updatedAt` (datetime, required)
- `createdBy` (string, required)
- `logoFileId` (string, optional, nullable)
- `colors` (StyleProfileColors, optional, default: {})
- `fonts` (StyleProfileFonts, optional, default: {})
- `page` (StyleProfilePage, optional, default: {})
- `headings` (StyleProfileHeadings, optional, default: {})
- `table` (StyleProfileTable, optional, default: {})
- `isDefault` (boolean, optional, default: false)

### ErrorEnvelopeIssuesItems

- `path` (string, required)
- `code` (string, required)
- `message` (string, required)

### PatchStyleProfileBodyPageMargins

- `top` (double, optional, default: 2.2)
- `bottom` (double, optional, default: 2.2)
- `left` (double, optional, default: 2)
- `right` (double, optional, default: 2)

### StyleProfileColors

- `primary` (string, optional, default: #1F6FEB)
- `secondary` (string, optional, default: #6E7781)
- `text` (string, optional, default: #111111)

### StyleProfileFonts

- `body` (string, optional, default: Noto Serif)
- `heading` (string, optional, default: Roboto)
- `baseSize` (double, optional, default: 10.5)

### StyleProfilePage

- `paper` (enum, optional, default: a4)
  - Allowed values: `a4`, `us-letter`
- `margins` (StyleProfilePageMargins, optional, default: {})
- `headerText` (string, optional, default: )
- `footerText` (string, optional, default: )
- `pageNumbers` (boolean, optional, default: true)

### StyleProfileHeadings

- `numbered` (boolean, optional, default: false)
- `color` (enum, optional, default: primary)
  - Allowed values: `primary`, `text`

### StyleProfileTable

- `headerFill` (enum, optional, default: secondary)
  - Allowed values: `primary`, `secondary`, `none`
- `stroke` (boolean, optional, default: true)

### StyleProfilePageMargins

- `top` (double, optional, default: 2.2)
- `bottom` (double, optional, default: 2.2)
- `left` (double, optional, default: 2)
- `right` (double, optional, default: 2)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "data": {
    "name": "string",
    "id": "sty_01J9ZQ8YV3K7M2N4P6R8T0W2X4",
    "createdAt": "2024-01-15T09:30:00Z",
    "updatedAt": "2024-01-15T09:30:00Z",
    "createdBy": "string",
    "logoFileId": "string",
    "colors": {
      "primary": "#1F6FEB",
      "secondary": "#1F6FEB",
      "text": "#1F6FEB"
    },
    "fonts": {
      "body": "Noto Serif",
      "heading": "Roboto",
      "baseSize": 10.5
    },
    "page": {
      "paper": "a4",
      "margins": {
        "top": 2.2,
        "bottom": 2.2,
        "left": 2,
        "right": 2
      },
      "headerText": "",
      "footerText": "",
      "pageNumbers": true
    },
    "headings": {
      "numbered": false,
      "color": "primary"
    },
    "table": {
      "headerFill": "secondary",
      "stroke": true
    },
    "isDefault": false
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.cloudraker.com/style-profiles/profileId"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.cloudraker.com/style-profiles/profileId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.cloudraker.com/style-profiles/profileId"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.cloudraker.com/style-profiles/profileId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.cloudraker.com/style-profiles/profileId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.cloudraker.com/style-profiles/profileId', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.cloudraker.com/style-profiles/profileId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cloudraker.com/style-profiles/profileId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```