POST/api/clients/{clientId}/identification-requests
Node.js · native fetch
1
2const baseUrl = process.env.CRASSULA_BASE_URL;
3const apiKey = process.env.CRASSULA_API_KEY;
4const clientId = process.env.CRASSULA_CLIENT_ID;
5
6const path = `/api/clients/${encodeURIComponent(clientId)}/identification-requests`;
7const response = await fetch(`${baseUrl}${path}`, {
8 method: 'POST',
9 headers: {
10 Authorization: apiKey,
11 'Content-Type': 'application/json',
12 },
13 body: JSON.stringify({
14 "provider": "sumsub",
15 "type": "main"
16 }),
17});
18
19if (!response.ok) throw new Error(`HTTP ${response.status}`);
20const data = await response.json();
Python · requests
1
2import os
3from urllib.parse import quote
4import requests
5
6base_url = os.environ["CRASSULA_BASE_URL"]
7api_key = os.environ["CRASSULA_API_KEY"]
8client_id = os.environ["CRASSULA_CLIENT_ID"]
9
10path = f'/api/clients/{quote(client_id, safe="")}/identification-requests'
11response = requests.post(
12 f"{base_url}{path}",
13 headers={"Authorization": api_key},
14 json={
15 "provider": "sumsub",
16 "type": "main"
17 },
18 timeout=30,
19)
20response.raise_for_status()
21data = response.json()
Shell · cURL
1
2curl --request POST \
3 "${CRASSULA_BASE_URL}/api/clients/${CRASSULA_CLIENT_ID}/identification-requests" \
4 --header "Authorization: ${CRASSULA_API_KEY}" \
5 --header 'Content-Type: application/json' \
6 --data '{
7 "provider": "sumsub",
8 "type": "main"
9}'