TrustWixDocs
API reference

Flows

GET
/v1/flows

Your saved flows FOR THE CALLING KEY'S ENVIRONMENT, archived ones included, since an archived flow still explains the verifications that ran through it. A flow belongs to one environment: a test key lists and creates sandbox flows, a live key live ones, and a flow id from the other environment is a 404. Cursor-paginated, newest first. limit accepts 1 to 100 and defaults to 20. To walk further, set starting_after to the id of the last record on the page you just read. has_more tells you another page exists and next_cursor is the value to pass back; on the last page has_more is false and next_cursor is null. An unknown cursor is ignored and you get the first page. Requires the settings:read permission on the calling key.

Authorization

secretKey
AuthorizationBearer <token>

Secret API key, server-side only. Example: Bearer TWK_...

In: header

Query Parameters

limit?integer

How many records to return. 1 to 100, defaults to 20.

Range1 <= value <= 100
Default20
starting_after?string

A flow id; returns the page after it.

Match^flw_

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/flows"
{  "object": "list",  "data": [    {      "id": "string",      "object": "flow",      "name": "string",      "steps": [        {          "type": "liveness",          "required": true,          "sensitivity": 0,          "threshold": 0,          "config": {            "ageRules": [              {                "fromAge": 0,                "toAge": 0,                "action": "reject"              }            ],            "ageRuleFallback": "pass"          }        }      ],      "is_default": true,      "status": "active",      "sensitivity": 0,      "brand_name": "string",      "logo_url": "http://example.com",      "accent_color": "string",      "support_url": "http://example.com",      "languages": [        "string"      ],      "default_email_locale": "string",      "country_policy": {        "allow": [          "string"        ],        "block": [          "string"        ],        "review": [          "string"        ],        "gate_before_start": true,        "blocked_mode": "run_and_decide",        "blocked_disposition": "reject"      },      "network_policy": {        "enabled": true,        "on_proxy": "ignore",        "on_ip_change": "ignore",        "exempt_countries": [          "string"        ]      },      "expiry_policy": {        "default": "reject",        "rules": [          {            "country": "string",            "document_type": "*",            "disposition": "reject"          }        ]      },      "policy_tree": {        "by_country": {          "property1": {            "by_document_type": {              "property1": {                "sensitivity": 0,                "sensitivity_by_check": {                  "property1": 0,                  "property2": 0                },                "findings": {                  "property1": {                    "disposition": "reject",                    "threshold": 0,                    "note": "string",                    "expires_at": "2019-08-24T14:15:22Z"                  },                  "property2": {                    "disposition": "reject",                    "threshold": 0,                    "note": "string",                    "expires_at": "2019-08-24T14:15:22Z"                  }                }              },              "property2": {                "sensitivity": 0,                "sensitivity_by_check": {                  "property1": 0,                  "property2": 0                },                "findings": {                  "property1": {                    "disposition": "reject",                    "threshold": 0,                    "note": "string",                    "expires_at": "2019-08-24T14:15:22Z"                  },                  "property2": {                    "disposition": "reject",                    "threshold": 0,                    "note": "string",                    "expires_at": "2019-08-24T14:15:22Z"                  }                }              }            },            "sensitivity": 0,            "sensitivity_by_check": {              "property1": 0,              "property2": 0            },            "findings": {              "property1": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              },              "property2": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              }            }          },          "property2": {            "by_document_type": {              "property1": {                "sensitivity": 0,                "sensitivity_by_check": {                  "property1": 0,                  "property2": 0                },                "findings": {                  "property1": {                    "disposition": "reject",                    "threshold": 0,                    "note": "string",                    "expires_at": "2019-08-24T14:15:22Z"                  },                  "property2": {                    "disposition": "reject",                    "threshold": 0,                    "note": "string",                    "expires_at": "2019-08-24T14:15:22Z"                  }                }              },              "property2": {                "sensitivity": 0,                "sensitivity_by_check": {                  "property1": 0,                  "property2": 0                },                "findings": {                  "property1": {                    "disposition": "reject",                    "threshold": 0,                    "note": "string",                    "expires_at": "2019-08-24T14:15:22Z"                  },                  "property2": {                    "disposition": "reject",                    "threshold": 0,                    "note": "string",                    "expires_at": "2019-08-24T14:15:22Z"                  }                }              }            },            "sensitivity": 0,            "sensitivity_by_check": {              "property1": 0,              "property2": 0            },            "findings": {              "property1": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              },              "property2": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              }            }          }        },        "legacy_by_document_type": {          "property1": {            "sensitivity": 0,            "sensitivity_by_check": {              "property1": 0,              "property2": 0            },            "findings": {              "property1": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              },              "property2": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              }            }          },          "property2": {            "sensitivity": 0,            "sensitivity_by_check": {              "property1": 0,              "property2": 0            },            "findings": {              "property1": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              },              "property2": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              }            }          }        },        "sensitivity": 0,        "sensitivity_by_check": {          "property1": 0,          "property2": 0        },        "findings": {          "property1": {            "disposition": "reject",            "threshold": 0,            "note": "string",            "expires_at": "2019-08-24T14:15:22Z"          },          "property2": {            "disposition": "reject",            "threshold": 0,            "note": "string",            "expires_at": "2019-08-24T14:15:22Z"          }        }      },      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "has_more": true,  "next_cursor": "string"}
GET
/v1/flows/{id}

Requires the settings:read permission on the calling key.

Authorization

