Forms API
Questions an assistant asks on calls, and the answers it collected.
The same operations are in the interactive API reference, and the whole contract is in the OpenAPI document.
GET/v1/forms
List forms
Returns every form in the organization. A form is a set of questions an assistant asks during a call, such as a survey or an order. Needs forms:read.
Paged, newest first: limit is 1 to 100 (default 50, out of range values are clamped) and cursor is the next_cursor of the previous page. The cursor is opaque and never built by the client; a cursor this API did not return is a 400. has_more is true while another page exists. There is no total. Drafts and archived forms are included, so check status. Only a published form can be used by a call or a campaign.
Test keys list the sandbox organization's forms; live keys the real ones.
Scope forms:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer | No | How many items to return. Default 50, at most 100. |
cursor | query | string | No | The `next_cursor` of the previous page. Opaque; never built by the client. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/forms/{id}
Get a form with its fields
Returns one form with all its fields. Needs forms:read. An id from another organization, or from the other mode, is 404.
unpublished_changes tells you the draft differs from what calls currently ask. Calls use the published current_version, so changes made after publishing do not affect them until the form is published again. Creating, editing and publishing forms are console actions and are not part of this API.
Scope forms:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The resource id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/forms/{id}/submissions
List submissions
Lists the answers collected for one form, newest first. One submission is one call or conversation with the answers given in it. Needs forms:read. The answers can contain personal details, including fields marked sensitive; treat the response accordingly.
Filter with outcome and q. Paged, newest first: limit is 1 to 100 (default 50, out of range values are clamped) and cursor is the next_cursor of the previous page. The cursor is opaque and never built by the client; a cursor this API did not return is a 400. has_more is true while another page exists. There is no total.
Paging is by keyset, so a submission that arrives while you page never shifts a page, skips a row or repeats one.
Scope forms:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The resource id. |
outcome | query | string | No | An outcome such as `completed` or `callback`, or a status such as `partial`. |
q | query | string | No | Text to search for in the answers and summary. |
limit | query | integer | No | How many items to return. Default 50, at most 100. |
cursor | query | string | No | The `next_cursor` of the previous page. Opaque; never built by the client. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/forms/{id}/export
Export answers as CSV
Downloads every answer to one form as a spreadsheet. Needs forms:read.
The response is text/csv; charset=utf-8 with a byte order mark so spreadsheet programs read Nepali text correctly, and a Content-Disposition that names the file after the form. It is not paged and not filtered: a large form produces a large file. Use the submissions list when you need a subset or JSON. The file holds the same answers as the JSON operations, including sensitive ones, so do not leave it in shared places.
Scope forms:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The resource id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/form-submissions/{id}
Get one submission
Returns one submission with every answer, its status and outcome, and the call or conversation it came from (source_kind and source_id). Needs forms:read.
Each answer says how sure we are: answered, declined, unsure or unconfirmed, whether it was heard live, filled in after the call, or entered by hand, and the words from the conversation that support it in evidence. The path takes a submission id, not a form id.
Scope form-submissions:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The resource id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |