Skip to content

Latest commit

Β 

History

History
6777 lines (4696 loc) Β· 80.4 KB

File metadata and controls

6777 lines (4696 loc) Β· 80.4 KB

Reference

BulkSync

client.bulkSync.list({ ...params }) -> Polytomic.BulkSyncListEnvelope

πŸ”Œ Usage

await client.bulkSync.list({
    active: true,
});

βš™οΈ Parameters

request: Polytomic.BulkSyncListRequest

requestOptions: BulkSync.RequestOptions

client.bulkSync.create({ ...params }) -> Polytomic.BulkSyncResponseEnvelope

πŸ“ Description

Create a new Bulk Sync from a source to a destination (data warehouse, database, or cloud storage bucket like S3).

Bulk Syncs are used for the ELT pattern (Extract, Load, and Transform), where you want to sync un-transformed data to your data warehouses, databases, or cloud storage buckets like S3.

All of the functionality described in the product documentation is configurable via the API.

Sample code examples:

Connection specific configuration

The destination_configuration is integration-specific configuration for the selected bulk sync destination. This includes settings such as the output schema and is required when creating a new sync.

The source_configuration is optional. It allows configuration for how Polytomic reads data from the source connection. This will not be available for integrations that do not support additional configuration.

Consult the connection configurations to see configurations for particular integrations (for example, here is the available source configuration for the PostgreSQL bulk sync source).

πŸ”Œ Usage

await client.bulkSync.create({
    destination_configuration: {
        schema: "my_schema",
    },
    destination_connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
    name: "My Bulk Sync",
    schedule: {
        frequency: "manual",
    },
    source_connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
});

βš™οΈ Parameters

request: Polytomic.CreateBulkSyncRequest

requestOptions: BulkSync.RequestOptions

client.bulkSync.get(id, { ...params }) -> Polytomic.BulkSyncResponseEnvelope

πŸ”Œ Usage

await client.bulkSync.get("248df4b7-aa70-47b8-a036-33ac447e668d", {
    refresh_schemas: true,
});

βš™οΈ Parameters

id: string

request: Polytomic.BulkSyncGetRequest

requestOptions: BulkSync.RequestOptions

client.bulkSync.update(id, { ...params }) -> Polytomic.BulkSyncResponseEnvelope

πŸ“ Description

πŸ“˜ Updating schemas

Schema updates can be performed using the Update Bulk Sync Schemas endpoint.

πŸ”Œ Usage

await client.bulkSync.update("248df4b7-aa70-47b8-a036-33ac447e668d", {
    destination_configuration: {
        schema: "my_schema",
    },
    destination_connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
    name: "My Bulk Sync",
    schedule: {
        frequency: "manual",
    },
    source_connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
});

βš™οΈ Parameters

id: string

request: Polytomic.UpdateBulkSyncRequest

requestOptions: BulkSync.RequestOptions

client.bulkSync.remove(id, { ...params }) -> void

πŸ”Œ Usage

await client.bulkSync.remove("248df4b7-aa70-47b8-a036-33ac447e668d", {
    refresh_schemas: true,
});

βš™οΈ Parameters

id: string

request: Polytomic.BulkSyncRemoveRequest

requestOptions: BulkSync.RequestOptions

client.bulkSync.activate(id, { ...params }) -> Polytomic.ActivateSyncEnvelope

πŸ”Œ Usage

await client.bulkSync.activate("248df4b7-aa70-47b8-a036-33ac447e668d", {
    active: true,
});

βš™οΈ Parameters

id: string

request: Polytomic.ActivateSyncInput

requestOptions: BulkSync.RequestOptions

client.bulkSync.cancel(id) -> Polytomic.CancelBulkSyncResponseEnvelope

πŸ”Œ Usage

