Fill a credential

Changed on

Types a secret, a vault's entries, or fields read from 1Password into inputs on a page in the session. The values are decrypted on the session's host; neither the request nor the response contains them. Fill only types: it never submits, so click the submit button or press Enter afterwards. Nothing is typed unless the target frame is on an allowed origin of every secret being filled, or for onePassword on one of the request's allowedOrigins. A totp secret types the code current at fill time. A fill is safe to retry. Without pageId, Hyperbrowser considers the tabs whose URL starts with pageUrl (if given). If one is left, it's the target. If several are left, it prefers the tabs on an origin every secret (or onePassword.allowedOrigins) allows, unless frame is given, then the visible one among them; if more than one still qualifies, it returns 409 CREDENTIAL_PAGE_AMBIGUOUS listing the tabs. The chosen tab's origin is then checked, and a tab outside the allowed origins gets 403 CREDENTIAL_ORIGIN_NOT_ALLOWED with nothing typed. Requires an active Firecracker browser session created with these secrets, or the onePassword token, in credentials. Secrets are enabled for teams on request; please contact support to enable them (otherwise 403 SECRETS_FEATURE_DISABLED). Restricted API keys need both the browser.sessions.update and secrets.use scopes. A fill can take up to about 18 seconds, so set your client timeout to at least 30 seconds. Fills and refusals are recorded in the session's event logs as credential_filled and credential_fill_refused, with credential, vault, or for 1Password the token's name as onePasswordToken, and never values.

post/api/session/{id}/credentials/fill

Request

Path parameters

idstring uuid required

Session ID.

Request body

credentialstring

A secret's name or ID (names are matched first). It must have been attached to the session when the session was created, directly or through a vault. Each field then has only a selector.

vaultstring

A vault's name. Each field's field names the entry whose secret is typed; the entry's secret must have been attached when the session was created.

pageIdstring

CDP target ID of the tab to fill, at most 128 UTF-8 bytes. Pass it, or pageUrl, when more than one tab could be the target. Not with pageUrl.

pageUrlstring

Fill the tab whose URL starts with this prefix, at most 2048 UTF-8 bytes, instead of naming its pageId. Not with pageId.

Example request

{
  "onePassword": {
    "allowedOrigins": [
      "https://www.scrapingcourse.com"
    ]
  }
}

Response

Success

versioninteger

The secret version filled, for credential fills only. Absent for vault and onePassword fills, whose fields each report their own.

pageIdstring required

CDP target ID of the tab filled.

originstring required

Origin of the frame filled.

Example response

{
  "fields": [
    {
      "reference": "op://Dev Vault for Testing/scrapingcourse login/username"
    }
  ]
}

Changes

    • breaking

      the / request property type changed from string to no type

    • info

      added subschema #1 to the / request property oneOf list

    • info

      removed the pattern ^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$ from the request property /

    • info

      added the new optional request property //

    • info

      added the new optional request property

    • info

      added the non-success response with the status

    • info

      added the optional property // to the response with the status