Interface AutomationsAPI

interface AutomationsAPI {
    changeOwnerAutomation: (
        id: string,
        body: { userId: string },
        options?: ApiCallOptions,
    ) => Promise<ChangeOwnerAutomationHttpResponse>;
    changeSpaceAutomation: (
        id: string,
        body: { spaceId: string },
        options?: ApiCallOptions,
    ) => Promise<ChangeSpaceAutomationHttpResponse>;
    clearCache: () => void;
    copyAutomation: (
        id: string,
        body: { name: string },
        options?: ApiCallOptions,
    ) => Promise<CopyAutomationHttpResponse>;
    createAutomation: (
        body: AutomationDetailRequestObject,
        options?: ApiCallOptions,
    ) => Promise<CreateAutomationHttpResponse>;
    deleteAutomation: (
        id: string,
        options?: ApiCallOptions,
    ) => Promise<DeleteAutomationHttpResponse>;
    disableAutomation: (
        id: string,
        options?: ApiCallOptions,
    ) => Promise<DisableAutomationHttpResponse>;
    enableAutomation: (
        id: string,
        options?: ApiCallOptions,
    ) => Promise<EnableAutomationHttpResponse>;
    getAutomation: (
        id: string,
        options?: ApiCallOptions,
    ) => Promise<GetAutomationHttpResponse>;
    getAutomationRun: (
        id: string,
        runId: string,
        options?: ApiCallOptions,
    ) => Promise<GetAutomationRunHttpResponse>;
    getAutomationRunDetails: (
        id: string,
        runId: string,
        options?: ApiCallOptions,
    ) => Promise<GetAutomationRunDetailsHttpResponse>;
    getAutomationRuns: (
        id: string,
        query: {
            fields?: string;
            filter?: string;
            limit?: number;
            sort?:
                | "status"
                | "id"
                | "+status"
                | "-status"
                | "+id"
                | "-id"
                | "startTime"
                | "-startTime"
                | "+startTime";
        },
        options?: ApiCallOptions,
    ) => Promise<GetAutomationRunsHttpResponse>;
    getAutomationRunWithQuery: (
        id: string,
        runId: string,
        query: { fields?: string },
        options?: ApiCallOptions,
    ) => Promise<GetAutomationRunWithQueryHttpResponse>;
    getAutomations: (
        query: {
            fields?: string;
            filter?: string;
            limit?: number;
            listAll?: boolean;
            sort?:
                | "state"
                | "id"
                | "name"
                | "-name"
                | "+name"
                | "+createdAt"
                | "-createdAt"
                | "+updatedAt"
                | "-updatedAt"
                | "createdAt"
                | "updatedAt"
                | "+id"
                | "-id"
                | "runMode"
                | "lastRunAt"
                | "lastRunStatus"
                | "duration"
                | "+runMode"
                | "+state"
                | "+lastRunAt"
                | "+lastRunStatus"
                | "-runMode"
                | "-state"
                | "-lastRunAt"
                | "-lastRunStatus"
                | "+duration"
                | "-duration";
        },
        options?: ApiCallOptions,
    ) => Promise<GetAutomationsHttpResponse>;
    getAutomationsUsageMetrics: (
        query: { breakdownBy?: string; filter: string },
        options?: ApiCallOptions,
    ) => Promise<GetAutomationsUsageMetricsHttpResponse>;
    getAutomationWithQuery: (
        id: string,
        query: { fields?: string },
        options?: ApiCallOptions,
    ) => Promise<GetAutomationWithQueryHttpResponse>;
    moveAutomation: (
        id: string,
        body: { userId: string },
        options?: ApiCallOptions,
    ) => Promise<MoveAutomationHttpResponse>;
    queueAutomationRun: (
        id: string,
        body: RunDetailRequestObject,
        options?: ApiCallOptions,
    ) => Promise<QueueAutomationRunHttpResponse>;
    retryAutomationRun: (
        id: string,
        runId: string,
        options?: ApiCallOptions,
    ) => Promise<RetryAutomationRunHttpResponse>;
    stopAutomationRun: (
        id: string,
        runId: string,
        options?: ApiCallOptions,
    ) => Promise<StopAutomationRunHttpResponse>;
    updateAutomation: (
        id: string,
        body: AutomationDetailRequestObject,
        options?: ApiCallOptions,
    ) => Promise<UpdateAutomationHttpResponse>;
}
Index

Properties

