Skip to main content
POST
/
api
/
v1
/
agents
/
{agent_id}
/
runs
Typescript (SDK)
import { SDK } from "@meetkai/mka1";

const sdk = new SDK();

async function run() {
  const result = await sdk.agentRuns.createAgentRun({
    bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
  }, {
    agentId: "<id>",
    createAgentRunRequest: {
      input: [
        {
          type: "<value>",
        },
      ],
    },
  });

  console.log(result);
}

run();
{
  "object": "agent.run",
  "id": "<string>",
  "agent_id": "<string>",
  "status": "queued",
  "input": "<string>",
  "conversation": "<string>",
  "previous_response_id": "<string>",
  "metadata": {},
  "gateway_response_id": "<string>",
  "gateway_response": "<string>",
  "error": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

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

Headers

X-On-Behalf-Of
string

Optional external end-user identifier forwarded by the API gateway.

Path Parameters

agent_id
string
required

Body

application/json
input
required
Minimum string length: 1
conversation
previous_response_id
string
metadata
object

Response

Persisted run result.

object
enum<string>
required
Available options:
agent.run
id
string
required
agent_id
string
required
status
enum<string>
required
Available options:
queued,
completed,
failed
input
required
conversation
required
previous_response_id
string | null
required
metadata
object
required
gateway_response_id
string | null
required
gateway_response
required
error
required
created_at
string<date-time>
required
completed_at
string<date-time> | null
required