{
  "info": {
    "name": "FormBlade API v1",
    "description": "FormBlade REST API — manage forms, submissions, and files programmatically.\n\nSet the `api_key` variable to your API key (fb_sk_...) and `base_url` to https://formblade.com.\n\nDocs: https://formblade.com/docs/api",
    "version": "1.0.0",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{api_key}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://formblade.com",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "fb_sk_your_key_here",
      "type": "string"
    },
    {
      "key": "form_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "submission_id",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Forms",
      "item": [
        {
          "name": "List forms",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/forms",
              "host": ["{{base_url}}"],
              "path": ["api", "forms"]
            },
            "description": "List all your forms with submission counts."
          }
        },
        {
          "name": "Create form",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/api/forms",
              "host": ["{{base_url}}"],
              "path": ["api", "forms"]
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Contact Form\",\n  \"notify_email\": \"you@example.com\"\n}"
            },
            "description": "Create a new form. Only `name` is required."
          }
        },
        {
          "name": "Get form",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/forms/{{form_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "forms", "{{form_id}}"]
            },
            "description": "Get a single form by ID."
          }
        },
        {
          "name": "Update form",
          "request": {
            "method": "PATCH",
            "url": {
              "raw": "{{base_url}}/api/forms/{{form_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "forms", "{{form_id}}"]
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Updated Form Name\",\n  \"is_active\": true\n}"
            },
            "description": "Update form settings. Send only the fields you want to change."
          }
        },
        {
          "name": "Delete form",
          "request": {
            "method": "DELETE",
            "url": {
              "raw": "{{base_url}}/api/forms/{{form_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "forms", "{{form_id}}"]
            },
            "description": "Delete a form and all its submissions and files."
          }
        },
        {
          "name": "Dashboard stats",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/forms/stats",
              "host": ["{{base_url}}"],
              "path": ["api", "forms", "stats"]
            },
            "description": "Get dashboard statistics: submission counts, storage, recent activity."
          }
        },
        {
          "name": "Test email",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/api/forms/{{form_id}}/test-email",
              "host": ["{{base_url}}"],
              "path": ["api", "forms", "{{form_id}}", "test-email"]
            },
            "description": "Send a test notification email for this form."
          }
        }
      ]
    },
    {
      "name": "Submissions",
      "item": [
        {
          "name": "List submissions",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/forms/{{form_id}}/submissions?page=1&per_page=25",
              "host": ["{{base_url}}"],
              "path": ["api", "forms", "{{form_id}}", "submissions"],
              "query": [
                {"key": "page", "value": "1"},
                {"key": "per_page", "value": "25"},
                {"key": "spam", "value": "false", "disabled": true}
              ]
            },
            "description": "List submissions with pagination. Use `spam=true` to show only spam, `spam=false` for inbox."
          }
        },
        {
          "name": "Export submissions (CSV)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/forms/{{form_id}}/submissions/export?format=csv",
              "host": ["{{base_url}}"],
              "path": ["api", "forms", "{{form_id}}", "submissions", "export"],
              "query": [
                {"key": "format", "value": "csv"}
              ]
            },
            "description": "Export submissions as CSV, JSON, or XLSX (xlsx requires Pro+)."
          }
        },
        {
          "name": "Export submissions (JSON)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/forms/{{form_id}}/submissions/export?format=json",
              "host": ["{{base_url}}"],
              "path": ["api", "forms", "{{form_id}}", "submissions", "export"],
              "query": [
                {"key": "format", "value": "json"}
              ]
            },
            "description": "Export submissions as JSON."
          }
        },
        {
          "name": "Toggle spam flag",
          "request": {
            "method": "PATCH",
            "url": {
              "raw": "{{base_url}}/api/forms/{{form_id}}/submissions/{{submission_id}}/spam",
              "host": ["{{base_url}}"],
              "path": ["api", "forms", "{{form_id}}", "submissions", "{{submission_id}}", "spam"]
            },
            "description": "Toggle the is_spam flag on a submission."
          }
        },
        {
          "name": "Resend notification",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/api/forms/{{form_id}}/submissions/{{submission_id}}/resend",
              "host": ["{{base_url}}"],
              "path": ["api", "forms", "{{form_id}}", "submissions", "{{submission_id}}", "resend"]
            },
            "description": "Resend the notification email for a submission."
          }
        },
        {
          "name": "Delete submission",
          "request": {
            "method": "DELETE",
            "url": {
              "raw": "{{base_url}}/api/forms/{{form_id}}/submissions/{{submission_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "forms", "{{form_id}}", "submissions", "{{submission_id}}"]
            },
            "description": "Delete a submission and its uploaded files."
          }
        },
        {
          "name": "Download file",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/forms/{{form_id}}/submissions/{{submission_id}}/files/{{stored_name}}",
              "host": ["{{base_url}}"],
              "path": ["api", "forms", "{{form_id}}", "submissions", "{{submission_id}}", "files", "{{stored_name}}"]
            },
            "description": "Download an uploaded file. Get `stored_name` from the submission's `files` object."
          }
        }
      ]
    },
    {
      "name": "Files",
      "item": [
        {
          "name": "List files",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/files?page=1&per_page=50",
              "host": ["{{base_url}}"],
              "path": ["api", "files"],
              "query": [
                {"key": "page", "value": "1"},
                {"key": "per_page", "value": "50"},
                {"key": "form_id", "value": "", "disabled": true},
                {"key": "file_type", "value": "", "disabled": true},
                {"key": "search", "value": "", "disabled": true}
              ]
            },
            "description": "List all uploaded files across forms with optional filtering."
          }
        }
      ]
    }
  ]
}