changeOwnerAutomation: (
    id: string,
    body: { userId: string },
    options?: ApiCallOptions,
) => Promise<ChangeOwnerAutomationHttpResponse>

Changes the owner of an automation to another user. This action removes the history and change logs of this automation. All linked connections used in the automation are detached and not moved to the new owner.

Type declaration

    • (
          id: string,
          body: { userId: string },
          options?: ApiCallOptions,
      ): Promise<ChangeOwnerAutomationHttpResponse>
    • Changes the owner of an automation to another user. This action removes the history and change logs of this automation. All linked connections used in the automation are detached and not moved to the new owner.

      Parameters

      • id: string

        The unique identifier for the automation.

      • body: { userId: string }

        an object with the body content

        • userId: string

          The unique identifier of the new owner.

      • Optionaloptions: ApiCallOptions

      Returns Promise<ChangeOwnerAutomationHttpResponse>

      ChangeOwnerAutomationHttpError

The unique identifier for the automation.

an object with the body content

ChangeOwnerAutomationHttpError

changeSpaceAutomation: (
    id: string,
    body: { spaceId: string },
    options?: ApiCallOptions,
) => Promise<ChangeSpaceAutomationHttpResponse>

Changes the space of an automation by specifying a new space.

Type declaration

    • (
          id: string,
          body: { spaceId: string },
          options?: ApiCallOptions,
      ): Promise<ChangeSpaceAutomationHttpResponse>
    • Changes the space of an automation by specifying a new space.

      Parameters

      • id: string

        The unique identifier for the automation.

      • body: { spaceId: string }

        an object with the body content

        • spaceId: string

          The unique identifier of the new space.

      • Optionaloptions: ApiCallOptions

      Returns Promise<ChangeSpaceAutomationHttpResponse>

      ChangeSpaceAutomationHttpError

The unique identifier for the automation.

an object with the body content

ChangeSpaceAutomationHttpError

clearCache: () => void

Clears the cache for automations api requests.

Type declaration

    • (): void
    • Clears the cache for automations api requests.

      Returns void

copyAutomation: (
    id: string,
    body: { name: string },
    options?: ApiCallOptions,
) => Promise<CopyAutomationHttpResponse>

Duplicates an existing automation. The requesting user must be the owner of the automation.

Type declaration

    • (
          id: string,
          body: { name: string },
          options?: ApiCallOptions,
      ): Promise<CopyAutomationHttpResponse>
    • Duplicates an existing automation. The requesting user must be the owner of the automation.

      Parameters

      • id: string

        The unique identifier for the automation.

      • body: { name: string }

        an object with the body content

        • name: string

          Name of the new automation.

      • Optionaloptions: ApiCallOptions

      Returns Promise<CopyAutomationHttpResponse>

      CopyAutomationHttpError

The unique identifier for the automation.

an object with the body content

CopyAutomationHttpError

createAutomation: (
    body: AutomationDetailRequestObject,
    options?: ApiCallOptions,
) => Promise<CreateAutomationHttpResponse>

Creates a new automation. The requesting user must be assigned the AutomationCreator role.

Type declaration

an object with the body content

CreateAutomationHttpError

deleteAutomation: (
    id: string,
    options?: ApiCallOptions,
) => Promise<DeleteAutomationHttpResponse>

Deletes an automation. The requesting user must be the owner of the automation, or be assigned the TenantAdmin role.

Type declaration

The unique identifier for the automation.

DeleteAutomationHttpError

disableAutomation: (
    id: string,
    options?: ApiCallOptions,
) => Promise<DisableAutomationHttpResponse>

Disables an automation so that it cannot be run. The requesting user must be the owner of the automation, or be assigned the TenantAdmin role.

Type declaration

The unique identifier for the automation.

DisableAutomationHttpError

enableAutomation: (
    id: string,
    options?: ApiCallOptions,
) => Promise<EnableAutomationHttpResponse>

Enables an automation so that it can be run. The requesting user must be the owner of the automation, or be assigned the TenantAdmin role.

Type declaration

The unique identifier for the automation.

EnableAutomationHttpError

getAutomation: (
    id: string,
    options?: ApiCallOptions,
) => Promise<GetAutomationHttpResponse>

Retrieves the full definition of an automation. The requesting user must be the owner of the automation.

Type declaration

The unique identifier for the automation.

GetAutomationHttpError

getAutomationRun: (
    id: string,
    runId: string,
    options?: ApiCallOptions,
) => Promise<GetAutomationRunHttpResponse>

