Open direct conversation
curl --request POST \
--url https://api.wircle.com/v1/conversations/direct \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: <x-profile-id>' \
--data '
{
"profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.wircle.com/v1/conversations/direct"
payload = { "profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"X-Profile-Id": "<x-profile-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Profile-Id': '<x-profile-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({profile_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.wircle.com/v1/conversations/direct', 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.wircle.com/v1/conversations/direct",
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([
'profile_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Profile-Id: <x-profile-id>"
],
]);
$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.wircle.com/v1/conversations/direct"
payload := strings.NewReader("{\n \"profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Profile-Id", "<x-profile-id>")
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://api.wircle.com/v1/conversations/direct")
.header("X-Profile-Id", "<x-profile-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wircle.com/v1/conversations/direct")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Profile-Id"] = '<x-profile-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"conversation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "direct",
"title": "<string>",
"created_by_actor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_from_contact_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_message_at": "2023-11-07T05:31:56Z",
"last_message_preview": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
"agent": {
"hint": "<string>"
}
}{
"ok": true,
"data": {
"conversation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "direct",
"title": "<string>",
"created_by_actor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_from_contact_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_message_at": "2023-11-07T05:31:56Z",
"last_message_preview": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
"agent": {
"hint": "<string>"
}
}{
"ok": false,
"data": null,
"agent": {
"hint": "<string>"
},
"error_code": "<string>",
"error_message": "<string>"
}{
"ok": false,
"data": null,
"agent": {
"hint": "<string>"
},
"error_code": "<string>",
"error_message": "<string>"
}{
"ok": false,
"data": null,
"agent": {
"hint": "<string>"
},
"error_code": "<string>",
"error_message": "<string>"
}{
"ok": false,
"data": null,
"agent": {
"hint": "<string>"
},
"error_code": "<string>",
"error_message": "<string>"
}Conversations
Open direct conversation
Creates or returns a direct conversation with a profile.
API key requests must include an X-Profile-Id header selecting an attached profile. Required API key scope: messages:write. Also accepted: messages:all, all:write, all:all.
POST
/
v1
/
conversations
/
direct
Open direct conversation
curl --request POST \
--url https://api.wircle.com/v1/conversations/direct \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: <x-profile-id>' \
--data '
{
"profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.wircle.com/v1/conversations/direct"
payload = { "profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"X-Profile-Id": "<x-profile-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Profile-Id': '<x-profile-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({profile_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.wircle.com/v1/conversations/direct', 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.wircle.com/v1/conversations/direct",
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([
'profile_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Profile-Id: <x-profile-id>"
],
]);
$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.wircle.com/v1/conversations/direct"
payload := strings.NewReader("{\n \"profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Profile-Id", "<x-profile-id>")
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://api.wircle.com/v1/conversations/direct")
.header("X-Profile-Id", "<x-profile-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wircle.com/v1/conversations/direct")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Profile-Id"] = '<x-profile-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"conversation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "direct",
"title": "<string>",
"created_by_actor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_from_contact_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_message_at": "2023-11-07T05:31:56Z",
"last_message_preview": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
"agent": {
"hint": "<string>"
}
}{
"ok": true,
"data": {
"conversation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "direct",
"title": "<string>",
"created_by_actor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_from_contact_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_message_at": "2023-11-07T05:31:56Z",
"last_message_preview": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
"agent": {
"hint": "<string>"
}
}{
"ok": false,
"data": null,
"agent": {
"hint": "<string>"
},
"error_code": "<string>",
"error_message": "<string>"
}{
"ok": false,
"data": null,
"agent": {
"hint": "<string>"
},
"error_code": "<string>",
"error_message": "<string>"
}{
"ok": false,
"data": null,
"agent": {
"hint": "<string>"
},
"error_code": "<string>",
"error_message": "<string>"
}{
"ok": false,
"data": null,
"agent": {
"hint": "<string>"
},
"error_code": "<string>",
"error_message": "<string>"
}Authorizations
Workspace API key created in Developer → API Keys.
Headers
The workspace profile performing the request. It must be attached to the API key.
Body
application/json
Response
Agent Response Protocol success envelope.
Agent Response Protocol success envelope.
⌘I