Skip to main content
PATCH
/
v1
/
snippets
/
{id}
Update snippet
curl --request PATCH \
  --url https://api.cnap.tech/v1/snippets/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "code": "<string>",
  "display_type": "table"
}
'
{
  "snippet_id": "<string>"
}

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

Body

application/json
name
string
Required string length: 1 - 100
description
string
Maximum string length: 500
code
string
Required string length: 1 - 50000
display_type
enum<string>

Controls how the snippet result is rendered in dashboard widgets

Available options:
table,
stat,
json,
logs

Response

Snippet updated

snippet_id
string
required