Retrieves a specific run for an automation. The requesting user must be the owner of the automation.

Type declaration

    • (
          id: string,
          runId: string,
          options?: ApiCallOptions,
      ): Promise<GetAutomationRunHttpResponse>
    • Retrieves a specific run for an automation. The requesting user must be the owner of the automation.

      Parameters

      • id: string

        The unique identifier for the automation.

      • runId: string

        The unique identifier for the run.

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetAutomationRunHttpResponse>

      GetAutomationRunHttpError

The unique identifier for the automation.

The unique identifier for the run.

GetAutomationRunHttpError

getAutomationRunDetails: (
    id: string,
    runId: string,
    options?: ApiCallOptions,
) => Promise<GetAutomationRunDetailsHttpResponse>

Retrieves the URL for the debug log of a specific automation run. The requesting user must be the owner of the automation.

Type declaration

The unique identifier for the automation.

The unique identifier for the run.

GetAutomationRunDetailsHttpError

getAutomationRuns: (
    id: string,
    query: {
        fields?: string;
        filter?: string;
        limit?: number;
        sort?:
            | "status"
            | "id"
            | "+status"
            | "-status"
            | "+id"
            | "-id"
            | "startTime"
            | "-startTime"
            | "+startTime";
    },
    options?: ApiCallOptions,
) => Promise<GetAutomationRunsHttpResponse>

Retrieves a list of runs for a specific automation. The requesting user must be the owner of the automation, or be assigned the TenantAdmin role.

Type declaration

    • (
          id: string,
          query: {
              fields?: string;
              filter?: string;
              limit?: number;
              sort?:
                  | "status"
                  | "id"
                  | "+status"
                  | "-status"
                  | "+id"
                  | "-id"
                  | "startTime"
                  | "-startTime"
                  | "+startTime";
          },
          options?: ApiCallOptions,
      ): Promise<GetAutomationRunsHttpResponse>
    • Retrieves a list of runs for a specific automation. The requesting user must be the owner of the automation, or be assigned the TenantAdmin role.

      Parameters

      • id: string

        The unique identifier for the automation.

      • query: {
            fields?: string;
            filter?: string;
            limit?: number;
            sort?:
                | "status"
                | "id"
                | "+status"
                | "-status"
                | "+id"
                | "-id"
                | "startTime"
                | "-startTime"
                | "+startTime";
        }

        an object with query parameters

        • Optionalfields?: string

          Allows to select the actual fields to be returned. Where the default is all fields

        • Optionalfilter?: string

          Allowed filters: status, context, startTime and title, spaceId, ownerId, executedById

        • Optionallimit?: number

          The number of runs to retrieve.

        • Optionalsort?:
              | "status"
              | "id"
              | "+status"
              | "-status"
              | "+id"
              | "-id"
              | "startTime"
              | "-startTime"
              | "+startTime"

          The field to sort by, with +- prefix indicating sort order. (?query=-startTime => sort on the startTime field using descending order)

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetAutomationRunsHttpResponse>

      GetAutomationRunsHttpError

The unique identifier for the automation.

an object with query parameters

GetAutomationRunsHttpError

getAutomationRunWithQuery: (
    id: string,
    runId: string,
    query: { fields?: string },
    options?: ApiCallOptions,
) => Promise<GetAutomationRunWithQueryHttpResponse>

Retrieves a specific run for an automation. The requesting user must be the owner of the automation.

Type declaration

    • (
          id: string,
          runId: string,
          query: { fields?: string },
          options?: ApiCallOptions,
      ): Promise<GetAutomationRunWithQueryHttpResponse>
    • Retrieves a specific run for an automation. The requesting user must be the owner of the automation.

      Parameters

      • id: string

        The unique identifier for the automation.

      • runId: string

        The unique identifier for the run.

      • query: { fields?: string }

        an object with query parameters

        • Optionalfields?: string

          Allows to select the actual fields to be returned. Where the default is all fields

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetAutomationRunWithQueryHttpResponse>

      GetAutomationRunWithQueryHttpError

The unique identifier for the automation.

The unique identifier for the run.

an object with query parameters

GetAutomationRunWithQueryHttpError

