Skip to main content
GET
Get snippet details

Authorizations

Authorization
string
header
required

Personal Access Token (cnap_pat_...) or OAuth2 JWT. Create tokens at https://cnap.tech/account/tokens

Path Parameters

id
string
required

Snippet ID

Response

Snippet details

id
string
required
Example:

"j572abc123def456"

name
string
required
Example:

"Cluster Resource Audit"

description
string | null
required
Example:

"Checks resource requests and limits"

code
string
required

Async JavaScript function body executed in a sandboxed V8 isolate. Has access to cnap.request() for API calls.

Example:

"async () => { ... }"

display_type
enum<string>
required

Controls how the snippet result is rendered in dashboard widgets

Available options:
table,
stat,
json,
logs
Example:

"table"

workspace_id
string
required
Example:

"j572abc123def456"

created_by
string
required

User ID of the snippet creator

created_at
number
required

Unix timestamp (seconds)