Create email
curl --request POST \
--url https://api.wellapp.ai/v1/emails \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"attributes": {
"value": "sarah.wilson@techcorp.com",
"is_primary": true,
"label": "work"
},
"relationships": {
"persons": {
"data": [
{
"type": "people",
"id": "people1"
}
]
},
"companies": {
"data": [
{
"type": "company",
"id": "company_tenant"
}
]
},
"workspaces": {
"data": [
{
"type": "workspace",
"external_workspace_id": "fygr_123"
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
]
}
}
}
'import requests
url = "https://api.wellapp.ai/v1/emails"
payload = {
"attributes": {
"value": "sarah.wilson@techcorp.com",
"is_primary": True,
"label": "work"
},
"relationships": {
"persons": { "data": [
{
"type": "people",
"id": "people1"
}
] },
"companies": { "data": [
{
"type": "company",
"id": "company_tenant"
}
] },
"workspaces": { "data": [
{
"type": "workspace",
"external_workspace_id": "fygr_123"
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
] }
}
}
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({
attributes: {value: 'sarah.wilson@techcorp.com', is_primary: true, label: 'work'},
relationships: {
persons: {data: [{type: 'people', id: 'people1'}]},
companies: {data: [{type: 'company', id: 'company_tenant'}]},
workspaces: {
data: [
{type: 'workspace', external_workspace_id: 'fygr_123'},
{type: 'workspace', id: '550e8400-e29b-41d4-a716-446655440000'}
]
}
}
})
};
fetch('https://api.wellapp.ai/v1/emails', 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/emails",
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([
'attributes' => [
'value' => 'sarah.wilson@techcorp.com',
'is_primary' => true,
'label' => 'work'
],
'relationships' => [
'persons' => [
'data' => [
[
'type' => 'people',
'id' => 'people1'
]
]
],
'companies' => [
'data' => [
[
'type' => 'company',
'id' => 'company_tenant'
]
]
],
'workspaces' => [
'data' => [
[
'type' => 'workspace',
'external_workspace_id' => 'fygr_123'
],
[
'type' => 'workspace',
'id' => '550e8400-e29b-41d4-a716-446655440000'
]
]
]
]
]),
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/emails"
payload := strings.NewReader("{\n \"attributes\": {\n \"value\": \"sarah.wilson@techcorp.com\",\n \"is_primary\": true,\n \"label\": \"work\"\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 \"external_workspace_id\": \"fygr_123\"\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\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/emails")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"attributes\": {\n \"value\": \"sarah.wilson@techcorp.com\",\n \"is_primary\": true,\n \"label\": \"work\"\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 \"external_workspace_id\": \"fygr_123\"\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/emails")
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 \"attributes\": {\n \"value\": \"sarah.wilson@techcorp.com\",\n \"is_primary\": true,\n \"label\": \"work\"\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 \"external_workspace_id\": \"fygr_123\"\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "email",
"id": "email1-uuid",
"attributes": {
"value": "sarah.wilson@techcorp.com",
"is_primary": true,
"is_verified": true,
"label": "work",
"created_at": "2023-06-15T10:30:00Z",
"updated_at": "2023-06-15T10:30:00Z"
},
"relationships": {
"persons": {
"data": [
{
"type": "people",
"id": "person1-uuid"
}
]
},
"companies": {
"data": [
{
"type": "company",
"id": "company1-uuid"
}
]
},
"workspaces": {
"data": [
{
"type": "workspace",
"id": "workspace1-uuid"
}
]
}
}
},
"included": [
{
"type": "people",
"id": "person1-uuid",
"attributes": {
"first_name": "Sarah",
"last_name": "Wilson",
"full_name": "Sarah Wilson",
"created_at": "2023-06-15T09:00:00Z",
"updated_at": "2023-06-15T09:00:00Z"
}
},
{
"type": "company",
"id": "company1-uuid",
"attributes": {
"name": "TechCorp Solutions",
"description": "Leading technology company",
"domain_name_primary_link_url": "techcorp.com",
"locale": "en",
"created_at": "2023-06-01T08:00:00Z",
"updated_at": "2023-06-01T08:00:00Z"
}
},
{
"type": "workspace",
"id": "workspace1-uuid",
"attributes": {
"name": "Sales Team",
"description": "Sales team workspace",
"avatar_color": "#FF5733",
"auto_extract_enabled": true,
"created_at": "2023-06-01T08:00:00Z",
"updated_at": "2023-06-01T08:00:00Z"
}
}
]
}{
"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"
}
}Emails
Create Email
Create a new email address with relationships to people, companies, or workspaces
POST
/
v1
/
emails
Create email
curl --request POST \
--url https://api.wellapp.ai/v1/emails \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"attributes": {
"value": "sarah.wilson@techcorp.com",
"is_primary": true,
"label": "work"
},
"relationships": {
"persons": {
"data": [
{
"type": "people",
"id": "people1"
}
]
},
"companies": {
"data": [
{
"type": "company",
"id": "company_tenant"
}
]
},
"workspaces": {
"data": [
{
"type": "workspace",
"external_workspace_id": "fygr_123"
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
]
}
}
}
'import requests
url = "https://api.wellapp.ai/v1/emails"
payload = {
"attributes": {
"value": "sarah.wilson@techcorp.com",
"is_primary": True,
"label": "work"
},
"relationships": {
"persons": { "data": [
{
"type": "people",
"id": "people1"
}
] },
"companies": { "data": [
{
"type": "company",
"id": "company_tenant"
}
] },
"workspaces": { "data": [
{
"type": "workspace",
"external_workspace_id": "fygr_123"
},
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
] }
}
}
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({
attributes: {value: 'sarah.wilson@techcorp.com', is_primary: true, label: 'work'},
relationships: {
persons: {data: [{type: 'people', id: 'people1'}]},
companies: {data: [{type: 'company', id: 'company_tenant'}]},
workspaces: {
data: [
{type: 'workspace', external_workspace_id: 'fygr_123'},
{type: 'workspace', id: '550e8400-e29b-41d4-a716-446655440000'}
]
}
}
})
};
fetch('https://api.wellapp.ai/v1/emails', 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/emails",
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([
'attributes' => [
'value' => 'sarah.wilson@techcorp.com',
'is_primary' => true,
'label' => 'work'
],
'relationships' => [
'persons' => [
'data' => [
[
'type' => 'people',
'id' => 'people1'
]
]
],
'companies' => [
'data' => [
[
'type' => 'company',
'id' => 'company_tenant'
]
]
],
'workspaces' => [
'data' => [
[
'type' => 'workspace',
'external_workspace_id' => 'fygr_123'
],
[
'type' => 'workspace',
'id' => '550e8400-e29b-41d4-a716-446655440000'
]
]
]
]
]),
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/emails"
payload := strings.NewReader("{\n \"attributes\": {\n \"value\": \"sarah.wilson@techcorp.com\",\n \"is_primary\": true,\n \"label\": \"work\"\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 \"external_workspace_id\": \"fygr_123\"\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\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/emails")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"attributes\": {\n \"value\": \"sarah.wilson@techcorp.com\",\n \"is_primary\": true,\n \"label\": \"work\"\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 \"external_workspace_id\": \"fygr_123\"\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/emails")
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 \"attributes\": {\n \"value\": \"sarah.wilson@techcorp.com\",\n \"is_primary\": true,\n \"label\": \"work\"\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 \"external_workspace_id\": \"fygr_123\"\n },\n {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "email",
"id": "email1-uuid",
"attributes": {
"value": "sarah.wilson@techcorp.com",
"is_primary": true,
"is_verified": true,
"label": "work",
"created_at": "2023-06-15T10:30:00Z",
"updated_at": "2023-06-15T10:30:00Z"
},
"relationships": {
"persons": {
"data": [
{
"type": "people",
"id": "person1-uuid"
}
]
},
"companies": {
"data": [
{
"type": "company",
"id": "company1-uuid"
}
]
},
"workspaces": {
"data": [
{
"type": "workspace",
"id": "workspace1-uuid"
}
]
}
}
},
"included": [
{
"type": "people",
"id": "person1-uuid",
"attributes": {
"first_name": "Sarah",
"last_name": "Wilson",
"full_name": "Sarah Wilson",
"created_at": "2023-06-15T09:00:00Z",
"updated_at": "2023-06-15T09:00:00Z"
}
},
{
"type": "company",
"id": "company1-uuid",
"attributes": {
"name": "TechCorp Solutions",
"description": "Leading technology company",
"domain_name_primary_link_url": "techcorp.com",
"locale": "en",
"created_at": "2023-06-01T08:00:00Z",
"updated_at": "2023-06-01T08:00:00Z"
}
},
{
"type": "workspace",
"id": "workspace1-uuid",
"attributes": {
"name": "Sales Team",
"description": "Sales team workspace",
"avatar_color": "#FF5733",
"auto_extract_enabled": true,
"created_at": "2023-06-01T08:00:00Z",
"updated_at": "2023-06-01T08:00:00Z"
}
}
]
}{
"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