getAutomations: (
    query: {
        fields?: string;
        filter?: string;
        limit?: number;
        listAll?: boolean;
        sort?:
            | "state"
            | "id"
            | "name"
            | "-name"
            | "+name"
            | "+createdAt"
            | "-createdAt"
            | "+updatedAt"
            | "-updatedAt"
            | "createdAt"
            | "updatedAt"
            | "+id"
            | "-id"
            | "runMode"
            | "lastRunAt"
            | "lastRunStatus"
            | "duration"
            | "+runMode"
            | "+state"
            | "+lastRunAt"
            | "+lastRunStatus"
            | "-runMode"
            | "-state"
            | "-lastRunAt"
            | "-lastRunStatus"
            | "+duration"
            | "-duration";
    },
    options?: ApiCallOptions,
) => Promise<GetAutomationsHttpResponse>

Retrieves a list of the automations that the requesting user has access to.

Type declaration

    • (
          query: {
              fields?: string;
              filter?: string;
              limit?: number;
              listAll?: boolean;
              sort?:
                  | "state"
                  | "id"
                  | "name"
                  | "-name"
                  | "+name"
                  | "+createdAt"
                  | "-createdAt"
                  | "+updatedAt"
                  | "-updatedAt"
                  | "createdAt"
                  | "updatedAt"
                  | "+id"
                  | "-id"
                  | "runMode"
                  | "lastRunAt"
                  | "lastRunStatus"
                  | "duration"
                  | "+runMode"
                  | "+state"
                  | "+lastRunAt"
                  | "+lastRunStatus"
                  | "-runMode"
                  | "-state"
                  | "-lastRunAt"
                  | "-lastRunStatus"
                  | "+duration"
                  | "-duration";
          },
          options?: ApiCallOptions,
      ): Promise<GetAutomationsHttpResponse>
    • Retrieves a list of the automations that the requesting user has access to.

      Parameters

      • query: {
            fields?: string;
            filter?: string;
            limit?: number;
            listAll?: boolean;
            sort?:
                | "state"
                | "id"
                | "name"
                | "-name"
                | "+name"
                | "+createdAt"
                | "-createdAt"
                | "+updatedAt"
                | "-updatedAt"
                | "createdAt"
                | "updatedAt"
                | "+id"
                | "-id"
                | "runMode"
                | "lastRunAt"
                | "lastRunStatus"
                | "duration"
                | "+runMode"
                | "+state"
                | "+lastRunAt"
                | "+lastRunStatus"
                | "-runMode"
                | "-state"
                | "-lastRunAt"
                | "-lastRunStatus"
                | "+duration"
                | "-duration";
        }

        an object with query parameters

        • Optionalfields?: string

          Allows to select the actual fields to be returned. When no fields are defined, all are returned.

        • Optionalfilter?: string

          Allowed filters: name, runMode, lastRunStatus, ownerId, spaceId

        • Optionallimit?: number

          The number of automations to retrieve.

        • OptionallistAll?: boolean

          When true, list all automations. Restricted to tenant admins and analytics admins.

        • Optionalsort?:
              | "state"
              | "id"
              | "name"
              | "-name"
              | "+name"
              | "+createdAt"
              | "-createdAt"
              | "+updatedAt"
              | "-updatedAt"
              | "createdAt"
              | "updatedAt"
              | "+id"
              | "-id"
              | "runMode"
              | "lastRunAt"
              | "lastRunStatus"
              | "duration"
              | "+runMode"
              | "+state"
              | "+lastRunAt"
              | "+lastRunStatus"
              | "-runMode"
              | "-state"
              | "-lastRunAt"
              | "-lastRunStatus"
              | "+duration"
              | "-duration"

          The field to sort by, with +- prefix indicating sort order. (?query=-name => sort on the name field using descending order)

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetAutomationsHttpResponse>

      getAutomations(
      {
      fields: "lastRun,lastRunStatus,runMode,createdAt,updatedAt"
      }
      )

      GetAutomationsHttpError

getAutomations(
{
fields: "lastRun,lastRunStatus,runMode,createdAt,updatedAt"
}
)

an object with query parameters

GetAutomationsHttpError

getAutomationsUsageMetrics: (
    query: { breakdownBy?: string; filter: string },
    options?: ApiCallOptions,
) => Promise<GetAutomationsUsageMetricsHttpResponse>

Retrieves paginated usage metrics for automations. The requesting user must be assigned the TenantAdmin role.

Type declaration

    • (
          query: { breakdownBy?: string; filter: string },
          options?: ApiCallOptions,
      ): Promise<GetAutomationsUsageMetricsHttpResponse>
    • Retrieves paginated usage metrics for automations. The requesting user must be assigned the TenantAdmin role.

      Parameters

      • query: { breakdownBy?: string; filter: string }

        an object with query parameters

        • OptionalbreakdownBy?: string

          If specified, result will be broken apart for each automation

        • filter: string

          Indicates how the metrics should be filtered

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetAutomationsUsageMetricsHttpResponse>

      GetAutomationsUsageMetricsHttpError

