Skip to main content
POST
/
snippets
Create snippet
curl --request POST \
  --url https://api.akua.dev/v1/snippets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Cluster Resource Audit",
  "code": "<string>",
  "description": "<string>",
  "agent_session_id": "<string>",
  "agent_turn_id": "<string>"
}
'
{
  "snippet_id": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://akua-1dce587a.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

workspace API token (sk_akua_...) or OAuth2 JWT. Create tokens at https://akua.dev/developers/api-tokens

Body

application/json
name
string
required
Required string length: 1 - 100
Example:

"Cluster Resource Audit"

code
string
required

Async JavaScript function body. Executed in a sandboxed V8 isolate with access to platform.request().

Required string length: 1 - 50000
display_type
enum<string>
required

Controls how the snippet result is rendered in dashboard widgets

Available options:
table,
stat,
json,
logs
description
string

Optional human-readable description

Maximum string length: 500
visibility
enum<string>

Whether the snippet is reusable workspace state or scoped to an agent session.

Available options:
workspace,
session
origin
enum<string>

Who authored the snippet descriptor.

Available options:
user,
agent,
system
agent_session_id
string
Required string length: 1 - 54
agent_turn_id
string
Required string length: 1 - 54
purpose
enum<string>
Available options:
general,
prepared_action,
reactive_read,
widget

Response

Snippet created

snippet_id
string
required