Skip to content
Navigation

Create an embed session

Creates a session for an embedded view and returns its iframe url.

Call this from your backend with your API key. Put url in the src of an iframe on one of the origins pages. The URL carries a short-lived token in its fragment: treat it as a secret, and create a new session for each person and each visit.

A review session binds one extraction run (exr_…) with unit per_document and 1 to 20 of its documents. In write mode the person can edit and approve values. webhook then receives each save and approval.

A transcript or document session binds one ready file, in read mode. transcript needs a transcribed audio file. document needs a PDF, an office file with a preview, or an image.

The session ends at expiresAt: the earliest of now plus ttl and the run expiry. Call DELETE /v1/embeds/{id} to end it sooner.

POST
https://api.cloudraker.com/v1/embeds
Try it
Request body
Live API request

This request can change data or incur charges for the selected organization.

Authorization

  • bearerAuth
    HTTP
    required

Request body JSON required

  • origins
    array of
    string
    required

    The exact origins of the pages that frame the view, such as https://app.example.com. No path, no wildcard, no trailing slash.

    maxLength: 255
  • view
    optional
    review
    or
    transcript
    or
    document

    The embedded view. review shows the results of an extraction run. transcript shows an audio file with its speaker transcript. document shows a PDF, an office file preview or an image. transcript and document are read only.

    default: "review"
  • run
    optional
    object

    The extraction run (exr_…) to review.

    • id
      string
      required
      minLength: 1
  • documents
    optional
    array of
    string

    The file ids of the run to show, in this order. The default is every finished document of the run, in run order.

    minLength: 1
  • file
    optional
    object

    The file to show (transcript and document views).

    • id
      string
      required
      minLength: 1
  • space
    optional
    object

    The space of file (transcript and document views). The default is the files of /v1/files.

    • id
      string
      required
      minLength: 1
  • mode
    optional
    read
    or
    write

    write lets the person edit and approve the values.

    default: "read"
  • user
    optional
    object

    The person who uses the embedded view, as your system knows them. It is stored as claimed and marked unverified. The email is never sent in a webhook or an audit event.

    • id
      string
      required
      maxLength: 128 · minLength: 1
    • name
      string
      required
      maxLength: 120 · minLength: 1
    • email
      optional
      string
      format: email · maxLength: 254 · pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
  • webhook
    optional

    Where to deliver this run's events, given one of two ways.

    • { "url": "…" } — a one-off https endpoint for this run only.
    • { "id": "whe_…" } — a saved endpoint from POST /v1/webhooks. Runs hold the reference, so pausing or re-pointing that endpoint applies to this run too.

    Deliveries are at-least-once and signed — dedupe on eventId and verify against GET /v1/webhooks/jwks.json.

    Any of the following:

    • object
      • url
        string
        required
        format: uri
    • object
      • id
        string
        required
        minLength: 1
  • theme
    optional
    object

    The look of the embedded view. The mode is fixed for the session.

    • mode
      optional
      light
      or
      dark
      default: "light"
    • colors
      optional
      map of
      string

      Hex colors (#rgb, #rgba, #rrggbb or #rrggbbaa) by theme key.

    • radius
      optional
      string

      Corner radius in px or rem, at most 32px or 2rem.

      pattern: ^\d{1,2}(\.\d{1,3})?(px|rem)$
    • font
      optional
      inter
      or
      system
  • locale
    optional
    en
    or
    fr-ca
    default: "en"
  • metadata
    optional
    map of
    unknown

    Arbitrary JSON you attach to the run and get back on every read of it.

    Use it to carry your own identifiers — an order number, a customer id — so a webhook or a polled run reconciles without a lookup table. Capped at 10 KB serialized.

  • ttl
    optional
    integer

    Session lifetime in seconds (60 to 28800). The session also ends when the run expires.

    maximum: 28800 · minimum: 60 · default: 3600

Returns

201

The session, with the iframe url.

JSON
  • object
    string
    required
  • id
    string
    required
  • view
    review
    or
    transcript
    or
    document
    required
  • mode
    read
    or
    write
    required
  • url
    string
    required

    The iframe src. It carries the session token in its fragment: treat it as a secret.

  • documents
    array of
    string
    required
  • expiresAt
    string
    required
  • createdAt
    string
    required
  • run
    optional
    object
    • id
      string
      required
      minLength: 1
  • file
    optional
    object
    • id
      string
      required
      minLength: 1

400

invalid_request: the body failed validation (theme, origins, webhook, ttl, or more than 20 documents).

401

Missing or invalid credential.

403

The credential may not use the /v1 API.

404

not_found: unknown run, file or space.

409

result_not_ready: the run has not finished. review_closed: the review state is gone, or less than 60 seconds remain. file_not_ready: the file is not ready.

410

run_expired: the run expired.

422

unsupported_run: not a per_document extraction run. unknown_document: a documents id is not a finished document of the run. unsupported_file: the file type does not fit the view.

429

Rate limited. The /v1 API allows at least 67 requests per minute per organization (about 1,000 requests per 15 minutes) — a guaranteed floor, enforced per edge location, so a geographically spread caller may get more. Wait for the Retry-After interval and retry — the error is retryable.
JSON
  • code
    rate_limited
    required
  • message
    string
    required
  • retryable
    true
    required
  • requestId
    string
    required
  • docUrl
    optional
    string

503

embed_unconfigured: embeds are not available right now.

Type to search…

↑↓ navigate↵ selectEsc close