Tasks API

The Airplane API is currently available to customers as a beta and is subject to change. Please reach out to us at hello@airplane.dev with any feedback!

A Task is a lightweight app that represents a single business operation for people at your company to execute.

The current tasks API is focused around allowing you to execute tasks. An instance of an executed task is called a run. See Runs API for how to track a run's status or fetch a run's output after you've executed a task.

Endpoints

Execute Task

POST /v0/tasks/execute

Execute a task and receive a run ID to track the task's exeuction. Check on the status of your newly created run with /runs/get.

Execute Task
Copied
1
curl https://api.airplane.dev/v0/tasks/execute \
2
-X POST \
3
-H "X-Airplane-API-Key: $AIRPLANE_API_KEY" \
4
-d 'envSlug=prod' \
5
-d '{
6
"id": "tsk20210728zxb2vxn",
7
"paramValues": {
8
"limit": "20",
9
"user": "eric"
10
},
11
"slug": "hello_world"
12
}'

Query Parameters

envSlugstringoptional

Environment to execute the task in.

Body Parameters

idstringoptional

Unique ID of the task. You can find your task's ID by visiting the task's page on Airplane. The task ID is located at the end of the url.

e.g. the task ID for https://app.airplane.dev/tasks/tsk20210728zxb2vxn is tsk20210728zxb2vxn

Either an ID or a slug must be provided.

paramValueskey valueoptional

Mapping of parameter name to value. You can find your task's parameters inside the task editor on Airplane or by running airplane tasks list from the CLI.

slugstringoptional

Unique slug of the task. You can find your task's slug next to the task's name within the task editor on Airplane or by running airplane tasks list from the CLI.

Either an ID or a slug must be provided.

Response
Copied
1
{
2
"runID": "run20220215zv10o6s52qj"
3
}

Response

runIDstring

Unique ID of the task execution's run.