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
Pins
Create pin
Pin a document as a result for a given search query.Pin results that are known to be a good match.
POST
/
rest
/
api
/
v1
/
pin
from glean import Glean, models
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as g_client:
res = g_client.client.pins.create(request={
"audience_filters": [
{
"field_name": "type",
"values": [
{
"value": "Spreadsheet",
"relation_type": models.RelationType.EQUALS,
},
{
"value": "Presentation",
"relation_type": models.RelationType.EQUALS,
},
],
},
],
})
# Handle response
print(res)
{
"queries": [
"<string>"
],
"audienceFilters": [
{
"fieldName": "type",
"values": [
{
"value": "Spreadsheet",
"relationType": "EQUALS"
},
{
"value": "Presentation",
"relationType": "EQUALS"
}
]
}
],
"id": "<string>",
"documentId": "<string>",
"attribution": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Details about the document and query for the pin.
The body is of type object
.
Response
200
application/json
OK
The response is of type object
.
Was this page helpful?
from glean import Glean, models
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as g_client:
res = g_client.client.pins.create(request={
"audience_filters": [
{
"field_name": "type",
"values": [
{
"value": "Spreadsheet",
"relation_type": models.RelationType.EQUALS,
},
{
"value": "Presentation",
"relation_type": models.RelationType.EQUALS,
},
],
},
],
})
# Handle response
print(res)
{
"queries": [
"<string>"
],
"audienceFilters": [
{
"fieldName": "type",
"values": [
{
"value": "Spreadsheet",
"relationType": "EQUALS"
},
{
"value": "Presentation",
"relationType": "EQUALS"
}
]
}
],
"id": "<string>",
"documentId": "<string>",
"attribution": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z"
}
Assistant
Responses are generated using AI and may contain mistakes.