Skip to main content
POST
Add a custom pattern: mask matching values before agents see them.
Scope: guardrails:patterns:write. See API Tokens.

Authorizations

Authorization
string
header
required

CloudThinker token: a personal access token ct_pat_… (fine-grained scopes, created in Settings) or an OAuth access token ct_oat_… (1 hour, from the OAuth flow). Send Authorization: Bearer <token>. Scopes have the form module:resource:read|write; write includes read.

Headers

Idempotency-Key
string
required

Unique per logical write. A retry with the same key and body returns the first result.

Required string length: 1 - 255

Path Parameters

workspace_id
string<uuid>
required

Workspace to act in. Every call names it.

Body

application/json

A new custom pattern.

label
string
required
Required string length: 1 - 200
kind
string
required

The category agents see in place of a matched value: lowercase words joined by single hyphens. Built-in kinds are refused.

Required string length: 1 - 32
regex
string
required
Required string length: 1 - 512

Response

Created

A custom pattern Guardrails masks before agents see the value.

id
string
required
label
string
required
kind
string
required

The category agents see in place of a matched value: lowercase words joined by single hyphens. Built-in kinds are refused.

regex
string
required
enabled
boolean
required

Whether detection uses this pattern.

created_by
string<uuid>
required
created_at
string<date-time>
required