API docs

zpe-forms

mount /forms · base https://zpe.vc/forms · v7.0.2 · 12 operations · 5 write · 2 need no account · stable

the document this app serves now. Contract: https://zpe.vc/forms/_/api/v1/openapi.json · sha256 e0c4776763ee

POST /_/api/v1/forms/{publicId}/submissions Write one submission to the form that owns this public id postFormsByIdSubmissions no account

Write one submission to the form that owns this public id

Parameters

nameinrequiredtypenotes
publicIdpathyesstringThe form's public id, the one its `/f/<publicId>` link carries.
Idempotency-KeyheadernostringA value that names this attempt. Send the same one when retrying and the answer is the submission the first call wrote (`200`) instead of a second row; present and empty is refused. The form's own page cannot set a header, so it carries the same value in a body field of the same name.

Request body application/json · required

fieldtyperequirednotes
Idempotency-KeystringnoThe page's copy of the retry handle: the same value the `Idempotency-Key` header carries. Lifted out of the body before the questions are judged, never stored as an answer.

Responses

statusmeaningbody
200Nothing new was written: this `Idempotency-Key` already wrote a submission to this form, and this is the id of the row the first call wrote.object
201The submission was written to the account that owns this form. The body names its id.object
303The caller posted the page's own form rather than asking for JSON, so the answer is the page it came from (or `?redirect=`, or the form's page with `sent=1`). No body.
400The body is not JSON, or is not an object, or `Idempotency-Key` was sent empty or longer than 200 characters.object
401The credential is missing or does not open this accountobject
403This account may not do thatobject
404That public id names no form on this deployment.object
413The body is over this deployment's `MAX_SUBMISSION_BYTES`.object
415The body is not `application/json`, `application/x-www-form-urlencoded` or `multipart/form-data`.object
422A question the form declares was left unanswered, a value is too long or is not the shape its key asks for, nothing at all was filled in, or the body carries a key the form never declared. Nothing was written.object
429Too many requestsobject

Example

Write one submission to the form that owns this public id.

POST /_/api/v1/forms/{publicId}/submissions
curl -X POST 'https://zpe.vc/forms/_/api/v1/forms/string/submissions' \
  -H 'content-type: application/json' \
  -d '{
  "Idempotency-Key": "string"
}'
200 application/json
{
  "success": false,
  "id": "string"
}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

OPTIONS /_/api/v1/forms/{publicId}/submissions CORS preflight for the write path, answered before any credential optionsFormsByIdSubmissions no account

CORS preflight for the write path, answered before any credential

Parameters

nameinrequiredtypenotes
publicIdpathyesstringThe form's public id, the one its `/f/<publicId>` link carries.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
204No content: the preflight's policy is in the headers (`access-control-allow-origin`, `-methods`, `-headers`, `-max-age`) and the answer carries no body. Answered before any credential is read.
500The deployment failed while answering. The wrapper answers this for any matched route whose handler throws, so it is published rather than left for a caller to discover.object
503The database schema could not be created, so the request was refused before it reached the handler. Nothing was read and nothing was written.object

Example

CORS preflight for the write path, answered before any credential.

OPTIONS /_/api/v1/forms/{publicId}/submissions
curl -X OPTIONS 'https://zpe.vc/forms/_/api/v1/forms/string/submissions'

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/submissions Read the 200 most recent submissions of every form this account owns getSubmissions

Read the 200 most recent submissions of every form this account owns

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200Every form this account owns, and its 200 most recent submissions, newest first, each named by the form it came from.object
401No key and no session: the caller is not signed in at the door, or the key it sent is unknown, revoked or expired.object
403This credential opens no account here, this key is not granted this app, or — on a write — the request came from another origin.object
429This key has spent its ceiling of 120 requests in the current minute; `retry-after` says when to try again.object
500This app failed while answeringobject
503The door did not answer, or this deployment could not create its schema, so nothing was read and nothing was written.object

Example

Read the 200 most recent submissions of every form this account owns, with a token from the door.

GET /_/api/v1/submissions
curl -X GET 'https://zpe.vc/forms/_/api/v1/submissions' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/console/me Who the caller is, as the door names them getConsoleMe

Who the caller is, as the door names them

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The account the door named for this caller, and the email the session carries (`null` for a key, which names no person).object
401No key and no session: the caller is not signed in at the door, or the key it sent is unknown, revoked or expired.object
403This credential opens no account here, this key is not granted this app, or — on a write — the request came from another origin.object
429This key has spent its ceiling of 120 requests in the current minute; `retry-after` says when to try again.object
500This app failed while answeringobject
503The door did not answer, or this deployment could not create its schema, so nothing was read and nothing was written.object

Example

Who the caller is, as the door names them, with a token from the door.

GET /_/api/v1/console/me
curl -X GET 'https://zpe.vc/forms/_/api/v1/console/me' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/console/forms List this account's forms, oldest first, with a submission count and the last one's time getConsoleForms

List this account's forms, oldest first, with a submission count and the last one's time

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200This account's forms, oldest first, each with its submission count and the time of its last one.object
401No key and no session: the caller is not signed in at the door, or the key it sent is unknown, revoked or expired.object
403This credential opens no account here, this key is not granted this app, or — on a write — the request came from another origin.object
429This key has spent its ceiling of 120 requests in the current minute; `retry-after` says when to try again.object
500This app failed while answeringobject
503The door did not answer, or this deployment could not create its schema, so nothing was read and nothing was written.object

Example

List this account's forms, oldest first, with a submission count and the last one's time, with a token from the door.

GET /_/api/v1/console/forms
curl -X GET 'https://zpe.vc/forms/_/api/v1/console/forms' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/console/forms Create a form in this account; the slug comes from the name and the public id is minted here postConsoleForms

Create a form in this account; the slug comes from the name and the public id is minted here

Parameters

nameinrequiredtypenotes
Idempotency-KeyheadernostringA value that names this attempt. Send the same one when retrying and the answer is the form the first call wrote (`200`) instead of `a form named … already exists`; present and empty is refused.

Request body application/json · required

fieldtyperequirednotes
namestringyesThe form's name. Its slug is derived once, here, and never moves.

Responses

statusmeaningbody
200Nothing new was written: this `Idempotency-Key` already created a form in this account, and this is the row the first call wrote.object
201The form was created in this account. Its slug comes from the name.object
400The body names no form, its name has no letter or digit, the name is one of this app's own addresses, a form with that name already exists in this account, or `Idempotency-Key` was sent empty or over 200 characters.object
401The credential is missing or does not open this accountobject
403This account may not do thatobject
404Nothing is hereobject
429Too many requestsobject

Example

Create a form in this account; the slug comes from the name and the public id is minted here, with a token from the door.

POST /_/api/v1/console/forms
curl -X POST 'https://zpe.vc/forms/_/api/v1/console/forms' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "name": "string"
}'
200 application/json
{
  "success": false,
  "form": {
    "id": "string",
    "name": "string",
    "public_id": "string",
    "created_at": 0,
    "updated_at": 0
  }
}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/console/forms/{id} One form of this account, with its submission stats and its last 30 days getConsoleFormsById

One form of this account, with its submission stats and its last 30 days

Parameters

nameinrequiredtypenotes
idpathyesstringThe form's slug, unique within this account.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The form, its question set (`null` when it inherits the three defaults), its submission stats and its last 30 days.object
400The path carries a malformed percent escape, so the slug cannot be read and no form can be addressed.object
401No key and no session: the caller is not signed in at the door, or the key it sent is unknown, revoked or expired.object
403This credential opens no account here, this key is not granted this app, or — on a write — the request came from another origin.object
404No form in this account answers to that slug.object
429This key has spent its ceiling of 120 requests in the current minute; `retry-after` says when to try again.object
500This app failed while answeringobject
503The door did not answer, or this deployment could not create its schema, so nothing was read and nothing was written.object

Example

One form of this account, with its submission stats and its last 30 days, with a token from the door.

GET /_/api/v1/console/forms/{id}
curl -X GET 'https://zpe.vc/forms/_/api/v1/console/forms/string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

PATCH /_/api/v1/console/forms/{id} Rename a form or replace its question set; the slug and the public id do not move patchConsoleFormsById

Rename a form or replace its question set; the slug and the public id do not move

Parameters

nameinrequiredtypenotes
idpathyesstringThe form's slug, unique within this account.

Request body application/json · required

fieldtyperequirednotes
namestringnoThe new name. A form's address is fixed at creation.
fieldsarray | null of objectnoThe form's own questions, in the order the page asks them, or null to inherit the three defaults. Replaces the whole set.

Responses

statusmeaningbody
200The form was renamed or its question set replaced; the row published is the one now stored.object
400The body is not JSON, is not an object, carries neither a name nor a field set, or names a field set this app will not store.object
401No key and no session: the caller is not signed in at the door, or the key it sent is unknown, revoked or expired.object
403This credential opens no account here, this key is not granted this app, or — on a write — the request came from another origin.object
404No form in this account answers to that slug, so nothing was changed.object
413The body is larger than this deployment's `MAX_SUBMISSION_BYTES`.object
415The body is neither `application/json` nor `application/x-www-form-urlencoded`.object
429This key has spent its ceiling of 120 requests in the current minute; `retry-after` says when to try again.object
500This app failed while answeringobject
503The door did not answer, or this deployment could not create its schema, so nothing was read and nothing was written.object

