curl -X PATCH 'https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/add-images/' \
-H 'x-api-key: YOUR_API_KEY' \
-F 'file=@./back-of-id.jpg' \
-F 'model_type=kyc'import os
import requests
session_id = '11111111-2222-3333-4444-555555555555'
with open('back-of-id.jpg', 'rb') as fh:
resp = requests.patch(
f'https://verification.didit.me/v3/session/{session_id}/add-images/',
headers={'x-api-key': os.environ['DIDIT_API_KEY']},
files={'file': ('back-of-id.jpg', fh, 'image/jpeg')},
data={'model_type': 'kyc'},
timeout=10,
)
resp.raise_for_status()
print(resp.json()['extra_files'])import { readFile } from 'node:fs/promises';
const sessionId = '11111111-2222-3333-4444-555555555555';
const form = new FormData();
form.append('file', new Blob([await readFile('./back-of-id.jpg')], { type: 'image/jpeg' }), 'back-of-id.jpg');
form.append('model_type', 'kyc');
const resp = await fetch(`https://verification.didit.me/v3/session/${sessionId}/add-images/`, {
method: 'PATCH',
headers: { 'x-api-key': process.env.DIDIT_API_KEY },
body: form,
});
if (!resp.ok) throw new Error(`Upload failed: ${resp.status}`);
const { extra_files: extraFiles } = await resp.json();
console.log(extraFiles);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://verification.didit.me/v3/session/{sessionId}/add-images/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_type\"\r\n\r\nkyc\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data; boundary=---011000010111000001101001",
"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://verification.didit.me/v3/session/{sessionId}/add-images/"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_type\"\r\n\r\nkyc\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://verification.didit.me/v3/session/{sessionId}/add-images/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_type\"\r\n\r\nkyc\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://verification.didit.me/v3/session/{sessionId}/add-images/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_type\"\r\n\r\nkyc\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"extra_files": [
"https://media.example.com/session/11111111-2222-3333-4444-555555555555/kyc-extra-files/66666666-7777-8888-9999-000000000000.jpg?expires=1789383731&signature=abc123"
]
}Add Images to a Session
Attach an extra image or PDF to the ID verification or Proof of Address result of a finished KYC session, for example a document’s back side.
curl -X PATCH 'https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/add-images/' \
-H 'x-api-key: YOUR_API_KEY' \
-F 'file=@./back-of-id.jpg' \
-F 'model_type=kyc'import os
import requests
session_id = '11111111-2222-3333-4444-555555555555'
with open('back-of-id.jpg', 'rb') as fh:
resp = requests.patch(
f'https://verification.didit.me/v3/session/{session_id}/add-images/',
headers={'x-api-key': os.environ['DIDIT_API_KEY']},
files={'file': ('back-of-id.jpg', fh, 'image/jpeg')},
data={'model_type': 'kyc'},
timeout=10,
)
resp.raise_for_status()
print(resp.json()['extra_files'])import { readFile } from 'node:fs/promises';
const sessionId = '11111111-2222-3333-4444-555555555555';
const form = new FormData();
form.append('file', new Blob([await readFile('./back-of-id.jpg')], { type: 'image/jpeg' }), 'back-of-id.jpg');
form.append('model_type', 'kyc');
const resp = await fetch(`https://verification.didit.me/v3/session/${sessionId}/add-images/`, {
method: 'PATCH',
headers: { 'x-api-key': process.env.DIDIT_API_KEY },
body: form,
});
if (!resp.ok) throw new Error(`Upload failed: ${resp.status}`);
const { extra_files: extraFiles } = await resp.json();
console.log(extraFiles);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://verification.didit.me/v3/session/{sessionId}/add-images/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_type\"\r\n\r\nkyc\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data; boundary=---011000010111000001101001",
"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://verification.didit.me/v3/session/{sessionId}/add-images/"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_type\"\r\n\r\nkyc\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://verification.didit.me/v3/session/{sessionId}/add-images/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_type\"\r\n\r\nkyc\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://verification.didit.me/v3/session/{sessionId}/add-images/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_type\"\r\n\r\nkyc\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"extra_files": [
"https://media.example.com/session/11111111-2222-3333-4444-555555555555/kyc-extra-files/66666666-7777-8888-9999-000000000000.jpg?expires=1789383731&signature=abc123"
]
}extra_files expire. Read fresh ones from the session decision when you need the files later. To correct the data extracted from a document instead, use Update session data.Authorizations
Your application's API key, from Developers -> API keys in the Business Console. The primary key has full access. A named key can be scoped: none, read or write per resource, limited to some workflows or to approved sessions, to a list of IP addresses, and to an expiry date. 401 means the key is missing, wrong, revoked or expired; 403 means the key has no access to this resource or action, or the request came from an address outside its IP list; 404 on a session route means the session is outside the key's workflows or statuses. A key without media access receives image, video and PDF URLs as null, and a key without sessions write receives session links and tokens as null. See https://docs.didit.me/console/api-keys.
Path Parameters
UUID of the User Verification (KYC) session to add the file to (the session_id returned by POST /v3/session/). A Business Verification (KYB) session ID returns 404.
"11111111-2222-3333-4444-555555555555"
Body
The image or PDF. Allowed extensions: jpg, jpeg, png, webp, tiff, pdf. At most 15 MB as uploaded; the file is then compressed and rejected with 400 if it is still larger than 2 MB (2,097,152 bytes). Empty files are rejected.
kyc adds the file to the ID verification result, poa to the Proof of Address result.
kyc, poa "kyc"
Password of an encrypted PDF. Without it, or with a wrong one, an encrypted PDF returns 400.
Response
File added. Returns every extra file of that result, including the new one.
Short-lived presigned links to all extra files of the result named by model_type, oldest first. Each link is null for a scoped API key without media: read. Read fresh links from the session decision later.