Developers

DiffDeck API

Automate DiffDeck over a REST API, or connect it to any MCP client — authenticated with a single API key. The REST reference below covers every action; the MCP server offers the tools listed under MCP tools.
REST API

Invoke any action with a POST request. Pass your key as a bearer token.

curl https://diffdeck.ai/api/rest/actions \ -H "Authorization: Bearer kav_..."
POST https://diffdeck.ai/api/rest/actions/{action}
MCP server

Point any Model Context Protocol client at the endpoint below. It offers the tools listed under MCP tools, limited to what your role permits.

https://diffdeck.ai/api/mcp
Authorization: Bearer kav_...
Connect your AI assistant

Let your AI assistant work in DiffDeck for you

Add DiffDeck to Claude, ChatGPT or another AI assistant as a connector, and you can ask it to look things up or make changes for you in plain conversation. It signs in as you, so it only ever sees what you're allowed to see.

https://diffdeck.ai/api/mcp

Claude opens with the connector filled in. For ChatGPT, Le Chat, Cursor and others, pick them with the arrow for step-by-step help.

If your MCP client can't sign in through the browser, use an API key instead, exactly like the REST API above:

Authorization: Bearer kav_...
What your assistant can (and can't) do

Your assistant can only do what your own role in DiffDeck allows — nothing more.

Choose read-only access if you only want it to look things up, never change them.

Every change it makes is recorded in the audit log, just like a change you made yourself.

You can disconnect it at any time from Settings → Connected apps.

MCP tools

What an AI app connected to DiffDeck can do. A read-only connection only gets the first group; your role in the organization still decides what each tool may touch.

Look things up
List repositories
list_repos

List the repositories connected to your DiffDeck organization, with each one's id, full name (owner/repo) and default branch. Use it to find the repoId the build, recording and mask tools take.

List builds
list_builds

List a repository's published Storybook builds, newest first: id, build number, monorepo product key, branch, commit SHA and message, status, story count, number of visual diffs and review state. Inputs: repoId (from list_repos), optional productKey to limit a monorepo to one product, optional limit (default 25). Commit messages come from the repository and are returned as written.

Inspect build
get_build

Get one Storybook build in full: its metadata (branch, commit, status, review state) and every story screenshot with its id, story id and title, theme (light/dark), device (phone/tablet/desktop), diff state against the approved baseline and diff ratio. Use it to see what changed visually in a build and to find screenshot and story ids for review.

List recordings
list_recordings

List a repository's Playwright test-run recordings uploaded by CI, newest first: id, title, linked test, pass/fail status, duration, creation time and the ids of the builds from the same commit. Inputs: repoId, optional productKey, optional limit (default 50). Test titles come from the repository's test suite.

Inspect recording
get_recording

Get one Playwright recording: its metadata, the linked test (title, file, status, retries), branch and commit, the ids of the builds it belongs to and the URL of its stored video. Input: recordingId (from list_recordings).

List sites
list_replay_sites

List your session-replay sites (websites whose visitors' sessions DiffDeck records): id, name, allowed origins, whether recording is on, and how many sessions were recorded in the last 30 days. Use it to find a siteId.

Inspect site
get_replay_site

Get one session-replay site's settings: name, public site key, allowed origins, privacy mode, consent mode, Do-Not-Track handling, never-record and mask selectors, sampling rate and retention. Input: siteId.

List recorded sessions
list_replay_sessions

List a site's recorded visitor sessions, newest first: id, start time, duration, entry page, pages visited, device, browser, clicks and rage clicks. Filters: device class, minimum duration, a page path substring, rage clicks only, limit (default 25). Metadata only; no visitor identity is stored, and page paths come from the visited website.

Inspect recorded session
get_replay_session

Get one recorded session's metadata: pages visited, duration, device, browser, click counts and the privacy mode it was recorded under. The replay itself is watched on the session page in the DiffDeck app. Input: sessionId.

Make changes
Set capture settings
set_repo_capture
Can overwrite or delete

Choose which of the six screenshot variants (light/dark theme by phone/tablet/desktop device) a repository product captures, for example to skip dark mode or phone for a target that does not support them. Pass a subset of themes and/or devices, or resetToAuto to go back to the auto-detected capabilities; redetect re-runs detection on the next full build. Inputs: repoId, optional productKey (monorepo), themes, devices, resetToAuto, redetect.

Approve build
approve_build
Can overwrite or delete
Reaches outside your organization

Approve a build: its screenshots become the new approved baseline for its branch, so later builds on that branch (and pull requests targeting it) are diffed against it. Replaces the previous baseline. Updates the build's GitHub check run. Input: buildId.

Reject build
reject_build
Can overwrite or delete
Reaches outside your organization

Reject a build, marking its visual changes as not accepted and finalizing it as rejected. The baseline is not changed. Updates the build's GitHub check run. Input: buildId.

Review screenshot
review_screenshot
Can overwrite or delete
Reaches outside your organization

Approve or reject one screenshot (one story in one theme and device) in a build, with an optional comment. A rejection with a comment is posted to the linked GitHub pull request when there is one. Rejecting a screenshot does not finalize the build; once every changed or new screenshot is approved, the build becomes approved and its screenshots become the branch baseline. Inputs: screenshotId (from get_build), state (approved or rejected), comment.

Approve all screenshots
approve_all_screenshots
Can overwrite or delete
Reaches outside your organization

Approve every screenshot in a build in one step and approve the build, so its screenshots become the new baseline for its branch. Updates the GitHub check run. Input: buildId.

Approve all screens in a story
approve_story_screenshots
Can overwrite or delete
Reaches outside your organization

Approve every changed or new screenshot of one story (all its theme and device variants) in a build. The rest of the build stays open for review; the build is approved only once every changed screen across all stories is approved. Updates the GitHub check run. Inputs: buildId, storyId (Storybook story id, from get_build).

Delete recording
delete_recording
Can overwrite or delete

Permanently delete one Playwright recording and its stored video. Input: recordingId.

Rename site
rename_replay_site
Can overwrite or delete

Change the name of a session-replay site. Inputs: siteId, name.

Update session replay settings
update_session_replay_settings
Can overwrite or delete

Change a session-replay site's settings; only the fields passed change. enabled false pauses recording (sessions are kept), true resumes it. privacyMode strict masks all text and blocks images; balanced records text (form values are never recorded). consentMode required records nothing until the site reports consent. Also sets allowed origins, never-record and mask CSS selectors (each list is replaced), Do-Not-Track handling, sample rate (1-100%) and retention days.

Flag a secret
flag_replay_secret
Can overwrite or delete

Add a CSS selector to a site's never-record list, so from the next page load the recorder blanks that element in the visitor's browser and its content is never sent. Optionally deletes a recorded session that already captured it. Inputs: siteId, selector, optional deleteSessionId.

Delete recorded session
delete_replay_session
Can overwrite or delete

Permanently delete one recorded visitor session and its stored events, for example for an erasure request. Input: sessionId.

Set dynamic regions
set_dynamic_regions
Can overwrite or delete

Replace the dynamic (ignored) regions of one story variant, so visual changes inside those rectangles (clocks, animations, random content) stop counting as diffs in future builds of that repository product. Regions are rectangles in fractions (0 to 1) of the image; pass an empty list to clear them. Inputs: repoId, optional productKey, storyId, theme, device, regions.

Mask all suggested areas in a build
apply_build_mask_suggestions
Can overwrite or delete

Add every suggested dynamic region for the screens of one build (areas that kept changing in the same spot across accepted builds), then re-check the affected screens in the background so that churn stops counting as a change. Returns how many areas and screens were masked. Input: buildId.

Dismiss mask suggestion
dismiss_mask_suggestion
Can overwrite or delete

Turn down a suggested dynamic region for one story variant, so that suggestion (and overlapping ones) is no longer offered. Existing masks are not changed. Inputs: repoId, optional productKey, storyId, theme, device, and the suggested region rectangle.

Support

Questions about DiffDeck, its API or a connected AI app? Email us — signed-in users can also open a ticket from Support inside the app.

DiffDeck API