---
updatedAt: 2026-04-24T14:52:01.000Z
agentTools:
  projectIndex: https://oysterskin.readme.io/llms.txt
---

# Get scan session status

Get the current status of a scan session. This endpoint is public (no authentication required)
and can be used as a polling fallback when WebSocket is unavailable.

**Status Values:**
- `pending` - Waiting for customer to submit images
- `analyzing` - Images received, analysis in progress
- `completed` - Analysis finished, results available
- `expired` - Session TTL exceeded
- `failed` - Analysis encountered an error


# OpenAPI definition

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Oyster Skin API",
    "description": "The Oyster Skin API is a RESTful API that provides a way to interact with the Oyster Skin platform.\n\nAll endpoints return JSON responses and use standard HTTP status codes.\n\n## Authentication\nThe API uses Bearer token authentication. Include your API key in the Authorization header:\n```\nAuthorization: Bearer <your-token>\n```\n\nKeys are issued from **API Manager** in the vendor portal, by the account owner or a team\nmember with the `create api` permission.\n\n### Keys belong to the organisation\nAn API key is owned by the vendor account, not by the person who created it. Removing that\nperson from the team, changing their role, or revoking their permissions does not affect the\nkey. Only an explicit revoke or the key's expiry ends it.\n\n### Scopes\nEvery key is stamped with one or more ability groups and can only reach the endpoints they\ncover. Anything else returns `403`. Choose scopes when you mint the key.\n\n| Scope | Grants |\n|---|---|\n| `skin:read` | Read scan history, analyses, care routines and procedure recommendations |\n| `skin:write` | Submit images for analysis, create scan sessions, generate routines |\n| `catalogue:read` | List and search products, the master catalogue and lookup data |\n| `catalogue:write` | Create, update and delete products and master-catalogue imports |\n| `orders:read` | Read order history, statistics and order details |\n| `orders:write` | Act on orders |\n| `ai:chat` | Ask the vendor AI assistant questions against your knowledge base |\n| `storefront:shopify` | Connect a Shopify store and keep its catalogue and orders in sync |\n| `storefront:woocommerce` | Connect a WooCommerce store and keep its catalogue and orders in sync |\n| `vendor:read` | Read your business profile, widget configuration and dashboard metrics |\n| `vendor:write` | Update your business profile and widget configuration |\n| `billing:read` | Read usage, balance and invoices |\n| `billing:pay` | Start a checkout for your outstanding invoices |\n| `billing:settings` | Change the scan spend cap and body-scan setting |\n| `scans:coupons` | Create, edit and delete scan coupons. Every coupon scan is billed to you |\n| `appointments:manage` | Cancel appointments. Cancelling moves no money, and no key can refund |\n| `files:read` | List and download your uploaded files |\n| `files:write` | Upload and delete files |\n\n`GET /user` is reachable by any key regardless of scopes — it is how an integration\ndiscovers which vendor it is authenticated as.\n\nKeys minted before scopes existed reach the whole public API and are flagged as **legacy**\nin the portal; rotate one to a scoped key to narrow it.\n\nNo scope grants access to credential management (API keys, MCP tokens), team and role\nadministration, wallets or withdrawals. Those remain portal-only.\n\n### Connected storefronts\nThe Shopify app and WooCommerce plugin authenticate with an organisation key like any other\nclient, and each has a named preset holding the minimum scope set it needs — pick it by\nname when minting the key (`\"preset\": \"shopify\"`) or fetch the list from\n`GET /developers/api-keys/presets`.\n\n| Preset | Scopes |\n|---|---|\n| `woocommerce` | `storefront:woocommerce`, `vendor:read`, `scans:collect`, `scans:pricing`, `skin:read`, `scan:delivery` |\n| `shopify` | `storefront:shopify`, `vendor:read`, `vendor:write`, `billing:read`, `catalogue:read`, `orders:read`, `files:write` |\n\nEach preset is derived from the endpoints that app actually calls, and asserted against\nthat list in the test suite. `billing:settings` is in neither, and `billing:pay` is in\nneither: the Shopify app reports usage but no longer settles invoices.\n\nA connected store's key reads its scopes from this table on every request rather than from\nthe list stamped on it when the store connected, so a scope added to a preset reaches\nstores that connected before it existed, with no reconnect.\n\n### The two billing write scopes\n`billing:pay` **cannot charge anything**. `POST /vendors/billing/pay-all` and\n`POST /vendors/billing/invoices/{id}/pay` open a gateway checkout session and return an\n`authorization_url`; funds move only when a human completes that checkout and the provider\nwebhook reconciles. The worst a leaked key does is generate a payment link for invoices the\nvendor already owes.\n\n`billing:settings` is the consequential one: `PATCH /vendors/billing/scan-spend-cap` accepts\n`null`, which removes your spending cap entirely, and `PATCH /vendors/billing/body-scan`\nenables a billable feature. Nothing outside the vendor portal needs it.\n\n`scans:pricing` reads and writes `/vendors/billing/scan-retail-price` — what you charge\nyour own customers when you collect scan payments on your own gateway. It is kept apart\nfrom `billing:settings` because it cannot change what Oyster charges you: your invoice is\nmeasured against your billing rate whatever price you set. A storefront integration can\nhold this without also gaining the ability to lift your spend cap.\n\n## Partner API\nA **partner** onboards and manages vendors. Its API keys are minted by partner staff with\nthe `manage partner developers` permission (`/partner/api-keys`, portal only) and belong to\nthe partner, not to the person who created them.\n\n### Partner scopes\nA partner key's scopes cover two things. Partner scopes decide what it may do on the\npartner's own routes (`/partner/*`):\n\n| Scope | Grants |\n|---|---|\n| `partner:vendors:read` | List your vendors and read each one's profile |\n| `partner:vendors:write` | Onboard vendors, update them, and suspend or reactivate their dashboard access |\n| `partner:staff:manage` | Invite, re-invite and remove your vendors' staff, and list their roles, branches and storefronts |\n| `partner:webhooks:manage` | Register where your vendors' events are delivered, rotate signing secrets and read delivery history |\n| `partner:settlements:read` | Read what you collected on each vendor's behalf in a month and what you owe them, booking by booking (`GET /partner/settlements`). Marking a vendor's month settled stays with partner staff |\n\n`GET /partner` is reachable by any partner key. No scope reaches key management or your\nown team (`/partner/staff`, `/partner/roles`), which stay in the partner portal.\n\n### Acting on a vendor\nSend the vendor's slug in the `X-Vendor-Code` header to call any vendor endpoint in this\nAPI as that vendor:\n```\nAuthorization: Bearer <partner-key>\nX-Vendor-Code: lekki-skin-clinic\n```\nThe request is then judged exactly like a request with that vendor's own key: the\nvendor scopes on the partner key (`skin:read`, `vendor:read`, ...) decide which endpoints\nit reaches. Credential management, roles, wallets, withdrawals and KYC stay unreachable,\nand so do the routes a partner owns for its vendors (developers, MCP, widget,\nintegrations, billing). The header is ignored on `/partner/*`. The slug is the `slug`\nof `GET /partner/vendors` and of the `vendor` object on partner webhook deliveries.\n\nA partner key holding `appointments:manage` can cancel a vendor's appointment\n(`PUT /consultation/appointments/{appointment_number}` with `status: cancelled`). It cannot\nrefund one: refunds are made by partner or vendor staff in the portal.\n\n### Partner error codes\n| Code | Status | Meaning |\n|---|---|---|\n| `OYS-PARTNER-1000` | 403 | The route belongs to the partner, not to the vendor it manages |\n| `OYS-PARTNER-1001` | 404 | `X-Vendor-Code` names no vendor of yours (another partner's vendor answers the same) |\n| `OYS-PARTNER-1002` | 403 | A partner key called a vendor route without `X-Vendor-Code` |\n\n### Partner webhooks\nEndpoints registered under `/partner/webhook-endpoints` receive the subscribed events of\nevery vendor you manage, alongside any endpoints of the vendor's own. Each delivery\ncarries `vendor: {id, slug}` at the top level and is signed per attempt like any other.\n\n## Rate Limiting\nAPI endpoints are rate limited to prevent abuse. Check response headers for rate limit information.\n\n## Error Handling\nAll errors return a consistent JSON structure:\n```json\n{\n  \"message\": \"Error description\",\n  \"errors\": {\n    \"field\": [\"Specific error message\"]\n  }\n}\n```\n",
    "version": "1.0.0",
    "contact": {
      "name": "The Oyster Skin Team",
      "email": "team@oysterskin.com"
    }
  },
  "servers": [
    {
      "url": "https://api.sandbox.oysterskin.com/api/v1",
      "description": "Sandbox server"
    }
  ],
  "tags": [
    {
      "name": "SkinAnalysis",
      "description": "Skin analysis and AI-powered assessment endpoints"
    },
    {
      "name": "ScanSession",
      "description": "Scan session management for QR-based and cross-device skin analysis flows"
    }
  ],
  "components": {
    "schemas": {
      "ScanSessionStatusResponse": {
        "type": "object",
        "description": "Current status of a scan session",
        "properties": {
          "valid": {
            "type": "boolean",
            "description": "Whether the session can accept new image submissions. True only for pending sessions that haven't expired.",
            "example": true
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "Human-readable reason for the current state (null when valid)",
            "example": "Session has expired"
          },
          "batch_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "The session batch ID (null if not found)",
            "example": "019421c8-7a2e-7000-8000-000000000000"
          },
          "status": {
            "type": "string",
            "nullable": true,
            "enum": [
              "pending",
              "analyzing",
              "completed",
              "expired",
              "failed"
            ],
            "description": "Current session status",
            "example": "pending"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the session expires",
            "example": "2026-01-25T12:10:00Z"
          },
          "is_expired": {
            "type": "boolean",
            "description": "Whether the session has passed its expiration time",
            "example": false
          },
          "results_url": {
            "type": "string",
            "nullable": true,
            "description": "URL to fetch analysis results (only present when status is \"completed\")",
            "example": "/api/v1/skin/analysis/019421c8-7a2e-7000-8000-000000000000"
          },
          "completed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "ISO 8601 timestamp when analysis completed (only present when status is \"completed\")",
            "example": "2026-01-25T12:05:30Z"
          }
        },
        "required": [
          "valid",
          "batch_id",
          "status"
        ]
      }
    }
  },
  "paths": {
    "/skin/scan-session/{batch_id}": {
      "get": {
        "tags": [
          "SkinAnalysis",
          "ScanSession"
        ],
        "summary": "Get scan session status",
        "description": "Get the current status of a scan session. This endpoint is public (no authentication required)\nand can be used as a polling fallback when WebSocket is unavailable.\n\n**Status Values:**\n- `pending` - Waiting for customer to submit images\n- `analyzing` - Images received, analysis in progress\n- `completed` - Analysis finished, results available\n- `expired` - Session TTL exceeded\n- `failed` - Analysis encountered an error\n",
        "operationId": "getScanSession",
        "security": [],
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "description": "The scan session batch ID (UUID)",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "019421c8-7a2e-7000-8000-000000000000"
          }
        ],
        "responses": {
          "200": {
            "description": "Scan session status retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanSessionStatusResponse"
                },
                "examples": {
                  "pending": {
                    "summary": "Session waiting for images",
                    "value": {
                      "valid": true,
                      "reason": null,
                      "batch_id": "019421c8-7a2e-7000-8000-000000000000",
                      "status": "pending",
                      "expires_at": "2026-01-25T12:10:00Z",
                      "is_expired": false
                    }
                  },
                  "analyzing": {
                    "summary": "Analysis in progress",
                    "value": {
                      "valid": false,
                      "reason": "Session is currently being processed",
                      "batch_id": "019421c8-7a2e-7000-8000-000000000000",
                      "status": "analyzing",
                      "expires_at": "2026-01-25T12:10:00Z",
                      "is_expired": false
                    }
                  },
                  "completed": {
                    "summary": "Analysis completed",
                    "value": {
                      "valid": false,
                      "reason": "Session has already been used",
                      "batch_id": "019421c8-7a2e-7000-8000-000000000000",
                      "status": "completed",
                      "expires_at": "2026-01-25T12:10:00Z",
                      "is_expired": false,
                      "results_url": "/api/v1/skin/analysis/019421c8-7a2e-7000-8000-000000000000",
                      "completed_at": "2026-01-25T12:05:30Z"
                    }
                  },
                  "expired": {
                    "summary": "Session expired",
                    "value": {
                      "valid": false,
                      "reason": "Session has expired",
                      "batch_id": "019421c8-7a2e-7000-8000-000000000000",
                      "status": "expired",
                      "expires_at": "2026-01-25T12:00:00Z",
                      "is_expired": true
                    }
                  },
                  "not_found": {
                    "summary": "Session not found",
                    "value": {
                      "valid": false,
                      "reason": "Session not found",
                      "batch_id": null,
                      "status": null
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
````