Contacts
Create one or more contacts
Drivers, receivers, and other business contacts. See the resource guide for ownership and lifecycle constraints.
POST
/
contact
Create one or more contacts
curl --request POST \
--url https://{instance}/api/v2/contact \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isArchived": true,
"identifier": "<string>",
"email": "<string>",
"phone": "<string>",
"title": "<string>",
"companyName": "<string>",
"vendorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"isPrimary": true,
"notes": "<string>",
"metadata": {}
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
isArchived: true,
identifier: '<string>',
email: '<string>',
phone: '<string>',
title: '<string>',
companyName: '<string>',
vendorId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
role: '<string>',
isPrimary: true,
notes: '<string>',
metadata: {}
})
};
fetch('https://{instance}/api/v2/contact', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{instance}/api/v2/contact"
payload = {
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isArchived": True,
"identifier": "<string>",
"email": "<string>",
"phone": "<string>",
"title": "<string>",
"companyName": "<string>",
"vendorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"isPrimary": True,
"notes": "<string>",
"metadata": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"value": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"archivedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"identifier": "<string>",
"email": "<string>",
"phone": "<string>",
"title": "<string>",
"companyName": "<string>",
"vendorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"isPrimary": true,
"notes": "<string>",
"metadata": {}
}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}Authorizations
Organization-scoped API key. Create one in the BuildingSwell app under Organization settings, API keys.
Body
application/json
Response
Successful response.
- Option 1
- Option 2
Show child attributes
Show child attributes
⌘I
Create one or more contacts
curl --request POST \
--url https://{instance}/api/v2/contact \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isArchived": true,
"identifier": "<string>",
"email": "<string>",
"phone": "<string>",
"title": "<string>",
"companyName": "<string>",
"vendorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"isPrimary": true,
"notes": "<string>",
"metadata": {}
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
isArchived: true,
identifier: '<string>',
email: '<string>',
phone: '<string>',
title: '<string>',
companyName: '<string>',
vendorId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
role: '<string>',
isPrimary: true,
notes: '<string>',
metadata: {}
})
};
fetch('https://{instance}/api/v2/contact', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{instance}/api/v2/contact"
payload = {
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isArchived": True,
"identifier": "<string>",
"email": "<string>",
"phone": "<string>",
"title": "<string>",
"companyName": "<string>",
"vendorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"isPrimary": True,
"notes": "<string>",
"metadata": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"value": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"archivedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"identifier": "<string>",
"email": "<string>",
"phone": "<string>",
"title": "<string>",
"companyName": "<string>",
"vendorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"isPrimary": true,
"notes": "<string>",
"metadata": {}
}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}