Skip to content

Form Collections

Form Collections allow you to organize multiple forms under a single namespace, giving you cleaner URLs and better management capabilities for teams and agencies.

Collections solve several problems:

  • Clean URLs: Instead of /f/{random-id}, get /f/company/contact
  • Organization: Group related forms (contact, feedback, support) together
  • Team Management: Shared settings and permissions across forms
  • Professional Branding: Consistent namespace across all your forms
FeatureInstant FormsCollection Forms
URL Structure/f/{formId} or /f/{slug}/f/{collection}/{form}
Setup Time5 seconds30 seconds
OrganizationIndividualGrouped
Best ForQuick prototypesProduction use

Both approaches work simultaneously - you can have instant forms and collection forms active at the same time.

Terminal window
mailiam collections create mycompany "My Company Forms"
Terminal window
# Add a contact form
mailiam collections add-form mycompany contact --email hello@mycompany.com
# Add a feedback form
mailiam collections add-form mycompany feedback --email feedback@mycompany.com
Terminal window
mailiam push

Your forms are now live at:

  • https://api.mailiam.dev/f/mycompany/contact
  • https://api.mailiam.dev/f/mycompany/feedback

Use your collection forms in any HTML:

<!-- Contact Form -->
<form action="https://api.mailiam.dev/f/mycompany/contact" method="POST">
<input type="text" name="name" placeholder="Your name" required>
<input type="email" name="email" placeholder="Email" required>
<textarea name="message" placeholder="Message" required></textarea>
<!-- Anti-spam honeypot -->
<input type="text" name="pooh-bear" style="display: none;">
<button type="submit">Send Message</button>
</form>

Collections support powerful configuration options:

collections:
mycompany:
name: "My Company Forms"
settings:
# Rate limiting (per hour)
rateLimit: 100
# Spam protection
spamProtection: true
# Require API key for submissions
requireApiKey: false
# Default thank you message
customMessage: "Thank you for contacting us!"

Override collection settings for specific forms:

collections:
mycompany:
forms:
contact:
email: hello@mycompany.com
settings:
# Override collection message for this form
customMessage: "We'll get back to you within 24 hours!"
# Custom rate limit for high-traffic forms
rateLimitPerMinute: 5
# Redirect after submission
redirectUrl: "https://mycompany.com/thank-you"

Already have instant forms? Easily migrate them to collections:

Terminal window
# Import existing form to collection
mailiam collections import mycompany existing-form-id contact

This will:

  • Move the form to your collection
  • Give it a clean URL: /f/mycompany/contact
  • Keep the old URL working for backward compatibility
Terminal window
mailiam collections list
Terminal window
mailiam collections forms mycompany
Terminal window
mailiam collections add-form mycompany support --email support@mycompany.com
Terminal window
mailiam collections delete mycompany

⚠️ Note: You must delete all forms in a collection before deleting the collection itself.

Collections work great with teams:

  1. Shared Configuration: Everyone uses the same mailiam.config.yaml
  2. Version Control: Check your collections into Git
  3. Environment Management: Different collections for staging/production
  4. Permission Control: Collection-level API key requirements
  • Collection slugs: Use company/brand name (mycompany, agency-client)
  • Form slugs: Use descriptive names (contact, newsletter, support)
  • Email addresses: Use role-based emails (hello@, support@)

Single Company:

company/
├── contact
├── support
└── newsletter

Agency with Multiple Clients:

client-a/
├── contact
└── quote
client-b/
├── contact
├── support
└── feedback
  • Enable spamProtection for public forms
  • Use requireApiKey for internal/admin forms
  • Set appropriate rateLimit based on expected traffic