---
title: "Execute an automation (async)"
method: POST
path: "/v1/async/sessions/{sessionId}/windows/{windowId}/execute-automation"
tags: ["windows"]
---

# Execute an automation (async)

`POST /v1/async/sessions/{sessionId}/windows/{windowId}/execute-automation`

Execute an automation of a browser window asynchronously

## Path parameters

- `sessionId` string, required
- `windowId` string, required

## Headers

- `Authorization` string, required

## Request body

- object
  - `async` TypeAsyncConfig
    - `webhookUrl` string — The URL to send the response to when the request is complete.
  - `automationId` string, required — The ID of the automation to execute
  - `clientRequestId` string
  - `costThresholdCredits` integer — A credit threshold that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended).
  - `parameters` object — Optional parameters to pass to the automation execution
  - `timeThresholdSeconds` integer — A time threshold in seconds that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended). This setting does not extend the maximum session duration provided at the time of session creation.

## Response `201`

Created

- TypeAsyncSessionAiResponseEnvelope
  - `errors` TypeIssue[]
    - `code` string — Issue code.
    - `details` object — Any associated details.
    - `message` string, required — Message describing the issue.
    - `reason` string — Underlying reason for the issue.
  - `requestId` string, required
  - `warnings` TypeIssue[]
    - `code` string — Issue code.
    - `details` object — Any associated details.
    - `message` string, required — Message describing the issue.
    - `reason` string — Underlying reason for the issue.

---

[API](https://skmtc.net/airtop/apis/airtop-api.md) · [All operations](https://skmtc.net/airtop/apis/airtop-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/airtop/airtop-api/revisions/4a02eb5d21ca/schema)
