> 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 saved view

PATCH https://api.cloudraker.com/spaces/{spaceId}/objects/{definitionId}/views/{viewId}
Content-Type: application/json

Partially updates a saved view. Authorization: requires `space:contribute` on `:spaceId` — lacking it gives **403** (no `space:read` → 404). Strict body accepting any of `name`, `fields[]`, `filters[]`, `sorts[]`, `filterLogic`. The seeded default view cannot be renamed → 400 `default_view_not_renamable`; unknown view → 404; invalid body → 422. Returns `{ view }`.

Reference: https://docs.cloudraker.com/api/cloud-raker-api/workspace/data-objects/update-object-view

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: CloudRaker API
  version: 1.0.0
paths:
  /spaces/{spaceId}/objects/{definitionId}/views/{viewId}:
    patch:
      operationId: update-object-view
      summary: Update a saved view
      description: >-
        Partially updates a saved view. Authorization: requires
        `space:contribute` on `:spaceId` — lacking it gives **403** (no
        `space:read` → 404). Strict body accepting any of `name`, `fields[]`,
        `filters[]`, `sorts[]`, `filterLogic`. The seeded default view cannot be
        renamed → 400 `default_view_not_renamable`; unknown view → 404; invalid
        body → 422. Returns `{ view }`.
      tags:
        - dataObjects
      parameters:
        - name: spaceId
          in: path
          required: true
          schema:
            type: string
        - name: definitionId
          in: path
          required: true
          schema:
            type: string
        - name: viewId
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The updated view.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectViewEnvelope'
        '400':
          description: '`default_view_not_renamable` — the default view cannot be renamed.'
          content:
            application/json:
              schema:
                description: Any type
        '403':
          description: Missing `space:contribute`.
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: Unknown view (or missing `space:read`).
          content:
            application/json:
              schema:
                description: Any type
        '422':
          description: '`validation_failed` — invalid body.'
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        description: 'Strict: unknown and server-controlled keys are rejected.'
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                fields:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/SpacesSpaceIdObjectsDefinitionIdViewsViewIdPatchRequestBodyContentApplicationJsonSchemaFieldsItems
                filters:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/SpacesSpaceIdObjectsDefinitionIdViewsViewIdPatchRequestBodyContentApplicationJsonSchemaFiltersItems
                sorts:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/SpacesSpaceIdObjectsDefinitionIdViewsViewIdPatchRequestBodyContentApplicationJsonSchemaSortsItems
                filterLogic:
                  type: string
servers:
  - url: https://api.cloudraker.com
    description: Production
  - url: https://api.staging.raker.one
    description: Staging
  - url: https://api.dev.raker.one
    description: Development
