API keys and your in-app contact form
Updated
API keys connect your own product and scripts to Bancroft. The most common use is a contact form inside your app: each message a customer sends becomes a ticket, right next to your email.
Only workspace admins can create and revoke keys, in Settings → API keys.
Choose the right key
| Key type | Use it for | Safe in your app's frontend? |
|---|---|---|
| Client | Your in-app contact form. Customers only ever see their own tickets. | Yes |
| Server | Scripts and back-end jobs that read and update any ticket | No, keep it on your server |
Each key is also Live or Test. Test keys create tickets in your test queue, where they're never emailed and don't count toward your plan. Use one while you build, then switch to a live key.
Create a key
- Go to Settings → API keys and select Create key.
- Give it a name you'll recognize, like "Marketing site contact form". Leave it blank and Bancroft names it for you.
- Choose the type and mode, then create it.
- Copy the key and store it somewhere safe, like your secrets manager.
Bancroft shows the key only once. If you lose it, create a new one and revoke the old one.
Build your contact form
You design the form in your own app, so it looks like the rest of your product. Your form sends each message to Bancroft with your client key, and it arrives as a ticket in Unassigned. You can also offer a callback request, where the customer leaves a phone number and a good time to call.
The step-by-step guide with code is in the developer docs.
Revoke a key
Select Revoke next to a key. Requests using it fail from then on, and it can't be turned back on. Create a new key to replace it.