Skip to Content
Routing FormsEvaluate Form

Evaluate Routing Form

Submit the visitor’s answers and get the routing result — which event type to book or where to redirect.

Endpoint

POST /api/public/routing/{userSlug}/{formSlug}/evaluate

Authentication: None required

Path Parameters

ParameterTypeDescription
userSlugstringThe user’s unique URL slug
formSlugstringThe routing form’s URL slug

Request Body

{ "answers": { "field_company_size": "opt_3", "field_topic": "opt_a", "field_email": "alex@example.com" } }

Request Fields

FieldTypeRequiredDescription
answersobjectYesMap of field IDs to answer values. For select fields, the value is the selected option’s id. For text fields, the value is the entered text.

Response

Returns 200 OK with the routing result.

Route to Event Type

{ "action": "routeToEvent", "eventTypeSlug": "enterprise-demo", "eventTypeName": "Enterprise Demo (45 min)", "message": null }

Redirect to URL

{ "action": "redirect", "redirectUrl": "https://support.proximity.io/billing", "message": null }

Show Message

{ "action": "message", "message": "Thanks for your interest! We'll reach out to schedule a call.", "redirectUrl": null }

Response Fields

FieldTypeDescription
actionstringResult action: routeToEvent, redirect, or message
eventTypeSlugstring | nullEvent type to route to (when action is routeToEvent)
eventTypeNamestring | nullHuman-readable name of the event type
redirectUrlstring | nullURL to redirect to (when action is redirect)
messagestring | nullMessage to display (when action is message)

Handling the Result

After evaluation, take action based on the action field:

const result = await evaluateForm(answers); switch (result.action) { case 'routeToEvent': // Navigate to the booking page for this event type window.location.href = `/schedule/${userSlug}/${result.eventTypeSlug}`; break; case 'redirect': // Redirect to the external URL window.location.href = result.redirectUrl; break; case 'message': // Show the message to the visitor showSuccessMessage(result.message); break; }

Errors

StatusDescription
400Missing required fields or invalid answer values
404User or routing form not found

Code Examples

cURL

curl -X POST https://app.proximity.io/api/public/routing/jane-doe/book-a-meeting/evaluate \ -H "Content-Type: application/json" \ -d '{ "answers": { "field_company_size": "opt_3", "field_topic": "opt_a", "field_email": "alex@example.com" } }'

JavaScript

const response = await fetch( 'https://app.proximity.io/api/public/routing/jane-doe/book-a-meeting/evaluate', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ answers: { field_company_size: 'opt_3', field_topic: 'opt_a', field_email: 'alex@example.com', }, }), } ); const result = await response.json(); console.log(`Action: ${result.action}`);

Python

import requests response = requests.post( "https://app.proximity.io/api/public/routing/jane-doe/book-a-meeting/evaluate", json={ "answers": { "field_company_size": "opt_3", "field_topic": "opt_a", "field_email": "alex@example.com", } }, ) result = response.json() print(f"Action: {result['action']}")
Last updated on