Example of payload for the "create Temporary object set" endpoint?

I want to use the “Create Temporary Object Set” endpoint to perform performant filtering, search-arounds to other object sets, etc.

See https://www.palantir.com/docs/foundry/api/v2/ontologies-v2-resources/ontology-object-sets/create-temporary-object-set

Is there an example of payload I can use to this endpoint to get started ?

Note: The below is untested, but this should be fairly close to the syntax that works.

From an object type. For “base”, use “objectType” (not “objectTypeId”).

{
  "objectSet": {
    "type": "base",
    "objectType": "myObjectTypeApiName"
  }
}

From a static list of object uuid.

{
  "objectSet": {
    "type": "static",
    "objects": [
      "ri.phonograph2-objects.main.object.5747a88f-1234-4867-6788-0ec76fa7b0eb"
    ]
  }
}

From an existing object set rid.

{
  "objectSet": {
    "type": "reference",
    "reference": "ri.object-set.main.temporary-object-set.0cb2066e-1234-4014-5678-33e3a60e56bc"
  }
}

From a simple search-around:

{
  "objectSet": {
    "type": "searchAround",
    "link": "linkTypeAPI",
    "objectSet": {
      "type": "static",
      "objects": [ 
        // here you need to have you starting objects, and/or use another object set definition 
      ]
    }
  }
}

Intersection of object sets

{
  "objectSet": {
    "type": "intersect",
    "objectSets": [
      {
        "type": "searchAround",
        "objectSet": {
          "type": "filter",
          "objectSet": {
            "type": "base",
            "objectType": "myObjectTypeApiName"
          },
          "where": {
            "type": "not",
            "value": {
              "type": "isNull",
              "field": "myPropertyApiName",
              "value": true
            }
          }
        },
        "link": "myLinkApiName"
      },
      {
        "type": "searchAround",
        "objectSet": {
          "type": "base",
          "objectType": "myObjectTypeApiName"
        },
        "link": "myOtherLinkApiName"
      }
    ]
  }
}

And here is an example with filters.
For “filtered”, the structure is more complex and may require “filter” and “objectSet” subfields.

{
  "objectSet": {
    "filter": {
      "objectSet": {
        "base": {
          "objectTypeId": "my-object-type"
        },
        "type": "base"
      },
      "where": {
        "eq": {
          "field": "property_identifier",
          "value": "ABC-123456789"
        },
        "type": "eq"
      }
    },
    "type": "filter"
  }
}

If you get errors, double-check the field names and types. The API is strict about the schema.