For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inBook a demo
GuidesAPI Reference
GuidesAPI Reference
  • API Reference
      • POSTUpsert Schema Fields
      • DELDelete Schema Field
      • PATCHPatch Schema Field
      • PUTSet Primary Keys
      • DELReset Primary Keys
      • POSTRefresh Connection Schema
      • GETGet Schema Status
      • GETGet Schema
      • GETGet Schema Records
Logo
Log inBook a demo
API ReferenceSchemas

Set Primary Keys

PUT
https://app.polytomic.com/api/connections/:connection_id/schemas/:schema_id/primary_keys
PUT
/api/connections/:connection_id/schemas/:schema_id/primary_keys
$curl -X PUT https://app.polytomic.com/api/connections/248df4b7-aa70-47b8-a036-33ac447e668d/schemas/public.users/primary_keys \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{}'
1{}
Overrides the primary key detected on a schema. This is a full replacement: the keys you supply become the complete override set, replacing any previously configured overrides. Omitting a key that was previously set removes it. Primary key overrides are useful when the source does not expose a primary key or when the source-detected key is not the correct deduplication identifier for your use case. > 📘 To revert to the source-detected primary keys and remove all overrides, > use [`DELETE /api/connections/{connection_id}/schemas/{schema_id}/primary_keys`](../../../../../../api-reference/schemas/reset-primary-keys).
Was this page helpful?
Previous

Reset Primary Keys

Next

Overrides the primary key detected on a schema.

This is a full replacement: the keys you supply become the complete override set, replacing any previously configured overrides. Omitting a key that was previously set removes it.

Primary key overrides are useful when the source does not expose a primary key or when the source-detected key is not the correct deduplication identifier for your use case.

📘 To revert to the source-detected primary keys and remove all overrides, use DELETE /api/connections/{connection_id}/schemas/{schema_id}/primary_keys.

Authentication

AuthorizationBearer
Bearer user API key
OR
AuthorizationBasic

Basic organization-scoped API key

Path parameters

connection_idstringRequiredformat: "uuid"
Unique identifier of the connection.
schema_idstringRequired
Identifier of the schema whose primary keys are being overridden.

Headers

X-Polytomic-VersionstringOptional

Request

This endpoint expects an object.
fieldslist of objects or nullOptional

Ordered list of source fields that together form the primary key. Replaces any existing override; supply an empty list to clear.

Response headers

locationstring

Response

Accepted

Errors

400
Bad Request Error
404
Not Found Error
500
Internal Server Error