Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions constructs/api-check.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,13 @@ request: {
| `followRedirects` | `boolean` | ❌ | `true` | Whether to automatically follow 30x redirects |
| `headers` | `array` | ❌ | `[]` | Array of `{ key, value }` objects for HTTP headers |
| `skipSSL` | `boolean` | ❌ | `false` | Whether to skip SSL certificate validation |
| `treatResponseBodyAsText` | `boolean` | ❌ | `false` | Feature-flagged support override for known text responses served with a binary `Content-Type` header |
| `queryParameters` | `array` | ❌ | `[]` | Array of `{ key, value }` objects for query parameters |

<Warning>
`treatResponseBodyAsText` is only available when Checkly has enabled the API response body text override for your account. Use it only for endpoints that return text payloads with misleading binary response headers, such as `application/octet-stream`.
</Warning>

**Examples:**

<CodeGroup>
Expand All @@ -161,6 +166,18 @@ request: {
},
```

```ts Binary-labelled text response
request: {
method: "GET",
url: "https://api.example.com/status",
treatResponseBodyAsText: true,
assertions: [
AssertionBuilder.statusCode().equals(200),
AssertionBuilder.textBody().contains("OK"),
],
},
```

```ts GraphQL API
request: {
method: "POST",
Expand Down
8 changes: 7 additions & 1 deletion detect/synthetic-monitoring/api-checks/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ Additionally, if your API responds with a binary type body, i.e. a PDF or video
it with a short text saying that we scrubbed it. We determine the body content type by looking at the `Content-Type`
response header.

<Warning>
If an endpoint returns a text payload with a binary `Content-Type` header, such as `application/octet-stream`, Checkly treats the response as binary and scrubs the body before text body assertions run. For endpoints you know return text despite the header, contact support to enable the feature-flagged **Treat response body as text** override for API checks.

Only use this override for known text responses. Enabling it for true binary responses can expose binary payloads in check results and make assertions unreliable.
</Warning>

This list shows all content types that we scrub from the response data.

| content type |
Expand Down Expand Up @@ -220,4 +226,4 @@ This list shows all content types that we scrub from the response data.
* **Description:** Add context about what this check does and why it matters. Supports markdown, max 500 characters. When a failure occurs, [Rocky AI](/ai/rocky-ai) uses the description to provide more accurate [root cause and user impact analysis](/resolve/ai-root-cause-analysis/overview)
* **Tags:** Use tags to organize checks across [dashboards](/communicate/dashboards/overview/) and [maintenance windows](/communicate/maintenance-windows/overview)
* **Retries:** Define how failed runs should be retried. See [retry strategies](/communicate/alerts/retries)
* **Alerting:** Configure your [alert settings](/communicate/alerts/configuration), [alert channels](/communicate/alerts/channels), or set up [webhooks](/integrations/alerts/webhooks) for custom integrations
* **Alerting:** Configure your [alert settings](/communicate/alerts/configuration), [alert channels](/communicate/alerts/channels), or set up [webhooks](/integrations/alerts/webhooks) for custom integrations
Loading