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
Collections
Add Collection item
Add items to a Collection.
POST
/
rest
/
api
/
v1
/
addcollectionitems
from glean import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as g_client:
res = g_client.client.collections.add_items(collection_id=7742.68)
# Handle response
print(res)
{
"collection": {
"name": "<string>",
"description": "<string>",
"addedRoles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
],
"removedRoles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
],
"audienceFilters": [
{
"fieldName": "type",
"values": [
{
"value": "Spreadsheet",
"relationType": "EQUALS"
},
{
"value": "Presentation",
"relationType": "EQUALS"
}
]
}
],
"icon": "<string>",
"adminLocked": true,
"parentId": 123,
"thumbnail": {
"photoId": "<string>",
"url": "<string>"
},
"allowedDatasource": "<string>",
"permissions": {
"write": {
"scopeType": "GLOBAL",
"create": true,
"update": true,
"delete": true
}
},
"id": 123,
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"creator": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"itemCount": 123,
"childCount": 123,
"items": [
{
"name": "<string>",
"description": "<string>",
"icon": "<string>",
"collectionId": 123,
"documentId": "<string>",
"url": "<string>",
"itemId": "<string>",
"createdBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createdAt": "2023-11-07T05:31:56Z",
"document": {
"id": "<string>",
"datasource": "<string>",
"connectorType": "API_CRAWL",
"docType": "<string>",
"content": {
"fullTextList": [
"<string>"
]
},
"containerDocument": {},
"parentDocument": {},
"title": "<string>",
"url": "<string>",
"metadata": {
"container": "container",
"parentId": "JIRA_EN-1337",
"createTime": "2000-01-23T04:56:07.000Z",
"datasource": "datasource",
"author": {
"name": "name"
},
"documentId": "documentId",
"updateTime": "2000-01-23T04:56:07.000Z",
"mimeType": "mimeType",
"objectType": "Feature Request",
"components": [
"Backend",
"Networking"
],
"status": [
"Done"
],
"customData": {
"someCustomField": "someCustomValue"
}
},
"sections": [
{
"title": "<string>",
"url": "<string>"
}
]
},
"shortcut": {
"id": 123,
"inputAlias": "<string>",
"destinationUrl": "<string>",
"destinationDocumentId": "<string>",
"description": "<string>",
"unlisted": true,
"urlTemplate": "<string>",
"addedRoles": [
{}
],
"removedRoles": [
{}
],
"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": [
{}
]
},
"collection": "<any>",
"itemType": "DOCUMENT"
}
],
"pinMetadata": {
"existingPins": [
{
"category": "COMPANY_RESOURCE",
"value": "<string>",
"target": "RESOURCE_CARD"
}
],
"eligiblePins": [
{
"id": 123,
"target": {
"category": "COMPANY_RESOURCE",
"value": "<string>",
"target": "RESOURCE_CARD"
}
}
]
},
"shortcuts": [
"<string>"
],
"children": [
"<any>"
],
"roles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
]
},
"error": {
"errorType": "EXISTING_ITEM"
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Data describing the add operation.
The body is of type object
.
Response
200
application/json
OK
The response is of type object
.
from glean import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as g_client:
res = g_client.client.collections.add_items(collection_id=7742.68)
# Handle response
print(res)
{
"collection": {
"name": "<string>",
"description": "<string>",
"addedRoles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
],
"removedRoles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
],
"audienceFilters": [
{
"fieldName": "type",
"values": [
{
"value": "Spreadsheet",
"relationType": "EQUALS"
},
{
"value": "Presentation",
"relationType": "EQUALS"
}
]
}
],
"icon": "<string>",
"adminLocked": true,
"parentId": 123,
"thumbnail": {
"photoId": "<string>",
"url": "<string>"
},
"allowedDatasource": "<string>",
"permissions": {
"write": {
"scopeType": "GLOBAL",
"create": true,
"update": true,
"delete": true
}
},
"id": 123,
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"creator": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"itemCount": 123,
"childCount": 123,
"items": [
{
"name": "<string>",
"description": "<string>",
"icon": "<string>",
"collectionId": 123,
"documentId": "<string>",
"url": "<string>",
"itemId": "<string>",
"createdBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createdAt": "2023-11-07T05:31:56Z",
"document": {
"id": "<string>",
"datasource": "<string>",
"connectorType": "API_CRAWL",
"docType": "<string>",
"content": {
"fullTextList": [
"<string>"
]
},
"containerDocument": {},
"parentDocument": {},
"title": "<string>",
"url": "<string>",
"metadata": {
"container": "container",
"parentId": "JIRA_EN-1337",
"createTime": "2000-01-23T04:56:07.000Z",
"datasource": "datasource",
"author": {
"name": "name"
},
"documentId": "documentId",
"updateTime": "2000-01-23T04:56:07.000Z",
"mimeType": "mimeType",
"objectType": "Feature Request",
"components": [
"Backend",
"Networking"
],
"status": [
"Done"
],
"customData": {
"someCustomField": "someCustomValue"
}
},
"sections": [
{
"title": "<string>",
"url": "<string>"
}
]
},
"shortcut": {
"id": 123,
"inputAlias": "<string>",
"destinationUrl": "<string>",
"destinationDocumentId": "<string>",
"description": "<string>",
"unlisted": true,
"urlTemplate": "<string>",
"addedRoles": [
{}
],
"removedRoles": [
{}
],
"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": [
{}
]
},
"collection": "<any>",
"itemType": "DOCUMENT"
}
],
"pinMetadata": {
"existingPins": [
{
"category": "COMPANY_RESOURCE",
"value": "<string>",
"target": "RESOURCE_CARD"
}
],
"eligiblePins": [
{
"id": 123,
"target": {
"category": "COMPANY_RESOURCE",
"value": "<string>",
"target": "RESOURCE_CARD"
}
}
]
},
"shortcuts": [
"<string>"
],
"children": [
"<any>"
],
"roles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
]
},
"error": {
"errorType": "EXISTING_ITEM"
}
}
Assistant
Responses are generated using AI and may contain mistakes.