Completes a flow from List Flows in one
request and one database transaction, as the API key’s member submitting it in
the app would: the flow checks the answers, matches the contact details and
commits its event and journey status. A refused submission leaves nothing
behind. This operation is not idempotent; do not blindly retry it.
For the create prospect flow, the submission starts the flow on a new contact,
as the toolbar does, and makes a prospect of it with the flow’s
flow.events.prospect_created event and journey status. Contact details (email
address or phone number) of an existing customer or prospect the API key may
edit make no second record: the submission is recorded there, opening a new
prospect next to its others with the answers kept on the run, and returns
200 OK with created: false; the record’s fields are left as they are.
Contact details of a record the key may not edit are refused with
already_exists (409) and nothing is created.
answers holds the form’s answers keyed by each question’s key, with the
values the form stores. input holds the flow’s own inputs; unknown keys and
values of the wrong JSON type are refused.
result is the flow’s own outcome; the create prospect flow returns
customer_id, is_prospect, prospect_id and existing_contact.
Refusals carry a Connect error code:
Code
HTTP
When
invalid_argument
400
A required answer or input is missing, an input is unknown or of the wrong type, the prospect source is unknown or archived, or the contact person has no email address or valid phone number
permission_denied
403
The actor may not start the flow
not_found
404
The flow is missing, archived or not enabled
already_exists
409
The contact details belong to an existing customer or prospect the API key may not edit
failed_precondition
412
The contact details belong to a customer on hold that blocks the flow
failed_precondition
400
The flow’s type cannot be used through the API, or the flow cannot start now (for example an incomplete setup)
Generated Reference
POST/public-api/publicapi.v1.Flow/SubmitFlow
Completes a flow from ListApiFlows in one request and one database transaction, as a member submitting it would: the flow checks the answers, matches the contact details and commits its event. A refused submission leaves nothing behind. Contact details of an existing customer or prospect the API key may edit make no new record: the prospect flow records the submission there, opening a new prospect next to its others and leaving its fields as they are (created false); one the key may not edit is refused (409). This operation is not idempotent.
RequestSubmitFlowRequest
ResponseSubmitFlowResponse
SubmitFlowRequest
Field
Type
Description
flow_id
string
A flow from ListApiFlows.
answers
google.protobuf.Struct
The form's answers keyed by PublicFlowQuestion.key, with the values the form stores (a contact person is an object such as {"first_name": "Ada", "last_name": "Lovelace", "email": "[email protected]"}).
input
google.protobuf.Struct
The flow's own inputs keyed by PublicFlowInput.key.
SubmitFlowResponse
Field
Type
Description
transaction_id
string
The flow's transaction the submission created and committed.
customer_id
string
The customer the submission made.
result
google.protobuf.Struct
The flow's own result; the prospect flow returns customer_id, is_prospect, prospect_id and existing_contact.
created
bool
False when the contact details matched an existing record and the submission was recorded there instead of making a new one.
prospect_id
string
The prospect the submission opened; empty when none.