an object with query parameters

GetAutomationsUsageMetricsHttpError

getAutomationWithQuery: (
    id: string,
    query: { fields?: string },
    options?: ApiCallOptions,
) => Promise<GetAutomationWithQueryHttpResponse>

Retrieves the full definition of an automation. The requesting user must be the owner of the automation.

Type declaration

    • (
          id: string,
          query: { fields?: string },
          options?: ApiCallOptions,
      ): Promise<GetAutomationWithQueryHttpResponse>
    • Retrieves the full definition of an automation. The requesting user must be the owner of the automation.

      Parameters

      • id: string

        The unique identifier for the automation.

      • query: { fields?: string }

        an object with query parameters

        • Optionalfields?: string

          Allows to select the actual fields to be returned. Where the default is all fields

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetAutomationWithQueryHttpResponse>

      GetAutomationWithQueryHttpError

The unique identifier for the automation.

an object with query parameters

GetAutomationWithQueryHttpError

moveAutomation: (
    id: string,
    body: { userId: string },
    options?: ApiCallOptions,
) => Promise<MoveAutomationHttpResponse>

Changes the owner of an automation to another user. This action removes the history and change logs of this automation. All linked connections used in the automation are detached and not moved to the new owner.

Type declaration

    • (
          id: string,
          body: { userId: string },
          options?: ApiCallOptions,
      ): Promise<MoveAutomationHttpResponse>
    • Changes the owner of an automation to another user. This action removes the history and change logs of this automation. All linked connections used in the automation are detached and not moved to the new owner.

      Parameters

      • id: string

        The unique identifier for the automation.

      • body: { userId: string }

        an object with the body content

      • Optionaloptions: ApiCallOptions

      Returns Promise<MoveAutomationHttpResponse>

      MoveAutomationHttpError

The unique identifier for the automation.

an object with the body content

MoveAutomationHttpError

queueAutomationRun: (
    id: string,
    body: RunDetailRequestObject,
    options?: ApiCallOptions,
) => Promise<QueueAutomationRunHttpResponse>

Creates a runs for a specific automation. The requesting user must be the owner of the automation.

Type declaration

The unique identifier for the automation.

an object with the body content

QueueAutomationRunHttpError

retryAutomationRun: (
    id: string,
    runId: string,
    options?: ApiCallOptions,
) => Promise<RetryAutomationRunHttpResponse>

Retries a specific run by creating a new run using the same inputs. The requesting user must be the owner of the automation.

Type declaration

    • (
          id: string,
          runId: string,
          options?: ApiCallOptions,
      ): Promise<RetryAutomationRunHttpResponse>
    • Retries a specific run by creating a new run using the same inputs. The requesting user must be the owner of the automation.

      Parameters

      • id: string

        The unique identifier for the automation.

      • runId: string

        The unique identifier for the run.

      • Optionaloptions: ApiCallOptions

      Returns Promise<RetryAutomationRunHttpResponse>

      RetryAutomationRunHttpError

The unique identifier for the automation.

The unique identifier for the run.

RetryAutomationRunHttpError

stopAutomationRun: (
    id: string,
    runId: string,
    options?: ApiCallOptions,
) => Promise<StopAutomationRunHttpResponse>

Forcefully stops an automation run immediately. The requesting user must be the owner of the automation.

Type declaration

    • (
          id: string,
          runId: string,
          options?: ApiCallOptions,
      ): Promise<StopAutomationRunHttpResponse>
    • Forcefully stops an automation run immediately. The requesting user must be the owner of the automation.

      Parameters

      • id: string

        The unique identifier for the automation.

      • runId: string

        The unique identifier for the run.

      • Optionaloptions: ApiCallOptions

      Returns Promise<StopAutomationRunHttpResponse>

      StopAutomationRunHttpError

The unique identifier for the automation.

The unique identifier for the run.

StopAutomationRunHttpError

updateAutomation: (
    id: string,
    body: AutomationDetailRequestObject,
    options?: ApiCallOptions,
) => Promise<UpdateAutomationHttpResponse>

Updates the full definition of an automation. The requesting user must be the owner of the automation.

Type declaration

The unique identifier for the automation.

an object with the body content

UpdateAutomationHttpError