curl --request POST \
--url https://connect.penbox.io/v1/cases/{id}/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contacts": [
{
"key": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"phone": "<string>"
}
]
}
'import requests
url = "https://connect.penbox.io/v1/cases/{id}/contacts"
payload = { "contacts": [
{
"key": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"phone": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contacts: [
{
key: '<string>',
email: 'jsmith@example.com',
name: '<string>',
given_name: '<string>',
family_name: '<string>',
phone: '<string>'
}
]
})
};
fetch('https://connect.penbox.io/v1/cases/{id}/contacts', 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/cases/{id}/contacts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contacts' => [
[
'key' => '<string>',
'email' => 'jsmith@example.com',
'name' => '<string>',
'given_name' => '<string>',
'family_name' => '<string>',
'phone' => '<string>'
]
]
]),
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/cases/{id}/contacts"
payload := strings.NewReader("{\n \"contacts\": [\n {\n \"key\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"given_name\": \"<string>\",\n \"family_name\": \"<string>\",\n \"phone\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://connect.penbox.io/v1/cases/{id}/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contacts\": [\n {\n \"key\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"given_name\": \"<string>\",\n \"family_name\": \"<string>\",\n \"phone\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connect.penbox.io/v1/cases/{id}/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contacts\": [\n {\n \"key\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"given_name\": \"<string>\",\n \"family_name\": \"<string>\",\n \"phone\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"locale": "<string>",
"reference": "<string>",
"status": "<string>",
"archived_at": "2023-11-07T05:31:56Z",
"contacts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"given_name": "<string>",
"family_name": "<string>",
"phone": "<string>"
}
],
"template": "<string>",
"owner": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"given_name": "<string>",
"family_name": "<string>"
},
"steps": [
{
"id": "<string>",
"title": "<string>",
"status": "<string>",
"data": {}
}
],
"schema": [
{
"key": "<string>",
"type": "<string>",
"value": "<unknown>",
"name": "<string>"
}
]
}Update Case Contacts
Replace the contacts for a specific case. This will replace all existing contacts with the provided contacts.
curl --request POST \
--url https://connect.penbox.io/v1/cases/{id}/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contacts": [
{
"key": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"phone": "<string>"
}
]
}
'import requests
url = "https://connect.penbox.io/v1/cases/{id}/contacts"
payload = { "contacts": [
{
"key": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"phone": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contacts: [
{
key: '<string>',
email: 'jsmith@example.com',
name: '<string>',
given_name: '<string>',
family_name: '<string>',
phone: '<string>'
}
]
})
};
fetch('https://connect.penbox.io/v1/cases/{id}/contacts', 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/cases/{id}/contacts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contacts' => [
[
'key' => '<string>',
'email' => 'jsmith@example.com',
'name' => '<string>',
'given_name' => '<string>',
'family_name' => '<string>',
'phone' => '<string>'
]
]
]),
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/cases/{id}/contacts"
payload := strings.NewReader("{\n \"contacts\": [\n {\n \"key\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"given_name\": \"<string>\",\n \"family_name\": \"<string>\",\n \"phone\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://connect.penbox.io/v1/cases/{id}/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contacts\": [\n {\n \"key\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"given_name\": \"<string>\",\n \"family_name\": \"<string>\",\n \"phone\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connect.penbox.io/v1/cases/{id}/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contacts\": [\n {\n \"key\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"given_name\": \"<string>\",\n \"family_name\": \"<string>\",\n \"phone\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"locale": "<string>",
"reference": "<string>",
"status": "<string>",
"archived_at": "2023-11-07T05:31:56Z",
"contacts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"given_name": "<string>",
"family_name": "<string>",
"phone": "<string>"
}
],
"template": "<string>",
"owner": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"given_name": "<string>",
"family_name": "<string>"
},
"steps": [
{
"id": "<string>",
"title": "<string>",
"status": "<string>",
"data": {}
}
],
"schema": [
{
"key": "<string>",
"type": "<string>",
"value": "<unknown>",
"name": "<string>"
}
]
}Authorizations
API token (starts with pnbx_). Create at https://app.penbox.io/workspace/settings/api. Include as: Authorization: Bearer {token}
Path Parameters
The unique identifier of the case
Body
1Show child attributes
Show child attributes
Response
Contacts added successfully
Case UUID
Case title
Parent status
draft, pending, in_progress, closed Creation timestamp
Last update timestamp
Case description
Language/locale code
Custom reference number
Custom status value
Who the case is waiting for
none, owner, contact Timestamp when archived
Array of contact objects
Show child attributes
Show child attributes
Template reference
Case owner information
Show child attributes
Show child attributes
Array of step objects representing the case workflow
Show child attributes
Show child attributes
Array of data fields with their current values
Show child attributes
Show child attributes
Was this page helpful?