Skip to main content
POST
Create Suppression

Authorizations

X-API-Key
string
header
required

PromptGuard API key for developer endpoints. Keys start with pg_live_ and are created in the dashboard.

Headers

x-api-key
string | null
PromptGuard-Approval
string | null

The approval_id of an approval_required refusal, once your user has approved it. Send the same method, path, query and body.

Maximum string length: 64

Path Parameters

project_id
string
required

Body

application/json

What a Suppression names. Never text: only a rule, and optionally the SHA-256 of one exact matched text.

detector
string
required

The detector, as a finding's rule.detector names it.

Required string length: 1 - 100
rule_id
string
required

The rule of that detector, as a finding's rule.id names it.

Required string length: 1 - 200
match_sha256
string | null

Lowercase hex SHA-256 of the UTF-8 bytes of one exact matched text, to silence the rule only for that text. Omitted, it is silenced for every text.

Pattern: ^[0-9a-f]{64}$
expires_at
string<date-time> | null

When it stops applying: in the future, and at most 90 days away. Omitted with expires_in_days, 30 days from now.

expires_in_days
integer | null

How many days from now, by the server's clock, it stops applying: 1 to 90. Instead of expires_at, never with it.

Response

Successful Response

A Suppression in force, as an API key reads it.

id
string
required
detector
string
required
rule_id
string
required
match_sha256
string | null
required
expires_at
string<date-time>
required
created_by
string | null
required
created_at
string<date-time>
required