await client.bulkSync.cancel("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string β€” The active execution of this bulk sync ID will be cancelled.

requestOptions: BulkSync.RequestOptions

client.bulkSync.start(id, { ...params }) -> Polytomic.BulkSyncExecutionEnvelope

πŸ”Œ Usage

await client.bulkSync.start("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

request: Polytomic.StartBulkSyncRequest

requestOptions: BulkSync.RequestOptions

client.bulkSync.getStatus(id) -> Polytomic.BulkSyncStatusEnvelope

πŸ”Œ Usage

await client.bulkSync.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: BulkSync.RequestOptions

client.bulkSync.getSource(id, { ...params }) -> Polytomic.BulkSyncSourceEnvelope

πŸ”Œ Usage

await client.bulkSync.getSource("248df4b7-aa70-47b8-a036-33ac447e668d", {
    include_fields: true,
});

βš™οΈ Parameters

id: string

request: Polytomic.BulkSyncGetSourceRequest

requestOptions: BulkSync.RequestOptions

client.bulkSync.getDestination(id) -> Polytomic.BulkSyncDestEnvelope

πŸ”Œ Usage

await client.bulkSync.getDestination("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: BulkSync.RequestOptions

Connections

client.connections.getTypes() -> Polytomic.ConnectionTypeResponseEnvelope

πŸ”Œ Usage

await client.connections.getTypes();

βš™οΈ Parameters

requestOptions: Connections.RequestOptions

client.connections.getConnectionTypeSchema(id) -> Polytomic.JsonschemaSchema

πŸ”Œ Usage

await client.connections.getConnectionTypeSchema("postgresql");

βš™οΈ Parameters

id: string

requestOptions: Connections.RequestOptions

client.connections.getTypeParameterValues(type_, { ...params }) -> Polytomic.ConnectionParameterValuesResponseEnvelope

πŸ”Œ Usage

await client.connections.getTypeParameterValues("type", {
    field: "field",
});

βš™οΈ Parameters

type_: string

request: Polytomic.GetConnectionTypeParameterValuesRequestSchema

requestOptions: Connections.RequestOptions

client.connections.list() -> Polytomic.ConnectionListResponseEnvelope

πŸ”Œ Usage

await client.connections.list();

βš™οΈ Parameters

requestOptions: Connections.RequestOptions

client.connections.create({ ...params }) -> Polytomic.CreateConnectionResponseEnvelope

πŸ”Œ Usage

await client.connections.create({
    configuration: {
        database: "example",
        hostname: "postgres.example.com",
        password: "********",
        port: 5432,
        username: "user",
    },
    name: "My Postgres Connection",
    type: "postgresql",
});

βš™οΈ Parameters

request: Polytomic.CreateConnectionRequestSchema

requestOptions: Connections.RequestOptions

client.connections.connect({ ...params }) -> Polytomic.ConnectCardResponseEnvelope

πŸ“ Description

Creates a new request for Polytomic Connect.

This endpoint configures a Polytomic Connect request and returns the URL to redirect users to. This allows embedding Polytomic connection authorization in other applications.

See also:

πŸ”Œ Usage

await client.connections.connect({
    name: "Salesforce Connection",
    redirect_url: "redirect_url",
});

βš™οΈ Parameters

request: Polytomic.ConnectCardRequest

requestOptions: Connections.RequestOptions

client.connections.testConnection({ ...params }) -> void

πŸ“ Description

Tests a connection configuration.

πŸ”Œ Usage

await client.connections.testConnection({
    configuration: {
        database: "example",
        hostname: "postgres.example.com",
        password: "password",
        port: 5432,
        username: "user",
    },
    type: "postgresql",
});

βš™οΈ Parameters

request: Polytomic.TestConnectionRequest

requestOptions: Connections.RequestOptions

client.connections.get(id) -> Polytomic.ConnectionResponseEnvelope

πŸ”Œ Usage

await client.connections.get("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Connections.RequestOptions

client.connections.update(id, { ...params }) -> Polytomic.CreateConnectionResponseEnvelope

πŸ”Œ Usage

await client.connections.update("248df4b7-aa70-47b8-a036-33ac447e668d", {
    configuration: {
        database: "example",
        hostname: "postgres.example.com",
        password: "********",
        port: 5432,
        username: "user",
    },
    name: "My Postgres Connection",
});

βš™οΈ Parameters

id: string

request: Polytomic.UpdateConnectionRequestSchema

requestOptions: Connections.RequestOptions

client.connections.remove(id, { ...params }) -> void

πŸ”Œ Usage

await client.connections.remove("248df4b7-aa70-47b8-a036-33ac447e668d", {
    force: true,
});

βš™οΈ Parameters

id: string

request: Polytomic.ConnectionsRemoveRequest

requestOptions: Connections.RequestOptions

client.connections.getParameterValues(id) -> Polytomic.ConnectionParameterValuesResponseEnvelope

πŸ”Œ Usage

await client.connections.getParameterValues("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Connections.RequestOptions

client.connections.createSharedConnection(parentConnectionId, { ...params }) -> Polytomic.V2CreateSharedConnectionResponseEnvelope

πŸ“ Description

🚧 Requires partner key

Shared connections can only be created by using partner keys.

πŸ”Œ Usage

await client.connections.createSharedConnection("248df4b7-aa70-47b8-a036-33ac447e668d", {
    child_organization_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
});

βš™οΈ Parameters

parentConnectionId: string

request: Polytomic.ApiRequest

requestOptions: Connections.RequestOptions

client.connections.listSharedConnections(parentConnectionId) -> Polytomic.ConnectionListResponseEnvelope

πŸ”Œ Usage

await client.connections.listSharedConnections("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

parentConnectionId: string

requestOptions: Connections.RequestOptions

QueryRunner

client.queryRunner.runQuery(connectionId, { ...params }) -> Polytomic.V4RunQueryEnvelope

πŸ“ Description

Submit a query for asynchronous execution against the connection. The initial response may only contain the query task id and status. Poll GET /api/queries/{id} with the returned id to retrieve completion status, fields, and results.

πŸ”Œ Usage

await client.queryRunner.runQuery("248df4b7-aa70-47b8-a036-33ac447e668d", {
    query: "SELECT * FROM table",
});

βš™οΈ Parameters

connectionId: string

request: Polytomic.V4RunQueryRequest

requestOptions: QueryRunner.RequestOptions

client.queryRunner.getQuery(id, { ...params }) -> Polytomic.V4QueryResultsEnvelope

πŸ“ Description

Fetch the latest status for a submitted query and, once complete, return fields and paginated results. Use the query id returned by POST /api/connections/{connection_id}/query.

πŸ”Œ Usage

await client.queryRunner.getQuery("248df4b7-aa70-47b8-a036-33ac447e668d", {
    page: "page",
});

βš™οΈ Parameters

id: string

request: Polytomic.QueryRunnerGetQueryRequest

requestOptions: QueryRunner.RequestOptions

Schemas

client.schemas.upsertField(connectionId, schemaId, { ...params }) -> void

πŸ”Œ Usage

await client.schemas.upsertField("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users");

βš™οΈ Parameters

connectionId: string

schemaId: string

request: Polytomic.UpsertSchemaFieldRequest

requestOptions: Schemas.RequestOptions

client.schemas.deleteField(connectionId, schemaId, fieldId) -> void

πŸ”Œ Usage

await client.schemas.deleteField("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users", "first_name");

βš™οΈ Parameters

connectionId: string

schemaId: string

fieldId: string

requestOptions: Schemas.RequestOptions

client.schemas.setPrimaryKeys(connectionId, schemaId, { ...params }) -> void

πŸ”Œ Usage

await client.schemas.setPrimaryKeys("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users");

βš™οΈ Parameters

connectionId: string

schemaId: string

request: Polytomic.SetPrimaryKeysRequest

requestOptions: Schemas.RequestOptions

client.schemas.resetPrimaryKeys(connectionId, schemaId) -> void

πŸ“ Description

Delete all primary key overrides for a schema. After this call the schema will use the primary keys detected from the source connection, if any.

πŸ”Œ Usage

await client.schemas.resetPrimaryKeys("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users");

βš™οΈ Parameters

connectionId: string

schemaId: string

requestOptions: Schemas.RequestOptions

client.schemas.refresh(id) -> void

πŸ”Œ Usage

await client.schemas.refresh("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Schemas.RequestOptions

client.schemas.getStatus(id) -> Polytomic.BulkSyncSourceStatusEnvelope

πŸ“ Description

Polytomic periodically inspects the schemas for connections to discover new fields and update metadata. This endpoint returns the current inspection status.

πŸ”Œ Usage

await client.schemas.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Schemas.RequestOptions

client.schemas.get(id, schemaId) -> Polytomic.BulkSyncSourceSchemaEnvelope

πŸ”Œ Usage

await client.schemas.get("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users");

βš™οΈ Parameters

id: string

schemaId: string

requestOptions: Schemas.RequestOptions

client.schemas.getRecords(id, schemaId) -> Polytomic.SchemaRecordsResponseEnvelope

πŸ”Œ Usage

await client.schemas.getRecords("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users");

βš™οΈ Parameters

id: string

schemaId: string

requestOptions: Schemas.RequestOptions

Models

client.models.getEnrichmentSource(id, { ...params }) -> Polytomic.GetModelSyncSourceMetaEnvelope

πŸ”Œ Usage

await client.models.getEnrichmentSource("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

request: Polytomic.ModelsGetEnrichmentSourceRequest

requestOptions: Models.RequestOptions

client.models.post(connectionId, { ...params }) -> Polytomic.V2GetEnrichmentInputFieldsResponseEnvelope

πŸ“ Description

For a given connection and enrichment configuration, provides the valid sets of input fields.

πŸ”Œ Usage

await client.models.post("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

connectionId: string

request: Polytomic.GetEnrichmentInputFieldsRequest

requestOptions: Models.RequestOptions

client.models.preview({ ...params }) -> Polytomic.ModelResponseEnvelope

πŸ”Œ Usage

await client.models.preview({
    async: true,
    body: {
        configuration: {
            table: "public.users",
        },
        connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
        name: "Users",
    },
});

βš™οΈ Parameters

request: Polytomic.ModelsPreviewRequest

requestOptions: Models.RequestOptions

client.models.list() -> Polytomic.ModelListResponseEnvelope

πŸ”Œ Usage

await client.models.list();

βš™οΈ Parameters

requestOptions: Models.RequestOptions

client.models.create({ ...params }) -> Polytomic.ModelResponseEnvelope

πŸ”Œ Usage

await client.models.create({
    async: true,
    body: {
        configuration: {
            table: "public.users",
        },
        connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
        name: "Users",
    },
});

βš™οΈ Parameters

request: Polytomic.ModelsCreateRequest

requestOptions: Models.RequestOptions

client.models.get(id, { ...params }) -> Polytomic.ModelResponseEnvelope

πŸ”Œ Usage

await client.models.get("248df4b7-aa70-47b8-a036-33ac447e668d", {
    async: true,
});

βš™οΈ Parameters

id: string

request: Polytomic.ModelsGetRequest

requestOptions: Models.RequestOptions

client.models.update(id, { ...params }) -> Polytomic.ModelResponseEnvelope

πŸ”Œ Usage

await client.models.update("248df4b7-aa70-47b8-a036-33ac447e668d", {
    async: false,
    configuration: {
        table: "public.users",
    },
    connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
    name: "Users",
});

βš™οΈ Parameters

id: string

request: Polytomic.UpdateModelRequest

requestOptions: Models.RequestOptions

client.models.remove(id, { ...params }) -> void

πŸ”Œ Usage

await client.models.remove("248df4b7-aa70-47b8-a036-33ac447e668d", {
    async: true,
});

βš™οΈ Parameters

id: string

request: Polytomic.ModelsRemoveRequest

requestOptions: Models.RequestOptions

client.models.sample(id, { ...params }) -> Polytomic.ModelSampleResponseEnvelope

πŸ“ Description

Returns sample records from the model. The first ten records that the source provides will be returned after being enriched (if applicable). Synchronous requests must complete within 10s. If either querying or enrichment exceeds 10s, please use the async option.

πŸ”Œ Usage

await client.models.sample("248df4b7-aa70-47b8-a036-33ac447e668d", {
    async: true,
});

βš™οΈ Parameters

id: string

request: Polytomic.ModelsSampleRequest

requestOptions: Models.RequestOptions

ModelSync

client.modelSync.getSource(id, { ...params }) -> Polytomic.GetModelSyncSourceMetaEnvelope

πŸ”Œ Usage

await client.modelSync.getSource("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

request: Polytomic.ModelSyncGetSourceRequest

requestOptions: ModelSync.RequestOptions

client.modelSync.getSourceFields(id, { ...params }) -> Polytomic.ModelFieldResponse

πŸ”Œ Usage

await client.modelSync.getSourceFields("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

request: Polytomic.ModelSyncGetSourceFieldsRequest

requestOptions: ModelSync.RequestOptions

client.modelSync.list({ ...params }) -> Polytomic.ListModelSyncResponseEnvelope

πŸ”Œ Usage

await client.modelSync.list({
    active: true,
    mode: "create",
    target_connection_id: "0b155265-c537-44c9-9359-a3ceb468a4da",
});

βš™οΈ Parameters

request: Polytomic.ModelSyncListRequest

requestOptions: ModelSync.RequestOptions

client.modelSync.create({ ...params }) -> Polytomic.ModelSyncResponseEnvelope

πŸ“ Description

Create a new sync from one or more models to a destination.

All of the functionality described in the product documentation is configurable via the API.

Guides:

Targets (Destinations)

Polytomic refers to a model sync's destination as the "target object", or target. Target objects are identified by a connection ID and an object ID. You can retrieve a list of all target objects for a connection using the Get Target Objects endpoint.

The target object in the request specifies information about the sync destination.

"target": {
    "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
    "object": "Users",
},

Some connections support additional configuration for targets. For example, Salesforce connections support optionally specifying the ingestion API to use. The target specific options are passed as configuration; consult the integration guides for details about specific connection configurations.

Creating a new target

Some integrations support creating a new target when creating a model sync. For example, an ad audience or database table.

When creating a new target, object is omitted and create is specified instead. The create property is an object containing integration specific configuration for the new target.

"target": {
    "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
    "create": {
        "name": "New audience",
        "type": "user_audience"
    }
},

The Get Target List endpoint returns information about whether a connection supports target creation.

πŸ”Œ Usage

await client.modelSync.create({
    fields: [
        {
            target: "name",
        },
    ],
    mode: "create",
    name: "Users Sync",
    schedule: {},
    target: {
        connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
    },
});

βš™οΈ Parameters

request: Polytomic.CreateModelSyncRequest

requestOptions: ModelSync.RequestOptions

client.modelSync.getScheduleOptions() -> Polytomic.ScheduleOptionResponseEnvelope

πŸ”Œ Usage

await client.modelSync.getScheduleOptions();

βš™οΈ Parameters

requestOptions: ModelSync.RequestOptions

client.modelSync.get(id) -> Polytomic.ModelSyncResponseEnvelope

πŸ”Œ Usage

await client.modelSync.get("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: ModelSync.RequestOptions

client.modelSync.update(id, { ...params }) -> Polytomic.ModelSyncResponseEnvelope

πŸ”Œ Usage

await client.modelSync.update("248df4b7-aa70-47b8-a036-33ac447e668d", {
    fields: [
        {
            target: "name",
        },
    ],
    mode: "create",
    name: "Users Sync",
    schedule: {},
    target: {
        connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
    },
});

βš™οΈ Parameters

id: string

request: Polytomic.UpdateModelSyncRequest

requestOptions: ModelSync.RequestOptions

client.modelSync.remove(id) -> void

πŸ”Œ Usage

await client.modelSync.remove("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: ModelSync.RequestOptions

client.modelSync.activate(id, { ...params }) -> Polytomic.ActivateSyncEnvelope

πŸ”Œ Usage

await client.modelSync.activate("248df4b7-aa70-47b8-a036-33ac447e668d", {
    active: true,
});

βš™οΈ Parameters

id: string

request: Polytomic.ActivateSyncInput

requestOptions: ModelSync.RequestOptions

client.modelSync.cancel(id) -> Polytomic.CancelModelSyncResponseEnvelope

πŸ”Œ Usage

await client.modelSync.cancel("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string β€” The active execution of this sync ID will be cancelled.

requestOptions: ModelSync.RequestOptions

client.modelSync.start(id, { ...params }) -> Polytomic.StartModelSyncResponseEnvelope

πŸ“ Description

🚧 Force full resync

Use caution when setting the resync parameter to true. This will force a full resync of the data from the source system. This can be a time-consuming operation and may impact the performance of the source system. It is recommended to only use this option when necessary.

πŸ”Œ Usage

await client.modelSync.start("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

request: Polytomic.StartModelSyncRequest

requestOptions: ModelSync.RequestOptions

client.modelSync.getStatus(id) -> Polytomic.SyncStatusEnvelope

πŸ”Œ Usage

await client.modelSync.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: ModelSync.RequestOptions

Events

client.events.list({ ...params }) -> Polytomic.EventsEnvelope

πŸ”Œ Usage

await client.events.list({
    organization_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
    type: "type",
    starting_after: "2020-01-01T00:00:00Z",
    ending_before: "2020-01-01T00:00:00Z",
    limit: 1,
});

βš™οΈ Parameters

request: Polytomic.EventsListRequest

requestOptions: Events.RequestOptions

client.events.getTypes() -> Polytomic.EventTypesEnvelope

πŸ”Œ Usage

await client.events.getTypes();

βš™οΈ Parameters

requestOptions: Events.RequestOptions

Jobs

client.jobs.get(type_, id) -> Polytomic.JobResponseEnvelope

πŸ”Œ Usage

await client.jobs.get("createmodel", "248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

type_: string

id: string

requestOptions: Jobs.RequestOptions

Identity

client.identity.get() -> Polytomic.GetIdentityResponseEnvelope

πŸ“ Description

Returns information about the caller's identity.

πŸ”Œ Usage

await client.identity.get();

βš™οΈ Parameters

requestOptions: Identity.RequestOptions

Notifications

client.notifications.getGlobalErrorSubscribers() -> Polytomic.V4GlobalErrorSubscribersResponse

πŸ”Œ Usage

await client.notifications.getGlobalErrorSubscribers();

βš™οΈ Parameters

requestOptions: Notifications.RequestOptions

client.notifications.setGlobalErrorSubscribers({ ...params }) -> Polytomic.V4GlobalErrorSubscribersResponse

πŸ”Œ Usage

await client.notifications.setGlobalErrorSubscribers();

βš™οΈ Parameters

request: Polytomic.V4GlobalErrorSubscribersRequest

requestOptions: Notifications.RequestOptions

Organization

client.organization.list() -> Polytomic.OrganizationsEnvelope

πŸ“ Description

🚧 Requires partner key

Organization endpoints are only accessible using partner keys.

πŸ”Œ Usage

await client.organization.list();

βš™οΈ Parameters

requestOptions: Organization.RequestOptions

client.organization.create({ ...params }) -> Polytomic.OrganizationEnvelope

πŸ“ Description

🚧 Requires partner key

Organization endpoints are only accessible using partner keys.

πŸ”Œ Usage

await client.organization.create({
    name: "My Organization",
});

βš™οΈ Parameters

request: Polytomic.CreateOrganizationRequestSchema

requestOptions: Organization.RequestOptions

client.organization.get(id) -> Polytomic.OrganizationEnvelope

πŸ“ Description

🚧 Requires partner key

Organization endpoints are only accessible using partner keys.

πŸ”Œ Usage

await client.organization.get("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Organization.RequestOptions

client.organization.update(id, { ...params }) -> Polytomic.OrganizationEnvelope

πŸ“ Description

🚧 Requires partner key

Organization endpoints are only accessible using partner keys.

πŸ”Œ Usage

await client.organization.update("248df4b7-aa70-47b8-a036-33ac447e668d", {
    name: "My Organization",
});

βš™οΈ Parameters

id: string

request: Polytomic.UpdateOrganizationRequestSchema

requestOptions: Organization.RequestOptions

client.organization.remove(id) -> void

πŸ“ Description

🚧 Requires partner key

Organization endpoints are only accessible using partner keys.

πŸ”Œ Usage

await client.organization.remove("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Organization.RequestOptions

Users

client.users.list(orgId) -> Polytomic.ListUsersEnvelope

πŸ”Œ Usage

await client.users.list("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

orgId: string

requestOptions: Users.RequestOptions

client.users.create(orgId, { ...params }) -> Polytomic.UserEnvelope

πŸ”Œ Usage

await client.users.create("248df4b7-aa70-47b8-a036-33ac447e668d", {
    email: "mail@example.com",
});

βš™οΈ Parameters

orgId: string

request: Polytomic.CreateUserRequestSchema

requestOptions: Users.RequestOptions

client.users.get(orgId, id) -> Polytomic.UserEnvelope

πŸ”Œ Usage

await client.users.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

orgId: string

id: string

requestOptions: Users.RequestOptions

client.users.update(orgId, id, { ...params }) -> Polytomic.UserEnvelope

πŸ”Œ Usage

await client.users.update("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
    email: "mail@example.com",
});

βš™οΈ Parameters

orgId: string

id: string

request: Polytomic.UpdateUserRequestSchema

requestOptions: Users.RequestOptions

client.users.remove(orgId, id) -> Polytomic.UserEnvelope

πŸ”Œ Usage

await client.users.remove("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

orgId: string

id: string

requestOptions: Users.RequestOptions

client.users.createApiKey(orgId, id, { ...params }) -> Polytomic.ApiKeyResponseEnvelope

πŸ“ Description

🚧 Requires partner key

User endpoints are only accessible using partner keys.

πŸ”Œ Usage

await client.users.createApiKey("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
    force: true,
});

βš™οΈ Parameters

orgId: string

id: string

request: Polytomic.UsersCreateApiKeyRequest

requestOptions: Users.RequestOptions

Webhooks

client.webhooks.list() -> Polytomic.WebhookListEnvelope

πŸ“ Description

Webooks can be set up using the webhook API endpoints. Currently, only one webhook may be created per organization. The webhook will be called for events in that organization.

Consult the Events documentation for more information.

πŸ”Œ Usage

await client.webhooks.list();

βš™οΈ Parameters

requestOptions: Webhooks.RequestOptions

client.webhooks.create({ ...params }) -> Polytomic.WebhookEnvelope

πŸ“ Description

Webooks can be set up using the webhook API endpoints. Currently, only one webhook may be created per organization. The webhook will be called for events in that organization.

Consult the Events documentation for more information.

πŸ”Œ Usage

await client.webhooks.create({
    endpoint: "https://example.com/webhook",
    secret: "secret",
});

βš™οΈ Parameters

request: Polytomic.CreateWebhooksSchema

requestOptions: Webhooks.RequestOptions

client.webhooks.get(id) -> Polytomic.WebhookEnvelope

πŸ“ Description

Webooks can be set up using the webhook API endpoints. Currently, only one webhook may be created per organization. The webhook will be called for events in that organization.

Consult the Events documentation for more information.

πŸ”Œ Usage

await client.webhooks.get("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Webhooks.RequestOptions

client.webhooks.update(id, { ...params }) -> Polytomic.WebhookEnvelope

πŸ“ Description

Webooks can be set up using the webhook API endpoints. Currently, only one webhook may be created per organization. The webhook will be called for events in that organization.

Consult the Events documentation for more information.

πŸ”Œ Usage

await client.webhooks.update("248df4b7-aa70-47b8-a036-33ac447e668d", {
    endpoint: "https://example.com/webhook",
    secret: "secret",
});

βš™οΈ Parameters

id: string

request: Polytomic.UpdateWebhooksSchema

requestOptions: Webhooks.RequestOptions

client.webhooks.remove(id) -> void

πŸ”Œ Usage

await client.webhooks.remove("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Webhooks.RequestOptions

client.webhooks.disable(id) -> Polytomic.WebhookEnvelope

πŸ”Œ Usage

await client.webhooks.disable("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Webhooks.RequestOptions

client.webhooks.enable(id) -> Polytomic.WebhookEnvelope

πŸ”Œ Usage

await client.webhooks.enable("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Webhooks.RequestOptions

BulkSync Executions

client.bulkSync.executions.listStatus({ ...params }) -> Polytomic.ListBulkSyncExecutionStatusEnvelope

πŸ”Œ Usage

await client.bulkSync.executions.listStatus({
    all: true,
    active: true,
});

βš™οΈ Parameters

request: Polytomic.bulkSync.ExecutionsListStatusRequest

requestOptions: Executions.RequestOptions

client.bulkSync.executions.list(id, { ...params }) -> Polytomic.ListBulkSyncExecutionsEnvelope

πŸ”Œ Usage

await client.bulkSync.executions.list("248df4b7-aa70-47b8-a036-33ac447e668d", {
    page_token: "AmkYh8v0jR5B3kls2Qcc9y8MjrPmvR4CvaK7H0F4rEwqvg76K==",
    only_terminal: true,
    ascending: true,
    limit: 100,
});

βš™οΈ Parameters

id: string

request: Polytomic.bulkSync.ExecutionsListRequest

requestOptions: Executions.RequestOptions

client.bulkSync.executions.get(id, execId) -> Polytomic.BulkSyncExecutionEnvelope

πŸ”Œ Usage

await client.bulkSync.executions.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

execId: string

requestOptions: Executions.RequestOptions

client.bulkSync.executions.cancel(id, execId) -> Polytomic.CancelBulkSyncResponseEnvelope

πŸ”Œ Usage

await client.bulkSync.executions.cancel("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string β€” The bulk sync ID.

execId: string β€” The execution ID to cancel.

requestOptions: Executions.RequestOptions

client.bulkSync.executions.getLogs(syncId, executionId) -> Polytomic.V4BulkSyncExecutionLogsEnvelope

πŸ”Œ Usage

await client.bulkSync.executions.getLogs(
    "248df4b7-aa70-47b8-a036-33ac447e668d",
    "248df4b7-aa70-47b8-a036-33ac447e668d",
);

βš™οΈ Parameters

syncId: string

executionId: string

requestOptions: Executions.RequestOptions

client.bulkSync.executions.exportLogs(syncId, executionId, { ...params }) -> Polytomic.V4ExportSyncLogsEnvelope

πŸ”Œ Usage

await client.bulkSync.executions.exportLogs(
    "248df4b7-aa70-47b8-a036-33ac447e668d",
    "248df4b7-aa70-47b8-a036-33ac447e668d",
    {
        notify: true,
    },
);

βš™οΈ Parameters

syncId: string

executionId: string

request: Polytomic.bulkSync.ExecutionsExportLogsRequest

requestOptions: Executions.RequestOptions

BulkSync Schemas

client.bulkSync.schemas.list(id, { ...params }) -> Polytomic.ListBulkSchema

πŸ”Œ Usage

await client.bulkSync.schemas.list("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

request: Polytomic.bulkSync.SchemasListRequest

requestOptions: Schemas.RequestOptions

client.bulkSync.schemas.patch(id, { ...params }) -> Polytomic.ListBulkSchema

πŸ”Œ Usage

await client.bulkSync.schemas.patch("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

request: Polytomic.bulkSync.BulkSyncSchemasRequest

requestOptions: Schemas.RequestOptions

client.bulkSync.schemas.get(id, schemaId) -> Polytomic.BulkSchemaEnvelope

πŸ”Œ Usage

await client.bulkSync.schemas.get("248df4b7-aa70-47b8-a036-33ac447e668d", "Contact");

βš™οΈ Parameters

id: string

schemaId: string

requestOptions: Schemas.RequestOptions

client.bulkSync.schemas.update(id, schemaId, { ...params }) -> Polytomic.BulkSchemaEnvelope

πŸ”Œ Usage

await client.bulkSync.schemas.update("248df4b7-aa70-47b8-a036-33ac447e668d", "contact");

βš™οΈ Parameters

id: string

schemaId: string

request: Polytomic.bulkSync.UpdateBulkSchema

requestOptions: Schemas.RequestOptions

client.bulkSync.schemas.cancel(id, schemaId) -> Polytomic.CancelBulkSyncResponseEnvelope

πŸ”Œ Usage

await client.bulkSync.schemas.cancel("248df4b7-aa70-47b8-a036-33ac447e668d", "schema_id");

βš™οΈ Parameters

id: string β€” The bulk sync ID.

schemaId: string β€” The schema ID to cancel for the bulk sync.

requestOptions: Schemas.RequestOptions

BulkSync Schedules

client.bulkSync.schedules.list(syncId) -> Polytomic.SchedulesEnvelope

πŸ”Œ Usage

await client.bulkSync.schedules.list("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

syncId: string

requestOptions: Schedules.RequestOptions

client.bulkSync.schedules.create(syncId, { ...params }) -> Polytomic.ScheduleEnvelope

πŸ”Œ Usage

await client.bulkSync.schedules.create("248df4b7-aa70-47b8-a036-33ac447e668d", {
    schedule: {
        frequency: "manual",
    },
});

βš™οΈ Parameters

syncId: string

request: Polytomic.bulkSync.CreateScheduleRequest

requestOptions: Schedules.RequestOptions

client.bulkSync.schedules.get(syncId, scheduleId) -> Polytomic.ScheduleEnvelope

πŸ”Œ Usage

await client.bulkSync.schedules.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

syncId: string

scheduleId: string

requestOptions: Schedules.RequestOptions

client.bulkSync.schedules.update(syncId, scheduleId, { ...params }) -> Polytomic.ScheduleEnvelope

πŸ”Œ Usage

await client.bulkSync.schedules.update("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
    schedule: {
        frequency: "manual",
    },
});

βš™οΈ Parameters

syncId: string

scheduleId: string

request: Polytomic.bulkSync.UpdateScheduleRequest

requestOptions: Schedules.RequestOptions

client.bulkSync.schedules.delete(syncId, scheduleId) -> void

πŸ”Œ Usage

await client.bulkSync.schedules.delete("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

syncId: string

scheduleId: string

requestOptions: Schedules.RequestOptions

ModelSync Targets

client.modelSync.targets.getTarget(id, { ...params }) -> Polytomic.GetConnectionMetaEnvelope

πŸ”Œ Usage

await client.modelSync.targets.getTarget("248df4b7-aa70-47b8-a036-33ac447e668d", {
    type: "type",
    search: "search",
});

βš™οΈ Parameters

id: string

request: Polytomic.modelSync.TargetsGetTargetRequest

requestOptions: Targets.RequestOptions

client.modelSync.targets.getTargetFields(id, { ...params }) -> Polytomic.TargetResponseEnvelope

πŸ”Œ Usage

await client.modelSync.targets.getTargetFields("248df4b7-aa70-47b8-a036-33ac447e668d", {
    target: "database.table",
    refresh: false,
});

βš™οΈ Parameters

id: string

request: Polytomic.modelSync.TargetsGetTargetFieldsRequest

requestOptions: Targets.RequestOptions

client.modelSync.targets.list(id) -> Polytomic.V4TargetObjectsResponseEnvelope

πŸ“ Description

Returns available model sync destinations for a connection.

If the connection supports creating new destinations, the target_creation object will contain information on what properties are required to create the target.

Target creation properties are all string values; the enum flag indicates if the property has a fixed set of valid values. When enum is true, the Target Creation Property Values endpoint can be used to retrieve the valid values.

Sync modes

The sync mode determines which records are written to the destination for a model sync. The modes array for a target object defines the id along with what operations the mode supports.

πŸ”Œ Usage

await client.modelSync.targets.list("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Targets.RequestOptions

client.modelSync.targets.getCreateProperty(id, property) -> Polytomic.V4TargetPropertyValuesEnvelope

πŸ“ Description

Connections which support creating new sync target objects (destinations) will return target_creation with their target object list. This endpoint will return possible values for properties where enum is true.

If the connection does not support creating new target objects, an HTTP 404 will be returned.

The values array lists the valid options (and labels) for the property. Each member of the values array has a label and value. For exaample,

{
    "data": [
        {
            "id": "account",
            "title": "Account ID",
            "enum": true,
            "values": [
                {
                    "value": "1234567::urn:li:organization:987654",
                    "label": "Polytomic Inc. (1234567)"
                }
            ]
        }
    ]
}

The value for the selected option should be passed when creating a sync.

πŸ”Œ Usage

await client.modelSync.targets.getCreateProperty("248df4b7-aa70-47b8-a036-33ac447e668d", "property");

βš™οΈ Parameters

id: string

property: string

requestOptions: Targets.RequestOptions

ModelSync Executions

client.modelSync.executions.list(syncId, { ...params }) -> Polytomic.ListExecutionResponseEnvelope

πŸ”Œ Usage

await client.modelSync.executions.list("248df4b7-aa70-47b8-a036-33ac447e668d", {
    page_token: "AmkYh8v0jR5B3kls2Qcc9y8MjrPmvR4CvaK7H0F4rEwqvg76K==",
    only_completed: true,
    ascending: true,
});

βš™οΈ Parameters

syncId: string

request: Polytomic.modelSync.ExecutionsListRequest

requestOptions: Executions.RequestOptions

client.modelSync.executions.get(syncId, id) -> Polytomic.GetExecutionResponseEnvelope

πŸ”Œ Usage

await client.modelSync.executions.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

syncId: string

id: string

requestOptions: Executions.RequestOptions

client.modelSync.executions.update(syncId, id, { ...params }) -> Polytomic.GetExecutionResponseEnvelope

πŸ”Œ Usage

await client.modelSync.executions.update(
    "248df4b7-aa70-47b8-a036-33ac447e668d",
    "248df4b7-aa70-47b8-a036-33ac447e668d",
    {
        status: "created",
    },
);

βš™οΈ Parameters

syncId: string

id: string β€” The ID of the execution to update.

request: Polytomic.modelSync.UpdateExecutionRequest

requestOptions: Executions.RequestOptions

client.modelSync.executions.getLogUrls(syncId, id, type_) -> Polytomic.ExecutionLogsResponseEnvelope

πŸ”Œ Usage

await client.modelSync.executions.getLogUrls(
    "248df4b7-aa70-47b8-a036-33ac447e668d",
    "248df4b7-aa70-47b8-a036-33ac447e668d",
    "records",
);

βš™οΈ Parameters

syncId: string

id: string

type_: Polytomic.V2ExecutionLogType

requestOptions: Executions.RequestOptions

client.modelSync.executions.getLogs(syncId, id, type_, filename) -> void

πŸ”Œ Usage

await client.modelSync.executions.getLogs(
    "248df4b7-aa70-47b8-a036-33ac447e668d",
    "0ecd09c1-b901-4d27-9053-f0367c427254",
    "records",
    "path/to/file.json",
);

βš™οΈ Parameters

syncId: string

id: string

type_: Polytomic.V2ExecutionLogType

filename: string

requestOptions: Executions.RequestOptions

Permissions Policies

client.permissions.policies.list() -> Polytomic.ListPoliciesResponseEnvelope

πŸ”Œ Usage

await client.permissions.policies.list();

βš™οΈ Parameters

requestOptions: Policies.RequestOptions

client.permissions.policies.create({ ...params }) -> Polytomic.PolicyResponseEnvelope

πŸ”Œ Usage

await client.permissions.policies.create({
    name: "Custom",
});

βš™οΈ Parameters

request: Polytomic.permissions.CreatePolicyRequest

requestOptions: Policies.RequestOptions

client.permissions.policies.get(id) -> Polytomic.PolicyResponseEnvelope

πŸ”Œ Usage

await client.permissions.policies.get("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Policies.RequestOptions

client.permissions.policies.update(id, { ...params }) -> Polytomic.PolicyResponseEnvelope

πŸ”Œ Usage

await client.permissions.policies.update("248df4b7-aa70-47b8-a036-33ac447e668d", {
    name: "Custom",
});

βš™οΈ Parameters

id: string

request: Polytomic.permissions.UpdatePolicyRequest

requestOptions: Policies.RequestOptions

client.permissions.policies.remove(id) -> void

πŸ”Œ Usage

await client.permissions.policies.remove("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Policies.RequestOptions

Permissions Roles

client.permissions.roles.list() -> Polytomic.RoleListResponseEnvelope

πŸ”Œ Usage

await client.permissions.roles.list();

βš™οΈ Parameters

requestOptions: Roles.RequestOptions

client.permissions.roles.create({ ...params }) -> Polytomic.RoleResponseEnvelope

πŸ”Œ Usage

await client.permissions.roles.create({
    name: "Custom",
});

βš™οΈ Parameters

request: Polytomic.permissions.CreateRoleRequest

requestOptions: Roles.RequestOptions

client.permissions.roles.get(id) -> Polytomic.RoleResponseEnvelope

πŸ”Œ Usage

await client.permissions.roles.get("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Roles.RequestOptions

client.permissions.roles.update(id, { ...params }) -> Polytomic.RoleResponseEnvelope

πŸ”Œ Usage

await client.permissions.roles.update("248df4b7-aa70-47b8-a036-33ac447e668d", {
    name: "Custom",
});

βš™οΈ Parameters

id: string

request: Polytomic.permissions.UpdateRoleRequest

requestOptions: Roles.RequestOptions

client.permissions.roles.remove(id) -> void

πŸ”Œ Usage

await client.permissions.roles.remove("248df4b7-aa70-47b8-a036-33ac447e668d");

βš™οΈ Parameters

id: string

requestOptions: Roles.RequestOptions