# Claim guest context

Source: https://recoupable.dev/docs/api-reference/context/guest-claim

Claim guest context after sign-in

## POST /api/context/guest/claim

Full OpenAPI specification: https://recoupable.dev/docs/spec/context.json

## Authentication

This operation requires one of the security alternatives in the specification below. Security scheme definitions are included where present in the published specification.

[Authentication guide](https://recoupable.dev/docs/authentication)

## Operation and referenced schemas

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Recoup Context Engine",
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "https://api.recoupable.dev"
    }
  ],
  "paths": {
    "/api/context/guest/claim": {
      "post": {
        "summary": "Claim guest context after sign-in",
        "description": "Requires the original guest cookie plus verified account authentication. Optionally claims into an authorized organization. Transfers saved metadata without refetching it; an in-progress worker finishes into the claimed destination. Repeated claims by the same account and destination return the same request ID. Another account cannot claim it. Existing matching identities and customer corrections are preserved. No artist ownership claim is implied. Signup UI integration must call this endpoint after authentication. The Recoup app provides a /context entry page and claims into the personal account after login. A failed extraction remains retryable through the same claim receipt. No completion email or website is generated by this flow.",
        "security": [
          {
            "GuestSession": [],
            "BearerAuth": []
          },
          {
            "GuestSession": [],
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The configured funnel origin. This is a browser session flow, not a public unauthenticated MCP tool."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "action"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "claim"
                    ]
                  },
                  "organization_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved guest context or claim receipt."
          },
          "400": {
            "description": "Invalid request."
          },
          "401": {
            "description": "Guest session or account authentication missing."
          },
          "403": {
            "description": "Origin or workspace access denied."
          },
          "409": {
            "description": "Operation unavailable; retry the same input and session."
          },
          "503": {
            "description": "Guest context is disabled."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "GuestSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "recoup_context_guest"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      },
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  }
}
```
