diff --git a/SOURCE-PROVENANCE.json b/SOURCE-PROVENANCE.json index bbd502fc..d18121cd 100644 --- a/SOURCE-PROVENANCE.json +++ b/SOURCE-PROVENANCE.json @@ -1,6 +1,6 @@ { "repository": "recoupable/marketing", - "commit": "f0a9278d91c98bb879f48ee740f4e1b1dc387d11", + "commit": "38a24f67a64d2f97c5367cdf8f3a187701ce8091", "sourceDirectory": "content/docs/source", "files": [ { @@ -486,12 +486,12 @@ { "path": "api-reference/openapi/content.json", "sourcePath": "content/docs/source/api-reference/openapi/content.json", - "sha256": "b89165f9296a1aa98139f64ae095eefd2a5b306950170d3f15a4826de95ed036" + "sha256": "a59fa965788414731d19e031ec4b44f4a83319bdc651cb0aa49fba5a534317b0" }, { "path": "api-reference/openapi/context.json", "sourcePath": "content/docs/source/api-reference/openapi/context.json", - "sha256": "dd0a72fef32fa9abd74410caa71ac2b71df0ee36edb3a6cbc3614cde408c0593" + "sha256": "7986a997d2da4eeec358764b727d31f8b841f49db350e1357ef02289504e0bb9" }, { "path": "api-reference/openapi/players.json", @@ -1156,7 +1156,7 @@ { "path": "llms-full.txt", "sourcePath": "content/docs/source/llms-full.txt", - "sha256": "12058533f63c8e0904672828534041423f16e3083c3ea0702e7d6e46231aa40d" + "sha256": "345621536d1715e5a25483d39c15e9066a616939f3fae686d91648066495f333" }, { "path": "llms.txt", @@ -1176,7 +1176,7 @@ { "path": "mcp.mdx", "sourcePath": "content/docs/source/mcp.mdx", - "sha256": "85c39cffc867dabf0aaa154b694dc1770b561b43b6f3e01ef2ba5b1c2d7b5566" + "sha256": "d95f5444269268a066f076e390065d136e24cdee50c51572c95ec957b2fd5658" }, { "path": "public-website-api.mdx", diff --git a/api-reference/openapi/content.json b/api-reference/openapi/content.json index 62a9de1f..eed746db 100644 --- a/api-reference/openapi/content.json +++ b/api-reference/openapi/content.json @@ -17,7 +17,7 @@ "/api/sandboxes": { "get": { "operationId": "getSandboxes", - "description": "List all sandboxes associated with the authenticated account and their current statuses. Returns sandbox details including lifecycle state, timeout remaining, and creation timestamp. Pass account_id to retrieve sandboxes for a specific account the API key has access to. Authentication is handled via the x-api-key header or Authorization Bearer token.\n\nSet `metadata_only=true` when you only need the existing saved metadata. This skips live sandbox status lookups and returns an empty `sandboxes` array alongside `snapshot_id`, `github_repo` and `filetree`, preserving their existing nullable behavior. Stored metadata reads and the optional GitHub filetree lookup still run. The empty array in this mode does not establish whether any sandbox is running.\n\nOmitting `metadata_only` or sending literal `false` preserves normal live-status behavior. Authentication, account access checks and sandbox filters remain the same in either mode. Supplied values must be literal lowercase `true` or `false`; other values, including an empty value, return 400 through query validation.", + "description": "List all sandboxes associated with the authenticated account and their current statuses. Returns sandbox details including lifecycle state, timeout remaining, and creation timestamp. Authentication is handled via the x-api-key header or Authorization Bearer token.\n\nSet `metadata_only=true` when you only need the existing saved metadata. This skips live sandbox status lookups and returns an empty `sandboxes` array alongside `snapshot_id`, `github_repo` and `filetree`, preserving their existing nullable behavior. Stored metadata reads and the optional GitHub filetree lookup still run. The empty array in this mode does not establish whether any sandbox is running.\n\nOmitting `metadata_only` or sending literal `false` preserves normal live-status behavior. Authentication, account access checks and sandbox filters remain the same in either mode. Supplied values must be literal lowercase `true` or `false`; other values, including an empty value, return 400 through query validation.\n\nOmit `account_id` to read the authenticated account. An explicit UUID must pass the existing account-access policy: the caller itself, an organization the caller belongs to, a shared-organization account, or existing Recoup administrative access. Invalid UUIDs return 400; denied targets return 403 before snapshot or repository lookup. A target read never falls back to the caller's repository. Successful explicit-target reads echo `account_id`; omitted-target responses do not add that field. This delegates reads only, not upload, replacement or deletion rights.", "parameters": [ { "name": "sandbox_id", @@ -32,12 +32,13 @@ { "name": "account_id", "in": "query", - "description": "Filter to a specific account. Only applicable when the authenticated account has access to multiple accounts via organization membership.", + "description": "Optional target account UUID authorized by the existing account-access policy. Omit for the authenticated account. Successful explicit-target reads echo this value as account_id; this does not grant file-write access.", "required": false, "schema": { "type": "string", "format": "uuid" - } + }, + "example": "11111111-1111-4111-8111-111111111111" }, { "name": "metadata_only", @@ -52,17 +53,40 @@ ], "responses": { "200": { - "description": "Sandboxes retrieved successfully. In metadata_only mode, sandboxes is empty while the existing saved metadata fields are retained.", + "description": "Sandboxes retrieved successfully. In metadata_only mode, sandboxes is empty while the existing saved metadata fields are retained. Explicit authorized account_id requests echo that account_id; omitted-target requests keep the existing response shape.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxesResponse" + }, + "examples": { + "ownMetadata": { + "summary": "Authenticated account metadata (metadata_only=true)", + "value": { + "status": "success", + "sandboxes": [], + "snapshot_id": null, + "github_repo": null, + "filetree": null + } + }, + "targetMetadata": { + "summary": "Authorized explicit account metadata (account_id and metadata_only=true)", + "value": { + "status": "success", + "sandboxes": [], + "snapshot_id": null, + "github_repo": null, + "filetree": null, + "account_id": "11111111-1111-4111-8111-111111111111" + } + } } } } }, "400": { - "description": "Invalid query parameters, including a supplied metadata_only value other than literal lowercase true or false.", + "description": "Invalid query parameters, including an invalid account_id UUID or a supplied metadata_only value other than literal lowercase true or false.", "content": { "application/json": { "schema": { @@ -82,7 +106,7 @@ } }, "403": { - "description": "Forbidden - account_id is not a member of the organization or account tried to filter by an account_id they don't have access to", + "description": "Access denied to the explicit account_id. No target snapshot/repository lookup or fallback to the caller's repository occurs.", "content": { "application/json": { "schema": { @@ -317,7 +341,7 @@ "/api/sandboxes/file": { "get": { "operationId": "getSandboxesFile", - "description": "Read a file from the authenticated account's Git-backed repository, including resolved submodule paths, on `main`. The repository comes from the [account's snapshot](/api-reference/sandboxes/list). Authenticate with `x-api-key` or an Authorization Bearer token.\n\nTo update an existing file without silently replacing a newer edit, set `include_revision=true`. The response pairs `content` with its blob `sha` from the same repository read. Keep that SHA with the opened draft and send it as `files[].expected_sha` when saving to the same account, resolved repository and path. Omitting the flag, or setting it to `false`, retains the legacy raw read without a SHA.\n\n**Text files are returned verbatim. Recognized binary extensions (`.mp3`, `.png`, `.jpg`, `.mp4`, `.pdf`, etc.) return base64 content with `encoding: base64`; decode those bytes before use.**\n\nVersioned reads support existing regular files whose content is returned inline by the repository service (normally up to 1 MB). Unknown binary content that is not valid UTF-8 is rejected by the versioned read rather than converted into damaged text. Missing/unsupported content, directories and symlinks return an error.\n\nThe SHA identifies the file content; it is not an editing history.", + "description": "Read a file from the authenticated account's Git-backed repository, or an explicitly authorized target account's repository, including resolved submodule paths, on `main`. The repository comes from the [account's snapshot](/api-reference/sandboxes/list). Authenticate with `x-api-key` or an Authorization Bearer token.\n\nOmit `account_id` to read the authenticated account. An explicit UUID must pass the existing account-access policy: the caller itself, an organization the caller belongs to, a shared-organization account, or existing Recoup administrative access. Invalid UUIDs return 400; denied targets return 403 before snapshot or repository lookup. A target read never falls back to the caller's repository. Successful explicit-target reads echo `account_id`; omitted-target responses do not add that field. This delegates reads only, not upload, replacement or deletion rights.\n\nClients selecting an account must send the same `account_id` on the list and file reads and require a matching response echo before using the result. Key cached data by authentication identity, target account and API origin. When that scope changes, reject stale in-flight results and invalidate writable revisions. Retain any unsaved replacement under its original account for manual recovery; never reuse that draft or its revision for a different account. An explicit override is a read-only view, even when it names the authenticated account. A SHA from a target read does not grant permission to write there.\n\nTo update an existing file without silently replacing a newer edit, set `include_revision=true`. The response pairs `content` with its blob `sha` from the same repository read. Keep that SHA with the opened draft and send it as `files[].expected_sha` when saving to the same account, resolved repository and path. Omitting the flag, or setting it to `false`, retains the legacy raw read without a SHA.\n\n**Text files are returned verbatim. Recognized binary extensions (`.mp3`, `.png`, `.jpg`, `.mp4`, `.pdf`, etc.) return base64 content with `encoding: base64`; decode those bytes before use.**\n\nVersioned reads support existing regular files whose content is returned inline by the repository service (normally up to 1 MB). Unknown binary content that is not valid UTF-8 is rejected by the versioned read rather than converted into damaged text. Missing/unsupported content, directories and symlinks return an error.\n\nThe SHA identifies the file content; it is not an editing history.", "parameters": [ { "name": "path", @@ -340,11 +364,22 @@ "default": false }, "example": true + }, + { + "name": "account_id", + "in": "query", + "description": "Optional target account UUID authorized by the existing account-access policy. Omit for the authenticated account. Successful explicit-target reads echo this value as account_id; this does not grant file-write access.", + "required": false, + "schema": { + "type": "string", + "format": "uuid" + }, + "example": "11111111-1111-4111-8111-111111111111" } ], "responses": { "200": { - "description": "File content. Versioned reads also return sha; recognized binary extensions also return encoding: base64.", + "description": "File content. Versioned reads also return sha; recognized binary extensions also return encoding: base64. Explicit authorized account_id requests also echo that account_id; omitted-target requests do not.", "content": { "application/json": { "schema": { @@ -374,13 +409,30 @@ "encoding": "base64", "sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } + }, + "targetText": { + "summary": "Authorized target read (account_id supplied; no revision requested)", + "value": { + "status": "success", + "content": "Release notes", + "account_id": "11111111-1111-4111-8111-111111111111" + } + }, + "targetVersionedText": { + "summary": "Authorized target bytes and revision (read access only)", + "value": { + "status": "success", + "content": "Release notes", + "sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "account_id": "11111111-1111-4111-8111-111111111111" + } } } } } }, "400": { - "description": "Missing/noncanonical path or include_revision other than true/false. Use a canonical relative path. Dot/traversal segments, backslashes, control characters, malformed Unicode and leading/trailing/doubled slashes return 400. These checks also apply to legacy requests.", + "description": "Invalid account_id UUID, missing/noncanonical path or include_revision other than true/false. Use a canonical relative path. Dot/traversal segments, backslashes, control characters, malformed Unicode and leading/trailing/doubled slashes return 400. These checks also apply to legacy requests.", "content": { "application/json": { "schema": { @@ -400,7 +452,7 @@ } }, "403": { - "description": "Forbidden - account does not have access", + "description": "Access denied to the explicit account_id. No target snapshot/repository lookup or fallback to the caller's repository occurs.", "content": { "application/json": { "schema": { @@ -410,7 +462,7 @@ } }, "404": { - "description": "No usable account snapshot/repository, missing file, or unsupported/failed versioned read. Guarded reads do not fall back to another branch or separately fetched bytes.", + "description": "No usable account snapshot/repository, missing file, or unsupported/failed versioned read. Guarded reads do not fall back to another branch or separately fetched bytes. An explicit target with no usable repository or file does not fall back to the caller's repository.", "content": { "application/json": { "schema": { @@ -476,7 +528,7 @@ "/api/sandboxes/files": { "post": { "operationId": "postSandboxesFiles", - "description": "Upload one or more files to the authenticated account's Git-backed repository. Each file URL is committed separately; paths inside a submodule resolve to that repository. Authenticate with `x-api-key` or an Authorization Bearer token.\n\nFor a guarded update of an existing file:\n1. Read it with `GET /api/sandboxes/file?include_revision=true` and retain the returned `sha` with that draft.\n2. Upload the edited bytes using the [staged-file upload](/api-reference/sandboxes/stage-file), then send the resulting URL and the original SHA as `files[].expected_sha`. Guarded updates save to `main`. A conflicting save is not retried automatically.\n3. On a conflict, preserve the unsaved draft, reread the latest content and reconcile explicitly. Do not fetch a new SHA merely to force an older draft through.\n\nA batch is not a transaction. HTTP 200 can include successful `uploaded` receipts alongside `errors` and `conflicts`; inspect every file. If every upload fails only because its condition conflicts, the response is 409. If all fail with mixed conflict/other failures, it is 500 and keeps the conflicts list. Conflicts contain submitted file names; successes include resulting blob SHAs.\n\nTemporary upload blobs are deleted after every attempt, including conflicts, so retrying requires a new upload URL. Omitting `expected_sha` creates or updates the file on the repository default branch without checking the version you opened. The condition only supports updates to existing files. It protects saves that supply it; saving here does not update files in an already running sandbox.\n\nIf the target was deleted after the read, do not retry without the condition. This upload has no dedicated missing-target status: non-conflict failures return 500 when no file succeeds, or appear in `errors` alongside successful receipts in a 200 partial result. A missing target is not guaranteed to return 404 or 409; reread the path before deciding how to recover.", + "description": "Upload one or more files to the authenticated account's Git-backed repository. Each file URL is committed separately; paths inside a submodule resolve to that repository. Authenticate with `x-api-key` or an Authorization Bearer token.\n\nFor a guarded update of an existing file:\n1. Read it with `GET /api/sandboxes/file?include_revision=true` and retain the returned `sha` with that draft.\n2. Upload the edited bytes using the [staged-file upload](/api-reference/sandboxes/stage-file), then send the resulting URL and the original SHA as `files[].expected_sha`. Guarded updates save to `main`. A conflicting save is not retried automatically.\n3. On a conflict, preserve the unsaved draft, reread the latest content and reconcile explicitly. Do not fetch a new SHA merely to force an older draft through.\n\nA batch is not a transaction. HTTP 200 can include successful `uploaded` receipts alongside `errors` and `conflicts`; inspect every file. If every upload fails only because its condition conflicts, the response is 409. If all fail with mixed conflict/other failures, it is 500 and keeps the conflicts list. Conflicts contain submitted file names; successes include resulting blob SHAs.\n\nTemporary upload blobs are deleted after every attempt, including conflicts, so retrying requires a new upload URL. Omitting `expected_sha` creates or updates the file on the repository default branch without checking the version you opened. The condition only supports updates to existing files. It protects saves that supply it; saving here does not update files in an already running sandbox.\n\nIf the target was deleted after the read, do not retry without the condition. This upload has no dedicated missing-target status: non-conflict failures return 500 when no file succeeds, or appear in `errors` alongside successful receipts in a 200 partial result. A missing target is not guaranteed to return 404 or 409; reread the path before deciding how to recover.\n\nThe optional `account_id` on list/file reads does not delegate uploads or replacements. This upload route remains bound to its existing authenticated-account ownership checks; do not reuse a different account's draft or SHA here. File deletion behavior is also unchanged.", "requestBody": { "description": "JSON body containing file URLs and target path", "required": true, @@ -5178,6 +5230,12 @@ "pattern": "^[a-f0-9]{40}$", "description": "Present when include_revision=true; use this reader-observed blob SHA as files[].expected_sha. Absent from legacy reads. It identifies the returned bytes, not an accepted Context source version.", "example": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + "account_id": { + "type": "string", + "format": "uuid", + "description": "On successful GET reads only: the explicitly requested, authorized target account UUID. Present even for an explicit self target; absent when account_id was omitted. This is read scope, not write authorization.", + "example": "11111111-1111-4111-8111-111111111111" } } }, @@ -5227,6 +5285,12 @@ "error": { "type": "string", "description": "Error message (only present if status is error)" + }, + "account_id": { + "type": "string", + "format": "uuid", + "description": "On successful GET reads only: the explicitly requested, authorized target account UUID. Present even for an explicit self target; absent when account_id was omitted. This is read scope, not write authorization.", + "example": "11111111-1111-4111-8111-111111111111" } } }, diff --git a/api-reference/openapi/context.json b/api-reference/openapi/context.json index 57a7b40c..9faa6879 100644 --- a/api-reference/openapi/context.json +++ b/api-reference/openapi/context.json @@ -3863,29 +3863,2526 @@ "additionalProperties": false } ] - } - } - }, - "paths": { - "/api/context": { - "post": { - "operationId": "contextOperation", - "summary": "Ingest, read, or compile context briefs", - "description": "Save and reuse evidence in an authorized Recoup workspace. **Preview: this reference is verified against API source, not a completed hosted acceptance test.** Actions require the corresponding database and workflow release; verification actions also require their feature to be enabled. Do not infer provider readiness, complete coverage, or a successful workflow from an accepted request schema.\n\n### Create context\n\n`ingest` creates or reuses a Spotify-track request and dispatches its durable workflow (202). The parser recognizes YouTube URLs, but ingestion still rejects them in this pilot. `ingest_release` stores a Spotify album locator; it does not automatically verify the release. `ingest_catalog` and `ingest_artist` refer to accessible Recoup records. `ingest_songwriter_name`, `ingest_company_name`, `ingest_campaign_brief`, and `ingest_supporting_text` store submitted context (200). Names and customer text are not verified identities or facts. Reuse an idempotency key only for the same intended input.\n\n### Read, plan and inspect\n\n`read` reads one request. For saved supporting text, HTTP and standard MCP also return a metadata-only `material_evidence` receipt identifying the current document, result and exact retained source version. It returns no submitted text, source location or signed access. `draft_origin` remains `not_recorded`: a retained customer assertion is not proof of its file origin or reviewed business facts. Unavailable material withholds those references. Delegated OAuth keeps its request-only response. `plan` plans modules from stored context; a plan is not authorization to collect data. `list_executions` and `read_execution` expose execution records. `list_catalog_members` pages saved members; `expand_catalog_members` materializes a bounded member page. These operations return 200. Request IDs, subject IDs and execution IDs refer to different records; use the IDs returned by the corresponding read rather than substituting an account ID. Catalog membership does not establish rights ownership. Use `plan_catalog_members` to plan a lookup for a page of current expanded catalog recordings, as described below.\n\n### Plan a catalog lookup\n\nA catalog manager can inspect which lookup would be proposed for recordings already expanded from an accessible catalog. This action reads the saved targets and returns a plan; it does not fetch recording matches, linked works or platform information.\n\nSupply the existing catalog Context `request_id` and its catalog `subject_id`, one `module`, and optionally `organization_id`, `after_isrc` and `limit` (1–100, default 100). These IDs refer to different records: do not substitute the catalog ID, account ID or a member recording subject for the catalog Context subject.\n\n| Preferred input | Lookup being planned | Legacy accepted input and returned module |\n| --- | --- | --- |\n| `recording_candidates` | Unconfirmed recording candidates from an ISRC; a candidate is not an approved recording identity | `musicbrainz` |\n| `recording_work_candidates` | Candidate works linked to a recording; no ownership or royalty-share verification | `mlc_recording` |\n| `platform_metadata` | Available platform track information; no growth-metric or complete-coverage promise | `songstats` |\n\nAll six input values remain accepted. The three values in the last column are compatibility identifiers, not a promise that data sources are interchangeable. Each preferred/legacy pair returns the same page, raw module, executor, node key, state and reasons. Source and saved-plan provenance remain unchanged.\n\nThe 200 result is `ContextCatalogPlanningResponse`: `page`, `plan` and `collectionPermitted: false`. `page` includes `catalogId`, `catalogSubjectId`, `members`, `nextCursor` and `hasMore`. Each member retains `subjectId`, `kind`, `identityConfirmed`, `availableFields`, `reusableModules` and `isrc`. The saved ISRC-backed target flag does not verify an external recording match, rights or ownership. Only expanded recordings still present in the selected workspace's accessible catalog are returned; removed and not-yet-expanded members are excluded. Pass `page.nextCursor` as `after_isrc` when `page.hasMore` is true.\n\n`plan` has one node per returned member, including `key`, `entry`, `subjectId`, `targetKind`, `module`, `executor`, `state`, `reasons`, `dependsOn`, `scope` and `executionStarted`. Node keys retain `{subjectId}:{legacy_module}`. This action supplies no permitted modules and does not reuse collection permission: every returned node is `blocked`, has `executionStarted: false`, an empty `dependsOn` and the reason `Server collection policy has not permitted this module`. An empty member page returns `plan: []` and still has `collectionPermitted: false`.\n\nAn executor name describes a planned implementation; it does not make that collector runnable. In particular, the platform-metadata collector is not connected to the trusted planned dispatcher. No provider/model call, execution claim, credit charge, new access grant or automatic catalog expansion is triggered. An accepted request or local fixture is not hosted customer-workflow acceptance.\n\n### Release verification and review\n\n`verify_release` and `verify_release_tracks` enqueue enabled verification workflows (202); disabled features or unmet readiness conditions return 409. `list_release_tracks`, `read_release_track_observations`, and `review_release_track_identities` inspect saved slots and identity evidence (200). Inspect the returned readiness, coverage and unresolved identity state before using a recording match. `list_release_cases`, `read_release_case`, `read_release_case_review`, and `review_release_case` read or record release-case review. A review requires the current fingerprint, a decision, and an idempotency key; it does not silently rewrite source evidence.\n\n### Compile and save briefs\n\n`brief` compiles evidence from up to ten completed or partial requests in one workspace without provider or model calls. Purposes are `creative_direction`, `playlist_pitch`, and `company_onboarding`. Creative direction prioritizes lyrics and artwork; playlist pitching prioritizes catalog/audio metadata. Inspect readiness, request_coverage, selected input versions and gaps. Briefs are evidence packets, not finished creative concepts or outreach. Compiled documents have accepted status and full or partial coverage; creative proposals and other document states are excluded by the current selector. Accepted is a saved-evidence status, not verification of identity or rights. `save_brief` freezes the server-compiled output, and `read_brief` retrieves that snapshot without recompilation. Newer evidence can supersede a snapshot without rewriting it; withdrawn evidence or removed scope can withhold its payload. All three actions return 200.\n\n### Link retained evidence\n\n`attach_evidence` links one exact retained `source_version_id` to 1–100 distinct existing targets: an artist, a professional, or a Context request/subject pair. Supply a stable `idempotency_key`; retry only the same version and targets with that key. Authentication supplies the actor. The receipt records relevance only; it does not confirm identity, rights or a business mandate. It creates no roster entry and makes no provider/model call or charge.\n\n`read_evidence_attachment` reads one receipt by `attachment_id`. `list_evidence_attachments` reads a page for an exact source version. Pass `next_id` as `after_id` while `has_more` is true, including an empty page where protected receipts were withheld. Reads check current workspace access, source retention and independent target access. Evidence responses and domain errors are private and must not be cached. A later source version needs a separate association; these actions do not rewrite historical receipts. They require the matching evidence-association database and API release; accepted request syntax is not hosted availability.\n\n### Scope and failures\n\nAuthentication determines the account. Optional organization_id selects an authorized organization workspace; request and subject ownership are checked again by the operation. Invalid request syntax returns 400, missing authentication 401, rejected organization access 403, and operation conflicts, unavailable evidence or disabled verification 409. No action accepts a caller-supplied account identity. Local schema tests do not establish hosted availability.\n\n### MCP mapping\n\nStandard MCP uses the `context` tool with the same action and fields as this REST request. The three evidence actions also have individually discoverable object-schema tools listed separately below; they are excluded from delegated OAuth connections. Delegated OAuth exposes the named tools below and supplies the action server-side; omit action from the named tool input. These registrations require the full `mcp:tools` grant, current ownership and fresh credential verification. Read-only is a tool annotation, not a guarantee of hosted readiness. Discover the actual tools in the connected client before use; this is a static source mapping, not a verified client catalog.\n\n| REST action | Delegated OAuth tool | Classification |\n| --- | --- | --- |\n| `list_release_cases` | `list_music_release_cases` | Read-only hint |\n| `read_release_case` | `read_music_release_case` | Read-only hint |\n| `read_release_case_review` | `read_music_release_case_review` | Read-only hint |\n| `review_release_case` | `record_music_release_case_review` | Writes or dispatches |\n| `save_brief` | `save_music_context_brief` | Writes or dispatches |\n| `read_brief` | `read_music_context_brief` | Read-only hint |\n| `plan` | `plan_music_context_research` | Read-only hint |\n| `list_executions` | `list_music_context_executions` | Read-only hint |\n| `list_catalog_members` | `list_music_context_catalog_members` | Read-only hint |\n| `list_release_tracks` | `list_music_context_release_tracks` | Read-only hint |\n| `read_release_track_observations` | `read_music_release_track_observations` | Read-only hint |\n| `review_release_track_identities` | `review_music_release_track_identities` | Read-only hint |\n| `verify_release_tracks` | `verify_music_release_tracks` | Writes or dispatches |\n| `expand_catalog_members` | `expand_music_context_catalog` | Writes or dispatches |\n| `plan_catalog_members` | `plan_music_catalog_research` | Read-only hint |\n| `read_execution` | `read_music_context_execution` | Read-only hint |\n| `ingest_catalog` | `import_catalog_context` | Writes or dispatches |\n| `ingest_artist` | `import_artist_context` | Writes or dispatches |\n| `ingest_songwriter_name` | `import_songwriter_context` | Writes or dispatches |\n| `ingest_company_name` | `import_music_company_context` | Writes or dispatches |\n| `ingest_campaign_brief` | `import_music_campaign_brief` | Writes or dispatches |\n| `ingest_supporting_text` | `import_music_supporting_text` | Writes or dispatches |\n| `ingest_release` | `import_music_release_context` | Writes or dispatches |\n| `verify_release` | `verify_music_release` | Writes or dispatches |\n| `ingest` | `import_song_context` | Writes or dispatches |\n| `read` | `read_music_context` | Read-only hint |\n| `brief` | `compile_music_context_brief` | Read-only hint |\n\n### Standard-only evidence tools\n\nThese tools are available to standard MCP clients after the required database/API release. They are excluded from delegated OAuth connections pending organization-grant review.\n\n| REST action | Standard MCP tool | Classification |\n| --- | --- | --- |\n| `attach_evidence` | `attach_music_evidence` | Writes |\n| `read_evidence_attachment` | `read_music_evidence_attachment` | Read-only hint |\n| `list_evidence_attachments` | `list_music_evidence_attachments` | Read-only hint |\n\n### Success responses and examples\n\nThe success model depends on the requested action. The table and `x-recoup-context-responses` connect each action to its HTTP status and complete named model; use that model rather than the union of all successful results. Request and response examples use synthetic authorized storage and mocked dispatch. A 202 receipt means queued, not completed. No example authorizes a provider call, collection, spending or new access.\n\nSaved request `input`/`output` JSON and historical execution-node/outcome metadata remain intentionally flexible. A saved request or execution record is not a guarantee of complete evidence, verified identity or rights. `read` may include metadata-only `material_evidence` on HTTP/standard MCP; delegated OAuth omits that receipt.\n\n| Action | HTTP status | Response model |\n| --- | --- | --- |\n| `attach_evidence` | 200 | `ContextEvidenceAttachmentReceipt` |\n| `read_evidence_attachment` | 200 | `ContextEvidenceAttachmentReceipt` |\n| `list_evidence_attachments` | 200 | `ContextEvidenceAttachmentPage` |\n| `list_release_cases` | 200 | `ContextReleaseCasesResponse` |\n| `read_release_case` | 200 | `ContextReleaseCaseResponse` |\n| `read_release_case_review` | 200 | `ContextReleaseCaseReviewResponse` |\n| `review_release_case` | 200 | `ContextReleaseCaseReviewResponse` |\n| `save_brief` | 200 | `ContextBriefSnapshotResponse` |\n| `read_brief` | 200 | `ContextBriefSnapshotResponse` |\n| `plan` | 200 | `ContextModulePlanResponse` |\n| `list_executions` | 200 | `ContextExecutionsResponse` |\n| `list_catalog_members` | 200 | `ContextCatalogMembersResponse` |\n| `list_release_tracks` | 200 | `ContextReleaseTracksResponse` |\n| `read_release_track_observations` | 200 | `ContextReleaseTrackObservationsResponse` |\n| `review_release_track_identities` | 200 | `ContextReleaseIdentityReviewResponse` |\n| `verify_release_tracks` | 202 | `ContextReleaseTrackVerificationResponse` |\n| `expand_catalog_members` | 200 | `ContextCatalogExpansionResponse` |\n| `plan_catalog_members` | 200 | `ContextCatalogPlanningResponse` |\n| `read_execution` | 200 | `ContextExecutionResponse` |\n| `ingest_catalog` | 200 | `ContextRequestResponse` |\n| `ingest_artist` | 200 | `ContextRequestResponse` |\n| `ingest_songwriter_name` | 200 | `ContextRequestResponse` |\n| `ingest_company_name` | 200 | `ContextRequestResponse` |\n| `ingest_campaign_brief` | 200 | `ContextRequestResponse` |\n| `ingest_supporting_text` | 200 | `ContextRequestResponse` |\n| `ingest_release` | 200 | `ContextRequestResponse` |\n| `verify_release` | 202 | `ContextReleaseVerificationResponse` |\n| `ingest` | 202 | `ContextRequestResponse` |\n| `read` | 200 | `ContextReadResponse` |\n| `brief` | 200 | `ContextBriefResponse` |", - "security": [ - { - "ApiKey": [] + }, + "ContextCatalogCaseResponse": { + "type": "object", + "properties": { + "case_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, - { - "BearerAuth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "oneOf": [ + "revision": { + "type": "integer", + "minimum": 1, + "maximum": 9007199254740991 + }, + "state": { + "type": "string", + "enum": [ + "saved", + "partial" + ] + }, + "evidence_kind": { + "type": "string", + "const": "customer_assertion" + }, + "snapshot": { + "type": "object", + "properties": { + "schema_version": { + "type": "number", + "const": 1 + }, + "case_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "workspace_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "revision": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "scope": { + "type": "string", + "maxLength": 32000 + }, + "sources": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "locator": { + "anyOf": [ + { + "type": "string", + "minLength": 1, + "maxLength": 32000 + }, + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + ] + }, + "status": { + "type": "string", + "enum": [ + "active", + "withdrawn" + ] + }, + "evidence_kind": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "context_source_version_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + } + }, + "required": [ + "id", + "version", + "sha256", + "locator", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "status": { + "type": "string", + "const": "withdrawn" + }, + "withheld": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "version", + "status", + "withheld" + ], + "additionalProperties": false + } + ] + } + }, + "assessments": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stage": { + "type": "string", + "enum": [ + "audit", + "reconcile", + "register", + "resolve_claims", + "manage_delivery", + "review_deal", + "import", + "explain_contract", + "organize_publishing", + "estimate_value", + "check_credits", + "check_metadata" + ] + }, + "status": { + "type": "string", + "enum": [ + "prepared", + "in_progress", + "partial", + "complete", + "blocked" + ] + } + }, + "required": [ + "id", + "source_refs", + "rule_version", + "stage", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "status": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stale": { + "type": "boolean", + "const": true + }, + "withheld": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "status", + "stale", + "withheld" + ], + "additionalProperties": false + } + ] + } + }, + "findings": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stage": { + "type": "string", + "enum": [ + "audit", + "reconcile", + "register", + "resolve_claims", + "manage_delivery", + "review_deal", + "import", + "explain_contract", + "organize_publishing", + "estimate_value", + "check_credits", + "check_metadata" + ] + }, + "status": { + "type": "string", + "enum": [ + "open", + "accepted", + "resolved", + "not_applicable" + ] + }, + "cause_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "id", + "source_refs", + "rule_version", + "stage", + "status", + "cause_id" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "status": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stale": { + "type": "boolean", + "const": true + }, + "withheld": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "status", + "stale", + "withheld" + ], + "additionalProperties": false + } + ] + } + }, + "actions": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stage": { + "type": "string", + "enum": [ + "register", + "resolve_claims", + "manage_delivery" + ] + }, + "status": { + "type": "string", + "enum": [ + "prepared", + "authorized", + "withdrawn" + ] + }, + "payload": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "operation": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "account": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "party": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "subjects": { + "minItems": 1, + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "scope": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "disclosure": { + "maxItems": 1000, + "type": "array", + "items": {} + }, + "costs": { + "maxItems": 1000, + "type": "array", + "items": {} + } + }, + "required": [ + "provider", + "operation", + "account", + "party", + "subjects", + "scope", + "disclosure", + "costs" + ], + "additionalProperties": {} + }, + "authorization": { + "type": "object", + "properties": { + "reference": { + "type": "string", + "minLength": 1, + "maxLength": 32000 + }, + "payload_sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "valid_until": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "scope": {} + }, + "required": [ + "reference", + "payload_sha256", + "valid_until", + "scope" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "source_refs", + "rule_version", + "stage", + "status", + "payload" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "status": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stale": { + "type": "boolean", + "const": true + }, + "withheld": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "status", + "stale", + "withheld" + ], + "additionalProperties": false + } + ] + } + }, + "attempts": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "payload_sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "status": { + "type": "string", + "enum": [ + "user_reported_sent", + "observed_sent", + "unknown_outcome", + "acknowledged", + "rejected" + ] + }, + "provider_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "item_ids": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "receipt_locator": {}, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "payload_sha256", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "status": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stale": { + "type": "boolean", + "const": true + }, + "withheld": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "status", + "stale", + "withheld" + ], + "additionalProperties": false + } + ] + } + }, + "outcomes": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "anyOf": [ + { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "dimension": { + "type": "string", + "const": "provider_decision" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "accepted", + "partially_accepted", + "rejected", + "superseded", + "rematched" + ] + }, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "dimension", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "dimension": { + "type": "string", + "const": "observed_record" + }, + "status": { + "type": "string", + "enum": [ + "unchecked", + "correct", + "partial", + "incorrect", + "stale" + ] + }, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "dimension", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "dimension": { + "type": "string", + "const": "financial_effect" + }, + "status": { + "type": "string", + "enum": [ + "unverified", + "adjustment_reported", + "remitted", + "bank_received", + "reversed" + ] + }, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "dimension", + "status" + ], + "additionalProperties": false + } + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "status": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stale": { + "type": "boolean", + "const": true + }, + "withheld": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "status", + "stale", + "withheld" + ], + "additionalProperties": false + } + ] + } + } + }, + "required": [ + "schema_version", + "case_id", + "workspace_id", + "revision", + "scope", + "sources", + "assessments", + "findings", + "actions", + "attempts", + "outcomes" + ], + "additionalProperties": false + }, + "withheld_record_ids": { + "maxItems": 6000, + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "snapshot_usable_for_save": { + "type": "boolean" + }, + "external_actions": { + "type": "string", + "const": "unsupported" + }, + "created_at": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + } + }, + "required": [ + "case_id", + "revision", + "state", + "evidence_kind", + "snapshot", + "withheld_record_ids", + "snapshot_usable_for_save", + "external_actions", + "created_at" + ], + "additionalProperties": false + }, + "ContextCatalogCasesResponse": { + "type": "object", + "properties": { + "cases": { + "maxItems": 100, + "type": "array", + "items": { + "type": "object", + "properties": { + "case_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "revision": { + "type": "integer", + "minimum": 1, + "maximum": 9007199254740991 + }, + "created_at": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + } + }, + "required": [ + "case_id", + "revision", + "created_at", + "updated_at" + ], + "additionalProperties": false + } + }, + "has_more": { + "type": "boolean" + }, + "next_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "cases", + "has_more", + "next_id" + ], + "additionalProperties": false + } + } + }, + "paths": { + "/api/context": { + "post": { + "operationId": "contextOperation", + "summary": "Ingest, read, or compile context briefs", + "description": "Save and reuse evidence in an authorized Recoup workspace. **Preview: this reference is verified against API source, not a completed hosted acceptance test.** Actions require the corresponding database and workflow release; verification actions also require their feature to be enabled. Do not infer provider readiness, complete coverage, or a successful workflow from an accepted request schema.\n\n### Create context\n\n`ingest` creates or reuses a Spotify-track request and dispatches its durable workflow (202). The parser recognizes YouTube URLs, but ingestion still rejects them in this pilot. `ingest_release` stores a Spotify album locator; it does not automatically verify the release. `ingest_catalog` and `ingest_artist` refer to accessible Recoup records. `ingest_songwriter_name`, `ingest_company_name`, `ingest_campaign_brief`, and `ingest_supporting_text` store submitted context (200). Names and customer text are not verified identities or facts. Reuse an idempotency key only for the same intended input.\n\n### Read, plan and inspect\n\n`read` reads one request. For saved supporting text, HTTP and standard MCP also return a metadata-only `material_evidence` receipt identifying the current document, result and exact retained source version. It returns no submitted text, source location or signed access. `draft_origin` remains `not_recorded`: a retained customer assertion is not proof of its file origin or reviewed business facts. Unavailable material withholds those references. Delegated OAuth keeps its request-only response. `plan` plans modules from stored context; a plan is not authorization to collect data. `list_executions` and `read_execution` expose execution records. `list_catalog_members` pages saved members; `expand_catalog_members` materializes a bounded member page. These operations return 200. Request IDs, subject IDs and execution IDs refer to different records; use the IDs returned by the corresponding read rather than substituting an account ID. Catalog membership does not establish rights ownership. Use `plan_catalog_members` to plan a lookup for a page of current expanded catalog recordings, as described below.\n\n### Plan a catalog lookup\n\nA catalog manager can inspect which lookup would be proposed for recordings already expanded from an accessible catalog. This action reads the saved targets and returns a plan; it does not fetch recording matches, linked works or platform information.\n\nSupply the existing catalog Context `request_id` and its catalog `subject_id`, one `module`, and optionally `organization_id`, `after_isrc` and `limit` (1–100, default 100). These IDs refer to different records: do not substitute the catalog ID, account ID or a member recording subject for the catalog Context subject.\n\n| Preferred input | Lookup being planned | Legacy accepted input and returned module |\n| --- | --- | --- |\n| `recording_candidates` | Unconfirmed recording candidates from an ISRC; a candidate is not an approved recording identity | `musicbrainz` |\n| `recording_work_candidates` | Candidate works linked to a recording; no ownership or royalty-share verification | `mlc_recording` |\n| `platform_metadata` | Available platform track information; no growth-metric or complete-coverage promise | `songstats` |\n\nAll six input values remain accepted. The three values in the last column are compatibility identifiers, not a promise that data sources are interchangeable. Each preferred/legacy pair returns the same page, raw module, executor, node key, state and reasons. Source and saved-plan provenance remain unchanged.\n\nThe 200 result is `ContextCatalogPlanningResponse`: `page`, `plan` and `collectionPermitted: false`. `page` includes `catalogId`, `catalogSubjectId`, `members`, `nextCursor` and `hasMore`. Each member retains `subjectId`, `kind`, `identityConfirmed`, `availableFields`, `reusableModules` and `isrc`. The saved ISRC-backed target flag does not verify an external recording match, rights or ownership. Only expanded recordings still present in the selected workspace's accessible catalog are returned; removed and not-yet-expanded members are excluded. Pass `page.nextCursor` as `after_isrc` when `page.hasMore` is true.\n\n`plan` has one node per returned member, including `key`, `entry`, `subjectId`, `targetKind`, `module`, `executor`, `state`, `reasons`, `dependsOn`, `scope` and `executionStarted`. Node keys retain `{subjectId}:{legacy_module}`. This action supplies no permitted modules and does not reuse collection permission: every returned node is `blocked`, has `executionStarted: false`, an empty `dependsOn` and the reason `Server collection policy has not permitted this module`. An empty member page returns `plan: []` and still has `collectionPermitted: false`.\n\nAn executor name describes a planned implementation; it does not make that collector runnable. In particular, the platform-metadata collector is not connected to the trusted planned dispatcher. No provider/model call, execution claim, credit charge, new access grant or automatic catalog expansion is triggered. An accepted request or local fixture is not hosted customer-workflow acceptance.\n\n### Release verification and review\n\n`verify_release` and `verify_release_tracks` enqueue enabled verification workflows (202); disabled features or unmet readiness conditions return 409. `list_release_tracks`, `read_release_track_observations`, and `review_release_track_identities` inspect saved slots and identity evidence (200). Inspect the returned readiness, coverage and unresolved identity state before using a recording match. `list_release_cases`, `read_release_case`, `read_release_case_review`, and `review_release_case` read or record release-case review. A review requires the current fingerprint, a decision, and an idempotency key; it does not silently rewrite source evidence.\n\n### Compile and save briefs\n\n`brief` compiles evidence from up to ten completed or partial requests in one workspace without provider or model calls. Purposes are `creative_direction`, `playlist_pitch`, and `company_onboarding`. Creative direction prioritizes lyrics and artwork; playlist pitching prioritizes catalog/audio metadata. Inspect readiness, request_coverage, selected input versions and gaps. Briefs are evidence packets, not finished creative concepts or outreach. Compiled documents have accepted status and full or partial coverage; creative proposals and other document states are excluded by the current selector. Accepted is a saved-evidence status, not verification of identity or rights. `save_brief` freezes the server-compiled output, and `read_brief` retrieves that snapshot without recompilation. Newer evidence can supersede a snapshot without rewriting it; withdrawn evidence or removed scope can withhold its payload. All three actions return 200.\n\n### Link retained evidence\n\n`attach_evidence` links one exact retained `source_version_id` to 1–100 distinct existing targets: an artist, a professional, or a Context request/subject pair. Supply a stable `idempotency_key`; retry only the same version and targets with that key. Authentication supplies the actor. The receipt records relevance only; it does not confirm identity, rights or a business mandate. It creates no roster entry and makes no provider/model call or charge.\n\n`read_evidence_attachment` reads one receipt by `attachment_id`. `list_evidence_attachments` reads a page for an exact source version. Pass `next_id` as `after_id` while `has_more` is true, including an empty page where protected receipts were withheld. Reads check current workspace access, source retention and independent target access. Evidence responses and domain errors are private and must not be cached. A later source version needs a separate association; these actions do not rewrite historical receipts. They require the matching evidence-association database and API release; accepted request syntax is not hosted availability.\n\n### Scope and failures\n\nAuthentication determines the account. Optional organization_id selects an authorized organization workspace; request and subject ownership are checked again by the operation. Invalid request syntax returns 400, missing authentication 401, rejected organization access 403, and operation conflicts, unavailable evidence or disabled verification 409. No action accepts a caller-supplied account identity. Local schema tests do not establish hosted availability.\n\n### MCP mapping\n\nStandard MCP uses the `context` tool with the same action and fields as this REST request. The three evidence actions also have individually discoverable object-schema tools listed separately below; they are excluded from delegated OAuth connections. Delegated OAuth exposes the named tools below and supplies the action server-side; omit action from the named tool input. These registrations require the full `mcp:tools` grant, current ownership and fresh credential verification. Read-only is a tool annotation, not a guarantee of hosted readiness. Discover the actual tools in the connected client before use; this is a static source mapping, not a verified client catalog.\n\n| REST action | Delegated OAuth tool | Classification |\n| --- | --- | --- |\n| `list_release_cases` | `list_music_release_cases` | Read-only hint |\n| `read_release_case` | `read_music_release_case` | Read-only hint |\n| `read_release_case_review` | `read_music_release_case_review` | Read-only hint |\n| `review_release_case` | `record_music_release_case_review` | Writes or dispatches |\n| `save_brief` | `save_music_context_brief` | Writes or dispatches |\n| `read_brief` | `read_music_context_brief` | Read-only hint |\n| `plan` | `plan_music_context_research` | Read-only hint |\n| `list_executions` | `list_music_context_executions` | Read-only hint |\n| `list_catalog_members` | `list_music_context_catalog_members` | Read-only hint |\n| `list_release_tracks` | `list_music_context_release_tracks` | Read-only hint |\n| `read_release_track_observations` | `read_music_release_track_observations` | Read-only hint |\n| `review_release_track_identities` | `review_music_release_track_identities` | Read-only hint |\n| `verify_release_tracks` | `verify_music_release_tracks` | Writes or dispatches |\n| `expand_catalog_members` | `expand_music_context_catalog` | Writes or dispatches |\n| `plan_catalog_members` | `plan_music_catalog_research` | Read-only hint |\n| `read_execution` | `read_music_context_execution` | Read-only hint |\n| `ingest_catalog` | `import_catalog_context` | Writes or dispatches |\n| `ingest_artist` | `import_artist_context` | Writes or dispatches |\n| `ingest_songwriter_name` | `import_songwriter_context` | Writes or dispatches |\n| `ingest_company_name` | `import_music_company_context` | Writes or dispatches |\n| `ingest_campaign_brief` | `import_music_campaign_brief` | Writes or dispatches |\n| `ingest_supporting_text` | `import_music_supporting_text` | Writes or dispatches |\n| `ingest_release` | `import_music_release_context` | Writes or dispatches |\n| `verify_release` | `verify_music_release` | Writes or dispatches |\n| `ingest` | `import_song_context` | Writes or dispatches |\n| `read` | `read_music_context` | Read-only hint |\n| `brief` | `compile_music_context_brief` | Read-only hint |\n\n### Standard-only evidence and catalog tools\n\nThese tools are available to standard MCP clients after the required database/API release. They are excluded from delegated OAuth connections pending organization-grant review.\n\n| REST action | Standard MCP tool | Classification |\n| --- | --- | --- |\n| `attach_evidence` | `attach_music_evidence` | Writes |\n| `read_evidence_attachment` | `read_music_evidence_attachment` | Read-only hint |\n| `list_evidence_attachments` | `list_music_evidence_attachments` | Read-only hint |\n| `save_catalog_case` | `save_catalog_case` | Writes |\n| `read_catalog_case` | `read_catalog_case` | Read-only hint |\n| `list_catalog_cases` | `list_catalog_cases` | Read-only hint |\n\n### Success responses and examples\n\nThe success model depends on the requested action. The table and `x-recoup-context-responses` connect each action to its HTTP status and complete named model; use that model rather than the union of all successful results. Request and response examples use synthetic authorized storage and mocked dispatch. A 202 receipt means queued, not completed. No example authorizes a provider call, collection, spending or new access.\n\nSaved request `input`/`output` JSON and historical execution-node/outcome metadata remain intentionally flexible. A saved request or execution record is not a guarantee of complete evidence, verified identity or rights. `read` may include metadata-only `material_evidence` on HTTP/standard MCP; delegated OAuth omits that receipt.\n\n| Action | HTTP status | Response model |\n| --- | --- | --- |\n| `attach_evidence` | 200 | `ContextEvidenceAttachmentReceipt` |\n| `read_evidence_attachment` | 200 | `ContextEvidenceAttachmentReceipt` |\n| `list_evidence_attachments` | 200 | `ContextEvidenceAttachmentPage` |\n| `list_release_cases` | 200 | `ContextReleaseCasesResponse` |\n| `read_release_case` | 200 | `ContextReleaseCaseResponse` |\n| `read_release_case_review` | 200 | `ContextReleaseCaseReviewResponse` |\n| `review_release_case` | 200 | `ContextReleaseCaseReviewResponse` |\n| `save_brief` | 200 | `ContextBriefSnapshotResponse` |\n| `read_brief` | 200 | `ContextBriefSnapshotResponse` |\n| `plan` | 200 | `ContextModulePlanResponse` |\n| `list_executions` | 200 | `ContextExecutionsResponse` |\n| `list_catalog_members` | 200 | `ContextCatalogMembersResponse` |\n| `list_release_tracks` | 200 | `ContextReleaseTracksResponse` |\n| `read_release_track_observations` | 200 | `ContextReleaseTrackObservationsResponse` |\n| `review_release_track_identities` | 200 | `ContextReleaseIdentityReviewResponse` |\n| `verify_release_tracks` | 202 | `ContextReleaseTrackVerificationResponse` |\n| `expand_catalog_members` | 200 | `ContextCatalogExpansionResponse` |\n| `plan_catalog_members` | 200 | `ContextCatalogPlanningResponse` |\n| `read_execution` | 200 | `ContextExecutionResponse` |\n| `ingest_catalog` | 200 | `ContextRequestResponse` |\n| `ingest_artist` | 200 | `ContextRequestResponse` |\n| `ingest_songwriter_name` | 200 | `ContextRequestResponse` |\n| `ingest_company_name` | 200 | `ContextRequestResponse` |\n| `ingest_campaign_brief` | 200 | `ContextRequestResponse` |\n| `ingest_supporting_text` | 200 | `ContextRequestResponse` |\n| `ingest_release` | 200 | `ContextRequestResponse` |\n| `verify_release` | 202 | `ContextReleaseVerificationResponse` |\n| `ingest` | 202 | `ContextRequestResponse` |\n| `read` | 200 | `ContextReadResponse` |\n| `brief` | 200 | `ContextBriefResponse` |\n| `save_catalog_case` | 200 | `ContextCatalogCaseResponse` |\n| `read_catalog_case` | 200 | `ContextCatalogCaseResponse` |\n| `list_catalog_cases` | 200 | `ContextCatalogCasesResponse` |\n\n### Catalog case continuation\n\n`save_catalog_case`, `read_catalog_case` and `list_catalog_cases` persist bounded catalog workflow artifacts as `customer_assertion` evidence. They are source contracts requiring the corresponding catalog-case database/API release; source tests and this reference do not prove deployment. No artist, ISRC, bank connection or ingestion request is required. Existing Context workspace authorization applies. These operations cannot register music, resolve a provider dispute, send correspondence or establish payment; `external_actions` is always `unsupported`.\n\nSave uses a UUID `case_id`, `expected_revision` (0 for a new case), `idempotency_key`, and a portable version-1 snapshot. Its workspace must be the authenticated owner, its case ID must match, and its revision must equal the expected revision. A saved receipt advances the revision. Snapshots contain scope and dictionaries of sources, assessments, findings, actions, attempts and outcomes; IDs must be unique, source references versioned, dependencies retained and acyclic. Each collection is limited to 1,000 records; the artifact is limited to 1 MiB. Arbitrary JSON extensions accept finite JSON with at most 100 nested levels. Unknown fields and local `history` are rejected, not dropped. Use record `data` for typed workpapers. Action payloads require nonempty provider/operation/account/party strings, nonempty subject identifiers, a nonempty scope object and explicit disclosure/cost arrays. Expired historical authorization assertions remain readable; caller-recorded authorization never grants provider authority.\n\nReplay an uncertain save with the same idempotency key, expected revision and unchanged snapshot. Re-read before editing a conflicting revision. Read supports an optional historical revision, and rechecks current access and retained Context source versions. Linked withdrawn sources and dependent records are withheld even in historical reads. A `partial` snapshot with `snapshot_usable_for_save: false` must be explicitly reassembled from permitted evidence before another save. A stale reference to an older source version requires a retained binding from this same case's earlier saved history; an imported stale record without that binding cannot be saved as though its provenance were known.\n\nList defaults to 50 cases and accepts a 1–100 limit. Pass `next_id` as `after_id` while `has_more` is true. Storage orders by creation time and ID descending; the UUID cursor is an opaque case reference, not a sortable boundary by itself. Responses use private/no-store caching. All three operations are standard MCP only and excluded from delegated OAuth. Prepared, submitted, provider-accepted, observed-correct and bank-received remain separate assertions that need their own actual evidence; artifact storage certifies none of them.", + "security": [ + { + "ApiKey": [] + }, + { + "BearerAuth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "save_catalog_case" + }, + "organization_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope." + }, + "case_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "expected_revision": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "idempotency_key": { + "type": "string", + "minLength": 1, + "maxLength": 128, + "pattern": "^[A-Za-z0-9._:-]+$" + }, + "snapshot": { + "type": "object", + "properties": { + "schema_version": { + "type": "number", + "const": 1 + }, + "case_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "workspace_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "revision": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "scope": { + "type": "string", + "maxLength": 32000 + }, + "sources": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "locator": { + "anyOf": [ + { + "type": "string", + "minLength": 1, + "maxLength": 32000 + }, + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + ] + }, + "status": { + "type": "string", + "enum": [ + "active", + "withdrawn" + ] + }, + "evidence_kind": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "context_source_version_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + } + }, + "required": [ + "id", + "version", + "sha256", + "locator", + "status" + ], + "additionalProperties": false + } + }, + "assessments": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stage": { + "type": "string", + "enum": [ + "audit", + "reconcile", + "register", + "resolve_claims", + "manage_delivery", + "review_deal", + "import", + "explain_contract", + "organize_publishing", + "estimate_value", + "check_credits", + "check_metadata" + ] + }, + "status": { + "type": "string", + "enum": [ + "prepared", + "in_progress", + "partial", + "complete", + "blocked" + ] + } + }, + "required": [ + "id", + "source_refs", + "rule_version", + "stage", + "status" + ], + "additionalProperties": false + } + }, + "findings": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stage": { + "type": "string", + "enum": [ + "audit", + "reconcile", + "register", + "resolve_claims", + "manage_delivery", + "review_deal", + "import", + "explain_contract", + "organize_publishing", + "estimate_value", + "check_credits", + "check_metadata" + ] + }, + "status": { + "type": "string", + "enum": [ + "open", + "accepted", + "resolved", + "not_applicable" + ] + }, + "cause_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "id", + "source_refs", + "rule_version", + "stage", + "status", + "cause_id" + ], + "additionalProperties": false + } + }, + "actions": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stage": { + "type": "string", + "enum": [ + "register", + "resolve_claims", + "manage_delivery" + ] + }, + "status": { + "type": "string", + "enum": [ + "prepared", + "authorized", + "withdrawn" + ] + }, + "payload": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "operation": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "account": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "party": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "subjects": { + "minItems": 1, + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "scope": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "disclosure": { + "maxItems": 1000, + "type": "array", + "items": {} + }, + "costs": { + "maxItems": 1000, + "type": "array", + "items": {} + } + }, + "required": [ + "provider", + "operation", + "account", + "party", + "subjects", + "scope", + "disclosure", + "costs" + ], + "additionalProperties": {} + }, + "authorization": { + "type": "object", + "properties": { + "reference": { + "type": "string", + "minLength": 1, + "maxLength": 32000 + }, + "payload_sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "valid_until": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "scope": {} + }, + "required": [ + "reference", + "payload_sha256", + "valid_until", + "scope" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "source_refs", + "rule_version", + "stage", + "status", + "payload" + ], + "additionalProperties": false + } + }, + "attempts": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "payload_sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "status": { + "type": "string", + "enum": [ + "user_reported_sent", + "observed_sent", + "unknown_outcome", + "acknowledged", + "rejected" + ] + }, + "provider_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "item_ids": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "receipt_locator": {}, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "payload_sha256", + "status" + ], + "additionalProperties": false + } + }, + "outcomes": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "dimension": { + "type": "string", + "const": "provider_decision" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "accepted", + "partially_accepted", + "rejected", + "superseded", + "rematched" + ] + }, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "dimension", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "dimension": { + "type": "string", + "const": "observed_record" + }, + "status": { + "type": "string", + "enum": [ + "unchecked", + "correct", + "partial", + "incorrect", + "stale" + ] + }, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "dimension", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "dimension": { + "type": "string", + "const": "financial_effect" + }, + "status": { + "type": "string", + "enum": [ + "unverified", + "adjustment_reported", + "remitted", + "bank_received", + "reversed" + ] + }, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "dimension", + "status" + ], + "additionalProperties": false + } + ] + } + } + }, + "required": [ + "schema_version", + "case_id", + "workspace_id", + "revision", + "scope", + "sources", + "assessments", + "findings", + "actions", + "attempts", + "outcomes" + ], + "additionalProperties": false + } + }, + "required": [ + "action", + "case_id", + "expected_revision", + "idempotency_key", + "snapshot" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "read_catalog_case" + }, + "organization_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope." + }, + "case_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "revision": { + "type": "integer", + "minimum": 1, + "maximum": 9007199254740991 + } + }, + "required": [ + "action", + "case_id" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "list_catalog_cases" + }, + "organization_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope." + }, + "after_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "limit": { + "default": 50, + "type": "integer", + "minimum": 1, + "maximum": 100 + } + }, + "required": [ + "action" + ], + "additionalProperties": false + }, { "type": "object", "properties": { @@ -5342,6 +7839,46 @@ "brief_id": "00000000-0000-4000-8000-000000000005", "organization_id": "00000000-0000-4000-8000-000000000002" } + }, + "contextActionSaveCatalogCase": { + "summary": "save_catalog_case (synthetic source contract)", + "value": { + "action": "save_catalog_case", + "case_id": "00000000-0000-4000-8000-000000000005", + "expected_revision": 0, + "idempotency_key": "catalog-case-example", + "snapshot": { + "schema_version": 1, + "case_id": "00000000-0000-4000-8000-000000000005", + "workspace_id": "00000000-0000-4000-8000-000000000002", + "revision": 0, + "scope": "One supplied composition; customer assertion", + "sources": {}, + "assessments": {}, + "findings": {}, + "actions": {}, + "attempts": {}, + "outcomes": {} + }, + "organization_id": "00000000-0000-4000-8000-000000000002" + } + }, + "contextActionReadCatalogCase": { + "summary": "read_catalog_case (synthetic source contract)", + "value": { + "action": "read_catalog_case", + "case_id": "00000000-0000-4000-8000-000000000005", + "revision": 1, + "organization_id": "00000000-0000-4000-8000-000000000002" + } + }, + "contextActionListCatalogCases": { + "summary": "list_catalog_cases (synthetic source contract)", + "value": { + "action": "list_catalog_cases", + "limit": 50, + "organization_id": "00000000-0000-4000-8000-000000000002" + } } } } @@ -5475,6 +8012,12 @@ }, { "$ref": "#/components/schemas/ContextBriefResponse" + }, + { + "$ref": "#/components/schemas/ContextCatalogCaseResponse" + }, + { + "$ref": "#/components/schemas/ContextCatalogCasesResponse" } ] }, @@ -6696,6 +9239,76 @@ "brief": null } } + }, + "contextActionSaveCatalogCase": { + "summary": "save_catalog_case assertion artifact; no external action", + "x-recoup-context-action": "save_catalog_case", + "value": { + "case_id": "00000000-0000-4000-8000-000000000005", + "revision": 1, + "state": "saved", + "evidence_kind": "customer_assertion", + "snapshot": { + "schema_version": 1, + "case_id": "00000000-0000-4000-8000-000000000005", + "workspace_id": "00000000-0000-4000-8000-000000000002", + "revision": 1, + "scope": "One supplied composition; customer assertion", + "sources": {}, + "assessments": {}, + "findings": {}, + "actions": {}, + "attempts": {}, + "outcomes": {} + }, + "withheld_record_ids": [], + "snapshot_usable_for_save": true, + "external_actions": "unsupported", + "created_at": "2026-10-21T00:00:00Z" + } + }, + "contextActionReadCatalogCase": { + "summary": "read_catalog_case assertion artifact; no external action", + "x-recoup-context-action": "read_catalog_case", + "value": { + "case_id": "00000000-0000-4000-8000-000000000005", + "revision": 1, + "state": "saved", + "evidence_kind": "customer_assertion", + "snapshot": { + "schema_version": 1, + "case_id": "00000000-0000-4000-8000-000000000005", + "workspace_id": "00000000-0000-4000-8000-000000000002", + "revision": 1, + "scope": "One supplied composition; customer assertion", + "sources": {}, + "assessments": {}, + "findings": {}, + "actions": {}, + "attempts": {}, + "outcomes": {} + }, + "withheld_record_ids": [], + "snapshot_usable_for_save": true, + "external_actions": "unsupported", + "created_at": "2026-10-21T00:00:00Z" + } + }, + "contextActionListCatalogCases": { + "summary": "list_catalog_cases assertion artifact; no external action", + "x-recoup-context-action": "list_catalog_cases", + "value": { + "cases": [ + { + "case_id": "00000000-0000-4000-8000-000000000005", + "revision": 1, + "created_at": "2026-10-21T00:00:00Z", + "updated_at": "2026-10-21T00:00:00Z" + } + ], + "has_more": false, + "next_id": null + } } } } @@ -6837,6 +9450,18 @@ "list_evidence_attachments": { "name": "list_music_evidence_attachments", "readOnly": true + }, + "save_catalog_case": { + "name": "save_catalog_case", + "readOnly": false + }, + "read_catalog_case": { + "name": "read_catalog_case", + "readOnly": true + }, + "list_catalog_cases": { + "name": "list_catalog_cases", + "readOnly": true } }, "x-recoup-context-responses": { @@ -7019,6 +9644,24 @@ "schema": { "$ref": "#/components/schemas/ContextBriefResponse" } + }, + "save_catalog_case": { + "status": 200, + "schema": { + "$ref": "#/components/schemas/ContextCatalogCaseResponse" + } + }, + "read_catalog_case": { + "status": 200, + "schema": { + "$ref": "#/components/schemas/ContextCatalogCaseResponse" + } + }, + "list_catalog_cases": { + "status": 200, + "schema": { + "$ref": "#/components/schemas/ContextCatalogCasesResponse" + } } } } diff --git a/llms-full.txt b/llms-full.txt index e9b872af..5c541534 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -735,6 +735,29 @@ blocked and has `collectionPermitted: false`. It does not fetch data, verify rig start collection or grant spending permission. The [Context reference](https://recoupable.dev/docs/api-reference/context/operate) lists all accepted compatibility values, required IDs, page cursors and the complete response. +## Continue a catalog case + +The source contract adds `save_catalog_case`, `read_catalog_case` and +`list_catalog_cases` to standard MCP; delegated OAuth excludes them. Discover the +tools in the connected host before using them. They also use the `context` tool +with the corresponding `action`. The catalog-case database and API release must +be deployed before this source contract is available. + +A case keeps versioned sources, assessments, findings, proposed actions, attempts +and outcomes for the authorized workspace. No artist or ingestion request is +required. The stored snapshot is `customer_assertion` evidence and always returns +`external_actions: unsupported`: saving a record does not submit a registration, +send a claim, confirm a provider decision or verify a bank receipt. + +For a new case, save with `expected_revision: 0` and `snapshot.revision: 0`. +For subsequent saves, use the current revision. Supply a unique idempotency key +for each new save. After an uncertain response, retry the unchanged payload with +the same key and expected revision. +Reads can withhold withdrawn evidence and its dependent records; explicitly +reassemble a partial snapshot before another save. The [Context reference](https://recoupable.dev/docs/api-reference/context/operate) +defines the complete bounded schema, historical-source rules, revision conflicts, +response fields and list pagination. + ## Release Packs When deployed and exposed by the current grant, the pack catalog includes @@ -20216,7 +20239,7 @@ This operation requires one of the security alternatives in the specification be "post": { "operationId": "contextOperation", "summary": "Ingest, read, or compile context briefs", - "description": "Save and reuse evidence in an authorized Recoup workspace. **Preview: this reference is verified against API source, not a completed hosted acceptance test.** Actions require the corresponding database and workflow release; verification actions also require their feature to be enabled. Do not infer provider readiness, complete coverage, or a successful workflow from an accepted request schema.\n\n### Create context\n\n`ingest` creates or reuses a Spotify-track request and dispatches its durable workflow (202). The parser recognizes YouTube URLs, but ingestion still rejects them in this pilot. `ingest_release` stores a Spotify album locator; it does not automatically verify the release. `ingest_catalog` and `ingest_artist` refer to accessible Recoup records. `ingest_songwriter_name`, `ingest_company_name`, `ingest_campaign_brief`, and `ingest_supporting_text` store submitted context (200). Names and customer text are not verified identities or facts. Reuse an idempotency key only for the same intended input.\n\n### Read, plan and inspect\n\n`read` reads one request. For saved supporting text, HTTP and standard MCP also return a metadata-only `material_evidence` receipt identifying the current document, result and exact retained source version. It returns no submitted text, source location or signed access. `draft_origin` remains `not_recorded`: a retained customer assertion is not proof of its file origin or reviewed business facts. Unavailable material withholds those references. Delegated OAuth keeps its request-only response. `plan` plans modules from stored context; a plan is not authorization to collect data. `list_executions` and `read_execution` expose execution records. `list_catalog_members` pages saved members; `expand_catalog_members` materializes a bounded member page. These operations return 200. Request IDs, subject IDs and execution IDs refer to different records; use the IDs returned by the corresponding read rather than substituting an account ID. Catalog membership does not establish rights ownership. Use `plan_catalog_members` to plan a lookup for a page of current expanded catalog recordings, as described below.\n\n### Plan a catalog lookup\n\nA catalog manager can inspect which lookup would be proposed for recordings already expanded from an accessible catalog. This action reads the saved targets and returns a plan; it does not fetch recording matches, linked works or platform information.\n\nSupply the existing catalog Context `request_id` and its catalog `subject_id`, one `module`, and optionally `organization_id`, `after_isrc` and `limit` (1–100, default 100). These IDs refer to different records: do not substitute the catalog ID, account ID or a member recording subject for the catalog Context subject.\n\n| Preferred input | Lookup being planned | Legacy accepted input and returned module |\n| --- | --- | --- |\n| `recording_candidates` | Unconfirmed recording candidates from an ISRC; a candidate is not an approved recording identity | `musicbrainz` |\n| `recording_work_candidates` | Candidate works linked to a recording; no ownership or royalty-share verification | `mlc_recording` |\n| `platform_metadata` | Available platform track information; no growth-metric or complete-coverage promise | `songstats` |\n\nAll six input values remain accepted. The three values in the last column are compatibility identifiers, not a promise that data sources are interchangeable. Each preferred/legacy pair returns the same page, raw module, executor, node key, state and reasons. Source and saved-plan provenance remain unchanged.\n\nThe 200 result is `ContextCatalogPlanningResponse`: `page`, `plan` and `collectionPermitted: false`. `page` includes `catalogId`, `catalogSubjectId`, `members`, `nextCursor` and `hasMore`. Each member retains `subjectId`, `kind`, `identityConfirmed`, `availableFields`, `reusableModules` and `isrc`. The saved ISRC-backed target flag does not verify an external recording match, rights or ownership. Only expanded recordings still present in the selected workspace's accessible catalog are returned; removed and not-yet-expanded members are excluded. Pass `page.nextCursor` as `after_isrc` when `page.hasMore` is true.\n\n`plan` has one node per returned member, including `key`, `entry`, `subjectId`, `targetKind`, `module`, `executor`, `state`, `reasons`, `dependsOn`, `scope` and `executionStarted`. Node keys retain `{subjectId}:{legacy_module}`. This action supplies no permitted modules and does not reuse collection permission: every returned node is `blocked`, has `executionStarted: false`, an empty `dependsOn` and the reason `Server collection policy has not permitted this module`. An empty member page returns `plan: []` and still has `collectionPermitted: false`.\n\nAn executor name describes a planned implementation; it does not make that collector runnable. In particular, the platform-metadata collector is not connected to the trusted planned dispatcher. No provider/model call, execution claim, credit charge, new access grant or automatic catalog expansion is triggered. An accepted request or local fixture is not hosted customer-workflow acceptance.\n\n### Release verification and review\n\n`verify_release` and `verify_release_tracks` enqueue enabled verification workflows (202); disabled features or unmet readiness conditions return 409. `list_release_tracks`, `read_release_track_observations`, and `review_release_track_identities` inspect saved slots and identity evidence (200). Inspect the returned readiness, coverage and unresolved identity state before using a recording match. `list_release_cases`, `read_release_case`, `read_release_case_review`, and `review_release_case` read or record release-case review. A review requires the current fingerprint, a decision, and an idempotency key; it does not silently rewrite source evidence.\n\n### Compile and save briefs\n\n`brief` compiles evidence from up to ten completed or partial requests in one workspace without provider or model calls. Purposes are `creative_direction`, `playlist_pitch`, and `company_onboarding`. Creative direction prioritizes lyrics and artwork; playlist pitching prioritizes catalog/audio metadata. Inspect readiness, request_coverage, selected input versions and gaps. Briefs are evidence packets, not finished creative concepts or outreach. Compiled documents have accepted status and full or partial coverage; creative proposals and other document states are excluded by the current selector. Accepted is a saved-evidence status, not verification of identity or rights. `save_brief` freezes the server-compiled output, and `read_brief` retrieves that snapshot without recompilation. Newer evidence can supersede a snapshot without rewriting it; withdrawn evidence or removed scope can withhold its payload. All three actions return 200.\n\n### Link retained evidence\n\n`attach_evidence` links one exact retained `source_version_id` to 1–100 distinct existing targets: an artist, a professional, or a Context request/subject pair. Supply a stable `idempotency_key`; retry only the same version and targets with that key. Authentication supplies the actor. The receipt records relevance only; it does not confirm identity, rights or a business mandate. It creates no roster entry and makes no provider/model call or charge.\n\n`read_evidence_attachment` reads one receipt by `attachment_id`. `list_evidence_attachments` reads a page for an exact source version. Pass `next_id` as `after_id` while `has_more` is true, including an empty page where protected receipts were withheld. Reads check current workspace access, source retention and independent target access. Evidence responses and domain errors are private and must not be cached. A later source version needs a separate association; these actions do not rewrite historical receipts. They require the matching evidence-association database and API release; accepted request syntax is not hosted availability.\n\n### Scope and failures\n\nAuthentication determines the account. Optional organization_id selects an authorized organization workspace; request and subject ownership are checked again by the operation. Invalid request syntax returns 400, missing authentication 401, rejected organization access 403, and operation conflicts, unavailable evidence or disabled verification 409. No action accepts a caller-supplied account identity. Local schema tests do not establish hosted availability.\n\n### MCP mapping\n\nStandard MCP uses the `context` tool with the same action and fields as this REST request. The three evidence actions also have individually discoverable object-schema tools listed separately below; they are excluded from delegated OAuth connections. Delegated OAuth exposes the named tools below and supplies the action server-side; omit action from the named tool input. These registrations require the full `mcp:tools` grant, current ownership and fresh credential verification. Read-only is a tool annotation, not a guarantee of hosted readiness. Discover the actual tools in the connected client before use; this is a static source mapping, not a verified client catalog.\n\n| REST action | Delegated OAuth tool | Classification |\n| --- | --- | --- |\n| `list_release_cases` | `list_music_release_cases` | Read-only hint |\n| `read_release_case` | `read_music_release_case` | Read-only hint |\n| `read_release_case_review` | `read_music_release_case_review` | Read-only hint |\n| `review_release_case` | `record_music_release_case_review` | Writes or dispatches |\n| `save_brief` | `save_music_context_brief` | Writes or dispatches |\n| `read_brief` | `read_music_context_brief` | Read-only hint |\n| `plan` | `plan_music_context_research` | Read-only hint |\n| `list_executions` | `list_music_context_executions` | Read-only hint |\n| `list_catalog_members` | `list_music_context_catalog_members` | Read-only hint |\n| `list_release_tracks` | `list_music_context_release_tracks` | Read-only hint |\n| `read_release_track_observations` | `read_music_release_track_observations` | Read-only hint |\n| `review_release_track_identities` | `review_music_release_track_identities` | Read-only hint |\n| `verify_release_tracks` | `verify_music_release_tracks` | Writes or dispatches |\n| `expand_catalog_members` | `expand_music_context_catalog` | Writes or dispatches |\n| `plan_catalog_members` | `plan_music_catalog_research` | Read-only hint |\n| `read_execution` | `read_music_context_execution` | Read-only hint |\n| `ingest_catalog` | `import_catalog_context` | Writes or dispatches |\n| `ingest_artist` | `import_artist_context` | Writes or dispatches |\n| `ingest_songwriter_name` | `import_songwriter_context` | Writes or dispatches |\n| `ingest_company_name` | `import_music_company_context` | Writes or dispatches |\n| `ingest_campaign_brief` | `import_music_campaign_brief` | Writes or dispatches |\n| `ingest_supporting_text` | `import_music_supporting_text` | Writes or dispatches |\n| `ingest_release` | `import_music_release_context` | Writes or dispatches |\n| `verify_release` | `verify_music_release` | Writes or dispatches |\n| `ingest` | `import_song_context` | Writes or dispatches |\n| `read` | `read_music_context` | Read-only hint |\n| `brief` | `compile_music_context_brief` | Read-only hint |\n\n### Standard-only evidence tools\n\nThese tools are available to standard MCP clients after the required database/API release. They are excluded from delegated OAuth connections pending organization-grant review.\n\n| REST action | Standard MCP tool | Classification |\n| --- | --- | --- |\n| `attach_evidence` | `attach_music_evidence` | Writes |\n| `read_evidence_attachment` | `read_music_evidence_attachment` | Read-only hint |\n| `list_evidence_attachments` | `list_music_evidence_attachments` | Read-only hint |\n\n### Success responses and examples\n\nThe success model depends on the requested action. The table and `x-recoup-context-responses` connect each action to its HTTP status and complete named model; use that model rather than the union of all successful results. Request and response examples use synthetic authorized storage and mocked dispatch. A 202 receipt means queued, not completed. No example authorizes a provider call, collection, spending or new access.\n\nSaved request `input`/`output` JSON and historical execution-node/outcome metadata remain intentionally flexible. A saved request or execution record is not a guarantee of complete evidence, verified identity or rights. `read` may include metadata-only `material_evidence` on HTTP/standard MCP; delegated OAuth omits that receipt.\n\n| Action | HTTP status | Response model |\n| --- | --- | --- |\n| `attach_evidence` | 200 | `ContextEvidenceAttachmentReceipt` |\n| `read_evidence_attachment` | 200 | `ContextEvidenceAttachmentReceipt` |\n| `list_evidence_attachments` | 200 | `ContextEvidenceAttachmentPage` |\n| `list_release_cases` | 200 | `ContextReleaseCasesResponse` |\n| `read_release_case` | 200 | `ContextReleaseCaseResponse` |\n| `read_release_case_review` | 200 | `ContextReleaseCaseReviewResponse` |\n| `review_release_case` | 200 | `ContextReleaseCaseReviewResponse` |\n| `save_brief` | 200 | `ContextBriefSnapshotResponse` |\n| `read_brief` | 200 | `ContextBriefSnapshotResponse` |\n| `plan` | 200 | `ContextModulePlanResponse` |\n| `list_executions` | 200 | `ContextExecutionsResponse` |\n| `list_catalog_members` | 200 | `ContextCatalogMembersResponse` |\n| `list_release_tracks` | 200 | `ContextReleaseTracksResponse` |\n| `read_release_track_observations` | 200 | `ContextReleaseTrackObservationsResponse` |\n| `review_release_track_identities` | 200 | `ContextReleaseIdentityReviewResponse` |\n| `verify_release_tracks` | 202 | `ContextReleaseTrackVerificationResponse` |\n| `expand_catalog_members` | 200 | `ContextCatalogExpansionResponse` |\n| `plan_catalog_members` | 200 | `ContextCatalogPlanningResponse` |\n| `read_execution` | 200 | `ContextExecutionResponse` |\n| `ingest_catalog` | 200 | `ContextRequestResponse` |\n| `ingest_artist` | 200 | `ContextRequestResponse` |\n| `ingest_songwriter_name` | 200 | `ContextRequestResponse` |\n| `ingest_company_name` | 200 | `ContextRequestResponse` |\n| `ingest_campaign_brief` | 200 | `ContextRequestResponse` |\n| `ingest_supporting_text` | 200 | `ContextRequestResponse` |\n| `ingest_release` | 200 | `ContextRequestResponse` |\n| `verify_release` | 202 | `ContextReleaseVerificationResponse` |\n| `ingest` | 202 | `ContextRequestResponse` |\n| `read` | 200 | `ContextReadResponse` |\n| `brief` | 200 | `ContextBriefResponse` |", + "description": "Save and reuse evidence in an authorized Recoup workspace. **Preview: this reference is verified against API source, not a completed hosted acceptance test.** Actions require the corresponding database and workflow release; verification actions also require their feature to be enabled. Do not infer provider readiness, complete coverage, or a successful workflow from an accepted request schema.\n\n### Create context\n\n`ingest` creates or reuses a Spotify-track request and dispatches its durable workflow (202). The parser recognizes YouTube URLs, but ingestion still rejects them in this pilot. `ingest_release` stores a Spotify album locator; it does not automatically verify the release. `ingest_catalog` and `ingest_artist` refer to accessible Recoup records. `ingest_songwriter_name`, `ingest_company_name`, `ingest_campaign_brief`, and `ingest_supporting_text` store submitted context (200). Names and customer text are not verified identities or facts. Reuse an idempotency key only for the same intended input.\n\n### Read, plan and inspect\n\n`read` reads one request. For saved supporting text, HTTP and standard MCP also return a metadata-only `material_evidence` receipt identifying the current document, result and exact retained source version. It returns no submitted text, source location or signed access. `draft_origin` remains `not_recorded`: a retained customer assertion is not proof of its file origin or reviewed business facts. Unavailable material withholds those references. Delegated OAuth keeps its request-only response. `plan` plans modules from stored context; a plan is not authorization to collect data. `list_executions` and `read_execution` expose execution records. `list_catalog_members` pages saved members; `expand_catalog_members` materializes a bounded member page. These operations return 200. Request IDs, subject IDs and execution IDs refer to different records; use the IDs returned by the corresponding read rather than substituting an account ID. Catalog membership does not establish rights ownership. Use `plan_catalog_members` to plan a lookup for a page of current expanded catalog recordings, as described below.\n\n### Plan a catalog lookup\n\nA catalog manager can inspect which lookup would be proposed for recordings already expanded from an accessible catalog. This action reads the saved targets and returns a plan; it does not fetch recording matches, linked works or platform information.\n\nSupply the existing catalog Context `request_id` and its catalog `subject_id`, one `module`, and optionally `organization_id`, `after_isrc` and `limit` (1–100, default 100). These IDs refer to different records: do not substitute the catalog ID, account ID or a member recording subject for the catalog Context subject.\n\n| Preferred input | Lookup being planned | Legacy accepted input and returned module |\n| --- | --- | --- |\n| `recording_candidates` | Unconfirmed recording candidates from an ISRC; a candidate is not an approved recording identity | `musicbrainz` |\n| `recording_work_candidates` | Candidate works linked to a recording; no ownership or royalty-share verification | `mlc_recording` |\n| `platform_metadata` | Available platform track information; no growth-metric or complete-coverage promise | `songstats` |\n\nAll six input values remain accepted. The three values in the last column are compatibility identifiers, not a promise that data sources are interchangeable. Each preferred/legacy pair returns the same page, raw module, executor, node key, state and reasons. Source and saved-plan provenance remain unchanged.\n\nThe 200 result is `ContextCatalogPlanningResponse`: `page`, `plan` and `collectionPermitted: false`. `page` includes `catalogId`, `catalogSubjectId`, `members`, `nextCursor` and `hasMore`. Each member retains `subjectId`, `kind`, `identityConfirmed`, `availableFields`, `reusableModules` and `isrc`. The saved ISRC-backed target flag does not verify an external recording match, rights or ownership. Only expanded recordings still present in the selected workspace's accessible catalog are returned; removed and not-yet-expanded members are excluded. Pass `page.nextCursor` as `after_isrc` when `page.hasMore` is true.\n\n`plan` has one node per returned member, including `key`, `entry`, `subjectId`, `targetKind`, `module`, `executor`, `state`, `reasons`, `dependsOn`, `scope` and `executionStarted`. Node keys retain `{subjectId}:{legacy_module}`. This action supplies no permitted modules and does not reuse collection permission: every returned node is `blocked`, has `executionStarted: false`, an empty `dependsOn` and the reason `Server collection policy has not permitted this module`. An empty member page returns `plan: []` and still has `collectionPermitted: false`.\n\nAn executor name describes a planned implementation; it does not make that collector runnable. In particular, the platform-metadata collector is not connected to the trusted planned dispatcher. No provider/model call, execution claim, credit charge, new access grant or automatic catalog expansion is triggered. An accepted request or local fixture is not hosted customer-workflow acceptance.\n\n### Release verification and review\n\n`verify_release` and `verify_release_tracks` enqueue enabled verification workflows (202); disabled features or unmet readiness conditions return 409. `list_release_tracks`, `read_release_track_observations`, and `review_release_track_identities` inspect saved slots and identity evidence (200). Inspect the returned readiness, coverage and unresolved identity state before using a recording match. `list_release_cases`, `read_release_case`, `read_release_case_review`, and `review_release_case` read or record release-case review. A review requires the current fingerprint, a decision, and an idempotency key; it does not silently rewrite source evidence.\n\n### Compile and save briefs\n\n`brief` compiles evidence from up to ten completed or partial requests in one workspace without provider or model calls. Purposes are `creative_direction`, `playlist_pitch`, and `company_onboarding`. Creative direction prioritizes lyrics and artwork; playlist pitching prioritizes catalog/audio metadata. Inspect readiness, request_coverage, selected input versions and gaps. Briefs are evidence packets, not finished creative concepts or outreach. Compiled documents have accepted status and full or partial coverage; creative proposals and other document states are excluded by the current selector. Accepted is a saved-evidence status, not verification of identity or rights. `save_brief` freezes the server-compiled output, and `read_brief` retrieves that snapshot without recompilation. Newer evidence can supersede a snapshot without rewriting it; withdrawn evidence or removed scope can withhold its payload. All three actions return 200.\n\n### Link retained evidence\n\n`attach_evidence` links one exact retained `source_version_id` to 1–100 distinct existing targets: an artist, a professional, or a Context request/subject pair. Supply a stable `idempotency_key`; retry only the same version and targets with that key. Authentication supplies the actor. The receipt records relevance only; it does not confirm identity, rights or a business mandate. It creates no roster entry and makes no provider/model call or charge.\n\n`read_evidence_attachment` reads one receipt by `attachment_id`. `list_evidence_attachments` reads a page for an exact source version. Pass `next_id` as `after_id` while `has_more` is true, including an empty page where protected receipts were withheld. Reads check current workspace access, source retention and independent target access. Evidence responses and domain errors are private and must not be cached. A later source version needs a separate association; these actions do not rewrite historical receipts. They require the matching evidence-association database and API release; accepted request syntax is not hosted availability.\n\n### Scope and failures\n\nAuthentication determines the account. Optional organization_id selects an authorized organization workspace; request and subject ownership are checked again by the operation. Invalid request syntax returns 400, missing authentication 401, rejected organization access 403, and operation conflicts, unavailable evidence or disabled verification 409. No action accepts a caller-supplied account identity. Local schema tests do not establish hosted availability.\n\n### MCP mapping\n\nStandard MCP uses the `context` tool with the same action and fields as this REST request. The three evidence actions also have individually discoverable object-schema tools listed separately below; they are excluded from delegated OAuth connections. Delegated OAuth exposes the named tools below and supplies the action server-side; omit action from the named tool input. These registrations require the full `mcp:tools` grant, current ownership and fresh credential verification. Read-only is a tool annotation, not a guarantee of hosted readiness. Discover the actual tools in the connected client before use; this is a static source mapping, not a verified client catalog.\n\n| REST action | Delegated OAuth tool | Classification |\n| --- | --- | --- |\n| `list_release_cases` | `list_music_release_cases` | Read-only hint |\n| `read_release_case` | `read_music_release_case` | Read-only hint |\n| `read_release_case_review` | `read_music_release_case_review` | Read-only hint |\n| `review_release_case` | `record_music_release_case_review` | Writes or dispatches |\n| `save_brief` | `save_music_context_brief` | Writes or dispatches |\n| `read_brief` | `read_music_context_brief` | Read-only hint |\n| `plan` | `plan_music_context_research` | Read-only hint |\n| `list_executions` | `list_music_context_executions` | Read-only hint |\n| `list_catalog_members` | `list_music_context_catalog_members` | Read-only hint |\n| `list_release_tracks` | `list_music_context_release_tracks` | Read-only hint |\n| `read_release_track_observations` | `read_music_release_track_observations` | Read-only hint |\n| `review_release_track_identities` | `review_music_release_track_identities` | Read-only hint |\n| `verify_release_tracks` | `verify_music_release_tracks` | Writes or dispatches |\n| `expand_catalog_members` | `expand_music_context_catalog` | Writes or dispatches |\n| `plan_catalog_members` | `plan_music_catalog_research` | Read-only hint |\n| `read_execution` | `read_music_context_execution` | Read-only hint |\n| `ingest_catalog` | `import_catalog_context` | Writes or dispatches |\n| `ingest_artist` | `import_artist_context` | Writes or dispatches |\n| `ingest_songwriter_name` | `import_songwriter_context` | Writes or dispatches |\n| `ingest_company_name` | `import_music_company_context` | Writes or dispatches |\n| `ingest_campaign_brief` | `import_music_campaign_brief` | Writes or dispatches |\n| `ingest_supporting_text` | `import_music_supporting_text` | Writes or dispatches |\n| `ingest_release` | `import_music_release_context` | Writes or dispatches |\n| `verify_release` | `verify_music_release` | Writes or dispatches |\n| `ingest` | `import_song_context` | Writes or dispatches |\n| `read` | `read_music_context` | Read-only hint |\n| `brief` | `compile_music_context_brief` | Read-only hint |\n\n### Standard-only evidence and catalog tools\n\nThese tools are available to standard MCP clients after the required database/API release. They are excluded from delegated OAuth connections pending organization-grant review.\n\n| REST action | Standard MCP tool | Classification |\n| --- | --- | --- |\n| `attach_evidence` | `attach_music_evidence` | Writes |\n| `read_evidence_attachment` | `read_music_evidence_attachment` | Read-only hint |\n| `list_evidence_attachments` | `list_music_evidence_attachments` | Read-only hint |\n| `save_catalog_case` | `save_catalog_case` | Writes |\n| `read_catalog_case` | `read_catalog_case` | Read-only hint |\n| `list_catalog_cases` | `list_catalog_cases` | Read-only hint |\n\n### Success responses and examples\n\nThe success model depends on the requested action. The table and `x-recoup-context-responses` connect each action to its HTTP status and complete named model; use that model rather than the union of all successful results. Request and response examples use synthetic authorized storage and mocked dispatch. A 202 receipt means queued, not completed. No example authorizes a provider call, collection, spending or new access.\n\nSaved request `input`/`output` JSON and historical execution-node/outcome metadata remain intentionally flexible. A saved request or execution record is not a guarantee of complete evidence, verified identity or rights. `read` may include metadata-only `material_evidence` on HTTP/standard MCP; delegated OAuth omits that receipt.\n\n| Action | HTTP status | Response model |\n| --- | --- | --- |\n| `attach_evidence` | 200 | `ContextEvidenceAttachmentReceipt` |\n| `read_evidence_attachment` | 200 | `ContextEvidenceAttachmentReceipt` |\n| `list_evidence_attachments` | 200 | `ContextEvidenceAttachmentPage` |\n| `list_release_cases` | 200 | `ContextReleaseCasesResponse` |\n| `read_release_case` | 200 | `ContextReleaseCaseResponse` |\n| `read_release_case_review` | 200 | `ContextReleaseCaseReviewResponse` |\n| `review_release_case` | 200 | `ContextReleaseCaseReviewResponse` |\n| `save_brief` | 200 | `ContextBriefSnapshotResponse` |\n| `read_brief` | 200 | `ContextBriefSnapshotResponse` |\n| `plan` | 200 | `ContextModulePlanResponse` |\n| `list_executions` | 200 | `ContextExecutionsResponse` |\n| `list_catalog_members` | 200 | `ContextCatalogMembersResponse` |\n| `list_release_tracks` | 200 | `ContextReleaseTracksResponse` |\n| `read_release_track_observations` | 200 | `ContextReleaseTrackObservationsResponse` |\n| `review_release_track_identities` | 200 | `ContextReleaseIdentityReviewResponse` |\n| `verify_release_tracks` | 202 | `ContextReleaseTrackVerificationResponse` |\n| `expand_catalog_members` | 200 | `ContextCatalogExpansionResponse` |\n| `plan_catalog_members` | 200 | `ContextCatalogPlanningResponse` |\n| `read_execution` | 200 | `ContextExecutionResponse` |\n| `ingest_catalog` | 200 | `ContextRequestResponse` |\n| `ingest_artist` | 200 | `ContextRequestResponse` |\n| `ingest_songwriter_name` | 200 | `ContextRequestResponse` |\n| `ingest_company_name` | 200 | `ContextRequestResponse` |\n| `ingest_campaign_brief` | 200 | `ContextRequestResponse` |\n| `ingest_supporting_text` | 200 | `ContextRequestResponse` |\n| `ingest_release` | 200 | `ContextRequestResponse` |\n| `verify_release` | 202 | `ContextReleaseVerificationResponse` |\n| `ingest` | 202 | `ContextRequestResponse` |\n| `read` | 200 | `ContextReadResponse` |\n| `brief` | 200 | `ContextBriefResponse` |\n| `save_catalog_case` | 200 | `ContextCatalogCaseResponse` |\n| `read_catalog_case` | 200 | `ContextCatalogCaseResponse` |\n| `list_catalog_cases` | 200 | `ContextCatalogCasesResponse` |\n\n### Catalog case continuation\n\n`save_catalog_case`, `read_catalog_case` and `list_catalog_cases` persist bounded catalog workflow artifacts as `customer_assertion` evidence. They are source contracts requiring the corresponding catalog-case database/API release; source tests and this reference do not prove deployment. No artist, ISRC, bank connection or ingestion request is required. Existing Context workspace authorization applies. These operations cannot register music, resolve a provider dispute, send correspondence or establish payment; `external_actions` is always `unsupported`.\n\nSave uses a UUID `case_id`, `expected_revision` (0 for a new case), `idempotency_key`, and a portable version-1 snapshot. Its workspace must be the authenticated owner, its case ID must match, and its revision must equal the expected revision. A saved receipt advances the revision. Snapshots contain scope and dictionaries of sources, assessments, findings, actions, attempts and outcomes; IDs must be unique, source references versioned, dependencies retained and acyclic. Each collection is limited to 1,000 records; the artifact is limited to 1 MiB. Arbitrary JSON extensions accept finite JSON with at most 100 nested levels. Unknown fields and local `history` are rejected, not dropped. Use record `data` for typed workpapers. Action payloads require nonempty provider/operation/account/party strings, nonempty subject identifiers, a nonempty scope object and explicit disclosure/cost arrays. Expired historical authorization assertions remain readable; caller-recorded authorization never grants provider authority.\n\nReplay an uncertain save with the same idempotency key, expected revision and unchanged snapshot. Re-read before editing a conflicting revision. Read supports an optional historical revision, and rechecks current access and retained Context source versions. Linked withdrawn sources and dependent records are withheld even in historical reads. A `partial` snapshot with `snapshot_usable_for_save: false` must be explicitly reassembled from permitted evidence before another save. A stale reference to an older source version requires a retained binding from this same case's earlier saved history; an imported stale record without that binding cannot be saved as though its provenance were known.\n\nList defaults to 50 cases and accepts a 1–100 limit. Pass `next_id` as `after_id` while `has_more` is true. Storage orders by creation time and ID descending; the UUID cursor is an opaque case reference, not a sortable boundary by itself. Responses use private/no-store caching. All three operations are standard MCP only and excluded from delegated OAuth. Prepared, submitted, provider-accepted, observed-correct and bank-received remain separate assertions that need their own actual evidence; artifact storage certifies none of them.", "security": [ { "ApiKey": [] @@ -20236,116 +20259,1074 @@ This operation requires one of the security alternatives in the specification be "properties": { "action": { "type": "string", - "const": "attach_evidence" + "const": "save_catalog_case" }, "organization_id": { - "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope.", "type": "string", "format": "uuid", - "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope." }, - "source_version_id": { - "description": "Exact retained source-version ID; use a new association for a later version.", + "case_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, - "targets": { - "uniqueItems": true, - "description": "Distinct typed targets. The server also rejects UUID duplicates that differ only in case.", - "minItems": 1, - "maxItems": 100, - "type": "array", - "items": { - "anyOf": [ - { + "expected_revision": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "idempotency_key": { + "type": "string", + "minLength": 1, + "maxLength": 128, + "pattern": "^[A-Za-z0-9._:-]+$" + }, + "snapshot": { + "type": "object", + "properties": { + "schema_version": { + "type": "number", + "const": 1 + }, + "case_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "workspace_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "revision": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "scope": { + "type": "string", + "maxLength": 32000 + }, + "sources": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { "type": "object", "properties": { - "artist_id": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "locator": { + "anyOf": [ + { + "type": "string", + "minLength": 1, + "maxLength": 32000 + }, + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + ] + }, + "status": { + "type": "string", + "enum": [ + "active", + "withdrawn" + ] + }, + "evidence_kind": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "context_source_version_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": [ - "artist_id" + "id", + "version", + "sha256", + "locator", + "status" ], "additionalProperties": false + } + }, + "assessments": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 }, - { + "additionalProperties": { "type": "object", "properties": { - "professional_id": { + "id": { "type": "string", - "format": "uuid", - "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stage": { + "type": "string", + "enum": [ + "audit", + "reconcile", + "register", + "resolve_claims", + "manage_delivery", + "review_deal", + "import", + "explain_contract", + "organize_publishing", + "estimate_value", + "check_credits", + "check_metadata" + ] + }, + "status": { + "type": "string", + "enum": [ + "prepared", + "in_progress", + "partial", + "complete", + "blocked" + ] } }, "required": [ - "professional_id" + "id", + "source_refs", + "rule_version", + "stage", + "status" ], "additionalProperties": false + } + }, + "findings": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 }, - { + "additionalProperties": { "type": "object", "properties": { - "request_id": { + "id": { "type": "string", - "format": "uuid", - "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + "minLength": 1, + "maxLength": 256 }, - "subject_id": { + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { "type": "string", - "format": "uuid", - "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stage": { + "type": "string", + "enum": [ + "audit", + "reconcile", + "register", + "resolve_claims", + "manage_delivery", + "review_deal", + "import", + "explain_contract", + "organize_publishing", + "estimate_value", + "check_credits", + "check_metadata" + ] + }, + "status": { + "type": "string", + "enum": [ + "open", + "accepted", + "resolved", + "not_applicable" + ] + }, + "cause_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 } }, "required": [ - "request_id", - "subject_id" + "id", + "source_refs", + "rule_version", + "stage", + "status", + "cause_id" ], "additionalProperties": false } - ] - } - }, - "idempotency_key": { - "type": "string", - "minLength": 1, - "maxLength": 128, - "pattern": "^[A-Za-z0-9._:-]+$" - } - }, - "required": [ - "action", - "source_version_id", - "targets", - "idempotency_key" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "action": { - "type": "string", - "const": "read_evidence_attachment" - }, - "organization_id": { - "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope.", - "type": "string", - "format": "uuid", - "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" - }, - "attachment_id": { - "type": "string", - "format": "uuid", - "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "actions": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stage": { + "type": "string", + "enum": [ + "register", + "resolve_claims", + "manage_delivery" + ] + }, + "status": { + "type": "string", + "enum": [ + "prepared", + "authorized", + "withdrawn" + ] + }, + "payload": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "operation": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "account": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "party": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "subjects": { + "minItems": 1, + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "scope": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "disclosure": { + "maxItems": 1000, + "type": "array", + "items": {} + }, + "costs": { + "maxItems": 1000, + "type": "array", + "items": {} + } + }, + "required": [ + "provider", + "operation", + "account", + "party", + "subjects", + "scope", + "disclosure", + "costs" + ], + "additionalProperties": {} + }, + "authorization": { + "type": "object", + "properties": { + "reference": { + "type": "string", + "minLength": 1, + "maxLength": 32000 + }, + "payload_sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "valid_until": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "scope": {} + }, + "required": [ + "reference", + "payload_sha256", + "valid_until", + "scope" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "source_refs", + "rule_version", + "stage", + "status", + "payload" + ], + "additionalProperties": false + } + }, + "attempts": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "payload_sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "status": { + "type": "string", + "enum": [ + "user_reported_sent", + "observed_sent", + "unknown_outcome", + "acknowledged", + "rejected" + ] + }, + "provider_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "item_ids": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "receipt_locator": {}, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "payload_sha256", + "status" + ], + "additionalProperties": false + } + }, + "outcomes": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "dimension": { + "type": "string", + "const": "provider_decision" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "accepted", + "partially_accepted", + "rejected", + "superseded", + "rematched" + ] + }, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "dimension", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "dimension": { + "type": "string", + "const": "observed_record" + }, + "status": { + "type": "string", + "enum": [ + "unchecked", + "correct", + "partial", + "incorrect", + "stale" + ] + }, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "dimension", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "dimension": { + "type": "string", + "const": "financial_effect" + }, + "status": { + "type": "string", + "enum": [ + "unverified", + "adjustment_reported", + "remitted", + "bank_received", + "reversed" + ] + }, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "dimension", + "status" + ], + "additionalProperties": false + } + ] + } + } + }, + "required": [ + "schema_version", + "case_id", + "workspace_id", + "revision", + "scope", + "sources", + "assessments", + "findings", + "actions", + "attempts", + "outcomes" + ], + "additionalProperties": false } }, "required": [ "action", - "attachment_id" + "case_id", + "expected_revision", + "idempotency_key", + "snapshot" ], "additionalProperties": false }, @@ -20354,37 +21335,28 @@ This operation requires one of the security alternatives in the specification be "properties": { "action": { "type": "string", - "const": "list_evidence_attachments" + "const": "read_catalog_case" }, "organization_id": { - "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope.", "type": "string", "format": "uuid", - "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope." }, - "source_version_id": { - "description": "Exact retained source-version ID; use a new association for a later version.", + "case_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, - "after_id": { - "description": "Pass the returned next_id as after_id while has_more is true, including empty pages with withheld receipts.", - "anyOf": [ - { - "type": "string", - "format": "uuid", - "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" - }, - { - "type": "null" - } - ] + "revision": { + "type": "integer", + "minimum": 1, + "maximum": 9007199254740991 } }, "required": [ "action", - "source_version_id" + "case_id" ], "additionalProperties": false }, @@ -20393,7 +21365,7 @@ This operation requires one of the security alternatives in the specification be "properties": { "action": { "type": "string", - "const": "list_release_cases" + "const": "list_catalog_cases" }, "organization_id": { "type": "string", @@ -20405,6 +21377,12 @@ This operation requires one of the security alternatives in the specification be "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "limit": { + "default": 50, + "type": "integer", + "minimum": 1, + "maximum": 100 } }, "required": [ @@ -20417,19 +21395,200 @@ This operation requires one of the security alternatives in the specification be "properties": { "action": { "type": "string", - "const": "read_release_case" + "const": "attach_evidence" }, "organization_id": { + "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope.", "type": "string", "format": "uuid", - "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", - "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope." + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, - "request_id": { + "source_version_id": { + "description": "Exact retained source-version ID; use a new association for a later version.", "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" - } + }, + "targets": { + "uniqueItems": true, + "description": "Distinct typed targets. The server also rejects UUID duplicates that differ only in case.", + "minItems": 1, + "maxItems": 100, + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "artist_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + } + }, + "required": [ + "artist_id" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "professional_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + } + }, + "required": [ + "professional_id" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "request_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "subject_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + } + }, + "required": [ + "request_id", + "subject_id" + ], + "additionalProperties": false + } + ] + } + }, + "idempotency_key": { + "type": "string", + "minLength": 1, + "maxLength": 128, + "pattern": "^[A-Za-z0-9._:-]+$" + } + }, + "required": [ + "action", + "source_version_id", + "targets", + "idempotency_key" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "read_evidence_attachment" + }, + "organization_id": { + "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope.", + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "attachment_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + } + }, + "required": [ + "action", + "attachment_id" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "list_evidence_attachments" + }, + "organization_id": { + "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope.", + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "source_version_id": { + "description": "Exact retained source-version ID; use a new association for a later version.", + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "after_id": { + "description": "Pass the returned next_id as after_id while has_more is true, including empty pages with withheld receipts.", + "anyOf": [ + { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "action", + "source_version_id" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "list_release_cases" + }, + "organization_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope." + }, + "after_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + } + }, + "required": [ + "action" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "read_release_case" + }, + "organization_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + "description": "Optional organization workspace. Current membership and ownership are checked; omitting it uses personal scope." + }, + "request_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + } }, "required": [ "action", @@ -21687,6 +22846,46 @@ This operation requires one of the security alternatives in the specification be "brief_id": "00000000-0000-4000-8000-000000000005", "organization_id": "00000000-0000-4000-8000-000000000002" } + }, + "contextActionSaveCatalogCase": { + "summary": "save_catalog_case (synthetic source contract)", + "value": { + "action": "save_catalog_case", + "case_id": "00000000-0000-4000-8000-000000000005", + "expected_revision": 0, + "idempotency_key": "catalog-case-example", + "snapshot": { + "schema_version": 1, + "case_id": "00000000-0000-4000-8000-000000000005", + "workspace_id": "00000000-0000-4000-8000-000000000002", + "revision": 0, + "scope": "One supplied composition; customer assertion", + "sources": {}, + "assessments": {}, + "findings": {}, + "actions": {}, + "attempts": {}, + "outcomes": {} + }, + "organization_id": "00000000-0000-4000-8000-000000000002" + } + }, + "contextActionReadCatalogCase": { + "summary": "read_catalog_case (synthetic source contract)", + "value": { + "action": "read_catalog_case", + "case_id": "00000000-0000-4000-8000-000000000005", + "revision": 1, + "organization_id": "00000000-0000-4000-8000-000000000002" + } + }, + "contextActionListCatalogCases": { + "summary": "list_catalog_cases (synthetic source contract)", + "value": { + "action": "list_catalog_cases", + "limit": 50, + "organization_id": "00000000-0000-4000-8000-000000000002" + } } } } @@ -21752,6 +22951,12 @@ This operation requires one of the security alternatives in the specification be }, { "$ref": "#/components/schemas/ContextBriefResponse" + }, + { + "$ref": "#/components/schemas/ContextCatalogCaseResponse" + }, + { + "$ref": "#/components/schemas/ContextCatalogCasesResponse" } ] }, @@ -22973,6 +24178,76 @@ This operation requires one of the security alternatives in the specification be "brief": null } } + }, + "contextActionSaveCatalogCase": { + "summary": "save_catalog_case assertion artifact; no external action", + "x-recoup-context-action": "save_catalog_case", + "value": { + "case_id": "00000000-0000-4000-8000-000000000005", + "revision": 1, + "state": "saved", + "evidence_kind": "customer_assertion", + "snapshot": { + "schema_version": 1, + "case_id": "00000000-0000-4000-8000-000000000005", + "workspace_id": "00000000-0000-4000-8000-000000000002", + "revision": 1, + "scope": "One supplied composition; customer assertion", + "sources": {}, + "assessments": {}, + "findings": {}, + "actions": {}, + "attempts": {}, + "outcomes": {} + }, + "withheld_record_ids": [], + "snapshot_usable_for_save": true, + "external_actions": "unsupported", + "created_at": "2026-10-21T00:00:00Z" + } + }, + "contextActionReadCatalogCase": { + "summary": "read_catalog_case assertion artifact; no external action", + "x-recoup-context-action": "read_catalog_case", + "value": { + "case_id": "00000000-0000-4000-8000-000000000005", + "revision": 1, + "state": "saved", + "evidence_kind": "customer_assertion", + "snapshot": { + "schema_version": 1, + "case_id": "00000000-0000-4000-8000-000000000005", + "workspace_id": "00000000-0000-4000-8000-000000000002", + "revision": 1, + "scope": "One supplied composition; customer assertion", + "sources": {}, + "assessments": {}, + "findings": {}, + "actions": {}, + "attempts": {}, + "outcomes": {} + }, + "withheld_record_ids": [], + "snapshot_usable_for_save": true, + "external_actions": "unsupported", + "created_at": "2026-10-21T00:00:00Z" + } + }, + "contextActionListCatalogCases": { + "summary": "list_catalog_cases assertion artifact; no external action", + "x-recoup-context-action": "list_catalog_cases", + "value": { + "cases": [ + { + "case_id": "00000000-0000-4000-8000-000000000005", + "revision": 1, + "created_at": "2026-10-21T00:00:00Z", + "updated_at": "2026-10-21T00:00:00Z" + } + ], + "has_more": false, + "next_id": null + } } } } @@ -23182,6 +24457,18 @@ This operation requires one of the security alternatives in the specification be "list_evidence_attachments": { "name": "list_music_evidence_attachments", "readOnly": true + }, + "save_catalog_case": { + "name": "save_catalog_case", + "readOnly": false + }, + "read_catalog_case": { + "name": "read_catalog_case", + "readOnly": true + }, + "list_catalog_cases": { + "name": "list_catalog_cases", + "readOnly": true } }, "x-recoup-context-responses": { @@ -23364,6 +24651,24 @@ This operation requires one of the security alternatives in the specification be "schema": { "$ref": "#/components/schemas/ContextBriefResponse" } + }, + "save_catalog_case": { + "status": 200, + "schema": { + "$ref": "#/components/schemas/ContextCatalogCaseResponse" + } + }, + "read_catalog_case": { + "status": 200, + "schema": { + "$ref": "#/components/schemas/ContextCatalogCaseResponse" + } + }, + "list_catalog_cases": { + "status": 200, + "schema": { + "$ref": "#/components/schemas/ContextCatalogCasesResponse" + } } } } @@ -27162,6 +28467,1367 @@ This operation requires one of the security alternatives in the specification be ], "additionalProperties": false }, + "ContextCatalogCaseResponse": { + "type": "object", + "properties": { + "case_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "revision": { + "type": "integer", + "minimum": 1, + "maximum": 9007199254740991 + }, + "state": { + "type": "string", + "enum": [ + "saved", + "partial" + ] + }, + "evidence_kind": { + "type": "string", + "const": "customer_assertion" + }, + "snapshot": { + "type": "object", + "properties": { + "schema_version": { + "type": "number", + "const": 1 + }, + "case_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "workspace_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "revision": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "scope": { + "type": "string", + "maxLength": 32000 + }, + "sources": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "locator": { + "anyOf": [ + { + "type": "string", + "minLength": 1, + "maxLength": 32000 + }, + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + ] + }, + "status": { + "type": "string", + "enum": [ + "active", + "withdrawn" + ] + }, + "evidence_kind": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "context_source_version_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + } + }, + "required": [ + "id", + "version", + "sha256", + "locator", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "status": { + "type": "string", + "const": "withdrawn" + }, + "withheld": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "version", + "status", + "withheld" + ], + "additionalProperties": false + } + ] + } + }, + "assessments": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stage": { + "type": "string", + "enum": [ + "audit", + "reconcile", + "register", + "resolve_claims", + "manage_delivery", + "review_deal", + "import", + "explain_contract", + "organize_publishing", + "estimate_value", + "check_credits", + "check_metadata" + ] + }, + "status": { + "type": "string", + "enum": [ + "prepared", + "in_progress", + "partial", + "complete", + "blocked" + ] + } + }, + "required": [ + "id", + "source_refs", + "rule_version", + "stage", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "status": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stale": { + "type": "boolean", + "const": true + }, + "withheld": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "status", + "stale", + "withheld" + ], + "additionalProperties": false + } + ] + } + }, + "findings": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stage": { + "type": "string", + "enum": [ + "audit", + "reconcile", + "register", + "resolve_claims", + "manage_delivery", + "review_deal", + "import", + "explain_contract", + "organize_publishing", + "estimate_value", + "check_credits", + "check_metadata" + ] + }, + "status": { + "type": "string", + "enum": [ + "open", + "accepted", + "resolved", + "not_applicable" + ] + }, + "cause_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "id", + "source_refs", + "rule_version", + "stage", + "status", + "cause_id" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "status": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stale": { + "type": "boolean", + "const": true + }, + "withheld": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "status", + "stale", + "withheld" + ], + "additionalProperties": false + } + ] + } + }, + "actions": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stage": { + "type": "string", + "enum": [ + "register", + "resolve_claims", + "manage_delivery" + ] + }, + "status": { + "type": "string", + "enum": [ + "prepared", + "authorized", + "withdrawn" + ] + }, + "payload": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "operation": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "account": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "party": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "subjects": { + "minItems": 1, + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "scope": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "disclosure": { + "maxItems": 1000, + "type": "array", + "items": {} + }, + "costs": { + "maxItems": 1000, + "type": "array", + "items": {} + } + }, + "required": [ + "provider", + "operation", + "account", + "party", + "subjects", + "scope", + "disclosure", + "costs" + ], + "additionalProperties": {} + }, + "authorization": { + "type": "object", + "properties": { + "reference": { + "type": "string", + "minLength": 1, + "maxLength": 32000 + }, + "payload_sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "valid_until": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "scope": {} + }, + "required": [ + "reference", + "payload_sha256", + "valid_until", + "scope" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "source_refs", + "rule_version", + "stage", + "status", + "payload" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "status": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stale": { + "type": "boolean", + "const": true + }, + "withheld": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "status", + "stale", + "withheld" + ], + "additionalProperties": false + } + ] + } + }, + "attempts": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "payload_sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "status": { + "type": "string", + "enum": [ + "user_reported_sent", + "observed_sent", + "unknown_outcome", + "acknowledged", + "rejected" + ] + }, + "provider_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "item_ids": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "receipt_locator": {}, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "payload_sha256", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "status": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stale": { + "type": "boolean", + "const": true + }, + "withheld": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "status", + "stale", + "withheld" + ], + "additionalProperties": false + } + ] + } + }, + "outcomes": { + "type": "object", + "propertyNames": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "additionalProperties": { + "anyOf": [ + { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "dimension": { + "type": "string", + "const": "provider_decision" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "accepted", + "partially_accepted", + "rejected", + "superseded", + "rematched" + ] + }, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "dimension", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "dimension": { + "type": "string", + "const": "observed_record" + }, + "status": { + "type": "string", + "enum": [ + "unchecked", + "correct", + "partial", + "incorrect", + "stale" + ] + }, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "dimension", + "status" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "context_refs": {}, + "summary": { + "type": "string", + "maxLength": 32000 + }, + "evidence_gap": { + "type": "string", + "maxLength": 32000 + }, + "depends_on": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "stale": { + "type": "boolean" + }, + "stale_reasons": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "string", + "maxLength": 2000 + } + }, + "source_refs": { + "maxItems": 1000, + "type": "array", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + } + }, + "required": [ + "source_id", + "version" + ], + "additionalProperties": false + } + }, + "rule_version": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "action_id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "dimension": { + "type": "string", + "const": "financial_effect" + }, + "status": { + "type": "string", + "enum": [ + "unverified", + "adjustment_reported", + "remitted", + "bank_received", + "reversed" + ] + }, + "raw_status": {} + }, + "required": [ + "id", + "source_refs", + "rule_version", + "action_id", + "dimension", + "status" + ], + "additionalProperties": false + } + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "status": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "stale": { + "type": "boolean", + "const": true + }, + "withheld": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "status", + "stale", + "withheld" + ], + "additionalProperties": false + } + ] + } + } + }, + "required": [ + "schema_version", + "case_id", + "workspace_id", + "revision", + "scope", + "sources", + "assessments", + "findings", + "actions", + "attempts", + "outcomes" + ], + "additionalProperties": false + }, + "withheld_record_ids": { + "maxItems": 6000, + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "snapshot_usable_for_save": { + "type": "boolean" + }, + "external_actions": { + "type": "string", + "const": "unsupported" + }, + "created_at": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + } + }, + "required": [ + "case_id", + "revision", + "state", + "evidence_kind", + "snapshot", + "withheld_record_ids", + "snapshot_usable_for_save", + "external_actions", + "created_at" + ], + "additionalProperties": false + }, + "ContextCatalogCasesResponse": { + "type": "object", + "properties": { + "cases": { + "maxItems": 100, + "type": "array", + "items": { + "type": "object", + "properties": { + "case_id": { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + "revision": { + "type": "integer", + "minimum": 1, + "maximum": 9007199254740991 + }, + "created_at": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + } + }, + "required": [ + "case_id", + "revision", + "created_at", + "updated_at" + ], + "additionalProperties": false + } + }, + "has_more": { + "type": "boolean" + }, + "next_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "cases", + "has_more", + "next_id" + ], + "additionalProperties": false + }, "ContextReleaseTrackVerificationResponse": { "description": "202 only after the existing feature/readiness checks and dispatch succeed; no automatic identity confirmation.", "type": "object", @@ -42032,7 +44698,7 @@ This operation requires one of the security alternatives in the specification be Source: https://recoupable.dev/docs/api-reference/sandboxes/list -List all sandboxes associated with the authenticated account and their current statuses. Returns sandbox details including lifecycle state, timeout remaining, and creation timestamp. Pass account_id to retrieve sandboxes for a specific account the API key has access to. Authentication is handled via the x-api-key header or Authorization Bearer token. +List all sandboxes associated with the authenticated account and their current statuses. Returns sandbox details including lifecycle state, timeout remaining, and creation timestamp. Authentication is handled via the x-api-key header or Authorization Bearer token. ## GET /api/sandboxes @@ -42066,7 +44732,7 @@ The supplied specification does not declare an OpenAPI security object for this "/api/sandboxes": { "get": { "operationId": "getSandboxes", - "description": "List all sandboxes associated with the authenticated account and their current statuses. Returns sandbox details including lifecycle state, timeout remaining, and creation timestamp. Pass account_id to retrieve sandboxes for a specific account the API key has access to. Authentication is handled via the x-api-key header or Authorization Bearer token.\n\nSet `metadata_only=true` when you only need the existing saved metadata. This skips live sandbox status lookups and returns an empty `sandboxes` array alongside `snapshot_id`, `github_repo` and `filetree`, preserving their existing nullable behavior. Stored metadata reads and the optional GitHub filetree lookup still run. The empty array in this mode does not establish whether any sandbox is running.\n\nOmitting `metadata_only` or sending literal `false` preserves normal live-status behavior. Authentication, account access checks and sandbox filters remain the same in either mode. Supplied values must be literal lowercase `true` or `false`; other values, including an empty value, return 400 through query validation.", + "description": "List all sandboxes associated with the authenticated account and their current statuses. Returns sandbox details including lifecycle state, timeout remaining, and creation timestamp. Authentication is handled via the x-api-key header or Authorization Bearer token.\n\nSet `metadata_only=true` when you only need the existing saved metadata. This skips live sandbox status lookups and returns an empty `sandboxes` array alongside `snapshot_id`, `github_repo` and `filetree`, preserving their existing nullable behavior. Stored metadata reads and the optional GitHub filetree lookup still run. The empty array in this mode does not establish whether any sandbox is running.\n\nOmitting `metadata_only` or sending literal `false` preserves normal live-status behavior. Authentication, account access checks and sandbox filters remain the same in either mode. Supplied values must be literal lowercase `true` or `false`; other values, including an empty value, return 400 through query validation.\n\nOmit `account_id` to read the authenticated account. An explicit UUID must pass the existing account-access policy: the caller itself, an organization the caller belongs to, a shared-organization account, or existing Recoup administrative access. Invalid UUIDs return 400; denied targets return 403 before snapshot or repository lookup. A target read never falls back to the caller's repository. Successful explicit-target reads echo `account_id`; omitted-target responses do not add that field. This delegates reads only, not upload, replacement or deletion rights.", "parameters": [ { "name": "sandbox_id", @@ -42081,12 +44747,13 @@ The supplied specification does not declare an OpenAPI security object for this { "name": "account_id", "in": "query", - "description": "Filter to a specific account. Only applicable when the authenticated account has access to multiple accounts via organization membership.", + "description": "Optional target account UUID authorized by the existing account-access policy. Omit for the authenticated account. Successful explicit-target reads echo this value as account_id; this does not grant file-write access.", "required": false, "schema": { "type": "string", "format": "uuid" - } + }, + "example": "11111111-1111-4111-8111-111111111111" }, { "name": "metadata_only", @@ -42101,17 +44768,40 @@ The supplied specification does not declare an OpenAPI security object for this ], "responses": { "200": { - "description": "Sandboxes retrieved successfully. In metadata_only mode, sandboxes is empty while the existing saved metadata fields are retained.", + "description": "Sandboxes retrieved successfully. In metadata_only mode, sandboxes is empty while the existing saved metadata fields are retained. Explicit authorized account_id requests echo that account_id; omitted-target requests keep the existing response shape.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxesResponse" + }, + "examples": { + "ownMetadata": { + "summary": "Authenticated account metadata (metadata_only=true)", + "value": { + "status": "success", + "sandboxes": [], + "snapshot_id": null, + "github_repo": null, + "filetree": null + } + }, + "targetMetadata": { + "summary": "Authorized explicit account metadata (account_id and metadata_only=true)", + "value": { + "status": "success", + "sandboxes": [], + "snapshot_id": null, + "github_repo": null, + "filetree": null, + "account_id": "11111111-1111-4111-8111-111111111111" + } + } } } } }, "400": { - "description": "Invalid query parameters, including a supplied metadata_only value other than literal lowercase true or false.", + "description": "Invalid query parameters, including an invalid account_id UUID or a supplied metadata_only value other than literal lowercase true or false.", "content": { "application/json": { "schema": { @@ -42131,7 +44821,7 @@ The supplied specification does not declare an OpenAPI security object for this } }, "403": { - "description": "Forbidden - account_id is not a member of the organization or account tried to filter by an account_id they don't have access to", + "description": "Access denied to the explicit account_id. No target snapshot/repository lookup or fallback to the caller's repository occurs.", "content": { "application/json": { "schema": { @@ -42192,289 +44882,301 @@ The supplied specification does not declare an OpenAPI security object for this "error": { "type": "string", "description": "Error message (only present if status is error)" - } - } - }, - "SandboxErrorResponse": { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string", - "description": "Error message describing what went wrong", - "example": "Failed to create sandbox" - } - } - }, - "Sandbox": { - "type": "object", - "required": [ - "sandboxId", - "sandboxStatus", - "timeout", - "createdAt" - ], - "description": "A sandbox environment instance", - "properties": { - "sandboxId": { - "type": "string", - "description": "Unique identifier for the sandbox", - "example": "sbx_abc123def456" - }, - "sandboxStatus": { - "type": "string", - "enum": [ - "pending", - "running", - "stopping", - "stopped", - "failed" - ], - "description": "Current lifecycle state of the sandbox", - "example": "running" - }, - "timeout": { - "type": "integer", - "description": "Milliseconds remaining before the sandbox stops automatically", - "example": 300000 - }, - "createdAt": { - "type": "string", - "format": "date-time", - "description": "ISO 8601 timestamp when the sandbox was created", - "example": "2024-01-15T10:30:00.000Z" - }, - "runId": { - "type": "string", - "description": "Unique identifier for the command execution run. Only present if a command was provided when creating the sandbox. Use this with [GET /api/tasks/runs](https://recoupable.dev/docs/api-reference/tasks/runs) to check the status and retrieve results.", - "example": "run_xyz789abc123" - } - } - }, - "FileTreeEntry": { - "type": "object", - "required": [ - "path", - "type", - "sha" - ], - "description": "A single entry in a GitHub repository file tree", - "properties": { - "path": { - "type": "string", - "description": "The file or directory path relative to the repository root", - "example": "src/index.ts" - }, - "type": { - "type": "string", - "enum": [ - "blob", - "tree" - ], - "description": "The type of entry: blob for files, tree for directories" - }, - "sha": { - "type": "string", - "description": "The SHA hash of the entry", - "example": "abc123def456" - }, - "size": { - "type": "integer", - "description": "The size of the file in bytes. Only present for blob entries.", - "example": 1024 - } - } - } - } - } -} -``` - - -# Create Sandbox - -Source: https://recoupable.dev/docs/api-reference/sandboxes/create - -Create a new ephemeral sandbox environment. Optionally executes a command or an OpenCode prompt if provided. Sandboxes are isolated Linux microVMs that can be used to evaluate account-generated code, run AI agent output safely, or execute reproducible tasks. The sandbox will automatically stop after the timeout period. If no command or prompt is provided, the sandbox is created without triggering any background task. Use the prompt parameter as a shortcut to run `opencode run ""` in the sandbox. Pass account_id to create a sandbox for a specific account the API key has access to. Authentication is handled via the x-api-key header or Authorization Bearer token. - -## POST /api/sandboxes - -Full OpenAPI specification: https://recoupable.dev/docs/spec/content.json - -## Authentication - -The supplied specification does not declare an OpenAPI security object for this operation. Its declared headers and parameters still apply. Consult the authentication guide and the full specification before calling it. - -[Authentication guide](https://recoupable.dev/docs/authentication) - -## Operation and referenced schemas - -```json -{ - "openapi": "3.1.0", - "info": { - "title": "Recoup API - Content", - "description": "API documentation for the Recoup platform - an AI agent platform for the music industry", - "license": { - "name": "MIT" - }, - "version": "1.0.0" - }, - "servers": [ - { - "url": "https://api.recoupable.dev" - } - ], - "paths": { - "/api/sandboxes": { - "post": { - "operationId": "postSandboxes", - "description": "Create a new ephemeral sandbox environment. Optionally executes a command or an OpenCode prompt if provided. Sandboxes are isolated Linux microVMs that can be used to evaluate account-generated code, run AI agent output safely, or execute reproducible tasks. The sandbox will automatically stop after the timeout period. If no command or prompt is provided, the sandbox is created without triggering any background task. Use the prompt parameter as a shortcut to run `opencode run \"\"` in the sandbox. Pass account_id to create a sandbox for a specific account the API key has access to. Authentication is handled via the x-api-key header or Authorization Bearer token.", - "requestBody": { - "description": "Optional command execution parameters. If command and prompt are both omitted, sandbox is created without running any command. Use prompt as a shortcut for running OpenCode.", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateSandboxRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Sandbox created successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SandboxesResponse" - } - } - } - }, - "400": { - "description": "Bad request - failed to create sandbox", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SandboxErrorResponse" - } - } - } - }, - "401": { - "description": "Unauthorized - invalid or missing API key", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SandboxErrorResponse" - } - } - } - }, - "403": { - "description": "Forbidden - account_id is not a member of the organization or account tried to use an account_id they don't have access to", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SandboxErrorResponse" - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "CreateSandboxRequest": { - "type": "object", - "description": "Request body for creating a new sandbox. All fields are optional - if no command or prompt is provided, sandbox is created without triggering a command execution task. Use prompt as a shortcut to run OpenCode with a given prompt instead of specifying command/args manually.", - "properties": { - "command": { - "type": "string", - "minLength": 1, - "description": "The command to execute in the sandbox environment. If omitted, the sandbox is created without running any command.", - "example": "ls" - }, - "args": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Optional arguments to pass to the command.", - "example": [ - "-la", - "/home" - ] - }, - "cwd": { - "type": "string", - "description": "Optional working directory for command execution.", - "example": "/home/user" - }, - "prompt": { - "type": "string", - "minLength": 1, - "description": "A prompt to pass to OpenCode in the sandbox. When provided, the sandbox will execute `opencode run \"\"`. Cannot be used together with command.", - "example": "create a hello world index.html" }, "account_id": { "type": "string", "format": "uuid", - "description": "UUID of the account to create the sandbox for. Only applicable when the authenticated account has access to multiple accounts via organization membership. If not provided, creates the sandbox for the API key's own account." - } - } - }, - "SandboxesResponse": { - "type": "object", - "required": [ - "status", - "sandboxes" - ], - "description": "Response containing sandbox information", - "properties": { - "status": { - "type": "string", - "enum": [ - "success", - "error" - ], - "description": "Status of the request" - }, - "sandboxes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Sandbox" - }, - "description": "Array of sandbox objects" - }, - "snapshot_id": { - "type": "string", - "description": "The account's saved snapshot ID used for creating new sandboxes. Null if no snapshot has been saved.", - "example": "snap_abc123def456", - "nullable": true - }, - "github_repo": { - "type": "string", - "description": "The GitHub repository URL associated with the account's sandbox environment. Used as the filesystem source when restoring sandboxes.", - "example": "https://github.com/username/repo", - "nullable": true - }, - "filetree": { - "type": "array", - "nullable": true, - "description": "The recursive file tree of the account's GitHub repository. Null if no github_repo is set or if the fetch fails.", - "items": { - "$ref": "#/components/schemas/FileTreeEntry" - } - }, - "error": { - "type": "string", - "description": "Error message (only present if status is error)" + "description": "On successful GET reads only: the explicitly requested, authorized target account UUID. Present even for an explicit self target; absent when account_id was omitted. This is read scope, not write authorization.", + "example": "11111111-1111-4111-8111-111111111111" + } + } + }, + "SandboxErrorResponse": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string", + "description": "Error message describing what went wrong", + "example": "Failed to create sandbox" + } + } + }, + "Sandbox": { + "type": "object", + "required": [ + "sandboxId", + "sandboxStatus", + "timeout", + "createdAt" + ], + "description": "A sandbox environment instance", + "properties": { + "sandboxId": { + "type": "string", + "description": "Unique identifier for the sandbox", + "example": "sbx_abc123def456" + }, + "sandboxStatus": { + "type": "string", + "enum": [ + "pending", + "running", + "stopping", + "stopped", + "failed" + ], + "description": "Current lifecycle state of the sandbox", + "example": "running" + }, + "timeout": { + "type": "integer", + "description": "Milliseconds remaining before the sandbox stops automatically", + "example": 300000 + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 timestamp when the sandbox was created", + "example": "2024-01-15T10:30:00.000Z" + }, + "runId": { + "type": "string", + "description": "Unique identifier for the command execution run. Only present if a command was provided when creating the sandbox. Use this with [GET /api/tasks/runs](https://recoupable.dev/docs/api-reference/tasks/runs) to check the status and retrieve results.", + "example": "run_xyz789abc123" + } + } + }, + "FileTreeEntry": { + "type": "object", + "required": [ + "path", + "type", + "sha" + ], + "description": "A single entry in a GitHub repository file tree", + "properties": { + "path": { + "type": "string", + "description": "The file or directory path relative to the repository root", + "example": "src/index.ts" + }, + "type": { + "type": "string", + "enum": [ + "blob", + "tree" + ], + "description": "The type of entry: blob for files, tree for directories" + }, + "sha": { + "type": "string", + "description": "The SHA hash of the entry", + "example": "abc123def456" + }, + "size": { + "type": "integer", + "description": "The size of the file in bytes. Only present for blob entries.", + "example": 1024 + } + } + } + } + } +} +``` + + +# Create Sandbox + +Source: https://recoupable.dev/docs/api-reference/sandboxes/create + +Create a new ephemeral sandbox environment. Optionally executes a command or an OpenCode prompt if provided. Sandboxes are isolated Linux microVMs that can be used to evaluate account-generated code, run AI agent output safely, or execute reproducible tasks. The sandbox will automatically stop after the timeout period. If no command or prompt is provided, the sandbox is created without triggering any background task. Use the prompt parameter as a shortcut to run `opencode run ""` in the sandbox. Pass account_id to create a sandbox for a specific account the API key has access to. Authentication is handled via the x-api-key header or Authorization Bearer token. + +## POST /api/sandboxes + +Full OpenAPI specification: https://recoupable.dev/docs/spec/content.json + +## Authentication + +The supplied specification does not declare an OpenAPI security object for this operation. Its declared headers and parameters still apply. Consult the authentication guide and the full specification before calling it. + +[Authentication guide](https://recoupable.dev/docs/authentication) + +## Operation and referenced schemas + +```json +{ + "openapi": "3.1.0", + "info": { + "title": "Recoup API - Content", + "description": "API documentation for the Recoup platform - an AI agent platform for the music industry", + "license": { + "name": "MIT" + }, + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://api.recoupable.dev" + } + ], + "paths": { + "/api/sandboxes": { + "post": { + "operationId": "postSandboxes", + "description": "Create a new ephemeral sandbox environment. Optionally executes a command or an OpenCode prompt if provided. Sandboxes are isolated Linux microVMs that can be used to evaluate account-generated code, run AI agent output safely, or execute reproducible tasks. The sandbox will automatically stop after the timeout period. If no command or prompt is provided, the sandbox is created without triggering any background task. Use the prompt parameter as a shortcut to run `opencode run \"\"` in the sandbox. Pass account_id to create a sandbox for a specific account the API key has access to. Authentication is handled via the x-api-key header or Authorization Bearer token.", + "requestBody": { + "description": "Optional command execution parameters. If command and prompt are both omitted, sandbox is created without running any command. Use prompt as a shortcut for running OpenCode.", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSandboxRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Sandbox created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SandboxesResponse" + } + } + } + }, + "400": { + "description": "Bad request - failed to create sandbox", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SandboxErrorResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - invalid or missing API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SandboxErrorResponse" + } + } + } + }, + "403": { + "description": "Forbidden - account_id is not a member of the organization or account tried to use an account_id they don't have access to", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SandboxErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "CreateSandboxRequest": { + "type": "object", + "description": "Request body for creating a new sandbox. All fields are optional - if no command or prompt is provided, sandbox is created without triggering a command execution task. Use prompt as a shortcut to run OpenCode with a given prompt instead of specifying command/args manually.", + "properties": { + "command": { + "type": "string", + "minLength": 1, + "description": "The command to execute in the sandbox environment. If omitted, the sandbox is created without running any command.", + "example": "ls" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional arguments to pass to the command.", + "example": [ + "-la", + "/home" + ] + }, + "cwd": { + "type": "string", + "description": "Optional working directory for command execution.", + "example": "/home/user" + }, + "prompt": { + "type": "string", + "minLength": 1, + "description": "A prompt to pass to OpenCode in the sandbox. When provided, the sandbox will execute `opencode run \"\"`. Cannot be used together with command.", + "example": "create a hello world index.html" + }, + "account_id": { + "type": "string", + "format": "uuid", + "description": "UUID of the account to create the sandbox for. Only applicable when the authenticated account has access to multiple accounts via organization membership. If not provided, creates the sandbox for the API key's own account." + } + } + }, + "SandboxesResponse": { + "type": "object", + "required": [ + "status", + "sandboxes" + ], + "description": "Response containing sandbox information", + "properties": { + "status": { + "type": "string", + "enum": [ + "success", + "error" + ], + "description": "Status of the request" + }, + "sandboxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Sandbox" + }, + "description": "Array of sandbox objects" + }, + "snapshot_id": { + "type": "string", + "description": "The account's saved snapshot ID used for creating new sandboxes. Null if no snapshot has been saved.", + "example": "snap_abc123def456", + "nullable": true + }, + "github_repo": { + "type": "string", + "description": "The GitHub repository URL associated with the account's sandbox environment. Used as the filesystem source when restoring sandboxes.", + "example": "https://github.com/username/repo", + "nullable": true + }, + "filetree": { + "type": "array", + "nullable": true, + "description": "The recursive file tree of the account's GitHub repository. Null if no github_repo is set or if the fetch fails.", + "items": { + "$ref": "#/components/schemas/FileTreeEntry" + } + }, + "error": { + "type": "string", + "description": "Error message (only present if status is error)" + }, + "account_id": { + "type": "string", + "format": "uuid", + "description": "On successful GET reads only: the explicitly requested, authorized target account UUID. Present even for an explicit self target; absent when account_id was omitted. This is read scope, not write authorization.", + "example": "11111111-1111-4111-8111-111111111111" } } }, @@ -43090,7 +45792,7 @@ The supplied specification does not declare an OpenAPI security object for this Source: https://recoupable.dev/docs/api-reference/sandboxes/get-file -Read a file from the authenticated account's Git-backed repository, including resolved submodule paths, on `main`. The repository comes from the [account's snapshot](https://recoupable.dev/docs/api-reference/sandboxes/list). Authenticate with `x-api-key` or an Authorization Bearer token. +Read a file from the authenticated account's Git-backed repository, or an explicitly authorized target account's repository, including resolved submodule paths, on `main`. The repository comes from the [account's snapshot](https://recoupable.dev/docs/api-reference/sandboxes/list). Authenticate with `x-api-key` or an Authorization Bearer token. ## GET /api/sandboxes/file @@ -43124,7 +45826,7 @@ The supplied specification does not declare an OpenAPI security object for this "/api/sandboxes/file": { "get": { "operationId": "getSandboxesFile", - "description": "Read a file from the authenticated account's Git-backed repository, including resolved submodule paths, on `main`. The repository comes from the [account's snapshot](https://recoupable.dev/docs/api-reference/sandboxes/list). Authenticate with `x-api-key` or an Authorization Bearer token.\n\nTo update an existing file without silently replacing a newer edit, set `include_revision=true`. The response pairs `content` with its blob `sha` from the same repository read. Keep that SHA with the opened draft and send it as `files[].expected_sha` when saving to the same account, resolved repository and path. Omitting the flag, or setting it to `false`, retains the legacy raw read without a SHA.\n\n**Text files are returned verbatim. Recognized binary extensions (`.mp3`, `.png`, `.jpg`, `.mp4`, `.pdf`, etc.) return base64 content with `encoding: base64`; decode those bytes before use.**\n\nVersioned reads support existing regular files whose content is returned inline by the repository service (normally up to 1 MB). Unknown binary content that is not valid UTF-8 is rejected by the versioned read rather than converted into damaged text. Missing/unsupported content, directories and symlinks return an error.\n\nThe SHA identifies the file content; it is not an editing history.", + "description": "Read a file from the authenticated account's Git-backed repository, or an explicitly authorized target account's repository, including resolved submodule paths, on `main`. The repository comes from the [account's snapshot](https://recoupable.dev/docs/api-reference/sandboxes/list). Authenticate with `x-api-key` or an Authorization Bearer token.\n\nOmit `account_id` to read the authenticated account. An explicit UUID must pass the existing account-access policy: the caller itself, an organization the caller belongs to, a shared-organization account, or existing Recoup administrative access. Invalid UUIDs return 400; denied targets return 403 before snapshot or repository lookup. A target read never falls back to the caller's repository. Successful explicit-target reads echo `account_id`; omitted-target responses do not add that field. This delegates reads only, not upload, replacement or deletion rights.\n\nClients selecting an account must send the same `account_id` on the list and file reads and require a matching response echo before using the result. Key cached data by authentication identity, target account and API origin. When that scope changes, reject stale in-flight results and invalidate writable revisions. Retain any unsaved replacement under its original account for manual recovery; never reuse that draft or its revision for a different account. An explicit override is a read-only view, even when it names the authenticated account. A SHA from a target read does not grant permission to write there.\n\nTo update an existing file without silently replacing a newer edit, set `include_revision=true`. The response pairs `content` with its blob `sha` from the same repository read. Keep that SHA with the opened draft and send it as `files[].expected_sha` when saving to the same account, resolved repository and path. Omitting the flag, or setting it to `false`, retains the legacy raw read without a SHA.\n\n**Text files are returned verbatim. Recognized binary extensions (`.mp3`, `.png`, `.jpg`, `.mp4`, `.pdf`, etc.) return base64 content with `encoding: base64`; decode those bytes before use.**\n\nVersioned reads support existing regular files whose content is returned inline by the repository service (normally up to 1 MB). Unknown binary content that is not valid UTF-8 is rejected by the versioned read rather than converted into damaged text. Missing/unsupported content, directories and symlinks return an error.\n\nThe SHA identifies the file content; it is not an editing history.", "parameters": [ { "name": "path", @@ -43147,11 +45849,22 @@ The supplied specification does not declare an OpenAPI security object for this "default": false }, "example": true + }, + { + "name": "account_id", + "in": "query", + "description": "Optional target account UUID authorized by the existing account-access policy. Omit for the authenticated account. Successful explicit-target reads echo this value as account_id; this does not grant file-write access.", + "required": false, + "schema": { + "type": "string", + "format": "uuid" + }, + "example": "11111111-1111-4111-8111-111111111111" } ], "responses": { "200": { - "description": "File content. Versioned reads also return sha; recognized binary extensions also return encoding: base64.", + "description": "File content. Versioned reads also return sha; recognized binary extensions also return encoding: base64. Explicit authorized account_id requests also echo that account_id; omitted-target requests do not.", "content": { "application/json": { "schema": { @@ -43181,13 +45894,30 @@ The supplied specification does not declare an OpenAPI security object for this "encoding": "base64", "sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } + }, + "targetText": { + "summary": "Authorized target read (account_id supplied; no revision requested)", + "value": { + "status": "success", + "content": "Release notes", + "account_id": "11111111-1111-4111-8111-111111111111" + } + }, + "targetVersionedText": { + "summary": "Authorized target bytes and revision (read access only)", + "value": { + "status": "success", + "content": "Release notes", + "sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "account_id": "11111111-1111-4111-8111-111111111111" + } } } } } }, "400": { - "description": "Missing/noncanonical path or include_revision other than true/false. Use a canonical relative path. Dot/traversal segments, backslashes, control characters, malformed Unicode and leading/trailing/doubled slashes return 400. These checks also apply to legacy requests.", + "description": "Invalid account_id UUID, missing/noncanonical path or include_revision other than true/false. Use a canonical relative path. Dot/traversal segments, backslashes, control characters, malformed Unicode and leading/trailing/doubled slashes return 400. These checks also apply to legacy requests.", "content": { "application/json": { "schema": { @@ -43207,7 +45937,7 @@ The supplied specification does not declare an OpenAPI security object for this } }, "403": { - "description": "Forbidden - account does not have access", + "description": "Access denied to the explicit account_id. No target snapshot/repository lookup or fallback to the caller's repository occurs.", "content": { "application/json": { "schema": { @@ -43217,7 +45947,7 @@ The supplied specification does not declare an OpenAPI security object for this } }, "404": { - "description": "No usable account snapshot/repository, missing file, or unsupported/failed versioned read. Guarded reads do not fall back to another branch or separately fetched bytes.", + "description": "No usable account snapshot/repository, missing file, or unsupported/failed versioned read. Guarded reads do not fall back to another branch or separately fetched bytes. An explicit target with no usable repository or file does not fall back to the caller's repository.", "content": { "application/json": { "schema": { @@ -43262,6 +45992,12 @@ The supplied specification does not declare an OpenAPI security object for this "pattern": "^[a-f0-9]{40}$", "description": "Present when include_revision=true; use this reader-observed blob SHA as files[].expected_sha. Absent from legacy reads. It identifies the returned bytes, not an accepted Context source version.", "example": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + "account_id": { + "type": "string", + "format": "uuid", + "description": "On successful GET reads only: the explicitly requested, authorized target account UUID. Present even for an explicit self target; absent when account_id was omitted. This is read scope, not write authorization.", + "example": "11111111-1111-4111-8111-111111111111" } } }, @@ -43430,7 +46166,7 @@ The supplied specification does not declare an OpenAPI security object for this "/api/sandboxes/files": { "post": { "operationId": "postSandboxesFiles", - "description": "Upload one or more files to the authenticated account's Git-backed repository. Each file URL is committed separately; paths inside a submodule resolve to that repository. Authenticate with `x-api-key` or an Authorization Bearer token.\n\nFor a guarded update of an existing file:\n1. Read it with `GET /api/sandboxes/file?include_revision=true` and retain the returned `sha` with that draft.\n2. Upload the edited bytes using the [staged-file upload](https://recoupable.dev/docs/api-reference/sandboxes/stage-file), then send the resulting URL and the original SHA as `files[].expected_sha`. Guarded updates save to `main`. A conflicting save is not retried automatically.\n3. On a conflict, preserve the unsaved draft, reread the latest content and reconcile explicitly. Do not fetch a new SHA merely to force an older draft through.\n\nA batch is not a transaction. HTTP 200 can include successful `uploaded` receipts alongside `errors` and `conflicts`; inspect every file. If every upload fails only because its condition conflicts, the response is 409. If all fail with mixed conflict/other failures, it is 500 and keeps the conflicts list. Conflicts contain submitted file names; successes include resulting blob SHAs.\n\nTemporary upload blobs are deleted after every attempt, including conflicts, so retrying requires a new upload URL. Omitting `expected_sha` creates or updates the file on the repository default branch without checking the version you opened. The condition only supports updates to existing files. It protects saves that supply it; saving here does not update files in an already running sandbox.\n\nIf the target was deleted after the read, do not retry without the condition. This upload has no dedicated missing-target status: non-conflict failures return 500 when no file succeeds, or appear in `errors` alongside successful receipts in a 200 partial result. A missing target is not guaranteed to return 404 or 409; reread the path before deciding how to recover.", + "description": "Upload one or more files to the authenticated account's Git-backed repository. Each file URL is committed separately; paths inside a submodule resolve to that repository. Authenticate with `x-api-key` or an Authorization Bearer token.\n\nFor a guarded update of an existing file:\n1. Read it with `GET /api/sandboxes/file?include_revision=true` and retain the returned `sha` with that draft.\n2. Upload the edited bytes using the [staged-file upload](https://recoupable.dev/docs/api-reference/sandboxes/stage-file), then send the resulting URL and the original SHA as `files[].expected_sha`. Guarded updates save to `main`. A conflicting save is not retried automatically.\n3. On a conflict, preserve the unsaved draft, reread the latest content and reconcile explicitly. Do not fetch a new SHA merely to force an older draft through.\n\nA batch is not a transaction. HTTP 200 can include successful `uploaded` receipts alongside `errors` and `conflicts`; inspect every file. If every upload fails only because its condition conflicts, the response is 409. If all fail with mixed conflict/other failures, it is 500 and keeps the conflicts list. Conflicts contain submitted file names; successes include resulting blob SHAs.\n\nTemporary upload blobs are deleted after every attempt, including conflicts, so retrying requires a new upload URL. Omitting `expected_sha` creates or updates the file on the repository default branch without checking the version you opened. The condition only supports updates to existing files. It protects saves that supply it; saving here does not update files in an already running sandbox.\n\nIf the target was deleted after the read, do not retry without the condition. This upload has no dedicated missing-target status: non-conflict failures return 500 when no file succeeds, or appear in `errors` alongside successful receipts in a 200 partial result. A missing target is not guaranteed to return 404 or 409; reread the path before deciding how to recover.\n\nThe optional `account_id` on list/file reads does not delegate uploads or replacements. This upload route remains bound to its existing authenticated-account ownership checks; do not reuse a different account's draft or SHA here. File deletion behavior is also unchanged.", "requestBody": { "description": "JSON body containing file URLs and target path", "required": true, diff --git a/mcp.mdx b/mcp.mdx index a4c9f199..e87f1ccc 100644 --- a/mcp.mdx +++ b/mcp.mdx @@ -38,6 +38,29 @@ blocked and has `collectionPermitted: false`. It does not fetch data, verify rig start collection or grant spending permission. The [Context reference](/api-reference/context/operate) lists all accepted compatibility values, required IDs, page cursors and the complete response. +## Continue a catalog case + +The source contract adds `save_catalog_case`, `read_catalog_case` and +`list_catalog_cases` to standard MCP; delegated OAuth excludes them. Discover the +tools in the connected host before using them. They also use the `context` tool +with the corresponding `action`. The catalog-case database and API release must +be deployed before this source contract is available. + +A case keeps versioned sources, assessments, findings, proposed actions, attempts +and outcomes for the authorized workspace. No artist or ingestion request is +required. The stored snapshot is `customer_assertion` evidence and always returns +`external_actions: unsupported`: saving a record does not submit a registration, +send a claim, confirm a provider decision or verify a bank receipt. + +For a new case, save with `expected_revision: 0` and `snapshot.revision: 0`. +For subsequent saves, use the current revision. Supply a unique idempotency key +for each new save. After an uncertain response, retry the unchanged payload with +the same key and expected revision. +Reads can withhold withdrawn evidence and its dependent records; explicitly +reassemble a partial snapshot before another save. The [Context reference](/api-reference/context/operate) +defines the complete bounded schema, historical-source rules, revision conflicts, +response fields and list pagination. + ## Release Packs When deployed and exposed by the current grant, the pack catalog includes