---
title: "Render a flakiness SVG badge for a repository."
method: GET
path: "/api/v1/flaky/badges"
tags: ["Badges"]
---

# Render a flakiness SVG badge for a repository.

`GET /api/v1/flaky/badges`

## Request

- Base URL: `https://platform.buildpulse.io`
- URL: `https://platform.buildpulse.io/api/v1/flaky/badges`
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer

Returns an SVG status badge showing the flakiness percentage for
the named repository over the last 14 days.

Color thresholds: 0% = green, 1–20% = yellow, >20% = red.

Embed in a README:

```markdown
![flakiness](https://platform.buildpulse.io/api/v1/flaky/badges?repository=widgets)
```

Note: badge endpoints require the same token authentication as
the rest of the API. The legacy badge endpoints were
unauthenticated; that was an oversight and is fixed here.

## Query parameters

- `repository` string, required

## Response `200`

SVG badge image.

## Other responses

- `400`: Missing `repository` parameter.
- `401`: Missing, malformed, or invalid token; or — for legacy 40-hex tokens only — the organization has no active plan (`marketplacePurchases.unitCount > 0`). The new `bp_<64-hex>` path has no plan gate, so a 401 there means the token shape was wrong, the hash didn't match, or the token has expired. Response body is empty (matches legacy Rails).
- `404`: Resource not found.

---

[API](https://skmtc.dev/buildpulse/apis/buildpulse-platform-api.md) · [All operations](https://skmtc.dev/buildpulse/apis/buildpulse-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/buildpulse/apis/buildpulse-platform-api/revisions/2e68b4b2df6a?raw)
