Skip to content

Replace a project's report key

POST
/projects/{id}/bug-report-settings/rotate-key
Code sample: Shell / cURL
curl --request POST \
--url https://example.com/api/v1/projects/example/bug-report-settings/rotate-key \
--header 'Authorization: Bearer <token>'

Replaces the project’s public report key; the old one stops working at once, so every page that carries it must be updated to the key in the answer. Records an audit entry. Takes no body. Requires projects.manage and a project the caller reaches. Answers 409 when the project has no key yet (turn the button on first) and 422 for a personal project.

id
required

Resource identifier (CUID2).

string
>= 1 characters

Resource identifier (CUID2).

The settings with the new key.

Media typeapplication/json
object
data
required

How a project’s report button is set up.

object
acceptsAnonymous
required

Whether a report from a visitor with no portal session is taken. Signed-in reporting from a site is not available yet, so false refuses every report until it is.

boolean
allowedDomains
required

The sites allowed to send reports.

Array<string>
canManage
required

Whether the caller may change these settings.

boolean
isActive
required

Whether the report button may file reports.

boolean
publicKey
required

The key the report button sends. It is read from the client’s page source by design; null until the project turns reports on.

string | null
suggestedDomain
required

The project’s own site as an allowed domain, to start the list from.

string | null

Example generated

{
"data": {
"acceptsAnonymous": true,
"allowedDomains": [
"example"
],
"canManage": true,
"isActive": true,
"publicKey": "example",
"suggestedDomain": "example"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Not found.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Conflict.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Invalid input.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.