curl --request GET \
--url https://api.baselayer.com/onboarding/sessions/{session_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.baselayer.com/onboarding/sessions/{session_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.baselayer.com/onboarding/sessions/{session_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.baselayer.com/onboarding/sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.baselayer.com/onboarding/sessions/{session_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.baselayer.com/onboarding/sessions/{session_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baselayer.com/onboarding/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": "PENDING",
"reference_id": "<string>",
"verdict": "APPROVED",
"terminal_reason": {
"state": "FAILED",
"message": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}{
"code": 37,
"message": "Forbidden access. The organization is not enrolled in the product this route belongs to.",
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Get a hosted enrollment session
Returns a session’s state, its verdict and terminal_reason once it ends, your reference_id, and when it started and ended. Poll it, or subscribe to the session’s webhooks, to learn when the applicant finishes. The embed link is not returned here: keep the embed_url from the POST /onboarding/sessions response.
This is a hosted enrollment session: the applicant completes your published journey on Baselayer’s page. To verify an identity you collected yourself, use a direct verification, POST /issuance/identities/verifications.
Onboarding must be enabled for your organization. Until it is, this endpoint answers 403 with error code 37.
curl --request GET \
--url https://api.baselayer.com/onboarding/sessions/{session_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.baselayer.com/onboarding/sessions/{session_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.baselayer.com/onboarding/sessions/{session_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.baselayer.com/onboarding/sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.baselayer.com/onboarding/sessions/{session_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.baselayer.com/onboarding/sessions/{session_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baselayer.com/onboarding/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": "PENDING",
"reference_id": "<string>",
"verdict": "APPROVED",
"terminal_reason": {
"state": "FAILED",
"message": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}{
"code": 37,
"message": "Forbidden access. The organization is not enrolled in the product this route belongs to.",
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Response
Successful Response
GET /onboarding/sessions/{session_id}: the session's state, plus its outcome
for a customer. An API key reads it without the fields the public spec
hides; the applicant's embed reads the state alone.
Onboarding session id.
Lifecycle state of the resumable workflow.
PENDING, EXECUTING, WAITING, COMPLETED, FAILED, EXPIRED, CANCELLED Caller-supplied correlation id from session creation.
The effective verdict: your reviewer's decision when one was made, otherwise what the checks concluded; null until the session completes.
APPROVED, UNDER_REVIEW, REJECTED Typed state and detail when the session ended in FAILED; null otherwise.
Show child attributes
Show child attributes
When the session was started.
When the session reached a terminal state; null until then.