Get Form By ID

Returns one dynamic form of the account by id. Use it for a form that is not tied to a page spot, such as one in a custom section.

GET/v1/forms/by-id/:id

Authentication

Public key?key=pk_…

Public key in the `key` query parameter. No OAuth, no secret.

Edge cache: 60 s + stale-while-revalidate 300 s

Path Parameters

idstring
required

The form id. The example is a fictional id, replace it with the id of one of your forms.

Query Parameters

keystring
required

The site's public key (pk_…). It selects the account. Safe to ship to the browser.

localeenum
optional

Language of the form texts: title, intro, field labels, placeholders, option labels and the submit button. `en`, an unknown code or no value returns the original English texts.

esbrptitrufrsrdecnzhplrotrar

Responses

200Success
application/json
formobject

The form definition.

Errors

404The form does not exist, belongs to another account, or the id is not valid. The body is `{ "message": "Form not found" }`.
401Missing or invalid public key.
403The account has no active subscription. The body also carries `code: "TENANT_INACTIVE"`.
500Unexpected server error.

Notes

  • The response has the same shape as Get Form By Spot, but it never returns `null`. A missing form is a 404.
  • Get Form By Spot is the better choice when the form belongs to a page spot, because the owner can swap the form without changing your code.
Request
curl --request GET \
--url "https://api.pandaidx.com/v1/forms/by-id/6a1f3c9d2b7e4a0012ab34cd?key={{public_key}}"
Response200 OK
{
"form": {
"_id": "6a1f3c9d2b7e4a0012ab34cd",
"name": "Contact Us",
"description": null,
"schema": {
"rows": [
{
"id": "row_1700000000000",
"columns": 1,
"fields": [
{
"id": "field_1700000000001",
"type": "name",
"label": "Full Name",
"required": true,
"crmFieldMapping": "name",
"placeholder": "Enter your name"
}
]
},
{
"id": "row_1700000000002",
"columns": 1,
"fields": [
{
"id": "field_1700000000003",
"type": "email",
"label": "Email Address",
"required": true,
"crmFieldMapping": "email",
"placeholder": "Enter your email"
}
]
}
],
"submitButton": {
"text": "Send Message",
"position": "left"
}
},
"assignedSpot": "contact"
}
}