Skip to main content
POST
Create a code snippet (its first draft)

Authorizations

Authorization
string
header
required

A workspace API key, sent as Authorization: Bearer sempera_sk_... Each operation names the one scope it needs. Scopes, key kinds and roles are in the Authentication guide.

Headers

Idempotency-Key
string

Replays the stored answer for a retry of the same request; 409 for a different request under the same key.

Maximum string length: 255

Body

application/json
name
string
required
Pattern: ^[a-z][a-z0-9_]{1,63}$
source
string
required
output_schema
object
required
description
string
inputs
object[]
timeout_ms
integer
Required range: 250 <= x <= 5000

Response

Created

id
string
required
Pattern: ^snip_[0-9a-f]{16}$
object
any
required
name
string
required
description
string
status
enum<string>
Available options:
active,
archived
latest_published
integer | null
draft_version
integer | null
versions
object[]
used_by
object[]
created_at
any
updated_at
any
archived_at
any
created_by
any