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

Authorization
string
header
required

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.