Forms API

The Forms API lives under <code>/apis/v1/forms</code>. A caller can see forms they own or that a Ration share grant gives them.

01

Before you start

Paths are given in full, or relative to /apis/v1/forms where a table says so. Every request needs a Ration bearer token (see Authentication):

Authorization: Bearer <ration_access_token>
Content-Type: application/json

02

Form model

Form responses are wrapped in a form object. A form includes its id, title, description, sections and questions, status and acceptance state, author data, sharing and access settings, and builder mechanics such as conditional logic and question settings.

Question and section definitions go in the form body. Keep question IDs stable when you update a form, so submitted answers and analytics stay matched to the right fields.

03

Presets and starter drafts

  • GET /apis/v1/forms/presets returns the presets for the detailed builder, each with key, label and summary.
  • POST /apis/v1/forms/draft creates a saved starter draft. Send method: "detailed" with a preset, or method: "assisted" with a description. Optional audience: "external" sets up external or link access. The response contains form, note and generated.

04

Authoring CRUD

MethodPathDescription
GET/apis/v1/formsList visible forms in a forms array.
POST/apis/v1/formsCreate a form. Returns 201 with a form object.
GET/apis/v1/forms/:idRead a form. Shared forms also return shared: true.
PATCH, PUT/apis/v1/forms/:idUpdate the builder definition and return the form.
DELETE/apis/v1/forms/:idDelete a form and return it.

05

Example minimal form

{
  "title": "Product feedback",
  "description": "Tell us what you think.",
  "sections": [
    {
      "id": "section-1",
      "title": "Feedback",
      "questions": [
        { "id": "q1", "type": "short_text", "label": "What worked well?", "required": true }
      ]
    }
  ]
}

06

Publishing lifecycle

Paths in this table are relative to /apis/v1/forms.

MethodPathRequestResponse
POST/:id/publishNonePublished form.
POST/:id/archiveNoneArchived form.
POST/:id/unarchiveNoneRestored form.
POST/:id/acceptingaccepting Boolean.Updated form.

Publishing makes a form available according to its access mode. Archiving stops its normal lifecycle. accepting: false stops collecting responses without deleting the form.

07

Submit as an authenticated user

POST /apis/v1/forms/:id/submit

{
  "answers": {
    "q1": "The search workflow was very clear."
  },
  "device_type": "mobile",
  "locale": "en"
}
FieldTypeRequiredDescription
answersObjectYesKeys are form question IDs. Values must satisfy their question type and validation.
device_typeStringNoResponding device classification.
localeStringNoRespondent locale.
metadataObjectNoAdditional client metadata.

Ration takes the respondent ID, name, email and source from the bearer-authenticated user. Success returns 201 with a response object. Validation errors return 422 with error: "validation_failed" and an errors object.

08

Read responses and analytics

Paths in this table are relative to /apis/v1/forms and need form-owner access.

MethodPathResponse
GET/:id/responsesResponses array. Use the supported list query parameters for pagination and filtering.
GET/:id/responses/:response_idOne response object.
GET/:id/analyticsAnalytics object aggregated across the form questions.

09

Export responses

Paths in this table are relative to /apis/v1/forms.

MethodPathResult
GET/:id/export.csvCSV attachment named responses-<form-id>.csv.
GET/:id/export.xlsxXLSX attachment named responses-<form-id>.xlsx.

10

Sharing and uploaded answers

Paths in this table are relative to /apis/v1/forms.

MethodPathRequest / response
POST/:id/shareOptional expires_at. Creates a share link and returns the form.
DELETE/:id/shareRevokes the form share link and returns the form.
POST/:id/share/regenerateReplaces the form share link and returns the form.
POST/:id/attachmentsMultipart request with a required file. Returns 201 and a file descriptor.

The file descriptor contains secure_id, filename, content_type, size and url. The hard attachment limit is 25,000,000 bytes. Individual questions may set smaller upload limits.

11

Saved reports

API clients can use the visual report builder. A saved report’s spec is the definition behind its drag-and-drop layout. Paths in this table are relative to /apis/v1/forms.

MethodPathRequest / response
GET/:id/report_snapshotCurrent materialised per-question snapshot, or snapshot: null.
GET, POST/:id/reportsList reports, or create one with required name and spec.
GET, PUT, DELETE/:id/reports/:report_idRead, update (name, spec) or delete a saved report.
POST/:id/reports/:report_id/shareSet read-only viewers with emails or shared_with.
GET/:id/reports/:report_id/shareList report viewers in shared_with.
POST/:id/report.xlsxExport client-computed report sheets to XLSX. Optional name.

12

Reports shared with you

MethodPathResult
GET/apis/v1/reports/sharedReports shared read-only with the caller.
GET/apis/v1/reports/shared/:report_idSaved report specification.
GET/apis/v1/reports/shared/:report_id/responsesResponse data needed to render the shared report.
GET/apis/v1/reports/shared/:report_id/formRead-only form definition for the shared report.

13

Errors

StatusMeaning
401Missing or invalid bearer authentication.
404Form or response not found, or not visible to the caller.
422Invalid form definition, validation failure, invalid ID, no changes, or a lifecycle operation that isn’t available.
Next guideSettings API →

Last reviewed 27 November 2026.

Still stuck?

Chat with our support team. Tell us what you were doing and what you saw, and a person will pick it up. You can also email support@ration.works.

Buying or moving to Ration?

For plans, migration or an on-premise deployment, talk to our sales team.