Rename or change a saved view
PATCH
/api/views/{id}
const url = 'https://forge.example.com/api/views/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","query":"example","version":1,"shared":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://forge.example.com/api/views/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "query": "example", "version": 1, "shared": true }'Your own views, or, for administrators, the organization’s. Another person’s own view answers 404. Send the view’s version as you read it. A stale one answers 409 with currentVersion, the version it has now.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
null | string
query
null | string
version
required
null | integer | string format: int32
shared
null | boolean
Example generated
{ "name": "example", "query": "example", "version": 1, "shared": true}Responses
Section titled “Responses”OK
Media typeapplication/json
object
id
required
string format: uuid
list
required
string
name
required
string
query
required
string
shared
required
boolean
owner
required
object
id
required
string format: uuid
displayName
required
string
canChange
required
boolean
updatedAt
required
string format: date-time
version
required
integer | string format: int32
pinned
boolean
pinnedAt
null | string format: date-time
Example
{ "pinned": false}default
Section titled “default”A refusal or an error, as a problem document. A model or draft you may not see answers 404, as one that does not exist.
Media typeapplication/problem+json
object
type
string
title
string
status
integer
detail
string
instance
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}