Request documents from a customer
curl --request POST \
--url https://app.instantcompliance.ai/api/v1/customers/{id}/document-requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Proof of address",
"items": [
{
"label": "Recent utility bill",
"required": true
}
]
}
'import requests
url = "https://app.instantcompliance.ai/api/v1/customers/{id}/document-requests"
payload = {
"title": "Proof of address",
"items": [
{
"label": "Recent utility bill",
"required": True
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Proof of address',
items: [{label: 'Recent utility bill', required: true}]
})
};
fetch('https://app.instantcompliance.ai/api/v1/customers/{id}/document-requests', 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://app.instantcompliance.ai/api/v1/customers/{id}/document-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Proof of address',
'items' => [
[
'label' => 'Recent utility bill',
'required' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.instantcompliance.ai/api/v1/customers/{id}/document-requests"
payload := strings.NewReader("{\n \"title\": \"Proof of address\",\n \"items\": [\n {\n \"label\": \"Recent utility bill\",\n \"required\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.instantcompliance.ai/api/v1/customers/{id}/document-requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Proof of address\",\n \"items\": [\n {\n \"label\": \"Recent utility bill\",\n \"required\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.instantcompliance.ai/api/v1/customers/{id}/document-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Proof of address\",\n \"items\": [\n {\n \"label\": \"Recent utility bill\",\n \"required\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"note": "<string>",
"status": "PENDING",
"recipient_name": "<string>",
"recipient_email": "<string>",
"requested_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"instructions": "<string>",
"required": true,
"status": "REQUESTED",
"has_upload": true,
"uploaded_at": "2023-11-07T05:31:56Z",
"reviewed_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"code": "unauthorized",
"message": "Invalid or revoked API key."
}
}{
"error": {
"code": "forbidden_scope",
"message": "This API key does not have the required scope. customers:write",
"details": {
"required_scope": "customers:write"
}
}
}{
"error": {
"code": "not_found",
"message": "Customer not found."
}
}{
"error": {
"code": "validation_failed",
"message": "Invalid customer payload.",
"details": {
"issues": {
"email": [
"Must be a valid email address."
]
}
}
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded. Slow down and retry shortly.",
"details": {
"limit": 60,
"window_seconds": 60
}
}
}Customers
Request documents from a customer
Ask the customer for documents — the same flow the in-app “request
documents” action runs. Emails them a secure portal link to upload
against. Provide items inline, or reference a saved package by id.
Requires documents:write.
POST
/
customers
/
{id}
/
document-requests
Request documents from a customer
curl --request POST \
--url https://app.instantcompliance.ai/api/v1/customers/{id}/document-requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Proof of address",
"items": [
{
"label": "Recent utility bill",
"required": true
}
]
}
'import requests
url = "https://app.instantcompliance.ai/api/v1/customers/{id}/document-requests"
payload = {
"title": "Proof of address",
"items": [
{
"label": "Recent utility bill",
"required": True
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Proof of address',
items: [{label: 'Recent utility bill', required: true}]
})
};
fetch('https://app.instantcompliance.ai/api/v1/customers/{id}/document-requests', 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://app.instantcompliance.ai/api/v1/customers/{id}/document-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Proof of address',
'items' => [
[
'label' => 'Recent utility bill',
'required' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.instantcompliance.ai/api/v1/customers/{id}/document-requests"
payload := strings.NewReader("{\n \"title\": \"Proof of address\",\n \"items\": [\n {\n \"label\": \"Recent utility bill\",\n \"required\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.instantcompliance.ai/api/v1/customers/{id}/document-requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Proof of address\",\n \"items\": [\n {\n \"label\": \"Recent utility bill\",\n \"required\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.instantcompliance.ai/api/v1/customers/{id}/document-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Proof of address\",\n \"items\": [\n {\n \"label\": \"Recent utility bill\",\n \"required\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"note": "<string>",
"status": "PENDING",
"recipient_name": "<string>",
"recipient_email": "<string>",
"requested_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"instructions": "<string>",
"required": true,
"status": "REQUESTED",
"has_upload": true,
"uploaded_at": "2023-11-07T05:31:56Z",
"reviewed_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"code": "unauthorized",
"message": "Invalid or revoked API key."
}
}{
"error": {
"code": "forbidden_scope",
"message": "This API key does not have the required scope. customers:write",
"details": {
"required_scope": "customers:write"
}
}
}{
"error": {
"code": "not_found",
"message": "Customer not found."
}
}{
"error": {
"code": "validation_failed",
"message": "Invalid customer payload.",
"details": {
"issues": {
"email": [
"Must be a valid email address."
]
}
}
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded. Slow down and retry shortly.",
"details": {
"limit": 60,
"window_seconds": 60
}
}
}Ask an individual customer for documents — the same flow the in-app “request
documents” action runs, emailing them a secure portal link. Provide items
inline, or reference a saved document
packageId. Requires the
documents:write scope.Authorizations
Bearer API key issued from Settings → Developers in your
Instant Compliance organisation. Format: ic_live_….
Headers
Caller-supplied unique key for safe retries. Repeat the same key within 24 hours and we replay the original response instead of repeating the side effect. Reusing the key with a different request body returns 409 idempotency_conflict.
Maximum string length:
255Path Parameters
Individual customer identifier (UUID or your external_id).
Body
application/json
Response
The document request that was created.
Available options:
PENDING, IN_PROGRESS, SUBMITTED, COMPLETE, CANCELLED Show child attributes
Show child attributes

