Docs
Submissions & Files API
List, fetch, export, delete, and moderate submissions, download uploaded files, and inspect payment attempts.
Authenticated endpoints for reading, exporting, moderating, and deleting submissions, plus downloading uploaded files and reading payment attempts.
All endpoints use https://a.firaform.com/api and a Sanctum bearer token. See the API Reference for authentication, roles, pagination, and error shapes.
List submissions
GET /api/forms/{form_id}/submissions
Any team member. Paginated.
Filters:
spam_status:pending,clean,suspicious,spam, orall(default: all statuses)date_from,date_to:Y-m-d, inclusive, in the app timezoneper_page,page
{
"data": [
{
"id": 101,
"data": { "name": "Sam", "email": "[email protected]" },
"spam_status": "clean",
"spam_score": "0.00",
"spam_false_positive": false,
"spam_checked_at": "2026-02-01T10:00:01.000000Z",
"created_at": "2026-02-01T10:00:00.000000Z",
"updated_at": "2026-02-01T10:00:01.000000Z",
"metadata": {
"ip_address": "203.0.113.10",
"user_agent": "Mozilla/5.0...",
"device_type": "desktop",
"browser_name": "Chrome",
"os_name": "Windows"
},
"files": []
}
],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 15,
"total": 1,
"from": 1,
"to": 1,
"links": [],
"path": "https://a.firaform.com/api/forms/V1StGXR8_Z5jdHi6B-myT/submissions"
}
}
GET /api/forms/{form_id}/submissions/{submission_id}
Any team member. Returns a single submission unwrapped (top-level fields), including safe file metadata:
{
"id": 101,
"data": { "name": "Sam" },
"spam_status": "clean",
"files": [
{
"id": 7,
"field_name": "attachment",
"original_name": "invoice.pdf",
"size": 204800,
"mime_type": "application/pdf",
"extension": "pdf"
}
]
}
path and storage_disk are never returned.
A submission ID from another form returns 404.
Export submissions
GET /api/forms/{form_id}/submissions/export
Any team member.
format:csv(default) orjsonspam_status: defaultclean; useallto export everythingdate_from,date_to
CSV responses are streamed and flatten arrays. Each file field gets a field (Files) column.
JSON exports are capped at 10,000 rows. Above that you get 422 — use CSV or narrow the dates.
Moderate and delete
POST /api/forms/{form_id}/submissions/{submission_id}/mark-not-spam
Owner, admin, or manager. Sets spam_status to clean and spam_false_positive to true.
{
"id": 101,
"spam_status": "clean",
"spam_false_positive": true
}
DELETE /api/forms/{form_id}/submissions/{submission_id}
Owner or admin. Deletes stored files and the submission record, and flushes the submission list cache.
{ "message": "Submission deleted successfully." }
Download files
GET /api/files/{file_id}/download
Any team member who can view the form. Returns a signed URL:
{
"url": "https://a.firaform.com/file/download/...?...",
"expires_in": 3600
}
- The URL expires after 1 hour.
- Anyone with the link can download until it expires.
- The URL is tied to the file’s storage disk; changing the
diskparameter invalidates the signature. - The private storage path is never returned.
Payment attempts
GET /api/forms/{form_id}/payment-attempts
Same access as viewing submissions.
- Optional
status:pending,succeeded,failed,canceled,refunded - Paginated
{
"data": [
{
"id": 31,
"submission_id": 101,
"provider": "paypal",
"environment": "sandbox",
"status": "failed",
"amount": "25.00",
"currency": "USD",
"provider_order_id": "ORDER-123",
"completed_at": null,
"created_at": "2026-02-01T10:00:00.000000Z",
"failure_message": "Card declined"
}
],
"meta": { "current_page": 1, "last_page": 1, "per_page": 15, "total": 1 }
}
provider_payload, full failure details, and idempotency_key are never returned.
Examples
JavaScript: fetch all clean submissions
const formId = 'YOUR_FORM_ID';
const token = process.env.FIRAFORM_TOKEN;
async function fetchAllPages() {
let page = 1;
const all = [];
while (true) {
const url = `https://a.firaform.com/api/forms/${formId}/submissions?spam_status=clean&per_page=100&page=${page}`;
const response = await fetch(url, {
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${token}`
}
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const body = await response.json();
all.push(...body.data);
if (page >= body.meta.last_page) break;
page++;
}
return all;
}
curl: export CSV
curl "https://a.firaform.com/api/forms/YOUR_FORM_ID/submissions/export?format=csv&spam_status=clean" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-o submissions.csv
curl: delete a submission
curl -X DELETE "https://a.firaform.com/api/forms/YOUR_FORM_ID/submissions/123" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
curl: download an uploaded file
# 1. Get the signed URL
curl "https://a.firaform.com/api/files/7/download" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
# 2. Download the file (no auth header needed)
curl -L "SIGNED_URL_FROM_STEP_1" -o invoice.pdf