Example

Rename a form or replace its question set; the slug and the public id do not move, with a token from the door.

PATCH /_/api/v1/console/forms/{id}
curl -X PATCH 'https://zpe.vc/forms/_/api/v1/console/forms/string' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "name": "string",
  "fields": null
}'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

DELETE /_/api/v1/console/forms/{id} Delete a form and every submission it received deleteConsoleFormsById

Delete a form and every submission it received

Parameters

nameinrequiredtypenotes
idpathyesstringThe form's slug, unique within this account.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The form and every submission it received were deleted; `deleted` counts the rows.object
400The path carries a malformed percent escape, so the slug cannot be read and no form can be addressed.object
401No key and no session: the caller is not signed in at the door, or the key it sent is unknown, revoked or expired.object
403This credential opens no account here, this key is not granted this app, or — on a write — the request came from another origin.object
404No form in this account answers to that slug, so nothing was deleted.object
429This key has spent its ceiling of 120 requests in the current minute; `retry-after` says when to try again.object
500This app failed while answeringobject
503The door did not answer, or this deployment could not create its schema, so nothing was read and nothing was written.object

Example

Delete a form and every submission it received, with a token from the door.

DELETE /_/api/v1/console/forms/{id}
curl -X DELETE 'https://zpe.vc/forms/_/api/v1/console/forms/string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/console/forms/{id}/submissions This form's submissions, newest first getConsoleFormsByIdSubmissions

This form's submissions, newest first

Parameters

nameinrequiredtypenotes
idpathyesstringThe form's slug, unique within this account.
limitquerynostringHow many rows to return; the deployment caps it.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200This form's submissions, newest first, capped by `limit` and by this deployment's own ceiling.object
400The path carries a malformed percent escape, so the slug cannot be read and no form can be addressed.object
401No key and no session: the caller is not signed in at the door, or the key it sent is unknown, revoked or expired.object
403This credential opens no account here, this key is not granted this app, or — on a write — the request came from another origin.object
404No form in this account answers to that slug.object
429This key has spent its ceiling of 120 requests in the current minute; `retry-after` says when to try again.object
500This app failed while answeringobject
503The door did not answer, or this deployment could not create its schema, so nothing was read and nothing was written.object

Example

This form's submissions, newest first, with a token from the door.

GET /_/api/v1/console/forms/{id}/submissions
curl -X GET 'https://zpe.vc/forms/_/api/v1/console/forms/string/submissions?limit=string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

DELETE /_/api/v1/console/forms/{id}/submissions/{submissionId} Delete one submission of this account's form deleteConsoleFormsByIdSubmissionsById

Delete one submission of this account's form

Parameters

nameinrequiredtypenotes
idpathyesstringThe form's slug, unique within this account.
submissionIdpathyesstringThe submission's id.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The submission was deleted; `deleted` counts the row.object
400A path segment carries a malformed percent escape, so the form or the submission cannot be addressed.object
401No key and no session: the caller is not signed in at the door, or the key it sent is unknown, revoked or expired.object
403This credential opens no account here, this key is not granted this app, or — on a write — the request came from another origin.object
404No submission in this account's form answers to that id, so nothing was deleted.object
429This key has spent its ceiling of 120 requests in the current minute; `retry-after` says when to try again.object
500This app failed while answeringobject
503The door did not answer, or this deployment could not create its schema, so nothing was read and nothing was written.object

Example

Delete one submission of this account's form, with a token from the door.

DELETE /_/api/v1/console/forms/{id}/submissions/{submissionId}
curl -X DELETE 'https://zpe.vc/forms/_/api/v1/console/forms/string/submissions/string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/console/settings What this deployment does about mail, which is not a setting a form can hold getConsoleSettings

What this deployment does about mail, which is not a setting a form can hold

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200What this deployment does about mail for submissions: nothing is sent, so `settings` is null and `managed` is the estate.object
401No key and no session: the caller is not signed in at the door, or the key it sent is unknown, revoked or expired.object
403This credential opens no account here, this key is not granted this app, or — on a write — the request came from another origin.object
429This key has spent its ceiling of 120 requests in the current minute; `retry-after` says when to try again.object
500This app failed while answeringobject
503The door did not answer, or this deployment could not create its schema, so nothing was read and nothing was written.object

Example

What this deployment does about mail, which is not a setting a form can hold, with a token from the door.

GET /_/api/v1/console/settings
curl -X GET 'https://zpe.vc/forms/_/api/v1/console/settings' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.