Skip to main content

LMK API (0.0.1)

Download OpenAPI specification:Download

app

Endpoints related to oauth apps

getCurrentApp

When called by an authorized app, this endpoint will return metadata about the app. For any other caller, this endpoint is forbidden

Responses

Response samples

Content type
application/json
{
  • "appId": "string",
  • "name": "string",
  • "iconUrl": "string",
  • "description": "string",
  • "introWarningMarkdown": "string",
  • "createdAt": "string",
  • "lastUpdatedAt": "string"
}

headlessAuth

Enpdoints related to headless authentication sessions

createHeadlessAuthSession

Create a headless auth session, which allows certain LMK apps to retrieve oauth access tokens without any server component

Request Body schema: application/json
appId
required
string
scope
required
string

Responses

Request samples

Content type
application/json
{
  • "appId": "string",
  • "scope": "string"
}

Response samples

Content type
application/json
{
  • "sessionId": "string",
  • "appId": "string",
  • "scope": "string",
  • "authorizeUrl": "string",
  • "createdAt": "string"
}

getHeadlessAuthSession

Get the headless auth session with the given ID.

path Parameters
sessionId
required
string

Responses

Response samples

Content type
application/json
{
  • "sessionId": "string",
  • "appId": "string",
  • "scope": "string",
  • "authorizeUrl": "string",
  • "createdAt": "string"
}

retrieveHeadlessAuthSessionToken

Retrieve the oauth token for the headless auth session. If the session is complete, the access and refresh tokens will be returned. Otherwise, this endpoint will return an error code.

path Parameters
sessionId
required
string

Responses

Response samples

Content type
application/json
{
  • "access_token": "string",
  • "token_type": "string",
  • "expires_in": 0,
  • "scope": "string",
  • "refresh_token": "string"
}

refreshHeadlessAuthToken

Refresh an oauth access token obtained through a headless auth session

Request Body schema: application/json
appId
required
string
refreshToken
required
string

Responses

Request samples

Content type
application/json
{
  • "appId": "string",
  • "refreshToken": "string"
}

Response samples

Content type
application/json
{
  • "access_token": "string",
  • "token_type": "string",
  • "expires_in": 0,
  • "scope": "string",
  • "refresh_token": "string"
}

oauth

Authorization and access token endpoints for oauth

token

This is the oauth access token endpoint as defined by the oauth spec. After an access code is given to an oauth app, they use that access code as well as their client id and secret to get an access token and refresh token from this endpoint.

header Parameters
authorization
required
string
Request Body schema: application/json
grant_type
required
string
Enum: "authorization_code" "refresh_token"
redirect_uri
required
string
code
required
string
refresh_token
required
string

Responses

Request samples

Content type
application/json
{
  • "grant_type": "authorization_code",
  • "redirect_uri": "string",
  • "code": "string",
  • "refresh_token": "string"
}

Response samples

Content type
application/json
{
  • "access_token": "string",
  • "token_type": "string",
  • "expires_in": 0,
  • "scope": "string",
  • "refresh_token": "string"
}

notification

Endpoints related to notification channels

listNotificationChannels

List the notification channels for the current user. If called by an oauth app, the results will depend on what scopes have been granted to the app. If channel.read has not been granted, this will return an empty list of channels. Otherwise, it will return all of the channels unless the user limited the app's visibillity during the oauth flow.

Responses

Response samples

Content type
application/json
{
  • "channels": [
    ]
}

event

API for posting events

postEvent

Post an event to LMK. This will appear in the LMK app and can optionally be used to notify the user on one of their configured notification channels.

Request Body schema: application/json
sessionId
string
message
required
string
contentType
string
Enum: "text/plain" "text/markdown"
object (EventNotificationConfiguration)

Responses

Request samples

Content type
application/json
{
  • "sessionId": "string",
  • "message": "string",
  • "contentType": "text/plain",
  • "notificationConfig": {
    }
}

Response samples

Content type
application/json
{
  • "eventId": "string",
  • "sessionId": "string",
  • "userId": "string",
  • "actor": {
    },
  • "message": "string",
  • "contentType": "text/plain",
  • "channels": [
    ],
  • "createdAt": "string"
}

session

Endpoints related to creating and updating interactive sessions

createSession

Create an interactive session. This appears in the LMK app and allows both monitoring the state of a remote process and interacting with it, or configuring notifications to be send when it finishes running.

Request Body schema: application/json
required
JupyterSessionState (object) or ProcessSessionState (object) or NoneSessionState (object)
name
required
string

Responses

Request samples

Content type
application/json
{
  • "state": {
    },
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "state": {
    },
  • "sessionId": "string",
  • "name": "string",
  • "type": "jupyter",
  • "createdAt": "string",
  • "createdByActor": {
    },
  • "lastUpdatedAt": "string",
  • "lastUpdatedByActor": {
    },
  • "endedAt": "string",
  • "endedByActor": {
    }
}

getSession

Get an interactive session by ID.

path Parameters
sessionId
required
string

Responses

Response samples

Content type
application/json
{
  • "state": {
    },
  • "sessionId": "string",
  • "name": "string",
  • "type": "jupyter",
  • "createdAt": "string",
  • "createdByActor": {
    },
  • "lastUpdatedAt": "string",
  • "lastUpdatedByActor": {
    },
  • "endedAt": "string",
  • "endedByActor": {
    }
}

updateSession

Update the state of an interactive session.

path Parameters
sessionId
required
string
Request Body schema: application/json
PartialJupyterSessionState (object) or PartialProcessSessionState (object) or PartialNoneSessionState (object)
One of
type
string
Value: "jupyter"
url
string
notebookName
string
shellState
string
cellState
string
cellText
string
cellError
string
executionNum
number
cellStartedAt
string
cellFinishedAt
string
notifyOn
string
notifyChannel
string

Responses

Request samples

Content type
application/json
{
  • "state": {
    }
}

Response samples

Content type
application/json
{
  • "state": {
    },
  • "sessionId": "string",
  • "name": "string",
  • "type": "jupyter",
  • "createdAt": "string",
  • "createdByActor": {
    },
  • "lastUpdatedAt": "string",
  • "lastUpdatedByActor": {
    },
  • "endedAt": "string",
  • "endedByActor": {
    }
}

endSession

Mark an interactive session as ended. This will not allow any further updates to the session.

path Parameters
sessionId
required
string

Responses

Response samples

Content type
application/json
{
  • "state": {
    },
  • "sessionId": "string",
  • "name": "string",
  • "type": "jupyter",
  • "createdAt": "string",
  • "createdByActor": {
    },
  • "lastUpdatedAt": "string",
  • "lastUpdatedByActor": {
    },
  • "endedAt": "string",
  • "endedByActor": {
    }
}

sessionAction

Perform one of the available actions. If no client is connected to the interactive session, it will return a 412 error code.

path Parameters
sessionId
required
string
Request Body schema: application/json
ProcessSendSignalRequest (object)
action
required
string

Responses

Request samples

Content type
application/json
{
  • "body": {
    },
  • "action": "string"
}