Create an embedded session
Creates a session for one component of the account holder and returns its
one-time clientToken. Pass the clientToken from your server to your page,
which hands it to the component; never put it in a URL. The component must be
framed by a page at origin, which must be one of the origins registered for
your platform.
The clientToken can be redeemed once, within 10 minutes. Redeeming it starts
the component, which then runs for at most 30 minutes. A session that ended
cannot be resumed; create a new one. Revoking the API key that created the
session, or changing its permissions, stops the session from being redeemed.
A completed component does not mean that a review passed. Read the account holder for the outcome.
A VERIFICATION_DOCUMENTS session covers every document requirement of the
account holder. Name target.requirementId to limit it to one requirement, or
target.userId to limit it to the requirements of one person of the account
holder. Uploading or submitting documents never approves a verification; only
the review decides it. Once it has submitted documents, the session records
embeddedSession.completed when nothing in its target is left to submit,
and embeddedSession.actionRequired when a requirement in its target is required
again after that.
Authentication
Access token from POST /access-token. Valid for at most 30 minutes.
Headers
Your unique key for this operation: 1 to 255 visible ASCII characters, ideally a new UUID v4 for each operation. A value in double quotes is accepted and the quotes are removed. Retrying with the same key and the same request returns the first response with Idempotent-Replayed: true; the same key with a different request is refused with IDEMPOTENCY_KEY_REUSED. A key can be used again 30 days after its operation completes.
The account holder a platform API key acts on. Platform keys must send it on account holder operations. A company API key acts on its own account holder; it may omit the header or send its own account holder ID.
Your own correlation ID for this request. It is recorded with the request. The X-Request-Id response header is always generated by the server.
Request
The exact origin of the page that frames the component, for example https://app.example.com: scheme and host, a port only when it is not the default, and no path or trailing slash. It must be registered for your platform.
Response headers
Remaining budget for each rate limit policy, for example "burst"; r=57; t=6 (requests remaining and seconds until the window resets).
The rate limit policies applied to this request, for example "burst"; q=60; w=10 (requests allowed per window of seconds).
Path of the resource, relative to the API host, for example /api/v2/embeddedSessions/0b6f3c1e-5d2a-4c8e-9a71-3f4d2e1b6c90.
Sent as true when this response repeats the first response to the same Idempotency-Key. A replay keeps the first response’s status and body, including the requestId of a problem; X-Request-Id is new.
Response
The session and its one-time clientToken.
Always embeddedSession.
true on a live platform in production, false on a Sandbox platform and outside production.
PENDING: the clientToken has not been redeemed.
When the clientToken stops being redeemable.
The one-time credential the component redeems. Keep it out of URLs and logs. It is returned by this response and by its replays for 24 hours; after that a replay omits it, so create a new session.