Set a contact card
curl --request PUT \
--url https://osis.co/api/v1/comms/contact-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"name": "<string>",
"email": "<string>",
"note": "<string>",
"photo_url": "<string>",
"photo_base64": "<string>",
"clear_photo": true
}
'import requests
url = "https://osis.co/api/v1/comms/contact-cards"
payload = {
"agent_id": "<string>",
"name": "<string>",
"email": "<string>",
"note": "<string>",
"photo_url": "<string>",
"photo_base64": "<string>",
"clear_photo": True
}
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({
agent_id: '<string>',
name: '<string>',
email: '<string>',
note: '<string>',
photo_url: '<string>',
photo_base64: '<string>',
clear_photo: true
})
};
fetch('https://osis.co/api/v1/comms/contact-cards', 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://osis.co/api/v1/comms/contact-cards",
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([
'agent_id' => '<string>',
'name' => '<string>',
'email' => '<string>',
'note' => '<string>',
'photo_url' => '<string>',
'photo_base64' => '<string>',
'clear_photo' => true
]),
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://osis.co/api/v1/comms/contact-cards"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"note\": \"<string>\",\n \"photo_url\": \"<string>\",\n \"photo_base64\": \"<string>\",\n \"clear_photo\": true\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://osis.co/api/v1/comms/contact-cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"note\": \"<string>\",\n \"photo_url\": \"<string>\",\n \"photo_base64\": \"<string>\",\n \"clear_photo\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://osis.co/api/v1/comms/contact-cards")
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 \"agent_id\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"note\": \"<string>\",\n \"photo_url\": \"<string>\",\n \"photo_base64\": \"<string>\",\n \"clear_photo\": true\n}"
response = http.request(request)
puts response.read_bodyMessages
Set a contact card
PUT /api/v1/comms/contact-cards — save the hosted card for a dedicated-line agent.
PUT
https://osis.co
/
api
/
v1
/
comms
/
contact-cards
Set a contact card
curl --request PUT \
--url https://osis.co/api/v1/comms/contact-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"name": "<string>",
"email": "<string>",
"note": "<string>",
"photo_url": "<string>",
"photo_base64": "<string>",
"clear_photo": true
}
'import requests
url = "https://osis.co/api/v1/comms/contact-cards"
payload = {
"agent_id": "<string>",
"name": "<string>",
"email": "<string>",
"note": "<string>",
"photo_url": "<string>",
"photo_base64": "<string>",
"clear_photo": True
}
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({
agent_id: '<string>',
name: '<string>',
email: '<string>',
note: '<string>',
photo_url: '<string>',
photo_base64: '<string>',
clear_photo: true
})
};
fetch('https://osis.co/api/v1/comms/contact-cards', 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://osis.co/api/v1/comms/contact-cards",
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([
'agent_id' => '<string>',
'name' => '<string>',
'email' => '<string>',
'note' => '<string>',
'photo_url' => '<string>',
'photo_base64' => '<string>',
'clear_photo' => true
]),
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://osis.co/api/v1/comms/contact-cards"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"note\": \"<string>\",\n \"photo_url\": \"<string>\",\n \"photo_base64\": \"<string>\",\n \"clear_photo\": true\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://osis.co/api/v1/comms/contact-cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"note\": \"<string>\",\n \"photo_url\": \"<string>\",\n \"photo_base64\": \"<string>\",\n \"clear_photo\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://osis.co/api/v1/comms/contact-cards")
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 \"agent_id\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"note\": \"<string>\",\n \"photo_url\": \"<string>\",\n \"photo_base64\": \"<string>\",\n \"clear_photo\": true\n}"
response = http.request(request)
puts response.read_bodySave the name, photo, and note a dedicated-line agent shows as its contact. People who text that number can add it.
Shared-line agents cannot set a card — one number cannot be many identities. Returns
The number is always the agent’s dedicated line. Hosted Settings → Identity has the same editor.
409 dedicated_line_required.
Scope: comms_send to write, comms_read to read.
Set
curl -X PUT "https://osis.co/api/v1/comms/contact-cards" \
-H "Authorization: Bearer $COMMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agent_01HZX…",
"name": "Jane Doe",
"photo_url": "https://example.com/jane.jpg"
}'
Body
string
required
Dedicated-line agent.
string
Name on the card and the iMessage add-contact prompt.
string
Optional email.
string
Optional note.
string
HTTPS JPEG, PNG, or GIF, max 200KB.
string
Same image as raw base64 or a data URL.
boolean
Drop the saved photo.
Read
curl "https://osis.co/api/v1/comms/contact-cards?agent_id=agent_01HZX…" \
-H "Authorization: Bearer $COMMS_API_KEY"
{
"contact_card": {
"agent_id": "agent_01HZX…",
"name": "Jane Doe",
"phone": "+16319869528",
"has_photo": true,
"dedicated": true,
"line_synced": true
}
}
line_synced is true when the dedicated iMessage line accepted the name and photo for Add Contact.⌘I