curl --request PATCH \
--url https://connect.penbox.io/v1/forms/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"archived": true,
"draft": true,
"processed": true,
"active_until": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://connect.penbox.io/v1/forms/{id}"
payload = {
"archived": True,
"draft": True,
"processed": True,
"active_until": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
archived: true,
draft: true,
processed: true,
active_until: '2023-11-07T05:31:56Z'
})
};
fetch('https://connect.penbox.io/v1/forms/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://connect.penbox.io/v1/forms/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'archived' => true,
'draft' => true,
'processed' => true,
'active_until' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://connect.penbox.io/v1/forms/{id}"
payload := strings.NewReader("{\n \"archived\": true,\n \"draft\": true,\n \"processed\": true,\n \"active_until\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://connect.penbox.io/v1/forms/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"archived\": true,\n \"draft\": true,\n \"processed\": true,\n \"active_until\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connect.penbox.io/v1/forms/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"archived\": true,\n \"draft\": true,\n \"processed\": true,\n \"active_until\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"archived": true,
"archived_at": "2023-11-07T05:31:56Z",
"processed_at": "2023-11-07T05:31:56Z",
"active_from": "2023-11-07T05:31:56Z",
"active_until": "2023-11-07T05:31:56Z",
"links": {
"fill": "<string>",
"app": "<string>"
},
"user": {
"anonymous": true,
"email": "<string>",
"phone": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"company_name": "<string>",
"internal_ref": "<string>"
},
"owner": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>"
},
"flow": {
"slug": "<string>"
},
"data": {},
"external_args": {},
"options": {},
"responses": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"data": {},
"user": {
"anonymous": true,
"ip": "<string>",
"email": "<string>",
"phone": "<string>",
"locale": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"user-agent": "<string>",
"accept-language": "<string>"
},
"attachments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>",
"scope": "<string>",
"data": "<string>",
"metadata": {
"size": 123,
"width": 123,
"height": 123
},
"uri": "<string>"
}
],
"signatures": {},
"files": {}
}
],
"notifications": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"at": "2023-11-07T05:31:56Z",
"to": "<string>",
"from": "<string>",
"cc": "<string>",
"bcc": "<string>",
"system": true,
"locale": "<string>",
"template": "<string>",
"variables": {},
"active": true,
"error": "<string>",
"message_id": "<string>",
"attachments": {},
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"webhooks": {}
}Update Form
Update a form’s status or properties.
curl --request PATCH \
--url https://connect.penbox.io/v1/forms/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"archived": true,
"draft": true,
"processed": true,
"active_until": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://connect.penbox.io/v1/forms/{id}"
payload = {
"archived": True,
"draft": True,
"processed": True,
"active_until": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
archived: true,
draft: true,
processed: true,
active_until: '2023-11-07T05:31:56Z'
})
};
fetch('https://connect.penbox.io/v1/forms/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://connect.penbox.io/v1/forms/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'archived' => true,
'draft' => true,
'processed' => true,
'active_until' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://connect.penbox.io/v1/forms/{id}"
payload := strings.NewReader("{\n \"archived\": true,\n \"draft\": true,\n \"processed\": true,\n \"active_until\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://connect.penbox.io/v1/forms/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"archived\": true,\n \"draft\": true,\n \"processed\": true,\n \"active_until\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connect.penbox.io/v1/forms/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"archived\": true,\n \"draft\": true,\n \"processed\": true,\n \"active_until\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"archived": true,
"archived_at": "2023-11-07T05:31:56Z",
"processed_at": "2023-11-07T05:31:56Z",
"active_from": "2023-11-07T05:31:56Z",
"active_until": "2023-11-07T05:31:56Z",
"links": {
"fill": "<string>",
"app": "<string>"
},
"user": {
"anonymous": true,
"email": "<string>",
"phone": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"company_name": "<string>",
"internal_ref": "<string>"
},
"owner": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>"
},
"flow": {
"slug": "<string>"
},
"data": {},
"external_args": {},
"options": {},
"responses": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"data": {},
"user": {
"anonymous": true,
"ip": "<string>",
"email": "<string>",
"phone": "<string>",
"locale": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"user-agent": "<string>",
"accept-language": "<string>"
},
"attachments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>",
"scope": "<string>",
"data": "<string>",
"metadata": {
"size": 123,
"width": 123,
"height": 123
},
"uri": "<string>"
}
],
"signatures": {},
"files": {}
}
],
"notifications": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"at": "2023-11-07T05:31:56Z",
"to": "<string>",
"from": "<string>",
"cc": "<string>",
"bcc": "<string>",
"system": true,
"locale": "<string>",
"template": "<string>",
"variables": {},
"active": true,
"error": "<string>",
"message_id": "<string>",
"attachments": {},
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"webhooks": {}
}Updatable Fields
| Field | Type | Description |
|---|---|---|
archived | boolean | Archive or unarchive the form |
draft | boolean | Set draft status (true = draft, false = activate) |
processed | boolean | Mark as processed or unprocessed |
active_until | string | Update expiration date (ISO 8601) |
Common Use Cases
Archive a Form
Archive completed or cancelled forms to keep your list organized:await fetch(`https://connect.penbox.io/v1/forms/${formId}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ archived: true })
});
Mark as Processed
Track which forms you’ve reviewed in your system:await fetch(`https://connect.penbox.io/v1/forms/${formId}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ processed: true })
});
Activate a Draft
Activate a draft form to send it to the contact:await fetch(`https://connect.penbox.io/v1/forms/${formId}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ draft: false })
});
Response Codes
| Code | Description |
|---|---|
200 | Success - Form updated successfully |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid access token |
403 | Forbidden - No access to this resource |
404 | Not Found - Form doesn’t exist |
422 | Unprocessable - Validation failed |
429 | Too Many Requests - Rate limit exceeded |
500 | Server Error - Internal error |
Authorizations
API token (starts with pnbx_). Create at https://app.penbox.io/workspace/settings/api. Include as: Authorization: Bearer {token}
Path Parameters
Form UUID
Body
Response
Form updated successfully
Form UUID
Creation timestamp
Current form status
draft, pending, completed, declined, processed Whether the form is archived
Timestamp when archived
Timestamp when marked as processed
When the form becomes active
When the form expires
URLs for accessing the form
Show child attributes
Show child attributes
Contact information
Show child attributes
Show child attributes
Form owner information
Show child attributes
Show child attributes
Form template information
Show child attributes
Show child attributes
Pre-filled form data
Custom metadata
Form-specific options
Array of form responses
Show child attributes
Show child attributes
Array of notifications sent for this form
Show child attributes
Show child attributes
Webhook URLs with event subscriptions
Show child attributes
Show child attributes
Was this page helpful?