components:
  schemas:
    SpacesSpaceIdObjectsDefinitionIdViewsViewIdPatchRequestBodyContentApplicationJsonSchemaFieldsItems:
      type: object
      properties:
        fieldKey:
          type: string
        isVisible:
          type: boolean
        width:
          type: number
          format: double
        position:
          type: number
          format: double
      required:
        - fieldKey
      title: >-
        SpacesSpaceIdObjectsDefinitionIdViewsViewIdPatchRequestBodyContentApplicationJsonSchemaFieldsItems
    SpacesSpaceIdObjectsDefinitionIdViewsViewIdPatchRequestBodyContentApplicationJsonSchemaFiltersItems:
      type: object
      properties:
        fieldKey:
          type: string
        subField:
          type: string
        operand:
          type: string
          description: One of the 14 supported operands.
        value:
          description: Any type
      required:
        - fieldKey
        - operand
      title: >-
        SpacesSpaceIdObjectsDefinitionIdViewsViewIdPatchRequestBodyContentApplicationJsonSchemaFiltersItems
    SpacesSpaceIdObjectsDefinitionIdViewsViewIdPatchRequestBodyContentApplicationJsonSchemaSortsItemsDirection:
      type: string
      enum:
        - asc
        - desc
      title: >-
        SpacesSpaceIdObjectsDefinitionIdViewsViewIdPatchRequestBodyContentApplicationJsonSchemaSortsItemsDirection
    SpacesSpaceIdObjectsDefinitionIdViewsViewIdPatchRequestBodyContentApplicationJsonSchemaSortsItems:
      type: object
      properties:
        fieldKey:
          type: string
        subField:
          type: string
        direction:
          $ref: >-
            #/components/schemas/SpacesSpaceIdObjectsDefinitionIdViewsViewIdPatchRequestBodyContentApplicationJsonSchemaSortsItemsDirection
      required:
        - fieldKey
        - direction
      title: >-
        SpacesSpaceIdObjectsDefinitionIdViewsViewIdPatchRequestBodyContentApplicationJsonSchemaSortsItems
    ObjectViewFieldsItems:
      type: object
      properties:
        fieldKey:
          type: string
        isVisible:
          type: boolean
        width:
          type: number
          format: double
        position:
          type: number
          format: double
      required:
        - fieldKey
        - isVisible
        - width
        - position
      title: ObjectViewFieldsItems
    ObjectViewFiltersItems:
      type: object
      properties:
        fieldKey:
          type: string
        subField:
          type: string
        operand:
          type: string
          description: One of the 14 supported operands.
        value:
          description: Any type
      required:
        - fieldKey
        - operand
      title: ObjectViewFiltersItems
    ObjectViewSortsItemsDirection:
      type: string
      enum:
        - asc
        - desc
      title: ObjectViewSortsItemsDirection
    ObjectViewSortsItems:
      type: object
      properties:
        fieldKey:
          type: string
        subField:
          type: string
        direction:
          $ref: '#/components/schemas/ObjectViewSortsItemsDirection'
      required:
        - fieldKey
        - direction
      title: ObjectViewSortsItems
    ObjectView:
      type: object
      properties:
        _id:
          type: string
        spaceId:
          type: string
        definitionId:
          type: string
        name:
          type: string
        isDefault:
          type: boolean
          description: 'The seeded default view: never renamable, never deletable.'
        filterLogic:
          type: string
        fields:
          type: array
          items:
            $ref: '#/components/schemas/ObjectViewFieldsItems'
        filters:
          type: array
          items:
            $ref: '#/components/schemas/ObjectViewFiltersItems'
        sorts:
          type: array
          items:
            $ref: '#/components/schemas/ObjectViewSortsItems'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        createdBy:
          type: string
      required:
        - _id
        - spaceId
        - definitionId
        - name
        - isDefault
        - filterLogic
        - fields
        - filters
        - sorts
        - createdAt
        - updatedAt
        - createdBy
      title: ObjectView
    ObjectViewEnvelope:
      type: object
      properties:
        view:
          $ref: '#/components/schemas/ObjectView'
      required:
        - view
      title: ObjectViewEnvelope
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "view": {
    "_id": "view_9876543210abcdef",
    "spaceId": "space_1234567890abcdef",
    "definitionId": "def_abcdef1234567890",
    "name": "Customer Overview",
    "isDefault": true,
    "filterLogic": "AND",
    "fields": [
      {
        "fieldKey": "customerName",
        "isVisible": true,
        "width": 150,
        "position": 1
      }
    ],
    "filters": [
      {
        "fieldKey": "status",
        "operand": "equals",
        "subField": "value"
      }
    ],
    "sorts": [
      {
        "fieldKey": "createdDate",
        "direction": "asc",
        "subField": "timestamp"
      }
    ],
    "createdAt": "2024-01-15T09:30:00Z",
    "updatedAt": "2024-01-15T09:30:00Z",
    "createdBy": "user_1234abcd5678efgh"
  }
}
```

**SDK Code**

```typescript
import { CloudRakerClient } from "@cloudraker/api";

async function main() {
    const client = new CloudRakerClient({
        token: "YOUR_TOKEN_HERE",
    });
    await client.dataObjects.updateObjectView("spaceId", "definitionId", "viewId", {});
}
main();

```

```python
from cloudraker import CloudRaker

client = CloudRaker(
    token="YOUR_TOKEN_HERE",
)

client.data_objects.update_object_view(
    space_id="spaceId",
    definition_id="definitionId",
    view_id="viewId",
)

```

```go
package main

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

func main() {

	url := "https://api.cloudraker.com/spaces/spaceId/objects/definitionId/views/viewId"

	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/spaces/spaceId/objects/definitionId/views/viewId")

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/spaces/spaceId/objects/definitionId/views/viewId")
  .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/spaces/spaceId/objects/definitionId/views/viewId', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.cloudraker.com/spaces/spaceId/objects/definitionId/views/viewId");
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/spaces/spaceId/objects/definitionId/views/viewId")! 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()
```