Update Project Flow
Endpointβ
PUT https://api.verifik.co/v3/project-flows/{id}
Update the configuration of an existing project flow. This endpoint supports partial updates and focuses on personal target flows.
Headersβ
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Paramsβ
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The unique identifier of the project flow to update |
Requestβ
- Node.js
- PHP
- Python
- Go
const fetch = require("node-fetch");
async function run() {
const flowId = "64a1b2c3d4e5f6789012346";
const res = await fetch(`https://api.verifik.co/v3/project-flows/${flowId}`, {
method: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
},
body: JSON.stringify({
documents: {
attemptLimit: 5,
criminalHistoryVerification: true,
verificationMethods: ["SCAN_PROMPT"],
documentTypes: [
{
country: "United States",
configurations: [
{
active: true,
documentCategory: "government_id"
}
]
}
]
}
}),
});
console.log(await res.json());
}
run();
<?php
$flowId = "64a1b2c3d4e5f6789012346";
$ch = curl_init("https://api.verifik.co/v3/project-flows/" . $flowId);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer " . getenv("VERIFIK_TOKEN")
]);
$body = json_encode([
"documents" => [
"attemptLimit" => 5,
"criminalHistoryVerification" => true,
"verificationMethods" => ["SCAN_PROMPT"],
"documentTypes" => [
[
"country" => "United States",
"configurations" => [
[
"active" => true,
"documentCategory" => "government_id"
]
]
]
]
]
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import os, requests
flow_id = "64a1b2c3d4e5f6789012346"
url = f"https://api.verifik.co/v3/project-flows/{flow_id}"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_TOKEN')}"
}
payload = {
"documents": {
"attemptLimit": 5,
"criminalHistoryVerification": True,
"verificationMethods": ["SCAN_PROMPT"],
"documentTypes": [
{
"country": "United States",
"configurations": [
{
"active": True,
"documentCategory": "government_id"
}
]
}
]
}
}
r = requests.put(url, json=payload, headers=headers)
print(r.json())
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
flowId := "64a1b2c3d4e5f6789012346"
payload := map[string]interface{}{
"documents": map[string]interface{}{
"attemptLimit": 5,
"criminalHistoryVerification": true,
"verificationMethods": []string{"SCAN_PROMPT"},
"documentTypes": []map[string]interface{}{
{
"country": "United States",
"configurations": []map[string]interface{}{
{
"active": true,
"documentCategory": "government_id",
},
},
},
},
},
}
b, _ := json.Marshal(payload)
url := fmt.Sprintf("https://api.verifik.co/v3/project-flows/%s", flowId)
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(b))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+os.Getenv("VERIFIK_TOKEN"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var out map[string]interface{}
json.NewDecoder(resp.Body).Decode(&out)
fmt.Println(out)
}
Responseβ
- 200
- 400
- 401/403
- 404
- 409
- 422
{
"data": {
"_id": "64a1b2c3d4e5f6789012346",
"type": "onboarding",
"target": "personal",
"status": "active",
"version": 3,
"redirectUrl": "https://example.com/success",
"webhookUrl": "https://example.com/webhook",
"signUpForm": {
"fullName": true,
"fullNameStyle": "separate",
"email": true,
"emailGateway": "mailgun",
"phone": true,
"phoneGateway": "whatsapp",
"showTermsAndConditions": true,
"showPrivacyNotice": true,
"additionalFields": [],
"allowAdditionalFields": false
},
"documents": {
"attemptLimit": 5,
"criminalHistoryVerification": true,
"informationVerification": true,
"screening": true,
"verificationMethods": ["SCAN_PROMPT"],
"documentTypes": [
{
"country": "United States",
"configurations": [
{
"active": true,
"documentCategory": "government_id",
"documentTemplates": []
}
]
}
]
},
"liveness": {
"attemptLimit": 3,
"minScore": 0.7,
"searchMinScore": 0.85,
"searchMode": "ACCURATE"
},
"steps": {
"document": "mandatory",
"liveness": "mandatory"
},
"integrations": {
"redirectUrl": "https://example.com/success",
"webhook": "64a1b2c3d4e5f6789012347",
"source": "API",
"strategy": "blacklist",
"apiUrl": "https://api.example.com/check",
"apiTestType": "email",
"apiTestValue": "test@example.com"
},
"createdAt": "2023-07-01T10:00:00.000Z",
"updatedAt": "2023-07-01T16:45:00.000Z"
}
}
{
"message": "Invalid project flow ID format",
"code": "BadRequest",
"status": 400,
"timestamp": "2023-07-01T10:00:00.000Z"
}
{
"message": "Access forbidden",
"code": "Forbidden",
"status": 401,
"timestamp": "2023-07-01T10:00:00.000Z"
}
or
{
"message": "Access forbidden",
"code": "Forbidden",
"status": 403,
"timestamp": "2023-07-01T10:00:00.000Z"
}
{
"message": "Project flow not found",
"code": "NotFound",
"status": 404,
"timestamp": "2023-07-01T10:00:00.000Z"
}
{
"message": "Cannot update project flow with active users",
"code": "Conflict",
"status": 409,
"timestamp": "2023-07-01T10:00:00.000Z"
}
{
"message": "Project flow validation failed",
"code": "UnprocessableEntity",
"status": 422,
"timestamp": "2023-07-01T10:00:00.000Z",
"details": [
{
"field": "documents.verificationMethods",
"message": "verificationMethods is required when documents step is not skipped"
}
]
}
Notesβ
- Partial Updates: You can update any combination of fields. Only the fields you specify will be updated; others will remain unchanged.
- Updatable Fields:
status,target,type,version,signUpForm,documents,liveness,steps,integrations. - Document Configuration:
verificationMethodsrequired whensteps.documentis not "skip".attemptLimitmust be between 1 and 5. - Liveness Configuration:
minScoremust be between 0.52 and 0.9;searchMinScorebetween 0.7 and 0.95;attemptLimitbetween 1 and 5. - Integration Configuration:
apiUrl,apiTestType, andapiTestValuerequired whensourceis "API". - Active Flows: Be cautious when updating active project flows, as changes may affect users currently going through the process.
- Validation: All updates are validated against the complete project flow configuration to ensure consistency and proper functionality.