Skip to main content
POST
/
invocations
JavaScript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
  apiKey: 'My API Key',
});

const invocation = await client.invocations.create({
  action_name: 'analyze',
  app_name: 'my-app',
  version: '1.0.0',
});

console.log(invocation.id);
{
  "id": "rr33xuugxj9h0bkf1rdt2bet",
  "action_name": "analyze",
  "status": "queued",
  "status_reason": "Invocation queued for execution",
  "output": "{\"result\":\"success\",\"data\":\"processed input\"}"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Invocation parameters

app_name
string
required

Name of the application

Example:

"my-app"

version
string
default:latest
required

Version of the application

Example:

"1.0.0"

action_name
string
required

Name of the action to invoke

Example:

"analyze"

payload
string

Input data for the action, sent as a JSON string.

Example:

"{\"data\":\"example input\"}"

async
boolean
default:false

If true, invoke asynchronously. When set, the API responds 202 Accepted with status "queued".

Example:

true

Response

Invocation created successfully

id
string
required

ID of the invocation

Example:

"rr33xuugxj9h0bkf1rdt2bet"

action_name
string
required

Name of the action invoked

Example:

"analyze"

status
enum<string>
required

Status of the invocation

Available options:
queued,
running,
succeeded,
failed
Example:

"queued"

status_reason
string

Status reason

Example:

"Invocation queued for execution"

output
string

The return value of the action that was invoked, rendered as a JSON string. This could be: string, number, boolean, array, object, or null.

Example:

"{\"result\":\"success\",\"data\":\"processed input\"}"

I