Sessions API

A session represents an instance of a runbook's execution. See Runbooks API for how to execute runbooks.

Endpoints

Get Session

GET /v0/sessions/get

Get information about an existing session.

Get Session
Copied
1
curl https://api.airplane.dev/v0/sessions/get \
2
-H "X-Airplane-API-Key: $AIRPLANE_API_KEY" \
3
-d 'id=ses20220120za1pskd' \
4
-G

Query Parameters

id
string
REQUIRED

ID of the session to retrieve.

Response
Copied
1
{
2
"createdAt": "2022-01-11 22:32:45.601486+00",
3
"createdBy": "usr20220103zlufhym",
4
"id": "ses20220120za1pskd",
5
"isPrivate": true,
6
"name": "MySession",
7
"paramValues": {
8
"limit": "20",
9
"user": "eric"
10
},
11
"params": [
12
{
13
"component": "textarea",
14
"constraints": {
15
"optional": false,
16
"options": {},
17
"regex": ""
18
},
19
"default": {},
20
"desc": "Email to use for selecting which user to edit.",
21
"name": "User Email",
22
"params": [],
23
"slug": "user_email",
24
"type": "string",
25
"values": {}
26
}
27
],
28
"permissions": [
29
{
30
"action": "sessions.get",
31
"roleID": "team_admin",
32
"subGroupID": "grp20220222zaigy4h2bw3",
33
"subUserID": "usr20211123zz1dv7z"
34
}
35
],
36
"runbookID": "rbk20220120z15kl79",
37
"status": "Succeeded",
38
"teamID": "tea20220103zvy4auu",
39
"updatedAt": "2022-01-11 22:35:45.238512+00",
40
"updatedBy": "ses20220120za1pskd"
41
}

Response

createdAt
string

When this session was created.

createdBy
string

ID of the user that created this session.

id
string

Unique ID of this session.

isPrivate
boolean

Whether or not the session is private.

name
string

Name of this session.

paramValues
key value

Mapping of parameter slug to value used in this session's execution.

params
array of object

Schema for the set of values users can provide when executing this session. More details.

 Show child attributes
permissions
array of object

Explicit permissions of this session if it is private. More details.

 Show child attributes
runbookID
string

ID of the runbook this session was spawned from if triggered from a runbook.

status
enum

Status of this session.

Possible Values
Pending
Active
Waiting
Succeeded
Failed
Show more
teamID
string

ID of the team that owns this session.

updatedAt
string

When this session was updated.

updatedBy
string

ID of the user who updated this session.

List Sessions

GET /v0/sessions/list
List Sessions
Copied
1
curl https://api.airplane.dev/v0/sessions/list \
2
-H "X-Airplane-API-Key: $AIRPLANE_API_KEY" \
3
-d 'runbookID=rbk20220120z15kl79' \
4
-d 'updatedAfter=2022-01-01T12:00:00-00:00' \
5
-d 'updatedBefore=2022-01-01T13:00:00-00:00' \
6
-d 'limit=10' \
7
-d 'page=0' \
8
-G

Query Parameters

runbookID
string
optional

Only fetch sessions for this specific runbook.

updatedAfter
string
optional

Fetch sessions last updated after this time (RFC 3339 format).

updatedBefore
string
optional

Fetch sessions last updated before this time (RFC 3339 format).

limit
integer
optional

Number of results per call. Accepted values: 0 - 50. Default: 50.

page
integer
optional

The offset used for this page of results.

Response
Copied
1
{
2
"sessions": [
3
{
4
"createdAt": "2022-01-11 22:32:45.601486+00",
5
"createdBy": "usr20220103zlufhym",
6
"id": "ses20220120za1pskd",
7
"isPrivate": true,
8
"name": "MySession",
9
"paramValues": {
10
"limit": "20",
11
"user": "eric"
12
},
13
"params": [
14
{
15
"component": "textarea",
16
"constraints": {
17
"optional": false,
18
"options": {},
19
"regex": ""
20
},
21
"default": {},
22
"desc": "Email to use for selecting which user to edit.",
23
"name": "User Email",
24
"params": [],
25
"slug": "user_email",
26
"type": "string",
27
"values": {}
28
}
29
],
30
"permissions": [
31
{
32
"action": "sessions.get",
33
"roleID": "team_admin",
34
"subGroupID": "grp20220222zaigy4h2bw3",
35
"subUserID": "usr20211123zz1dv7z"
36
}
37
],
38
"runbookID": "rbk20220120z15kl79",
39
"status": "Succeeded",
40
"teamID": "tea20220103zvy4auu",
41
"updatedAt": "2022-01-11 22:35:45.238512+00",
42
"updatedBy": "ses20220120za1pskd"
43
}
44
]
45
}

Response

sessions
array of object

Retrieved sessions.

 Show child attributes