---
title: "Replace screen surfaces settings"
method: PUT
path: "/protection/platform/{scope_id}/screen_surfaces"
tags: ["Protection"]
---

# Replace screen surfaces settings

`PUT /protection/platform/{scope_id}/screen_surfaces`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/protection/platform/{scope_id}/screen_surfaces`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Mnemom-Api-Key`
  - API key in cookie `mnemom_session`

PUT replaces the entire `screen_surfaces` block (which traffic surfaces the protection card inspects). The current spec at the platform scope is read; the new `screen_surfaces` is spliced in; the merged spec is validated; recompose is triggered. Requires `Idempotency-Key` and `If-Match`. Async fan-out — the response carries `agents_flagged_for_recompose`.

## Path parameters

- `scope_id` 'default', required

## Headers

- `Idempotency-Key` string, required
- `If-Match` string, required

## Request body

- object
  - `incoming` boolean, required
  - `outgoing` boolean, required
  - `tool_calls` boolean, required
  - `tool_responses` boolean, required

## Response `200`

The `screen_surfaces` primitive was updated at the platform scope.

- object
  - `ok` true, required
  - `scope` 'platform', required
  - `scope_id` string, required
  - `resource` 'protection', required
  - `primitive` 'screen_surfaces', required
  - `verb` 'put' | 'patch', required
  - `value` object, required
    - `incoming` boolean, required
    - `outgoing` boolean, required
    - `tool_calls` boolean, required
    - `tool_responses` boolean, required
  - `content_hash` string, required: New `sha256:<hex64>` of the spec at this scope after the write.
  - `agents_flagged_for_recompose` integer
  - `_warnings` object: Pre-existing structural issues outside the modified primitive. Present only when the existing spec carries unrelated validation problems; never blocks the write.

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Resource not found
- `409`: Resource conflict — the request cannot proceed because of a current state conflict (e.g., resource already exists, version mismatch, in-flight idempotency key with a different body).
- `412`: The `If-Match` header carried a stale ETag (the spec was updated since the caller read it). Run `GET` to fetch the current ETag, splice your changes onto the latest state, and retry the write. Cards-as-primitive Phase 4 W3.1.
- `413`: Request body exceeded the per-endpoint size cap. Cards-as-primitive sub-resource verbs cap each primitive body at 64 KiB; full-card PUTs cap at 128 KiB (alignment) / 64 KiB (protection).
- `422`: Request was well-formed but semantically invalid (e.g., business-rule validation failure, malformed YAML inside a JSON payload).
- `428`: The `If-Match` header is missing on a sub-resource write. Sub-resource verbs use optimistic concurrency — read the current ETag via `GET`, then retry with `If-Match: "sha256:..."`. Cards-as-primitive Phase 4 W3.1.
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.

---

[API](https://skmtc.dev/mnemom/apis/mnemom-api.md) · [All operations](https://skmtc.dev/mnemom/apis/mnemom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mnemom/apis/mnemom-api/revisions/274b7a6ea182?raw)
