import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.directory.update({
memberId: 941217,
directoryMemberUpdate: {
name: "Jane Doe",
type: "contact",
extensions: [
{
name: "work",
numbers: [
{
number: "+1234567890",
rules: [
{
"language": "en",
},
],
},
],
},
],
contactTags: {
"tag1": [
"value1",
],
"tag2": [
"value2",
],
},
comments: "Updated phone number",
id: 1,
},
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.directory.update(member_id=941217, directory_member_update={
"name": "Jane Doe",
"type": "contact",
"extensions": [
{
"name": "work",
"numbers": [
{
"number": "+1234567890",
"rules": [
{
"language": "en",
},
],
},
],
},
],
"contact_tags": {
"tag1": [
"value1",
],
"tag2": [
"value2",
],
},
"comments": "Updated phone number",
"id": 1,
})
# Handle response
print(res)curl --request PUT \
--url https://api.syllable.cloud/api/v1/directory_members/{member_id} \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"type": "<string>",
"id": 123,
"extensions": [
{
"name": "work",
"numbers": [
{
"number": "+1234567890",
"rules": [
{
"language": "en"
}
]
}
]
}
],
"contact_tags": {
"tag1": [
"value1"
],
"tag2": [
"value2"
]
},
"comments": "Updated to add new extension"
}
'const options = {
method: 'PUT',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
type: '<string>',
id: 123,
extensions: [{name: 'work', numbers: [{number: '+1234567890', rules: [{language: 'en'}]}]}],
contact_tags: {tag1: ['value1'], tag2: ['value2']},
comments: 'Updated to add new extension'
})
};
fetch('https://api.syllable.cloud/api/v1/directory_members/{member_id}', 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.syllable.cloud/api/v1/directory_members/{member_id}",
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([
'name' => '<string>',
'type' => '<string>',
'id' => 123,
'extensions' => [
[
'name' => 'work',
'numbers' => [
[
'number' => '+1234567890',
'rules' => [
[
'language' => 'en'
]
]
]
]
]
],
'contact_tags' => [
'tag1' => [
'value1'
],
'tag2' => [
'value2'
]
],
'comments' => 'Updated to add new extension'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Syllable-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.syllable.cloud/api/v1/directory_members/{member_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"id\": 123,\n \"extensions\": [\n {\n \"name\": \"work\",\n \"numbers\": [\n {\n \"number\": \"+1234567890\",\n \"rules\": [\n {\n \"language\": \"en\"\n }\n ]\n }\n ]\n }\n ],\n \"contact_tags\": {\n \"tag1\": [\n \"value1\"\n ],\n \"tag2\": [\n \"value2\"\n ]\n },\n \"comments\": \"Updated to add new extension\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Syllable-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.put("https://api.syllable.cloud/api/v1/directory_members/{member_id}")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"id\": 123,\n \"extensions\": [\n {\n \"name\": \"work\",\n \"numbers\": [\n {\n \"number\": \"+1234567890\",\n \"rules\": [\n {\n \"language\": \"en\"\n }\n ]\n }\n ]\n }\n ],\n \"contact_tags\": {\n \"tag1\": [\n \"value1\"\n ],\n \"tag2\": [\n \"value2\"\n ]\n },\n \"comments\": \"Updated to add new extension\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/directory_members/{member_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"id\": 123,\n \"extensions\": [\n {\n \"name\": \"work\",\n \"numbers\": [\n {\n \"number\": \"+1234567890\",\n \"rules\": [\n {\n \"language\": \"en\"\n }\n ]\n }\n ]\n }\n ],\n \"contact_tags\": {\n \"tag1\": [\n \"value1\"\n ],\n \"tag2\": [\n \"value2\"\n ]\n },\n \"comments\": \"Updated to add new extension\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"type": "<string>",
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"extensions": [
{
"name": "work",
"numbers": [
{
"number": "+1234567890",
"rules": [
{
"language": "en"
}
]
}
]
}
],
"contact_tags": {
"tag1": [
"value1"
],
"tag2": [
"value2"
]
},
"comments": "Updated to add new extension",
"deleted_at": null,
"last_updated_by": "user@email.com",
"created_by": "user@email.com"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Update Directory Member
Update a DirectoryMember.
import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.directory.update({
memberId: 941217,
directoryMemberUpdate: {
name: "Jane Doe",
type: "contact",
extensions: [
{
name: "work",
numbers: [
{
number: "+1234567890",
rules: [
{
"language": "en",
},
],
},
],
},
],
contactTags: {
"tag1": [
"value1",
],
"tag2": [
"value2",
],
},
comments: "Updated phone number",
id: 1,
},
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.directory.update(member_id=941217, directory_member_update={
"name": "Jane Doe",
"type": "contact",
"extensions": [
{
"name": "work",
"numbers": [
{
"number": "+1234567890",
"rules": [
{
"language": "en",
},
],
},
],
},
],
"contact_tags": {
"tag1": [
"value1",
],
"tag2": [
"value2",
],
},
"comments": "Updated phone number",
"id": 1,
})
# Handle response
print(res)curl --request PUT \
--url https://api.syllable.cloud/api/v1/directory_members/{member_id} \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"type": "<string>",
"id": 123,
"extensions": [
{
"name": "work",
"numbers": [
{
"number": "+1234567890",
"rules": [
{
"language": "en"
}
]
}
]
}
],
"contact_tags": {
"tag1": [
"value1"
],
"tag2": [
"value2"
]
},
"comments": "Updated to add new extension"
}
'const options = {
method: 'PUT',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
type: '<string>',
id: 123,
extensions: [{name: 'work', numbers: [{number: '+1234567890', rules: [{language: 'en'}]}]}],
contact_tags: {tag1: ['value1'], tag2: ['value2']},
comments: 'Updated to add new extension'
})
};
fetch('https://api.syllable.cloud/api/v1/directory_members/{member_id}', 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.syllable.cloud/api/v1/directory_members/{member_id}",
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([
'name' => '<string>',
'type' => '<string>',
'id' => 123,
'extensions' => [
[
'name' => 'work',
'numbers' => [
[
'number' => '+1234567890',
'rules' => [
[
'language' => 'en'
]
]
]
]
]
],
'contact_tags' => [
'tag1' => [
'value1'
],
'tag2' => [
'value2'
]
],
'comments' => 'Updated to add new extension'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Syllable-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.syllable.cloud/api/v1/directory_members/{member_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"id\": 123,\n \"extensions\": [\n {\n \"name\": \"work\",\n \"numbers\": [\n {\n \"number\": \"+1234567890\",\n \"rules\": [\n {\n \"language\": \"en\"\n }\n ]\n }\n ]\n }\n ],\n \"contact_tags\": {\n \"tag1\": [\n \"value1\"\n ],\n \"tag2\": [\n \"value2\"\n ]\n },\n \"comments\": \"Updated to add new extension\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Syllable-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.put("https://api.syllable.cloud/api/v1/directory_members/{member_id}")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"id\": 123,\n \"extensions\": [\n {\n \"name\": \"work\",\n \"numbers\": [\n {\n \"number\": \"+1234567890\",\n \"rules\": [\n {\n \"language\": \"en\"\n }\n ]\n }\n ]\n }\n ],\n \"contact_tags\": {\n \"tag1\": [\n \"value1\"\n ],\n \"tag2\": [\n \"value2\"\n ]\n },\n \"comments\": \"Updated to add new extension\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/directory_members/{member_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"id\": 123,\n \"extensions\": [\n {\n \"name\": \"work\",\n \"numbers\": [\n {\n \"number\": \"+1234567890\",\n \"rules\": [\n {\n \"language\": \"en\"\n }\n ]\n }\n ]\n }\n ],\n \"contact_tags\": {\n \"tag1\": [\n \"value1\"\n ],\n \"tag2\": [\n \"value2\"\n ]\n },\n \"comments\": \"Updated to add new extension\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"type": "<string>",
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"extensions": [
{
"name": "work",
"numbers": [
{
"number": "+1234567890",
"rules": [
{
"language": "en"
}
]
}
]
}
],
"contact_tags": {
"tag1": [
"value1"
],
"tag2": [
"value2"
]
},
"comments": "Updated to add new extension",
"deleted_at": null,
"last_updated_by": "user@email.com",
"created_by": "user@email.com"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Path Parameters
Query Parameters
Directory response format: normalized (default) strips @hours and formats times; raw returns stored @hours values.
normalized, raw Body
Request model to update a directory member.
Name of the directory member
"Jane Doe"
Type of the directory member
"Operator"
Internal ID of the directory member
1
List of extensions for the directory member
Show child attributes
Show child attributes
[
{
"name": "work",
"numbers": [
{
"number": "+1234567890",
"rules": [{ "language": "en" }]
}
]
}
]Tags for the directory member
Show child attributes
Show child attributes
{ "tag1": ["value1"], "tag2": ["value2"] }The comments for the most recent edit to the directory member
"Updated to add new extension"
Response
Successful Response
Model for a directory member (i.e. a contact).
Name of the directory member
"Jane Doe"
Type of the directory member
"Operator"
Internal ID of the directory member
1
When the contact was created
"2024-01-01T00:00:00Z"
Timestamp of most recent update
"2024-01-01T00:00:00Z"
List of extensions for the directory member
Show child attributes
Show child attributes
[
{
"name": "work",
"numbers": [
{
"number": "+1234567890",
"rules": [{ "language": "en" }]
}
]
}
]Tags for the directory member
Show child attributes
Show child attributes
{ "tag1": ["value1"], "tag2": ["value2"] }The comments for the most recent edit to the directory member
"Updated to add new extension"
When the contact was deleted, if deleted
null
Email of the user who last updated the directory member
"user@email.com"
Email of the user who created the directory member
"user@email.com"

