Tasks API

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 with a set of parameter values and receive a run ID to track the task's execution. 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
-H "X-Airplane-Env-Slug: prod" \
5
-d '{
6
"paramValues": {
7
"limit": "20",
8
"user": "eric"
9
},
10
"resources": {
11
"db": "demo_db"
12
},
13
"slug": "hello_world"
14
}'

Headers

X-Airplane-Env-Slug
string
optional

Slug of the environment to execute the task in. Either an ID or a slug can be provided.

X-Airplane-Env-ID
string
optional

ID of the environment to execute the task in. Either an ID or a slug can be provided.

Body Parameters

id
string
optional

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.

paramValues
key value
optional

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

resources
key value
optional

Mapping of resource aliases to id identifiers used by the task.

slug
string
optional

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

runID
string

Unique ID of the task execution's run.