Send a contact card
curl --request POST \
--url https://osis.co/api/v1/comms/contact-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"conversation_id": "<string>",
"contact_id": "<string>",
"agent_id": "<string>",
"name": "<string>",
"phone": "<string>",
"email": "<string>",
"organization": "<string>",
"note": "<string>",
"photo_url": "<string>",
"photo_base64": "<string>",
"caption": "<string>",
"channel": "<string>"
}
'import requests
url = "https://osis.co/api/v1/comms/contact-cards"
payload = {
"to": "<string>",
"conversation_id": "<string>",
"contact_id": "<string>",
"agent_id": "<string>",
"name": "<string>",
"phone": "<string>",
"email": "<string>",
"organization": "<string>",
"note": "<string>",
"photo_url": "<string>",
"photo_base64": "<string>",
"caption": "<string>",
"channel": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
conversation_id: '<string>',
contact_id: '<string>',
agent_id: '<string>',
name: '<string>',
phone: '<string>',
email: '<string>',
organization: '<string>',
note: '<string>',
photo_url: '<string>',
photo_base64: '<string>',
caption: '<string>',
channel: '<string>'
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '<string>',
'conversation_id' => '<string>',
'contact_id' => '<string>',
'agent_id' => '<string>',
'name' => '<string>',
'phone' => '<string>',
'email' => '<string>',
'organization' => '<string>',
'note' => '<string>',
'photo_url' => '<string>',
'photo_base64' => '<string>',
'caption' => '<string>',
'channel' => '<string>'
]),
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 \"to\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"organization\": \"<string>\",\n \"note\": \"<string>\",\n \"photo_url\": \"<string>\",\n \"photo_base64\": \"<string>\",\n \"caption\": \"<string>\",\n \"channel\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://osis.co/api/v1/comms/contact-cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"organization\": \"<string>\",\n \"note\": \"<string>\",\n \"photo_url\": \"<string>\",\n \"photo_base64\": \"<string>\",\n \"caption\": \"<string>\",\n \"channel\": \"<string>\"\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::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"organization\": \"<string>\",\n \"note\": \"<string>\",\n \"photo_url\": \"<string>\",\n \"photo_base64\": \"<string>\",\n \"caption\": \"<string>\",\n \"channel\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyMessages
Send a contact card
POST /api/v1/comms/contact-cards — text a saveable vCard to a phone.
POST
https://osis.co
/
api
/
v1
/
comms
/
contact-cards
Send a contact card
curl --request POST \
--url https://osis.co/api/v1/comms/contact-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"conversation_id": "<string>",
"contact_id": "<string>",
"agent_id": "<string>",
"name": "<string>",
"phone": "<string>",
"email": "<string>",
"organization": "<string>",
"note": "<string>",
"photo_url": "<string>",
"photo_base64": "<string>",
"caption": "<string>",
"channel": "<string>"
}
'import requests
url = "https://osis.co/api/v1/comms/contact-cards"
payload = {
"to": "<string>",
"conversation_id": "<string>",
"contact_id": "<string>",
"agent_id": "<string>",
"name": "<string>",
"phone": "<string>",
"email": "<string>",
"organization": "<string>",
"note": "<string>",
"photo_url": "<string>",
"photo_base64": "<string>",
"caption": "<string>",
"channel": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
conversation_id: '<string>',
contact_id: '<string>',
agent_id: '<string>',
name: '<string>',
phone: '<string>',
email: '<string>',
organization: '<string>',
note: '<string>',
photo_url: '<string>',
photo_base64: '<string>',
caption: '<string>',
channel: '<string>'
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '<string>',
'conversation_id' => '<string>',
'contact_id' => '<string>',
'agent_id' => '<string>',
'name' => '<string>',
'phone' => '<string>',
'email' => '<string>',
'organization' => '<string>',
'note' => '<string>',
'photo_url' => '<string>',
'photo_base64' => '<string>',
'caption' => '<string>',
'channel' => '<string>'
]),
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 \"to\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"organization\": \"<string>\",\n \"note\": \"<string>\",\n \"photo_url\": \"<string>\",\n \"photo_base64\": \"<string>\",\n \"caption\": \"<string>\",\n \"channel\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://osis.co/api/v1/comms/contact-cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"organization\": \"<string>\",\n \"note\": \"<string>\",\n \"photo_url\": \"<string>\",\n \"photo_base64\": \"<string>\",\n \"caption\": \"<string>\",\n \"channel\": \"<string>\"\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::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"<string>\",\n \"organization\": \"<string>\",\n \"note\": \"<string>\",\n \"photo_url\": \"<string>\",\n \"photo_base64\": \"<string>\",\n \"caption\": \"<string>\",\n \"channel\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySend a contact card (vCard) over iMessage or SMS. On iPhone it lands as a tappable contact.
Scope:
Hosted agent card:
Hosted Comms agents can also send this with the
comms_send
Pass agent_id to send a hosted agent’s card (name, line, claim note). Or pass name and phone for any contact.
Request
curl -X POST "https://osis.co/api/v1/comms/contact-cards" \
-H "Authorization: Bearer $COMMS_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: card-jane-4242" \
-d '{
"to": "+12125550147",
"name": "Jane Doe",
"phone": "+16319869528"
}'
curl -X POST "https://osis.co/api/v1/comms/contact-cards" \
-H "Authorization: Bearer $COMMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"conversation_id": "conv_01HZX…",
"agent_id": "agent_01HZX…"
}'
Body parameters
string
E.164 destination. Required unless
conversation_id or contact_id is set.string
Existing conversation to continue. Required unless
to or contact_id is set.string
Existing contact. Required unless
to or conversation_id is set.string
Hosted agent whose saved card to send. Fills
name and phone when those are omitted.string
Display name saved on the card. Required unless
agent_id is set.string
E.164 number saved on the card. Required unless
agent_id is set.string
Optional email on the card.
string
Optional organization on the card.
string
Optional note (for example a claim handle).
string
HTTPS JPEG, PNG, or GIF (max 200KB) shown as the contact photo. Hosted
agent_id cards default to the agent’s photo, then the Comms mark.string
Same image as raw base64 or a
data:image/...;base64, URL.string
Optional text sent with the card. Defaults to the contact name.
string
sms, imessage, or omit for auto.Response
Same envelope as Send a message, pluscontact_card.
{
"message": {
"id": "msg_01HZX…",
"body": "Jane Doe",
"direction": "outbound"
},
"contact_card": {
"name": "Jane Doe",
"phone": "+16319869528"
}
}
send_contact_card tool — they default the card to their own name, line, and photo.⌘I