Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.paubox.com/llms.txt

Use this file to discover all available pages before exploring further.

The Forms client does not require API credentials. Forms are identified by a UUID that you obtain from the Paubox dashboard.

Instantiation

from paubox import PauboxFormsClient

client = PauboxFormsClient()

Get a form

Retrieve a form’s metadata, field schema, and rendered HTML/CSS:
response = client.get_form('your-form-uuid')
form     = response.to_dict

print('Title:', form['title'])
print('HTML:',  form['form_html'])
Key fields in the response:
FieldDescription
titleDisplay name of the form
form_jsonParsed field schema
form_htmlRendered HTML for embedding
form_cssAssociated stylesheet
activeWhether the form is accepting submissions
submission_countNumber of submissions received

Submit a form

form_data = {
    'first_name': 'Jane',
    'last_name':  'Smith',
    'email':      'jane@example.com'
}

response = client.submit_form('your-form-uuid', form_data)
print('Status:', response.status_code)  # 201 on success
submit_form raises ValueError if form_data is empty or None.

Submitting with file attachments

The maximum total request size is 250 MB.
import base64

with open('consent.pdf', 'rb') as f:
    encoded = base64.b64encode(f.read()).decode('utf-8')

attachments = [
    {'name': 'consent.pdf', 'content': encoded}
]

response = client.submit_form('your-form-uuid', form_data, attachments)
Each attachment is a dict with two keys:
KeyDescription
nameFile name including extension
contentBase64-encoded file content

Error handling

import requests

try:
    response = client.get_form('your-form-uuid')
    response = client.submit_form('your-form-uuid', form_data)
except ValueError as e:
    print('Invalid input:', e)
except requests.exceptions.HTTPError as e:
    print('API error:', e.response.status_code, e.response.text)