Create phone
curl --request POST \
--url https://api.wellapp.ai/v1/phones \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "phone",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"country_code": 1,
"national_number": "4155552671",
"e164_number": "+14155552671",
"label": "work",
"is_primary": true,
"is_verified": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"relationships": {
"persons": {
"data": [
{
"type": "people",
"id": "people1"
}
]
},
"companies": {
"data": [
{
"type": "company",
"id": "company_tenant"
}
]
},
"workspaces": {
"data": [
{
"type": "workspace",
"id": "workspace_sales"
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
]
}
}
},
"included": [
{
"type": "people",
"id": "people1",
"attributes": {
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
},
{
"type": "company",
"id": "company_tenant",
"attributes": {
"name": "Acme Corporation",
"description": "Leading technology company",
"locale": "en",
"domain_name_primary_link_url": "acme.com",
"created_at": "2023-12-01T09:00:00Z",
"updated_at": "2023-12-01T09:00:00Z"
}
},
{
"type": "workspace",
"id": "workspace_sales",
"attributes": {
"name": "Sales Team Workspace",
"description": "Workspace for sales activities",
"avatar_color": "#FF6B35",
"external_workspace_id": "fygr_123",
"auto_extract_enabled": true,
"created_at": "2024-01-10T08:15:00Z",
"updated_at": "2024-01-10T08:15:00Z"
}
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"attributes": {
"name": "Marketing Team Workspace",
"description": "Workspace for marketing campaigns",
"avatar_color": "#4A90E2",
"external_workspace_id": "mkt_workspace_001",
"auto_extract_enabled": false,
"created_at": "2024-01-12T14:45:00Z",
"updated_at": "2024-01-12T14:45:00Z"
}
}
]
}
'import requests
url = "https://api.wellapp.ai/v1/phones"
payload = {
"data": {
"type": "phone",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"country_code": 1,
"national_number": "4155552671",
"e164_number": "+14155552671",
"label": "work",
"is_primary": True,
"is_verified": True,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"relationships": {
"persons": { "data": [
{
"type": "people",
"id": "people1"
}
] },
"companies": { "data": [
{
"type": "company",
"id": "company_tenant"
}
] },
"workspaces": { "data": [
{
"type": "workspace",
"id": "workspace_sales"
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
] }
}
},
"included": [
{
"type": "people",
"id": "people1",
"attributes": {
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
},
{
"type": "company",
"id": "company_tenant",
"attributes": {
"name": "Acme Corporation",
"description": "Leading technology company",
"locale": "en",
"domain_name_primary_link_url": "acme.com",
"created_at": "2023-12-01T09:00:00Z",
"updated_at": "2023-12-01T09:00:00Z"
}
},
{
"type": "workspace",
"id": "workspace_sales",
"attributes": {
"name": "Sales Team Workspace",
"description": "Workspace for sales activities",
"avatar_color": "#FF6B35",
"external_workspace_id": "fygr_123",
"auto_extract_enabled": True,
"created_at": "2024-01-10T08:15:00Z",
"updated_at": "2024-01-10T08:15:00Z"
}
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"attributes": {
"name": "Marketing Team Workspace",
"description": "Workspace for marketing campaigns",
"avatar_color": "#4A90E2",
"external_workspace_id": "mkt_workspace_001",
"auto_extract_enabled": False,
"created_at": "2024-01-12T14:45:00Z",
"updated_at": "2024-01-12T14:45:00Z"
}
}
]
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'phone',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
attributes: {
country_code: 1,
national_number: '4155552671',
e164_number: '+14155552671',
label: 'work',
is_primary: true,
is_verified: true,
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z'
},
relationships: {
persons: {data: [{type: 'people', id: 'people1'}]},
companies: {data: [{type: 'company', id: 'company_tenant'}]},
workspaces: {
data: [
{type: 'workspace', id: 'workspace_sales'},
{type: 'workspace', id: '550e8400-e29b-41d4-a716-446655440000'}
]
}
}
},
included: [
{
type: 'people',
id: 'people1',
attributes: {
first_name: 'John',
last_name: 'Doe',
full_name: 'John Doe',
created_at: '2024-01-15T10:30:00Z',
updated_at: '2024-01-15T10:30:00Z'
}
},
{
type: 'company',
id: 'company_tenant',
attributes: {
name: 'Acme Corporation',
description: 'Leading technology company',
locale: 'en',
domain_name_primary_link_url: 'acme.com',
created_at: '2023-12-01T09:00:00Z',
updated_at: '2023-12-01T09:00:00Z'
}
},
{
type: 'workspace',
id: 'workspace_sales',
attributes: {
name: 'Sales Team Workspace',
description: 'Workspace for sales activities',
avatar_color: '#FF6B35',
external_workspace_id: 'fygr_123',
auto_extract_enabled: true,
created_at: '2024-01-10T08:15:00Z',
updated_at: '2024-01-10T08:15:00Z'
}
},
{
type: 'workspace',
id: '550e8400-e29b-41d4-a716-446655440000',
attributes: {
name: 'Marketing Team Workspace',
description: 'Workspace for marketing campaigns',
avatar_color: '#4A90E2',
external_workspace_id: 'mkt_workspace_001',
auto_extract_enabled: false,
created_at: '2024-01-12T14:45:00Z',
updated_at: '2024-01-12T14:45:00Z'
}
}
]
})
};
fetch('https://api.wellapp.ai/v1/phones', 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.wellapp.ai/v1/phones",
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([
'data' => [
'type' => 'phone',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'attributes' => [
'country_code' => 1,
'national_number' => '4155552671',
'e164_number' => '+14155552671',
'label' => 'work',
'is_primary' => true,
'is_verified' => true,
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z'
],
'relationships' => [
'persons' => [
'data' => [
[
'type' => 'people',
'id' => 'people1'
]
]
],
'companies' => [
'data' => [
[
'type' => 'company',
'id' => 'company_tenant'
]
]
],
'workspaces' => [
'data' => [
[
'type' => 'workspace',
'id' => 'workspace_sales'
],
[
'type' => 'workspace',
'id' => '550e8400-e29b-41d4-a716-446655440000'
]
]
]
]
],
'included' => [
[
'type' => 'people',
'id' => 'people1',
'attributes' => [
'first_name' => 'John',
'last_name' => 'Doe',
'full_name' => 'John Doe',
'created_at' => '2024-01-15T10:30:00Z',
'updated_at' => '2024-01-15T10:30:00Z'
]
],
[
'type' => 'company',
'id' => 'company_tenant',
'attributes' => [
'name' => 'Acme Corporation',
'description' => 'Leading technology company',
'locale' => 'en',
'domain_name_primary_link_url' => 'acme.com',
'created_at' => '2023-12-01T09:00:00Z',
'updated_at' => '2023-12-01T09:00:00Z'
]
],
[
'type' => 'workspace',
'id' => 'workspace_sales',
'attributes' => [
'name' => 'Sales Team Workspace',
'description' => 'Workspace for sales activities',
'avatar_color' => '#FF6B35',
'external_workspace_id' => 'fygr_123',
'auto_extract_enabled' => true,
'created_at' => '2024-01-10T08:15:00Z',
'updated_at' => '2024-01-10T08:15:00Z'
]
],
[
'type' => 'workspace',
'id' => '550e8400-e29b-41d4-a716-446655440000',
'attributes' => [
'name' => 'Marketing Team Workspace',
'description' => 'Workspace for marketing campaigns',
'avatar_color' => '#4A90E2',
'external_workspace_id' => 'mkt_workspace_001',
'auto_extract_enabled' => false,
'created_at' => '2024-01-12T14:45:00Z',
'updated_at' => '2024-01-12T14:45:00Z'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://api.wellapp.ai/v1/phones"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"phone\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"country_code\": 1,\n \"national_number\": \"4155552671\",\n \"e164_number\": \"+14155552671\",\n \"label\": \"work\",\n \"is_primary\": true,\n \"is_verified\": true,\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n },\n \"relationships\": {\n \"persons\": {\n \"data\": [\n {\n \"type\": \"people\",\n \"id\": \"people1\"\n }\n ]\n },\n \"companies\": {\n \"data\": [\n {\n \"type\": \"company\",\n \"id\": \"company_tenant\"\n }\n ]\n },\n \"workspaces\": {\n \"data\": [\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_sales\"\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n }\n }\n },\n \"included\": [\n {\n \"type\": \"people\",\n \"id\": \"people1\",\n \"attributes\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"full_name\": \"John Doe\",\n \"created_at\": \"2024-01-15T10:30:00Z\",\n \"updated_at\": \"2024-01-15T10:30:00Z\"\n }\n },\n {\n \"type\": \"company\",\n \"id\": \"company_tenant\",\n \"attributes\": {\n \"name\": \"Acme Corporation\",\n \"description\": \"Leading technology company\",\n \"locale\": \"en\",\n \"domain_name_primary_link_url\": \"acme.com\",\n \"created_at\": \"2023-12-01T09:00:00Z\",\n \"updated_at\": \"2023-12-01T09:00:00Z\"\n }\n },\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_sales\",\n \"attributes\": {\n \"name\": \"Sales Team Workspace\",\n \"description\": \"Workspace for sales activities\",\n \"avatar_color\": \"#FF6B35\",\n \"external_workspace_id\": \"fygr_123\",\n \"auto_extract_enabled\": true,\n \"created_at\": \"2024-01-10T08:15:00Z\",\n \"updated_at\": \"2024-01-10T08:15:00Z\"\n }\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"attributes\": {\n \"name\": \"Marketing Team Workspace\",\n \"description\": \"Workspace for marketing campaigns\",\n \"avatar_color\": \"#4A90E2\",\n \"external_workspace_id\": \"mkt_workspace_001\",\n \"auto_extract_enabled\": false,\n \"created_at\": \"2024-01-12T14:45:00Z\",\n \"updated_at\": \"2024-01-12T14:45:00Z\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.wellapp.ai/v1/phones")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"phone\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"country_code\": 1,\n \"national_number\": \"4155552671\",\n \"e164_number\": \"+14155552671\",\n \"label\": \"work\",\n \"is_primary\": true,\n \"is_verified\": true,\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n },\n \"relationships\": {\n \"persons\": {\n \"data\": [\n {\n \"type\": \"people\",\n \"id\": \"people1\"\n }\n ]\n },\n \"companies\": {\n \"data\": [\n {\n \"type\": \"company\",\n \"id\": \"company_tenant\"\n }\n ]\n },\n \"workspaces\": {\n \"data\": [\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_sales\"\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n }\n }\n },\n \"included\": [\n {\n \"type\": \"people\",\n \"id\": \"people1\",\n \"attributes\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"full_name\": \"John Doe\",\n \"created_at\": \"2024-01-15T10:30:00Z\",\n \"updated_at\": \"2024-01-15T10:30:00Z\"\n }\n },\n {\n \"type\": \"company\",\n \"id\": \"company_tenant\",\n \"attributes\": {\n \"name\": \"Acme Corporation\",\n \"description\": \"Leading technology company\",\n \"locale\": \"en\",\n \"domain_name_primary_link_url\": \"acme.com\",\n \"created_at\": \"2023-12-01T09:00:00Z\",\n \"updated_at\": \"2023-12-01T09:00:00Z\"\n }\n },\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_sales\",\n \"attributes\": {\n \"name\": \"Sales Team Workspace\",\n \"description\": \"Workspace for sales activities\",\n \"avatar_color\": \"#FF6B35\",\n \"external_workspace_id\": \"fygr_123\",\n \"auto_extract_enabled\": true,\n \"created_at\": \"2024-01-10T08:15:00Z\",\n \"updated_at\": \"2024-01-10T08:15:00Z\"\n }\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"attributes\": {\n \"name\": \"Marketing Team Workspace\",\n \"description\": \"Workspace for marketing campaigns\",\n \"avatar_color\": \"#4A90E2\",\n \"external_workspace_id\": \"mkt_workspace_001\",\n \"auto_extract_enabled\": false,\n \"created_at\": \"2024-01-12T14:45:00Z\",\n \"updated_at\": \"2024-01-12T14:45:00Z\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/phones")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"phone\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"country_code\": 1,\n \"national_number\": \"4155552671\",\n \"e164_number\": \"+14155552671\",\n \"label\": \"work\",\n \"is_primary\": true,\n \"is_verified\": true,\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n },\n \"relationships\": {\n \"persons\": {\n \"data\": [\n {\n \"type\": \"people\",\n \"id\": \"people1\"\n }\n ]\n },\n \"companies\": {\n \"data\": [\n {\n \"type\": \"company\",\n \"id\": \"company_tenant\"\n }\n ]\n },\n \"workspaces\": {\n \"data\": [\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_sales\"\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n }\n }\n },\n \"included\": [\n {\n \"type\": \"people\",\n \"id\": \"people1\",\n \"attributes\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"full_name\": \"John Doe\",\n \"created_at\": \"2024-01-15T10:30:00Z\",\n \"updated_at\": \"2024-01-15T10:30:00Z\"\n }\n },\n {\n \"type\": \"company\",\n \"id\": \"company_tenant\",\n \"attributes\": {\n \"name\": \"Acme Corporation\",\n \"description\": \"Leading technology company\",\n \"locale\": \"en\",\n \"domain_name_primary_link_url\": \"acme.com\",\n \"created_at\": \"2023-12-01T09:00:00Z\",\n \"updated_at\": \"2023-12-01T09:00:00Z\"\n }\n },\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_sales\",\n \"attributes\": {\n \"name\": \"Sales Team Workspace\",\n \"description\": \"Workspace for sales activities\",\n \"avatar_color\": \"#FF6B35\",\n \"external_workspace_id\": \"fygr_123\",\n \"auto_extract_enabled\": true,\n \"created_at\": \"2024-01-10T08:15:00Z\",\n \"updated_at\": \"2024-01-10T08:15:00Z\"\n }\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"attributes\": {\n \"name\": \"Marketing Team Workspace\",\n \"description\": \"Workspace for marketing campaigns\",\n \"avatar_color\": \"#4A90E2\",\n \"external_workspace_id\": \"mkt_workspace_001\",\n \"auto_extract_enabled\": false,\n \"created_at\": \"2024-01-12T14:45:00Z\",\n \"updated_at\": \"2024-01-12T14:45:00Z\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"type": "phone",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"country_code": 1,
"national_number": "4155552671",
"e164_number": "+14155552671",
"label": "work",
"is_primary": true,
"is_verified": true,
"created_at": "2023-11-07T05:31:56Z"
},
"relationships": {
"persons": {
"data": [
{
"type": "people",
"id": "people1",
"attributes": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com"
}
}
]
},
"companies": {
"data": [
{
"type": "company",
"id": "company_tenant",
"attributes": {
"name": "Acme Corporation",
"description": "Leading technology company",
"website": "https://acme.com"
}
}
]
},
"workspaces": {
"data": [
{
"type": "workspace",
"external_workspace_id": "fygr_123",
"attributes": {
"name": "Sales Team Workspace",
"description": "Workspace for sales activities"
}
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"attributes": {
"name": "Marketing Team Workspace",
"description": "Workspace for marketing campaigns"
}
}
]
}
}
}
]
}{
"code": "SCHEMA_VALIDATION_ERROR",
"status": 400,
"title": "Validation Error",
"message": "The request is invalid",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
},
"details": [
{
"instancePath": "<string>",
"schemaPath": "<string>",
"keyword": "<string>",
"params": {},
"message": "<string>"
}
]
}{
"code": "UNAUTHORIZED",
"status": 401,
"title": "Unauthorized",
"message": "You are not authorized to access this resource",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
}
}{
"code": "PERSON_NOT_FOUND",
"status": 404,
"title": "Person Not Found",
"message": "The requested person could not be found",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
}
}Phones
Create Phone
Create a new phone number with relationships to people, companies, or workspaces
POST
/
v1
/
phones
Create phone
curl --request POST \
--url https://api.wellapp.ai/v1/phones \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "phone",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"country_code": 1,
"national_number": "4155552671",
"e164_number": "+14155552671",
"label": "work",
"is_primary": true,
"is_verified": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"relationships": {
"persons": {
"data": [
{
"type": "people",
"id": "people1"
}
]
},
"companies": {
"data": [
{
"type": "company",
"id": "company_tenant"
}
]
},
"workspaces": {
"data": [
{
"type": "workspace",
"id": "workspace_sales"
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
]
}
}
},
"included": [
{
"type": "people",
"id": "people1",
"attributes": {
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
},
{
"type": "company",
"id": "company_tenant",
"attributes": {
"name": "Acme Corporation",
"description": "Leading technology company",
"locale": "en",
"domain_name_primary_link_url": "acme.com",
"created_at": "2023-12-01T09:00:00Z",
"updated_at": "2023-12-01T09:00:00Z"
}
},
{
"type": "workspace",
"id": "workspace_sales",
"attributes": {
"name": "Sales Team Workspace",
"description": "Workspace for sales activities",
"avatar_color": "#FF6B35",
"external_workspace_id": "fygr_123",
"auto_extract_enabled": true,
"created_at": "2024-01-10T08:15:00Z",
"updated_at": "2024-01-10T08:15:00Z"
}
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"attributes": {
"name": "Marketing Team Workspace",
"description": "Workspace for marketing campaigns",
"avatar_color": "#4A90E2",
"external_workspace_id": "mkt_workspace_001",
"auto_extract_enabled": false,
"created_at": "2024-01-12T14:45:00Z",
"updated_at": "2024-01-12T14:45:00Z"
}
}
]
}
'import requests
url = "https://api.wellapp.ai/v1/phones"
payload = {
"data": {
"type": "phone",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"country_code": 1,
"national_number": "4155552671",
"e164_number": "+14155552671",
"label": "work",
"is_primary": True,
"is_verified": True,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"relationships": {
"persons": { "data": [
{
"type": "people",
"id": "people1"
}
] },
"companies": { "data": [
{
"type": "company",
"id": "company_tenant"
}
] },
"workspaces": { "data": [
{
"type": "workspace",
"id": "workspace_sales"
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
] }
}
},
"included": [
{
"type": "people",
"id": "people1",
"attributes": {
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
},
{
"type": "company",
"id": "company_tenant",
"attributes": {
"name": "Acme Corporation",
"description": "Leading technology company",
"locale": "en",
"domain_name_primary_link_url": "acme.com",
"created_at": "2023-12-01T09:00:00Z",
"updated_at": "2023-12-01T09:00:00Z"
}
},
{
"type": "workspace",
"id": "workspace_sales",
"attributes": {
"name": "Sales Team Workspace",
"description": "Workspace for sales activities",
"avatar_color": "#FF6B35",
"external_workspace_id": "fygr_123",
"auto_extract_enabled": True,
"created_at": "2024-01-10T08:15:00Z",
"updated_at": "2024-01-10T08:15:00Z"
}
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"attributes": {
"name": "Marketing Team Workspace",
"description": "Workspace for marketing campaigns",
"avatar_color": "#4A90E2",
"external_workspace_id": "mkt_workspace_001",
"auto_extract_enabled": False,
"created_at": "2024-01-12T14:45:00Z",
"updated_at": "2024-01-12T14:45:00Z"
}
}
]
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'phone',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
attributes: {
country_code: 1,
national_number: '4155552671',
e164_number: '+14155552671',
label: 'work',
is_primary: true,
is_verified: true,
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z'
},
relationships: {
persons: {data: [{type: 'people', id: 'people1'}]},
companies: {data: [{type: 'company', id: 'company_tenant'}]},
workspaces: {
data: [
{type: 'workspace', id: 'workspace_sales'},
{type: 'workspace', id: '550e8400-e29b-41d4-a716-446655440000'}
]
}
}
},
included: [
{
type: 'people',
id: 'people1',
attributes: {
first_name: 'John',
last_name: 'Doe',
full_name: 'John Doe',
created_at: '2024-01-15T10:30:00Z',
updated_at: '2024-01-15T10:30:00Z'
}
},
{
type: 'company',
id: 'company_tenant',
attributes: {
name: 'Acme Corporation',
description: 'Leading technology company',
locale: 'en',
domain_name_primary_link_url: 'acme.com',
created_at: '2023-12-01T09:00:00Z',
updated_at: '2023-12-01T09:00:00Z'
}
},
{
type: 'workspace',
id: 'workspace_sales',
attributes: {
name: 'Sales Team Workspace',
description: 'Workspace for sales activities',
avatar_color: '#FF6B35',
external_workspace_id: 'fygr_123',
auto_extract_enabled: true,
created_at: '2024-01-10T08:15:00Z',
updated_at: '2024-01-10T08:15:00Z'
}
},
{
type: 'workspace',
id: '550e8400-e29b-41d4-a716-446655440000',
attributes: {
name: 'Marketing Team Workspace',
description: 'Workspace for marketing campaigns',
avatar_color: '#4A90E2',
external_workspace_id: 'mkt_workspace_001',
auto_extract_enabled: false,
created_at: '2024-01-12T14:45:00Z',
updated_at: '2024-01-12T14:45:00Z'
}
}
]
})
};
fetch('https://api.wellapp.ai/v1/phones', 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.wellapp.ai/v1/phones",
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([
'data' => [
'type' => 'phone',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'attributes' => [
'country_code' => 1,
'national_number' => '4155552671',
'e164_number' => '+14155552671',
'label' => 'work',
'is_primary' => true,
'is_verified' => true,
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z'
],
'relationships' => [
'persons' => [
'data' => [
[
'type' => 'people',
'id' => 'people1'
]
]
],
'companies' => [
'data' => [
[
'type' => 'company',
'id' => 'company_tenant'
]
]
],
'workspaces' => [
'data' => [
[
'type' => 'workspace',
'id' => 'workspace_sales'
],
[
'type' => 'workspace',
'id' => '550e8400-e29b-41d4-a716-446655440000'
]
]
]
]
],
'included' => [
[
'type' => 'people',
'id' => 'people1',
'attributes' => [
'first_name' => 'John',
'last_name' => 'Doe',
'full_name' => 'John Doe',
'created_at' => '2024-01-15T10:30:00Z',
'updated_at' => '2024-01-15T10:30:00Z'
]
],
[
'type' => 'company',
'id' => 'company_tenant',
'attributes' => [
'name' => 'Acme Corporation',
'description' => 'Leading technology company',
'locale' => 'en',
'domain_name_primary_link_url' => 'acme.com',
'created_at' => '2023-12-01T09:00:00Z',
'updated_at' => '2023-12-01T09:00:00Z'
]
],
[
'type' => 'workspace',
'id' => 'workspace_sales',
'attributes' => [
'name' => 'Sales Team Workspace',
'description' => 'Workspace for sales activities',
'avatar_color' => '#FF6B35',
'external_workspace_id' => 'fygr_123',
'auto_extract_enabled' => true,
'created_at' => '2024-01-10T08:15:00Z',
'updated_at' => '2024-01-10T08:15:00Z'
]
],
[
'type' => 'workspace',
'id' => '550e8400-e29b-41d4-a716-446655440000',
'attributes' => [
'name' => 'Marketing Team Workspace',
'description' => 'Workspace for marketing campaigns',
'avatar_color' => '#4A90E2',
'external_workspace_id' => 'mkt_workspace_001',
'auto_extract_enabled' => false,
'created_at' => '2024-01-12T14:45:00Z',
'updated_at' => '2024-01-12T14:45:00Z'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://api.wellapp.ai/v1/phones"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"phone\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"country_code\": 1,\n \"national_number\": \"4155552671\",\n \"e164_number\": \"+14155552671\",\n \"label\": \"work\",\n \"is_primary\": true,\n \"is_verified\": true,\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n },\n \"relationships\": {\n \"persons\": {\n \"data\": [\n {\n \"type\": \"people\",\n \"id\": \"people1\"\n }\n ]\n },\n \"companies\": {\n \"data\": [\n {\n \"type\": \"company\",\n \"id\": \"company_tenant\"\n }\n ]\n },\n \"workspaces\": {\n \"data\": [\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_sales\"\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n }\n }\n },\n \"included\": [\n {\n \"type\": \"people\",\n \"id\": \"people1\",\n \"attributes\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"full_name\": \"John Doe\",\n \"created_at\": \"2024-01-15T10:30:00Z\",\n \"updated_at\": \"2024-01-15T10:30:00Z\"\n }\n },\n {\n \"type\": \"company\",\n \"id\": \"company_tenant\",\n \"attributes\": {\n \"name\": \"Acme Corporation\",\n \"description\": \"Leading technology company\",\n \"locale\": \"en\",\n \"domain_name_primary_link_url\": \"acme.com\",\n \"created_at\": \"2023-12-01T09:00:00Z\",\n \"updated_at\": \"2023-12-01T09:00:00Z\"\n }\n },\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_sales\",\n \"attributes\": {\n \"name\": \"Sales Team Workspace\",\n \"description\": \"Workspace for sales activities\",\n \"avatar_color\": \"#FF6B35\",\n \"external_workspace_id\": \"fygr_123\",\n \"auto_extract_enabled\": true,\n \"created_at\": \"2024-01-10T08:15:00Z\",\n \"updated_at\": \"2024-01-10T08:15:00Z\"\n }\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"attributes\": {\n \"name\": \"Marketing Team Workspace\",\n \"description\": \"Workspace for marketing campaigns\",\n \"avatar_color\": \"#4A90E2\",\n \"external_workspace_id\": \"mkt_workspace_001\",\n \"auto_extract_enabled\": false,\n \"created_at\": \"2024-01-12T14:45:00Z\",\n \"updated_at\": \"2024-01-12T14:45:00Z\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.wellapp.ai/v1/phones")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"phone\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"country_code\": 1,\n \"national_number\": \"4155552671\",\n \"e164_number\": \"+14155552671\",\n \"label\": \"work\",\n \"is_primary\": true,\n \"is_verified\": true,\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n },\n \"relationships\": {\n \"persons\": {\n \"data\": [\n {\n \"type\": \"people\",\n \"id\": \"people1\"\n }\n ]\n },\n \"companies\": {\n \"data\": [\n {\n \"type\": \"company\",\n \"id\": \"company_tenant\"\n }\n ]\n },\n \"workspaces\": {\n \"data\": [\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_sales\"\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n }\n }\n },\n \"included\": [\n {\n \"type\": \"people\",\n \"id\": \"people1\",\n \"attributes\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"full_name\": \"John Doe\",\n \"created_at\": \"2024-01-15T10:30:00Z\",\n \"updated_at\": \"2024-01-15T10:30:00Z\"\n }\n },\n {\n \"type\": \"company\",\n \"id\": \"company_tenant\",\n \"attributes\": {\n \"name\": \"Acme Corporation\",\n \"description\": \"Leading technology company\",\n \"locale\": \"en\",\n \"domain_name_primary_link_url\": \"acme.com\",\n \"created_at\": \"2023-12-01T09:00:00Z\",\n \"updated_at\": \"2023-12-01T09:00:00Z\"\n }\n },\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_sales\",\n \"attributes\": {\n \"name\": \"Sales Team Workspace\",\n \"description\": \"Workspace for sales activities\",\n \"avatar_color\": \"#FF6B35\",\n \"external_workspace_id\": \"fygr_123\",\n \"auto_extract_enabled\": true,\n \"created_at\": \"2024-01-10T08:15:00Z\",\n \"updated_at\": \"2024-01-10T08:15:00Z\"\n }\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"attributes\": {\n \"name\": \"Marketing Team Workspace\",\n \"description\": \"Workspace for marketing campaigns\",\n \"avatar_color\": \"#4A90E2\",\n \"external_workspace_id\": \"mkt_workspace_001\",\n \"auto_extract_enabled\": false,\n \"created_at\": \"2024-01-12T14:45:00Z\",\n \"updated_at\": \"2024-01-12T14:45:00Z\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/phones")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"phone\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"country_code\": 1,\n \"national_number\": \"4155552671\",\n \"e164_number\": \"+14155552671\",\n \"label\": \"work\",\n \"is_primary\": true,\n \"is_verified\": true,\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n },\n \"relationships\": {\n \"persons\": {\n \"data\": [\n {\n \"type\": \"people\",\n \"id\": \"people1\"\n }\n ]\n },\n \"companies\": {\n \"data\": [\n {\n \"type\": \"company\",\n \"id\": \"company_tenant\"\n }\n ]\n },\n \"workspaces\": {\n \"data\": [\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_sales\"\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n }\n }\n },\n \"included\": [\n {\n \"type\": \"people\",\n \"id\": \"people1\",\n \"attributes\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"full_name\": \"John Doe\",\n \"created_at\": \"2024-01-15T10:30:00Z\",\n \"updated_at\": \"2024-01-15T10:30:00Z\"\n }\n },\n {\n \"type\": \"company\",\n \"id\": \"company_tenant\",\n \"attributes\": {\n \"name\": \"Acme Corporation\",\n \"description\": \"Leading technology company\",\n \"locale\": \"en\",\n \"domain_name_primary_link_url\": \"acme.com\",\n \"created_at\": \"2023-12-01T09:00:00Z\",\n \"updated_at\": \"2023-12-01T09:00:00Z\"\n }\n },\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_sales\",\n \"attributes\": {\n \"name\": \"Sales Team Workspace\",\n \"description\": \"Workspace for sales activities\",\n \"avatar_color\": \"#FF6B35\",\n \"external_workspace_id\": \"fygr_123\",\n \"auto_extract_enabled\": true,\n \"created_at\": \"2024-01-10T08:15:00Z\",\n \"updated_at\": \"2024-01-10T08:15:00Z\"\n }\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"attributes\": {\n \"name\": \"Marketing Team Workspace\",\n \"description\": \"Workspace for marketing campaigns\",\n \"avatar_color\": \"#4A90E2\",\n \"external_workspace_id\": \"mkt_workspace_001\",\n \"auto_extract_enabled\": false,\n \"created_at\": \"2024-01-12T14:45:00Z\",\n \"updated_at\": \"2024-01-12T14:45:00Z\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"type": "phone",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"country_code": 1,
"national_number": "4155552671",
"e164_number": "+14155552671",
"label": "work",
"is_primary": true,
"is_verified": true,
"created_at": "2023-11-07T05:31:56Z"
},
"relationships": {
"persons": {
"data": [
{
"type": "people",
"id": "people1",
"attributes": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com"
}
}
]
},
"companies": {
"data": [
{
"type": "company",
"id": "company_tenant",
"attributes": {
"name": "Acme Corporation",
"description": "Leading technology company",
"website": "https://acme.com"
}
}
]
},
"workspaces": {
"data": [
{
"type": "workspace",
"external_workspace_id": "fygr_123",
"attributes": {
"name": "Sales Team Workspace",
"description": "Workspace for sales activities"
}
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"attributes": {
"name": "Marketing Team Workspace",
"description": "Workspace for marketing campaigns"
}
}
]
}
}
}
]
}{
"code": "SCHEMA_VALIDATION_ERROR",
"status": 400,
"title": "Validation Error",
"message": "The request is invalid",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
},
"details": [
{
"instancePath": "<string>",
"schemaPath": "<string>",
"keyword": "<string>",
"params": {},
"message": "<string>"
}
]
}{
"code": "UNAUTHORIZED",
"status": 401,
"title": "Unauthorized",
"message": "You are not authorized to access this resource",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
}
}{
"code": "PERSON_NOT_FOUND",
"status": 404,
"title": "Person Not Found",
"message": "The requested person could not be found",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
}
}⌘I