Skip to Content

Platform SDK overview

The @osdk/foundry packages wrap Foundry platform REST APIs for users, datasets, media sets, builds, and more, alongside the Ontology SDK.

Foundry docsFoundry REST APIs

The Platform SDK is a set of @osdk/foundry.* packages, one per area of the Foundry API. Use it to call the parts of Foundry that are not Ontology data: users and groups, datasets, media sets, builds, folders, and Ontology metadata.

OSDK and Platform SDK

The Ontology SDK (OSDK) and the Platform SDK can share one client and one token provider. They cover different parts of Foundry.

Ontology SDKPlatform SDK
Use it forReading and editing your Ontology: objects, links, actions, functions.Foundry platform resources: users, groups, markings, datasets, media sets, builds, files, Ontology metadata.
Packages@osdk/client plus an SDK generated for your Ontology, such as @my-app/sdk.Fixed packages published by Palantir, such as @osdk/foundry.admin. The same package works on every Foundry stack.
TypesGenerated from your object types, so Employee has fullName and startDate.Generic request and response types from the public API, such as User and Dataset.
Call styleclient(Employee).fetchPage()Users.getCurrent(client)
ClientcreateClient(baseUrl, ontologyRid, auth)The same client, or createPlatformClient(baseUrl, auth) when there is no Ontology.
src/whoami.ts
import { Employee } from "@my-app/sdk";
import type { Client } from "@osdk/client";
import { Users } from "@osdk/foundry.admin";

export async function loadDashboard(client: Client) {
  const [me, employees] = await Promise.all([
    Users.getCurrent(client),
    client(Employee).fetchPage({ $pageSize: 10 }),
  ]);
  return { username: me.username, employees: employees.data };
}

Use the Platform SDK when the OSDK has no equivalent. To read objects, apply actions, or upload media to an object property, use the OSDK.

Packages

Each package exports one namespace per resource. Install only the packages you call.

PackageNamespacesPurpose
@osdk/foundry.adminUsers, Groups, GroupMembers, GroupMemberships, Markings, MarkingCategories, MarkingMembers, Organizations, Roles, CbacBanners, and moreUsers, groups, memberships, markings, organizations, and classification banners.
@osdk/foundry.aipagentsAgents, AgentVersions, Sessions, Contents, SessionTracesStart and read conversations with AIP Agents.
@osdk/foundry.agentsAgentDefinitionVersions, AgentSessionsAgent definitions and sessions. Published from version 2.80.0.
@osdk/foundry.auditLogFilesList and download audit log files.
@osdk/foundry.checkpointsRecordsRead checkpoint records.
@osdk/foundry.connectivityConnections, FileImports, TableImports, VirtualTablesData Connection sources, imports, and virtual tables.
@osdk/foundry.coreTypes onlyShared types, such as PageSize, PageToken, UserId, and PreviewMode, used by every other package.
@osdk/foundry.datahealthChecks, CheckReportsData health checks and their reports.
@osdk/foundry.datasetsDatasets, Branches, Files, Transactions, ViewsCreate datasets, read and upload files, read tables, and manage branches and transactions.
@osdk/foundry.filesystemFolders, Projects, Resources, ResourceRoles, Spaces, and moreFolders, projects, and resource permissions in the Foundry filesystem.
@osdk/foundry.functionsQueries, Executions, ValueTypes, VersionIdsFunction metadata, execution, and value types.
@osdk/foundry.geoTypes onlyTypes for geographic data.
@osdk/foundry.geojsonTypes onlyGeoJSON types.
@osdk/foundry.languagemodelsAnthropic, OpenAiCall language models hosted in Foundry.
@osdk/foundry.mediasetsMediaSetsUpload media items, read their content and metadata, and run transformations.
@osdk/foundry.modelsModels, ModelVersions, LiveDeployments, Experiments, and moreModels, versions, deployments, and experiments.
@osdk/foundry.notepadDocuments, Templates, GenerationJobs, ExportJobs, FilesGenerate and export Notepad documents.
@osdk/foundry.ontologiesOntologiesV2, ObjectTypesV2, ActionTypesV2, QueryTypes, OntologyInterfaces, and moreOntology metadata and the raw object, action, and query endpoints that the OSDK is built on.
@osdk/foundry.operationsAsyncOperationsPoll long-running operations.
@osdk/foundry.orchestrationBuilds, Jobs, Schedules, ScheduleVersionsStart and monitor builds, and manage schedules.
@osdk/foundry.packDocuments, DocumentTypes, PublishedVersionsPACK documents and document types.
@osdk/foundry.publicapisApiDefinitions, OpenApiDefinitionsFetch API specifications.
@osdk/foundry.sqlqueriesSqlQueriesRun SQL queries and read their results.
@osdk/foundry.streamsDatasets, Streams, SubscribersStreaming datasets, streams, and subscribers.
@osdk/foundry.thirdpartyapplicationsThirdPartyApplications, Versions, WebsitesDeveloper Console applications and hosted website versions.
@osdk/foundry.widgetsWidgetSets, Releases, Repositories, WidgetsDevModeSettings, WidgetsDevModeSettingsV2Custom widget sets, releases, and dev mode.

@osdk/foundry re-exports each package except @osdk/foundry.geojson as a namespace, such as Admin and Datasets. Prefer the individual packages: they version independently and keep your bundle small.

import { Admin } from "@osdk/foundry";

const me = await Admin.Users.getCurrent(client);

Stable and preview endpoints

Every function's JSDoc carries a release tag:

TagMeaningHow to call it
@publicStable.Call it normally.
@betaPreview. The shape can change between versions.Pass preview: true in the query parameters.
@alphaEarly preview. Expect changes, and the endpoint may not be enabled on every stack.Pass preview: true in the query parameters.

Preview endpoints take an optional preview query parameter of type PreviewMode (a boolean). Without it, the server rejects the request with an ApiFeaturePreviewUsageOnly error:

import { Groups } from "@osdk/foundry.admin";

const { data: myGroups } = await Groups.listCurrent(client, { preview: true });

The calling convention page covers where preview goes when an endpoint has a body.

Next steps

For React hooks that call the admin APIs, see Users and markings in React.

On this page