Invocations

Invoke an action

Changed on

Invoke an action.

post/invocations

Request

  • Base URL
    https://api.onkernel.com
  • URL
    https://api.onkernel.com/invocations
  • Auth
    HTTP bearer

Request body

action_namestring required

Name of the action to invoke

app_namestring required

Name of the application

asyncboolean

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

async_timeout_secondsinteger

Timeout in seconds for async invocations (min 10, max 3600). Only applies when async is true.

payloadstring

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

versionstring required

Version of the application

Example request

{
  "action_name": "analyze",
  "app_name": "my-app",
  "async": true,
  "async_timeout_seconds": 600,
  "payload": "{\"data\":\"example input\"}",
  "version": "1.0.0"
}

Response

Invocation created successfully

action_namestring required

Name of the action invoked

idstring required

ID of the invocation

outputstring

The action result or detailed failure output. Often a JSON-encoded value, but failures may contain plain text. May contain sensitive application data.

status'queued' | 'running' | 'succeeded' | 'failed' required

Status of the invocation

status_reasonstring

A nonempty, customer-safe summary of the recorded failure output, always present when status is failed and omitted otherwise. Recognized messages receive a specific summary; other failures receive a generic summary. Message matching does not establish whether the failure originated in the platform or action code. Does not include raw action output or internal error details. Human-readable text, not a stable identifier for retry logic.

Example response

{
  "action_name": "analyze",
  "id": "rr33xuugxj9h0bkf1rdt2bet",
  "output": "{\"result\":\"success\",\"data\":\"processed input\"}",
  "status": "queued",
  "status_reason": "Invocation timed out after 900 seconds."
}

Changes