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

idstringREQUIRED

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
}
26
],
27
"permissions": [
28
{
29
"action": "sessions.get",
30
"roleID": "team_admin",
31
"subGroupID": "grp20220222zaigy4h2bw3",
32
"subUserID": "usr20211123zz1dv7z"
33
}
34
],
35
"runbookID": "rbk20220120z15kl79",
36
"status": "Succeeded",
37
"teamID": "tea20220103zvy4auu",
38
"updatedAt": "2022-01-11 22:35:45.238512+00",
39
"updatedBy": "ses20220120za1pskd"
40
}

Response

createdAtstring

When this session was created.

createdBystring

ID of the user that created this session.

idstring

Unique ID of this session.

isPrivateboolean

Whether or not the session is private.

namestring

Name of this session.

paramValueskey value

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

paramsarray of object

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

 Show child attributes
permissionsarray of object

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

 Show child attributes
runbookIDstring

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

statusenum

Status of this session.

Possible Values
Pending
Active
Waiting
Succeeded
Failed
Show more
teamIDstring

ID of the team that owns this session.

updatedAtstring

When this session was updated.

updatedBystring

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

runbookIDstringoptional

Only fetch sessions for this specific runbook.

updatedAfterstringoptional

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

updatedBeforestringoptional

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

limitintegeroptional

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

pageintegeroptional

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
}
28
],
29
"permissions": [
30
{
31
"action": "sessions.get",
32
"roleID": "team_admin",
33
"subGroupID": "grp20220222zaigy4h2bw3",
34
"subUserID": "usr20211123zz1dv7z"
35
}
36
],
37
"runbookID": "rbk20220120z15kl79",
38
"status": "Succeeded",
39
"teamID": "tea20220103zvy4auu",
40
"updatedAt": "2022-01-11 22:35:45.238512+00",
41
"updatedBy": "ses20220120za1pskd"
42
}
43
]
44
}

Response

sessionsarray of object

Retrieved sessions.

 Show child attributes