Push website leads
Send every request from your own website's contact form to Shortcut as a lead, safely retried and never duplicated.
After this guide, every request for service submitted on your website lands in Shortcut as a lead within a second: staff are notified, the address becomes the customer's property, and a retried submission never creates a second lead. It takes about 20 minutes and a server-side form handler.
Use this guide when your website is not built with Shortcut and already has its own contact form. If you want a form without writing code, Shortcut's own lead capture form under Settings → Lead capture does the same job.
1. Create a token for the website
In Settings → API & integrations, select Create token:
Name:
Website leads.Scopes: choose Custom, then turn on Write leads and Write customers. Write customers lets a returning customer ask for more work: without it, a request whose email belongs to an existing customer is refused. Turn on Trigger automations too if the new-lead welcome automation should greet each new lead, as it does for leads from Shortcut's own form. Without it, a lead created through the API starts none of your Automations rules or the new-lead welcome automation. See automations:trigger.
Expiry: 1 year, with a reminder to rotate it.
Store the token as SHORTCUT_TOKEN in your website's server environment, never in the page.
2. Map your form to a lead
POST /v1/leads takes:
firstName, lastName
Yes
Name. Split a single name field at the first space. Up to 100 characters each.
email
Yes
Email. Shortcut uses it to match the lead to an existing customer.
address
Yes
The service address on one line: 412 Elm St, Bozeman, MT 59715.
phone
No
Phone, as typed. US numbers may leave out the country code.
companyName
No
Company, for commercial requests.
servicesRequested
No
Checkboxes such as Weekly mowing or Aeration, up to 50.
specialRequests
No
The free-text message, up to 2,000 characters.
Send nothing else: the body is strict, so an extra field, such as a form id, is refused with 400 validation_failed.
3. Send it from your server
Try it once with curl:
The status is 201 Created. customerId and propertyId are the customer account and property Shortcut created for the new email, or the existing customer's when the email was already known.
Then wire the same call into your form handler. This one is for any Node.js server, with Express shown; pushLead works the same in a Next.js route handler or a serverless function, because it waits at most 10 seconds and leaves longer waits to your retry queue:
Install Express first:
Three details make this reliable:
One idempotency key per submission.
website-form-<submission id>stays the same across retries, so a timeout, a double click, or your own retry job never creates a second lead. Keys last 24 hours. A visitor who changes the form and submits again has made a new submission: give it a new id, and so a new key, or Shortcut answers422 idempotency_key_reused_with_different_payload.Retry only what can succeed.
409 idempotency_key_in_use(the same submission is still being processed),429, and5xxanswers are retried afterRetry-After. Anything else, including any other409, is a problem to fix, and retrying it with the same key replays the same answer.Never lose a submission. If Shortcut cannot take the lead right now,
saveForRetrystores the submission, and a scheduled job sends it again with the same key.
4. Handle the answers
201
The lead was created.
Nothing.
201 with Idempotent-Replayed: true
This submission was already sent. You got the original lead back.
Nothing.
400 validation_failed
A field is missing or malformed; param says which, such as body.email or body.phone.
Validate the field in your form. For a corrected resend, use a new key.
403 insufficient_scope with requiredScope: "customers:write"
The email belongs to an existing customer and the token lacks Write customers. Nothing was created.
Create a token with Write customers and replace this one.
429 workspace_rate_limited
More than 20 leads a minute reached Shortcut through the API.
Wait Retry-After seconds and retry with the same key.
401 token_invalid
The token was revoked or has expired.
Create a new token and update the server environment.
The full list is in Errors.
5. See it in Shortcut
Open Customers. Jamie Chen is at the top with the Lead label and under Needs estimate, with the address, the services requested, and the special requests on the lead. Staff who get new-lead notifications were notified. From here the lead moves through Shortcut like any other: estimate, approval, jobs, visits.
Keep spam out
Shortcut creates a lead for every request you send, so filter spam before you call it: use your form provider's spam protection or a CAPTCHA on the page, and drop submissions with no real address.
Last updated