Prompts API
A prompt is used to gather user input during a task's execution. See Prompts to
see how prompts are used.
Endpoints
Get Prompt
GET /v0/prompts/get
Get information about an existing prompt.
Get Prompt
Copied
1
curl https://api.airplane.dev/v0/prompts/get \
2
-H "X-Airplane-API-Key: $AIRPLANE_API_KEY" \
3
-d 'id=pmt20221122zyydx3rho2t' \
4
-G
Query Parameters
idstringREQUIRED
ID of the prompt to retrieve.
Response
Copied
1
{
2
"prompt": {
3
"cancelText": "Reject workflow.",
4
"confirmText": "Approve workflow.",
5
"createdAt": "2022-01-11 22:32:45.601486+00",
6
"description": "Prompt workflow description.",
7
"id": "pmt20221122zyydx3rho2t",
8
"reviewers": {
9
"allowSelfApprovals": false,
10
"groups": [],
11
"users": []
12
},
13
"runID": "run20220111zlq2ig4",
14
"schema": {
15
"parameters": [
16
{
17
"component": "textarea",
18
"constraints": {
19
"allowUnknownKeys": false,
20
"optional": false,
21
"options": {},
22
"regex": ""
23
},
24
"default": {},
25
"desc": "Email to use for selecting which user to edit.",
26
"name": "User Email",
27
"parameters": [],
28
"slug": "user_email",
29
"type": "string",
30
"values": {}
31
}
32
]
33
},
34
"submittedAt": "2022-01-11 22:32:46.601486+00",
35
"submittedBy": "usr20220103zlufhym",
36
"values": {
37
"limit": "20",
38
"user": "eric"
39
}
40
}
41
}
Response
promptobject
Retrieved prompt.
Show child attributes
List Prompts
GET /v0/prompts/list
List prompts from an existing run.
List Prompts
Copied
1
curl https://api.airplane.dev/v0/prompts/list \
2
-H "X-Airplane-API-Key: $AIRPLANE_API_KEY" \
3
-d 'runID=run20220215zv10o6s52qj' \
4
-G
Query Parameters
runIDstringREQUIRED
ID of the run to retrieve prompts for.
Response
Copied
1
{
2
"prompts": [
3
{
4
"cancelText": "Reject workflow.",
5
"confirmText": "Approve workflow.",
6
"createdAt": "2022-01-11 22:32:45.601486+00",
7
"description": "Prompt workflow description.",
8
"id": "pmt20221122zyydx3rho2t",
9
"reviewers": {
10
"allowSelfApprovals": false,
11
"groups": [],
12
"users": []
13
},
14
"runID": "run20220111zlq2ig4",
15
"schema": {
16
"parameters": [
17
{
18
"component": "textarea",
19
"constraints": {
20
"allowUnknownKeys": false,
21
"optional": false,
22
"options": {},
23
"regex": ""
24
},
25
"default": {},
26
"desc": "Email to use for selecting which user to edit.",
27
"name": "User Email",
28
"parameters": [],
29
"slug": "user_email",
30
"type": "string",
31
"values": {}
32
}
33
]
34
},
35
"submittedAt": "2022-01-11 22:32:46.601486+00",
36
"submittedBy": "usr20220103zlufhym",
37
"values": {
38
"limit": "20",
39
"user": "eric"
40
}
41
}
42
]
43
}
Response
promptsarray of object
Retrieved prompts.
Show child attributes
Submit Prompt
POST /v0/prompts/submit
Submit a prompt with a set of parameter values.
Submit Prompt
Copied
1
curl https://api.airplane.dev/v0/prompts/submit \
2
-X POST \
3
-H "X-Airplane-API-Key: $AIRPLANE_API_KEY" \
4
-d '{
5
"id": "pmt20221122zyydx3rho2t",
6
"values": {
7
"limit": "20",
8
"user": "eric"
9
}
10
}'
Body Parameters
idstringoptional
Unique ID of the prompt.
valueskey valueoptional
Mapping of parameter slug to value. You can find your prompt's parameter slugs on the Airplane runs page or by fetching the prompt via the API.
Response
Copied
1
{
2
"id": "pmt20221122zyydx3rho2t"
3
}
Response
idstring
Unique ID of the prompt.