# Load a page, popup or banner

Operation / SDK: `resolveContent` · `resolve_content` · `ResolveContent`

Resolve standalone Page, Popup or Banner content by resource or fixed version; the host explicitly mounts it and handles actions.

Last updated: 2026-11-05

[Web version](https://www.longplayai.com/docs/api/resolve-content)

<a id="request"></a>

## Request

- **Credential**: Server Key (with `customerId`) or Customer Token, scope `content:read`.
- **SDK**: JavaScript `createLongplayServer().resolveContent` · JavaScript `createLongplay().resolveContent` · Python `resolve_content` · Go `ResolveContent`
- **Success**: HTTP 200

The response shows example data.

**cURL: request.sh**

```bash
curl -X POST "$LONGPLAY_API_URL/api/v1/content/resolve" \
  -H "Authorization: Bearer $LONGPLAY_SERVER_KEY" \
  -H "X-Indiana-Protocol: 0.10" \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "page",
  "selector": {
    "type": "resource",
    "id": "ddff7ca6-bfe7-445e-81a6-ca13bbf64a41"
  },
  "customerId": "8b258f8b-4228-40fa-8d24-5b16428e686d"
}'
```

**TypeScript: resolveContent.ts**

```ts
import { createLongplayServer } from "@tinkerlandai/longplay-sdk/server";

const longplay = createLongplayServer({
  baseUrl: process.env.LONGPLAY_API_URL!,
  apiKey: process.env.LONGPLAY_SERVER_KEY!,
  scope: { projectId: process.env.LONGPLAY_PROJECT_ID!, environment: "sandbox" },
});

export async function resolveContent() {
  return longplay.resolveContent({
    kind: "page",
    selector: {
      type: "resource",
      id: "ddff7ca6-bfe7-445e-81a6-ca13bbf64a41",
    },
    customerId: "8b258f8b-4228-40fa-8d24-5b16428e686d",
  });
}
```

**Request body: request.json**

```json
{
  "kind": "page",
  "selector": {
    "type": "resource",
    "id": "ddff7ca6-bfe7-445e-81a6-ca13bbf64a41"
  },
  "customerId": "8b258f8b-4228-40fa-8d24-5b16428e686d"
}
```

**Response: response.json**

```json
{
  "requestId": "44f5fcb8-6ed8-41b8-818f-7571941c5fd5",
  "scope": {
    "projectId": "df5426d6-b335-403c-8f3e-b0f73d2e3511",
    "environment": "sandbox"
  },
  "content": {
    "id": "8f927788-da75-46cc-8159-0491ab40c155",
    "kind": "page",
    "resourceId": "79322b17-a312-485e-8033-b532cdc16fe9",
    "projectId": "7ef5bbb4-a4fc-4e78-83f3-81854bb3b42d",
    "environmentId": "c109bd50-5064-4390-8761-1589f2515d2d",
    "version": 1,
    "sourceRevision": 0,
    "document": {
      "kind": "page",
      "schemaVersion": 1,
      "name": "Welcome",
      "screen": {
        "kind": "screen",
        "schemaVersion": 4,
        "theme": {
          "primary": "#2C3C96",
          "background": "#FFFFFF",
          "text": "#1B1D24",
          "radius": "md",
          "font": "system"
        },
        "name": "Welcome",
        "surface": "page",
        "presentation": {
          "type": "fullscreen"
        },
        "pages": [
          {
            "id": "main",
            "name": "Main page",
            "root": {
              "type": "stack",
              "id": "root",
              "direction": "vertical",
              "align": "stretch",
              "justify": "start",
              "name": "Canvas",
              "style": {
                "gap": 16,
                "padding": {
                  "top": 24,
                  "right": 24,
                  "bottom": 24,
                  "left": 24
                }
              },
              "children": []
            }
          }
        ],
        "strings": {
          "defaultLocale": "en",
          "locales": {
            "en": {}
          }
        },
        "actions": []
      },
      "contract": {
        "inputs": {},
        "outputs": {}
      }
    },
    "createdAt": "2026-10-03T12:00:00.000Z"
  }
}
```

<a id="parameters"></a>

## Body parameters

**application/json**

- `kind` (enum, required): Kind; see the allowed values. Values: `"page"`, `"popup"`, `"banner"`.
- `selector` (object | object, required): How to select the Offering or Paywall.
- `selector.type` ("resource" | "version", required): Selection mode. For an Offering, `current` (the environment's current Offering), `id` and `lookup_key` resolve that Offering's published Version and `version` pins an exact Offering Version; for a Paywall, `paywall` resolves its published Version and `version` pins an exact Paywall Version. For a Page, Popup or Banner, `resource` resolves its currently published Version and `version` pins a published Version.
- `selector.id` (uuid | uuid, required): Offering UUID in an Offering selector. For a Page, Popup or Banner, the resource or published Version UUID selected by selector.type; an archived or unpublished resource returns not found.
- `customerId` (string, optional): The Customer UUID. Required with a Server Key; omit it with a Customer Token. minLength: 1

<a id="response"></a>

## Response fields

Every successful response includes `requestId` (this request's ID, for support) and `scope` (App and environment).

**HTTP 200 · application/json**

- `requestId` (uuid, required): UUID the server generated for this HTTP request; include it when reporting a problem. It is not your business requestId.
- `scope` (object, required): The App and environment of this response. Headers only verify scope; they cannot switch key scope.
- `scope.projectId` (string, required): App ID bound to the credential. minLength: 1
- `scope.environment` (enum, required): Separate data scope: sandbox or live. Values: `"sandbox"`, `"live"`.
- `content` (object, required): The immutable version of a standalone Page, Popup or Banner.
- `content.id` (uuid, required): UUID of the returned content version.
- `content.kind` (enum, required): Kind; see the allowed values. Values: `"page"`, `"popup"`, `"banner"`.
- `content.resourceId` (uuid, required): UUID of the standalone resource that owns this content.
- `content.projectId` (uuid, required): App ID bound to the credential.
- `content.environmentId` (uuid, required): environment ID.
- `content.version` (integer, required): Version number. max: 9007199254740991
- `content.sourceRevision` (integer, required): Resource draft revision captured when this version was published. min: 0 · max: 9007199254740991
- `content.document` (object, required): Published schemaVersion 3 design. May be null on a cache hit; direct HTTP callers must hydrate from the matching cache.
- `content.document.kind` (enum, required): Kind; see the allowed values. Values: `"page"`, `"popup"`, `"banner"`.
- `content.document.schemaVersion` (1, required): Data format version.
- `content.document.name` (string, required): Display name; not a unique identifier. minLength: 1 · maxLength: 80
- `content.document.screen` (object, required): The screen document rendered by the SDK.
- `content.document.screen.kind` ("screen", required): Kind; see the allowed values.
- `content.document.screen.schemaVersion` (4, required): Data format version.
- `content.document.screen.name` (string, required): Display name; not a unique identifier. minLength: 1 · maxLength: 80
- `content.document.screen.surface` (enum, required): Page, Popup or Banner surface; it matches the content kind. Values: `"popup"`, `"paywall"`, `"onboarding"`, `"page"`, `"banner"`.
- `content.document.screen.initialPageId` (string, optional): ID of the internal page shown when this screen opens. pattern: ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$
- `content.document.screen.presentation` (object | object | object | object, required): Presentation.
- `content.document.screen.theme` (object, required): Colors, corner radius and font used by this screen.
- `content.document.screen.pages` (array, required): Pages and component trees within this screen. minItems: 1 · maxItems: 10
- `content.document.screen.strings` (object, required): Default language, supplied languages and their localized string tables.
- `content.document.screen.actions` (array, required): Declared interaction actions available on this screen. maxItems: 40
- `content.document.contract` (object, required): Input and output types this standalone content declares to its host.
- `content.document.contract.inputs` (object, required): Variables the host can supply, including their value types and required status.
- `content.document.contract.outputs` (object, required): Types of event values this content can emit to its host.
- `content.createdAt` (date-time, required): ISO 8601 UTC time when the record was created.

<a id="errors"></a>

## Errors

Failures return an error object; handle them by `error.code` and `error.recovery`. The table lists the errors that follow from this operation's credential, scope and idempotency fields; depending on the request it can also return `NOT_FOUND` (a referenced resource doesn't exist), `NOT_CONFIGURED` (a required integration isn't connected) or `PAYLOAD_TOO_LARGE`. Some refusals, such as insufficient balance, are not errors but a `reason` in a successful response.

**Possible errors**

| code | HTTP | When | recovery |
| --- | --- | --- | --- |
| `INVALID_REQUEST` | 400 | The request doesn't match this page's parameters. A missing or malformed protocol header returns `UNSUPPORTED_PROTOCOL_VERSION` or `INVALID_PROTOCOL_VERSION` instead. | `fix_request` |
| `UNAUTHENTICATED` | 401 | The credential is missing, invalid, expired or revoked. | `authenticate` |
| `FORBIDDEN` | 403 | The credential lacks `content:read`. | `check_permissions` |
| `SCOPE_MISMATCH` | 403 | `X-Indiana-Project` or `X-Indiana-Environment` doesn't match the credential's App and environment. | `check_scope` |
| `RATE_LIMITED` | 429 | Too many requests; wait for `Retry-After` and retry the same request. | `retry_same_request` |
| `SERVICE_UNAVAILABLE` | 503 | The service is temporarily unavailable; retry the same request. | `retry_same_request` |
| `INTERNAL_ERROR` | 500 | The outcome is unknown; retry later. | `recover_operation` |

- [Error codes and recovery](https://www.longplayai.com/docs/api/errors.md)
- [Request conventions](https://www.longplayai.com/docs/api.md)
- [All operations](https://www.longplayai.com/docs/api/operations.md#integration)
