Get Started
Indexing
- Get Started
- Guides
- Authentication
- Datasources
- Documents
- Debugging
- API Reference
- OpenAPI Spec
Client
- Get Started
- Guides
- Search
- Governance
- API Reference
- Activity
- Announcements
- Answers
- Authentication
- Chat
- Agents
- Collections
- Documents
- Insights
- Messages
- Pins
- Search
- Entities
- Shortcuts
- Summarize
- Verification
- Tools
- Governance
- OpenAPI Spec
Web SDK
- Get Started
- Components
- Guides
Actions
- Get Started
- Examples
Shortcuts
Update shortcut
Updates the shortcut with the given ID.
POST
/
rest
/
api
/
v1
/
updateshortcut
from glean import Glean, models
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as g_client:
res = g_client.client.shortcuts.update(id=268238, added_roles=[
models.UserRoleSpecification(
person=models.Person(
name="George Clooney",
obfuscated_id="abc123",
),
role=models.UserRole.ANSWER_MODERATOR,
),
models.UserRoleSpecification(
person=models.Person(
name="George Clooney",
obfuscated_id="abc123",
),
role=models.UserRole.ANSWER_MODERATOR,
),
], removed_roles=[
models.UserRoleSpecification(
person=models.Person(
name="George Clooney",
obfuscated_id="abc123",
),
role=models.UserRole.VERIFIER,
),
models.UserRoleSpecification(
person=models.Person(
name="George Clooney",
obfuscated_id="abc123",
),
role=models.UserRole.VERIFIER,
),
])
# Handle response
print(res)
{
"shortcut": {
"id": 123,
"permissions": {
"write": {
"scopeType": "GLOBAL",
"create": true,
"update": true,
"delete": true
}
},
"createdBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createTime": "2023-11-07T05:31:56Z",
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"updateTime": "2023-11-07T05:31:56Z",
"destinationDocument": {},
"intermediateUrl": "<string>",
"viewPrefix": "<string>",
"isExternal": true,
"editUrl": "<string>",
"alias": "<string>",
"title": "<string>",
"roles": [
{}
]
},
"error": {
"errorType": "NO_PERMISSION"
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Shortcut content. Id need to be specified for the shortcut.
The body is of type object
.
Response
200
application/json
OK
The response is of type object
.
from glean import Glean, models
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as g_client:
res = g_client.client.shortcuts.update(id=268238, added_roles=[
models.UserRoleSpecification(
person=models.Person(
name="George Clooney",
obfuscated_id="abc123",
),
role=models.UserRole.ANSWER_MODERATOR,
),
models.UserRoleSpecification(
person=models.Person(
name="George Clooney",
obfuscated_id="abc123",
),
role=models.UserRole.ANSWER_MODERATOR,
),
], removed_roles=[
models.UserRoleSpecification(
person=models.Person(
name="George Clooney",
obfuscated_id="abc123",
),
role=models.UserRole.VERIFIER,
),
models.UserRoleSpecification(
person=models.Person(
name="George Clooney",
obfuscated_id="abc123",
),
role=models.UserRole.VERIFIER,
),
])
# Handle response
print(res)
{
"shortcut": {
"id": 123,
"permissions": {
"write": {
"scopeType": "GLOBAL",
"create": true,
"update": true,
"delete": true
}
},
"createdBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createTime": "2023-11-07T05:31:56Z",
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"updateTime": "2023-11-07T05:31:56Z",
"destinationDocument": {},
"intermediateUrl": "<string>",
"viewPrefix": "<string>",
"isExternal": true,
"editUrl": "<string>",
"alias": "<string>",
"title": "<string>",
"roles": [
{}
]
},
"error": {
"errorType": "NO_PERMISSION"
}
}
Assistant
Responses are generated using AI and may contain mistakes.