curl --request POST \
--url https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"firstName": "John",
"lastName": "Doe",
"languageCode": "EN",
"cellphone": "+14084029292",
"email": "john.doe@example.com",
"ownerIdentifier": {
"identifier": "john.doe@example.com",
"identifierType": "EMAIL"
},
"customAttributes": {
"openAttributes": [
{
"customAttributeId": "651c97c1-b31d-466f-825c-fe77b39e7ae6",
"content": "<string>"
}
],
"closedAttributes": [
{
"customAttributeId": "651c97c1-b31d-466f-825c-fe77b39e7ae6",
"closedCustomAttributeIds": [
"62de01f0-fd48-467c-9c35-18647c51532a",
"6faf42bb-7d7b-44bd-9e79-5de6fd491134"
]
}
]
}
}
'import requests
url = "https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts"
payload = {
"firstName": "John",
"lastName": "Doe",
"languageCode": "EN",
"cellphone": "+14084029292",
"email": "john.doe@example.com",
"ownerIdentifier": {
"identifier": "john.doe@example.com",
"identifierType": "EMAIL"
},
"customAttributes": {
"openAttributes": [
{
"customAttributeId": "651c97c1-b31d-466f-825c-fe77b39e7ae6",
"content": "<string>"
}
],
"closedAttributes": [
{
"customAttributeId": "651c97c1-b31d-466f-825c-fe77b39e7ae6",
"closedCustomAttributeIds": ["62de01f0-fd48-467c-9c35-18647c51532a", "6faf42bb-7d7b-44bd-9e79-5de6fd491134"]
}
]
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: 'John',
lastName: 'Doe',
languageCode: 'EN',
cellphone: '+14084029292',
email: 'john.doe@example.com',
ownerIdentifier: {identifier: 'john.doe@example.com', identifierType: 'EMAIL'},
customAttributes: {
openAttributes: [
{customAttributeId: '651c97c1-b31d-466f-825c-fe77b39e7ae6', content: '<string>'}
],
closedAttributes: [
{
customAttributeId: '651c97c1-b31d-466f-825c-fe77b39e7ae6',
closedCustomAttributeIds: ['62de01f0-fd48-467c-9c35-18647c51532a', '6faf42bb-7d7b-44bd-9e79-5de6fd491134']
}
]
}
})
};
fetch('https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/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://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/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([
'firstName' => 'John',
'lastName' => 'Doe',
'languageCode' => 'EN',
'cellphone' => '+14084029292',
'email' => 'john.doe@example.com',
'ownerIdentifier' => [
'identifier' => 'john.doe@example.com',
'identifierType' => 'EMAIL'
],
'customAttributes' => [
'openAttributes' => [
[
'customAttributeId' => '651c97c1-b31d-466f-825c-fe77b39e7ae6',
'content' => '<string>'
]
],
'closedAttributes' => [
[
'customAttributeId' => '651c97c1-b31d-466f-825c-fe77b39e7ae6',
'closedCustomAttributeIds' => [
'62de01f0-fd48-467c-9c35-18647c51532a',
'6faf42bb-7d7b-44bd-9e79-5de6fd491134'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts"
payload := strings.NewReader("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"languageCode\": \"EN\",\n \"cellphone\": \"+14084029292\",\n \"email\": \"john.doe@example.com\",\n \"ownerIdentifier\": {\n \"identifier\": \"john.doe@example.com\",\n \"identifierType\": \"EMAIL\"\n },\n \"customAttributes\": {\n \"openAttributes\": [\n {\n \"customAttributeId\": \"651c97c1-b31d-466f-825c-fe77b39e7ae6\",\n \"content\": \"<string>\"\n }\n ],\n \"closedAttributes\": [\n {\n \"customAttributeId\": \"651c97c1-b31d-466f-825c-fe77b39e7ae6\",\n \"closedCustomAttributeIds\": [\n \"62de01f0-fd48-467c-9c35-18647c51532a\",\n \"6faf42bb-7d7b-44bd-9e79-5de6fd491134\"\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"languageCode\": \"EN\",\n \"cellphone\": \"+14084029292\",\n \"email\": \"john.doe@example.com\",\n \"ownerIdentifier\": {\n \"identifier\": \"john.doe@example.com\",\n \"identifierType\": \"EMAIL\"\n },\n \"customAttributes\": {\n \"openAttributes\": [\n {\n \"customAttributeId\": \"651c97c1-b31d-466f-825c-fe77b39e7ae6\",\n \"content\": \"<string>\"\n }\n ],\n \"closedAttributes\": [\n {\n \"customAttributeId\": \"651c97c1-b31d-466f-825c-fe77b39e7ae6\",\n \"closedCustomAttributeIds\": [\n \"62de01f0-fd48-467c-9c35-18647c51532a\",\n \"6faf42bb-7d7b-44bd-9e79-5de6fd491134\"\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"languageCode\": \"EN\",\n \"cellphone\": \"+14084029292\",\n \"email\": \"john.doe@example.com\",\n \"ownerIdentifier\": {\n \"identifier\": \"john.doe@example.com\",\n \"identifierType\": \"EMAIL\"\n },\n \"customAttributes\": {\n \"openAttributes\": [\n {\n \"customAttributeId\": \"651c97c1-b31d-466f-825c-fe77b39e7ae6\",\n \"content\": \"<string>\"\n }\n ],\n \"closedAttributes\": [\n {\n \"customAttributeId\": \"651c97c1-b31d-466f-825c-fe77b39e7ae6\",\n \"closedCustomAttributeIds\": [\n \"62de01f0-fd48-467c-9c35-18647c51532a\",\n \"6faf42bb-7d7b-44bd-9e79-5de6fd491134\"\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234",
"workspaceId": "92b2d4f3-81e1-4b61-a7ec-6f4ff3b58be5",
"type": "NORMAL",
"createdAt": "2003-04-10T08:00:00.000Z",
"updatedAt": "2003-04-10T08:00:00.000Z",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"cellphone": "+14084029292",
"customAttributes": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"languageCode": "EN",
"ownerId": "37673840-6259-40f9-bbe5-a7db40f8e3cf"
}Create a new contact
Create a new contact in the specified workspace.
curl --request POST \
--url https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"firstName": "John",
"lastName": "Doe",
"languageCode": "EN",
"cellphone": "+14084029292",
"email": "john.doe@example.com",
"ownerIdentifier": {
"identifier": "john.doe@example.com",
"identifierType": "EMAIL"
},
"customAttributes": {
"openAttributes": [
{
"customAttributeId": "651c97c1-b31d-466f-825c-fe77b39e7ae6",
"content": "<string>"
}
],
"closedAttributes": [
{
"customAttributeId": "651c97c1-b31d-466f-825c-fe77b39e7ae6",
"closedCustomAttributeIds": [
"62de01f0-fd48-467c-9c35-18647c51532a",
"6faf42bb-7d7b-44bd-9e79-5de6fd491134"
]
}
]
}
}
'import requests
url = "https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts"
payload = {
"firstName": "John",
"lastName": "Doe",
"languageCode": "EN",
"cellphone": "+14084029292",
"email": "john.doe@example.com",
"ownerIdentifier": {
"identifier": "john.doe@example.com",
"identifierType": "EMAIL"
},
"customAttributes": {
"openAttributes": [
{
"customAttributeId": "651c97c1-b31d-466f-825c-fe77b39e7ae6",
"content": "<string>"
}
],
"closedAttributes": [
{
"customAttributeId": "651c97c1-b31d-466f-825c-fe77b39e7ae6",
"closedCustomAttributeIds": ["62de01f0-fd48-467c-9c35-18647c51532a", "6faf42bb-7d7b-44bd-9e79-5de6fd491134"]
}
]
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: 'John',
lastName: 'Doe',
languageCode: 'EN',
cellphone: '+14084029292',
email: 'john.doe@example.com',
ownerIdentifier: {identifier: 'john.doe@example.com', identifierType: 'EMAIL'},
customAttributes: {
openAttributes: [
{customAttributeId: '651c97c1-b31d-466f-825c-fe77b39e7ae6', content: '<string>'}
],
closedAttributes: [
{
customAttributeId: '651c97c1-b31d-466f-825c-fe77b39e7ae6',
closedCustomAttributeIds: ['62de01f0-fd48-467c-9c35-18647c51532a', '6faf42bb-7d7b-44bd-9e79-5de6fd491134']
}
]
}
})
};
fetch('https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/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://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/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([
'firstName' => 'John',
'lastName' => 'Doe',
'languageCode' => 'EN',
'cellphone' => '+14084029292',
'email' => 'john.doe@example.com',
'ownerIdentifier' => [
'identifier' => 'john.doe@example.com',
'identifierType' => 'EMAIL'
],
'customAttributes' => [
'openAttributes' => [
[
'customAttributeId' => '651c97c1-b31d-466f-825c-fe77b39e7ae6',
'content' => '<string>'
]
],
'closedAttributes' => [
[
'customAttributeId' => '651c97c1-b31d-466f-825c-fe77b39e7ae6',
'closedCustomAttributeIds' => [
'62de01f0-fd48-467c-9c35-18647c51532a',
'6faf42bb-7d7b-44bd-9e79-5de6fd491134'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts"
payload := strings.NewReader("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"languageCode\": \"EN\",\n \"cellphone\": \"+14084029292\",\n \"email\": \"john.doe@example.com\",\n \"ownerIdentifier\": {\n \"identifier\": \"john.doe@example.com\",\n \"identifierType\": \"EMAIL\"\n },\n \"customAttributes\": {\n \"openAttributes\": [\n {\n \"customAttributeId\": \"651c97c1-b31d-466f-825c-fe77b39e7ae6\",\n \"content\": \"<string>\"\n }\n ],\n \"closedAttributes\": [\n {\n \"customAttributeId\": \"651c97c1-b31d-466f-825c-fe77b39e7ae6\",\n \"closedCustomAttributeIds\": [\n \"62de01f0-fd48-467c-9c35-18647c51532a\",\n \"6faf42bb-7d7b-44bd-9e79-5de6fd491134\"\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"languageCode\": \"EN\",\n \"cellphone\": \"+14084029292\",\n \"email\": \"john.doe@example.com\",\n \"ownerIdentifier\": {\n \"identifier\": \"john.doe@example.com\",\n \"identifierType\": \"EMAIL\"\n },\n \"customAttributes\": {\n \"openAttributes\": [\n {\n \"customAttributeId\": \"651c97c1-b31d-466f-825c-fe77b39e7ae6\",\n \"content\": \"<string>\"\n }\n ],\n \"closedAttributes\": [\n {\n \"customAttributeId\": \"651c97c1-b31d-466f-825c-fe77b39e7ae6\",\n \"closedCustomAttributeIds\": [\n \"62de01f0-fd48-467c-9c35-18647c51532a\",\n \"6faf42bb-7d7b-44bd-9e79-5de6fd491134\"\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"languageCode\": \"EN\",\n \"cellphone\": \"+14084029292\",\n \"email\": \"john.doe@example.com\",\n \"ownerIdentifier\": {\n \"identifier\": \"john.doe@example.com\",\n \"identifierType\": \"EMAIL\"\n },\n \"customAttributes\": {\n \"openAttributes\": [\n {\n \"customAttributeId\": \"651c97c1-b31d-466f-825c-fe77b39e7ae6\",\n \"content\": \"<string>\"\n }\n ],\n \"closedAttributes\": [\n {\n \"customAttributeId\": \"651c97c1-b31d-466f-825c-fe77b39e7ae6\",\n \"closedCustomAttributeIds\": [\n \"62de01f0-fd48-467c-9c35-18647c51532a\",\n \"6faf42bb-7d7b-44bd-9e79-5de6fd491134\"\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234",
"workspaceId": "92b2d4f3-81e1-4b61-a7ec-6f4ff3b58be5",
"type": "NORMAL",
"createdAt": "2003-04-10T08:00:00.000Z",
"updatedAt": "2003-04-10T08:00:00.000Z",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"cellphone": "+14084029292",
"customAttributes": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"languageCode": "EN",
"ownerId": "37673840-6259-40f9-bbe5-a7db40f8e3cf"
}Authorizations
Copy the API key as provided by the Bridge Console.
Path Parameters
Unique identifier of the workspace (UUID v4).
"b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234"
Body
Request body for creating a new contact.
Contact's first name.
"John"
"Alice"
Contact's last name.
"Doe"
Contact's language code.
ES, EN "EN"
Contact's cellphone number.
"+14084029292"
Contact's email address.
"john.doe@example.com"
Body to identify an internal user in Bridge System.
Show child attributes
Show child attributes
Object with open and closed custom attributes.
Show child attributes
Show child attributes
Response
Successful Response
Response body for contact-related operations.
Unique identifier for the contact (UUID v4).
"b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234"
Unique identifier of the workspace this contact belongs to
"92b2d4f3-81e1-4b61-a7ec-6f4ff3b58be5"
NORMAL when all required identity and custom attribute fields are present, PARTIAL otherwise.
PARTIAL, NORMAL "NORMAL"
"PARTIAL"
Timestamp when the contact was created.
"2003-04-10T08:00:00.000Z"
Timestamp when the contact was last updated.
"2003-04-10T08:00:00.000Z"
Contact's first name.
"John"
Contact's last name.
"Doe"
Contact's email address.
"john.doe@example.com"
Contact's cellphone address.
"+14084029292"
Array of custom key-value attributes.
Show child attributes
Show child attributes
Language code from external user.
ES, EN "EN"
Email address of the salesperson or user who owns this contact.
"37673840-6259-40f9-bbe5-a7db40f8e3cf"
Was this page helpful?