secretKey
AuthorizationBearer <token>

Secret API key, server-side only. Example: Bearer TWK_...

In: header

Path Parameters

id*string

The flow id.

Match^flw_

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/flows/string"
{  "id": "string",  "object": "flow",  "name": "string",  "steps": [    {      "type": "liveness",      "required": true,      "sensitivity": 0,      "threshold": 0,      "config": {        "ageRules": [          {            "fromAge": 0,            "toAge": 0,            "action": "reject"          }        ],        "ageRuleFallback": "pass"      }    }  ],  "is_default": true,  "status": "active",  "sensitivity": 0,  "brand_name": "string",  "logo_url": "http://example.com",  "accent_color": "string",  "support_url": "http://example.com",  "languages": [    "string"  ],  "default_email_locale": "string",  "country_policy": {    "allow": [      "string"    ],    "block": [      "string"    ],    "review": [      "string"    ],    "gate_before_start": true,    "blocked_mode": "run_and_decide",    "blocked_disposition": "reject"  },  "network_policy": {    "enabled": true,    "on_proxy": "ignore",    "on_ip_change": "ignore",    "exempt_countries": [      "string"    ]  },  "expiry_policy": {    "default": "reject",    "rules": [      {        "country": "string",        "document_type": "*",        "disposition": "reject"      }    ]  },  "policy_tree": {    "by_country": {      "property1": {        "by_document_type": {          "property1": {            "sensitivity": 0,            "sensitivity_by_check": {              "property1": 0,              "property2": 0            },            "findings": {              "property1": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              },              "property2": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              }            }          },          "property2": {            "sensitivity": 0,            "sensitivity_by_check": {              "property1": 0,              "property2": 0            },            "findings": {              "property1": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              },              "property2": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              }            }          }        },        "sensitivity": 0,        "sensitivity_by_check": {          "property1": 0,          "property2": 0        },        "findings": {          "property1": {            "disposition": "reject",            "threshold": 0,            "note": "string",            "expires_at": "2019-08-24T14:15:22Z"          },          "property2": {            "disposition": "reject",            "threshold": 0,            "note": "string",            "expires_at": "2019-08-24T14:15:22Z"          }        }      },      "property2": {        "by_document_type": {          "property1": {            "sensitivity": 0,            "sensitivity_by_check": {              "property1": 0,              "property2": 0            },            "findings": {              "property1": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              },              "property2": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              }            }          },          "property2": {            "sensitivity": 0,            "sensitivity_by_check": {              "property1": 0,              "property2": 0            },            "findings": {              "property1": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              },              "property2": {                "disposition": "reject",                "threshold": 0,                "note": "string",                "expires_at": "2019-08-24T14:15:22Z"              }            }          }        },        "sensitivity": 0,        "sensitivity_by_check": {          "property1": 0,          "property2": 0        },        "findings": {          "property1": {            "disposition": "reject",            "threshold": 0,            "note": "string",            "expires_at": "2019-08-24T14:15:22Z"          },          "property2": {            "disposition": "reject",            "threshold": 0,            "note": "string",            "expires_at": "2019-08-24T14:15:22Z"          }        }      }    },    "legacy_by_document_type": {      "property1": {        "sensitivity": 0,        "sensitivity_by_check": {          "property1": 0,          "property2": 0        },        "findings": {          "property1": {            "disposition": "reject",            "threshold": 0,            "note": "string",            "expires_at": "2019-08-24T14:15:22Z"          },          "property2": {            "disposition": "reject",            "threshold": 0,            "note": "string",            "expires_at": "2019-08-24T14:15:22Z"          }        }      },      "property2": {        "sensitivity": 0,        "sensitivity_by_check": {          "property1": 0,          "property2": 0        },        "findings": {          "property1": {            "disposition": "reject",            "threshold": 0,            "note": "string",            "expires_at": "2019-08-24T14:15:22Z"          },          "property2": {            "disposition": "reject",            "threshold": 0,            "note": "string",            "expires_at": "2019-08-24T14:15:22Z"          }        }      }    },    "sensitivity": 0,    "sensitivity_by_check": {      "property1": 0,      "property2": 0    },    "findings": {      "property1": {        "disposition": "reject",        "threshold": 0,        "note": "string",        "expires_at": "2019-08-24T14:15:22Z"      },      "property2": {        "disposition": "reject",        "threshold": 0,        "note": "string",        "expires_at": "2019-08-24T14:15:22Z"      }    }  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
POST
/v1/flows/{id}/preview

Mint a throwaway session on this flow and get the hosted URL for it, so you can walk the flow exactly as an applicant sees it before pointing real traffic at it.

The session is always in sandbox mode, whichever key you call with, so a preview never meters as live traffic or shows up next to real applicants. It expires in 30 minutes rather than the 24 hours a real session gets, and the url already carries the token the hosted page needs, so it is ready to open.

An archived flow returns 400 FLOW_ARCHIVED, and a flow with no steps yet returns 400 FLOW_EMPTY.

Requires the verification:create permission on the calling key.

Authorization

secretKey
AuthorizationBearer <token>

Secret API key, server-side only. Example: Bearer TWK_...

In: header

Path Parameters

id*string

The flow id.

Match^flw_

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/flows/string/preview"
{  "id": "string",  "object": "flow_preview",  "flow": "string",  "mode": "sandbox",  "url": "http://example.com",  "client_token": "string",  "expires_at": "2019-08-24T14:15:22Z"}