cURL
curl --request POST \
--url https://api.readyhealth.com/document/scan/async \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form external_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form file='@example-file' \
--form validation=true \
--form 'context={
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-12-25",
"requirement": "<string>",
"source_validation": true
}'import requests
url = "https://api.readyhealth.com/document/scan/async"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"external_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"validation": "true",
"context": "{
\"first_name\": \"<string>\",
\"middle_name\": \"<string>\",
\"last_name\": \"<string>\",
\"date_of_birth\": \"2023-12-25\",
\"requirement\": \"<string>\",
\"source_validation\": true
}"
}
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('external_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('file', '<string>');
form.append('validation', 'true');
form.append('context', '{
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-12-25",
"requirement": "<string>",
"source_validation": true
}');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.readyhealth.com/document/scan/async', 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.readyhealth.com/document/scan/async",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"validation\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"context\"\r\n\r\n{\r\n \"first_name\": \"<string>\",\r\n \"middle_name\": \"<string>\",\r\n \"last_name\": \"<string>\",\r\n \"date_of_birth\": \"2023-12-25\",\r\n \"requirement\": \"<string>\",\r\n \"source_validation\": true\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.readyhealth.com/document/scan/async"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"validation\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"context\"\r\n\r\n{\r\n \"first_name\": \"<string>\",\r\n \"middle_name\": \"<string>\",\r\n \"last_name\": \"<string>\",\r\n \"date_of_birth\": \"2023-12-25\",\r\n \"requirement\": \"<string>\",\r\n \"source_validation\": true\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.readyhealth.com/document/scan/async")
.header("x-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"validation\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"context\"\r\n\r\n{\r\n \"first_name\": \"<string>\",\r\n \"middle_name\": \"<string>\",\r\n \"last_name\": \"<string>\",\r\n \"date_of_birth\": \"2023-12-25\",\r\n \"requirement\": \"<string>\",\r\n \"source_validation\": true\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.readyhealth.com/document/scan/async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"validation\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"context\"\r\n\r\n{\r\n \"first_name\": \"<string>\",\r\n \"middle_name\": \"<string>\",\r\n \"last_name\": \"<string>\",\r\n \"date_of_birth\": \"2023-12-25\",\r\n \"requirement\": \"<string>\",\r\n \"source_validation\": true\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "123",
"scanStatus": "PENDING",
"fields": null,
"validations": null
}Scans
Create a Document Scan
Asynchronously scan a document using form-data upload
POST
/
document
/
scan
/
async
cURL
curl --request POST \
--url https://api.readyhealth.com/document/scan/async \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form external_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form file='@example-file' \
--form validation=true \
--form 'context={
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-12-25",
"requirement": "<string>",
"source_validation": true
}'import requests
url = "https://api.readyhealth.com/document/scan/async"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"external_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"validation": "true",
"context": "{
\"first_name\": \"<string>\",
\"middle_name\": \"<string>\",
\"last_name\": \"<string>\",
\"date_of_birth\": \"2023-12-25\",
\"requirement\": \"<string>\",
\"source_validation\": true
}"
}
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('external_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('file', '<string>');
form.append('validation', 'true');
form.append('context', '{
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-12-25",
"requirement": "<string>",
"source_validation": true
}');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.readyhealth.com/document/scan/async', 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.readyhealth.com/document/scan/async",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"validation\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"context\"\r\n\r\n{\r\n \"first_name\": \"<string>\",\r\n \"middle_name\": \"<string>\",\r\n \"last_name\": \"<string>\",\r\n \"date_of_birth\": \"2023-12-25\",\r\n \"requirement\": \"<string>\",\r\n \"source_validation\": true\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.readyhealth.com/document/scan/async"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"validation\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"context\"\r\n\r\n{\r\n \"first_name\": \"<string>\",\r\n \"middle_name\": \"<string>\",\r\n \"last_name\": \"<string>\",\r\n \"date_of_birth\": \"2023-12-25\",\r\n \"requirement\": \"<string>\",\r\n \"source_validation\": true\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.readyhealth.com/document/scan/async")
.header("x-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"validation\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"context\"\r\n\r\n{\r\n \"first_name\": \"<string>\",\r\n \"middle_name\": \"<string>\",\r\n \"last_name\": \"<string>\",\r\n \"date_of_birth\": \"2023-12-25\",\r\n \"requirement\": \"<string>\",\r\n \"source_validation\": true\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.readyhealth.com/document/scan/async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"external_id\"\r\n\r\n3c90c3cc-0d44-4b50-8888-8dd25736052a\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"validation\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"context\"\r\n\r\n{\r\n \"first_name\": \"<string>\",\r\n \"middle_name\": \"<string>\",\r\n \"last_name\": \"<string>\",\r\n \"date_of_birth\": \"2023-12-25\",\r\n \"requirement\": \"<string>\",\r\n \"source_validation\": true\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "123",
"scanStatus": "PENDING",
"fields": null,
"validations": null
}Authorizations
Body
multipart/form-data
UUID of the document owner
The document as a binary file stream
If set to true, a contextually relevant set of validations will be returned. Default is set to false and will not return any validations.
These fields are required only if validation: true.
Show child attributes
Show child attributes
Response
201 - application/json
The document is pending processing.
Candidate information
Show child attributes
Show child attributes
One of VALID or INVALID
One of PENDING, IN_PROGRESS, FAILED or SUCCESS.
See the document field schema for the attributes to expect once the latest scan is complete.
See the document validations schema for the objects to expect once the latest validation is complete.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I