DocumentationAPI Reference
DocumentationAPI ReferenceStatus

Resuming Inquiries

Inquiries expire after a time limit to ensure that inquiries are only associated with one individual and cannot be reused. By default, inquiries in the pending state are expired after 24 hours.

You must resume the inquiry in order for the customer to continue the flow.

An expired inquiry can be resumed via API. This allows individuals to continue through flow and submit new verifications. Resuming inquiries is a two step process.

Step 1: Create a Session Token

Call /api/v1/inquiries/<inquiry-id>/resume to receive a session token. Within the response, the session token can be found as session-token within the response's meta object.

require 'http'
response = HTTP.
  headers('Authorization': "Bearer #{api_key}").
  post('https://withpersona.com/api/v1/inquiries/inq_RQ4jHMYx8wHMCSjQ2M43jf4r/resume')
inquiry = JSON.parse(response.body)
import requests
response = requests.post(
  'https://withpersona.com/api/v1/inquiries/inq_RQ4jHMYx8wHMCSjQ2M43jf4r/resume',
  headers: { 'Authorization': 'Bearer {}'.format(api_key) },
)
inquiry = response.json()
const request = require("request");
request.post(
  {
    json: true,
    url: "https://withpersona.com/api/v1/inquiries/inq_RQ4jHMYx8wHMCSjQ2M43jf4r/resume",
    headers: { Authorization: `Bearer ${apiKey}` }
  },
  (err, res, body) => {
    inquiry = res;
  }
);
{
  "data": { ... },
  "meta": {
    "session-token": "SESSION_TOKEN"
  }
}

Step 2: Load the Session

Boot up the flow using both the inquiry ID and session token as parameters. See Embedded or Hosted integrations for additional details.

<script src="https://cdn.withpersona.com/assets/v2/persona.js"></script>

<script>
  const client = new Persona.Client({
    environment: "sandbox",
    inquiryId: "inq_SOME_INQUIRY_ID",
    accessToken: "SOME_SESSION_TOKEN"
    onLoad: (_error) => client.open(),
    onComplete: meta => {
      // Inquiry completed. Optionally tell your server about it.
      console.log(`Sending finished inquiry ${meta.inquiryId} to backend`);
      fetch(`/server-handler?inquiry-id=${meta.inquiryId}`);
    }
  });
</script>