Create Contact Edition
curl --request PUT \
--url https://preview.intermezzo.ai/gb/organizations/{organization_id}/contact \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contacts": [
{
"email": "payroll@acme.example",
"is_primary": true,
"name": "Jane Smith",
"phone": {
"phone_number": "<string>"
},
"roles": [
"<string>"
]
}
],
"hmrc_sender_email": "payroll@acme.example",
"valid_from": "2023-12-25",
"valid_to": "2023-12-25"
}
'import requests
url = "https://preview.intermezzo.ai/gb/organizations/{organization_id}/contact"
payload = {
"contacts": [
{
"email": "payroll@acme.example",
"is_primary": True,
"name": "Jane Smith",
"phone": { "phone_number": "<string>" },
"roles": ["<string>"]
}
],
"hmrc_sender_email": "payroll@acme.example",
"valid_from": "2023-12-25",
"valid_to": "2023-12-25"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contacts: [
{
email: 'payroll@acme.example',
is_primary: true,
name: 'Jane Smith',
phone: {phone_number: '<string>'},
roles: ['<string>']
}
],
hmrc_sender_email: 'payroll@acme.example',
valid_from: '2023-12-25',
valid_to: '2023-12-25'
})
};
fetch('https://preview.intermezzo.ai/gb/organizations/{organization_id}/contact', 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://preview.intermezzo.ai/gb/organizations/{organization_id}/contact",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'contacts' => [
[
'email' => 'payroll@acme.example',
'is_primary' => true,
'name' => 'Jane Smith',
'phone' => [
'phone_number' => '<string>'
],
'roles' => [
'<string>'
]
]
],
'hmrc_sender_email' => 'payroll@acme.example',
'valid_from' => '2023-12-25',
'valid_to' => '2023-12-25'
]),
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://preview.intermezzo.ai/gb/organizations/{organization_id}/contact"
payload := strings.NewReader("{\n \"contacts\": [\n {\n \"email\": \"payroll@acme.example\",\n \"is_primary\": true,\n \"name\": \"Jane Smith\",\n \"phone\": {\n \"phone_number\": \"<string>\"\n },\n \"roles\": [\n \"<string>\"\n ]\n }\n ],\n \"hmrc_sender_email\": \"payroll@acme.example\",\n \"valid_from\": \"2023-12-25\",\n \"valid_to\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://preview.intermezzo.ai/gb/organizations/{organization_id}/contact")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contacts\": [\n {\n \"email\": \"payroll@acme.example\",\n \"is_primary\": true,\n \"name\": \"Jane Smith\",\n \"phone\": {\n \"phone_number\": \"<string>\"\n },\n \"roles\": [\n \"<string>\"\n ]\n }\n ],\n \"hmrc_sender_email\": \"payroll@acme.example\",\n \"valid_from\": \"2023-12-25\",\n \"valid_to\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://preview.intermezzo.ai/gb/organizations/{organization_id}/contact")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contacts\": [\n {\n \"email\": \"payroll@acme.example\",\n \"is_primary\": true,\n \"name\": \"Jane Smith\",\n \"phone\": {\n \"phone_number\": \"<string>\"\n },\n \"roles\": [\n \"<string>\"\n ]\n }\n ],\n \"hmrc_sender_email\": \"payroll@acme.example\",\n \"valid_from\": \"2023-12-25\",\n \"valid_to\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"edition": 123,
"valid_from": "2023-12-25",
"valid_to": "2023-12-25",
"contacts": [
{
"name": "Jane Smith",
"email": "<string>",
"is_primary": false,
"phone": {
"phone_number": "<string>",
"phone_type": "MOBILE"
},
"roles": [
"<string>"
]
}
],
"hmrc_sender_email": "<string>"
}Contact
Create Contact Edition
If-Match carries the edition of the slice the range starts in, as read. A satellite not yet written is created by a PUT with If-None-Match: * instead, on a range that runs to 9999-12-31. The response’s ETag is the edition written.
PUT
/
gb
/
organizations
/
{organization_id}
/
contact
Create Contact Edition
curl --request PUT \
--url https://preview.intermezzo.ai/gb/organizations/{organization_id}/contact \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contacts": [
{
"email": "payroll@acme.example",
"is_primary": true,
"name": "Jane Smith",
"phone": {
"phone_number": "<string>"
},
"roles": [
"<string>"
]
}
],
"hmrc_sender_email": "payroll@acme.example",
"valid_from": "2023-12-25",
"valid_to": "2023-12-25"
}
'import requests
url = "https://preview.intermezzo.ai/gb/organizations/{organization_id}/contact"
payload = {
"contacts": [
{
"email": "payroll@acme.example",
"is_primary": True,
"name": "Jane Smith",
"phone": { "phone_number": "<string>" },
"roles": ["<string>"]
}
],
"hmrc_sender_email": "payroll@acme.example",
"valid_from": "2023-12-25",
"valid_to": "2023-12-25"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contacts: [
{
email: 'payroll@acme.example',
is_primary: true,
name: 'Jane Smith',
phone: {phone_number: '<string>'},
roles: ['<string>']
}
],
hmrc_sender_email: 'payroll@acme.example',
valid_from: '2023-12-25',
valid_to: '2023-12-25'
})
};
fetch('https://preview.intermezzo.ai/gb/organizations/{organization_id}/contact', 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://preview.intermezzo.ai/gb/organizations/{organization_id}/contact",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'contacts' => [
[
'email' => 'payroll@acme.example',
'is_primary' => true,
'name' => 'Jane Smith',
'phone' => [
'phone_number' => '<string>'
],
'roles' => [
'<string>'
]
]
],
'hmrc_sender_email' => 'payroll@acme.example',
'valid_from' => '2023-12-25',
'valid_to' => '2023-12-25'
]),
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://preview.intermezzo.ai/gb/organizations/{organization_id}/contact"
payload := strings.NewReader("{\n \"contacts\": [\n {\n \"email\": \"payroll@acme.example\",\n \"is_primary\": true,\n \"name\": \"Jane Smith\",\n \"phone\": {\n \"phone_number\": \"<string>\"\n },\n \"roles\": [\n \"<string>\"\n ]\n }\n ],\n \"hmrc_sender_email\": \"payroll@acme.example\",\n \"valid_from\": \"2023-12-25\",\n \"valid_to\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://preview.intermezzo.ai/gb/organizations/{organization_id}/contact")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contacts\": [\n {\n \"email\": \"payroll@acme.example\",\n \"is_primary\": true,\n \"name\": \"Jane Smith\",\n \"phone\": {\n \"phone_number\": \"<string>\"\n },\n \"roles\": [\n \"<string>\"\n ]\n }\n ],\n \"hmrc_sender_email\": \"payroll@acme.example\",\n \"valid_from\": \"2023-12-25\",\n \"valid_to\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://preview.intermezzo.ai/gb/organizations/{organization_id}/contact")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contacts\": [\n {\n \"email\": \"payroll@acme.example\",\n \"is_primary\": true,\n \"name\": \"Jane Smith\",\n \"phone\": {\n \"phone_number\": \"<string>\"\n },\n \"roles\": [\n \"<string>\"\n ]\n }\n ],\n \"hmrc_sender_email\": \"payroll@acme.example\",\n \"valid_from\": \"2023-12-25\",\n \"valid_to\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"edition": 123,
"valid_from": "2023-12-25",
"valid_to": "2023-12-25",
"contacts": [
{
"name": "Jane Smith",
"email": "<string>",
"is_primary": false,
"phone": {
"phone_number": "<string>",
"phone_type": "MOBILE"
},
"roles": [
"<string>"
]
}
],
"hmrc_sender_email": "<string>"
}Headers
Body
application/json
Response
Successful Response
Was this page helpful?