Edit Agent
curl --request PUT \
--url https://app.openhome.com/api/personalities/edit-personality/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"personality_id": 123,
"matching_capabilities": 123
}
'import requests
url = "https://app.openhome.com/api/personalities/edit-personality/"
payload = {
"personality_id": 123,
"matching_capabilities": 123
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({personality_id: 123, matching_capabilities: 123})
};
fetch('https://app.openhome.com/api/personalities/edit-personality/', 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://app.openhome.com/api/personalities/edit-personality/",
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([
'personality_id' => 123,
'matching_capabilities' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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://app.openhome.com/api/personalities/edit-personality/"
payload := strings.NewReader("{\n \"personality_id\": 123,\n \"matching_capabilities\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-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://app.openhome.com/api/personalities/edit-personality/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"personality_id\": 123,\n \"matching_capabilities\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.openhome.com/api/personalities/edit-personality/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"personality_id\": 123,\n \"matching_capabilities\": 123\n}"
response = http.request(request)
puts response.read_bodyAgents
Edit Agent
Update an Agent. The most common use is assigning or unassigning Abilities.
PUT
/
api
/
personalities
/
edit-personality
/
Edit Agent
curl --request PUT \
--url https://app.openhome.com/api/personalities/edit-personality/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"personality_id": 123,
"matching_capabilities": 123
}
'import requests
url = "https://app.openhome.com/api/personalities/edit-personality/"
payload = {
"personality_id": 123,
"matching_capabilities": 123
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({personality_id: 123, matching_capabilities: 123})
};
fetch('https://app.openhome.com/api/personalities/edit-personality/', 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://app.openhome.com/api/personalities/edit-personality/",
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([
'personality_id' => 123,
'matching_capabilities' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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://app.openhome.com/api/personalities/edit-personality/"
payload := strings.NewReader("{\n \"personality_id\": 123,\n \"matching_capabilities\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-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://app.openhome.com/api/personalities/edit-personality/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"personality_id\": 123,\n \"matching_capabilities\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.openhome.com/api/personalities/edit-personality/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"personality_id\": 123,\n \"matching_capabilities\": 123\n}"
response = http.request(request)
puts response.read_bodyThis endpoint uses
multipart/form-data, not JSON. Use the cURL or Python example below. The Agent is identified by the personality_id form field, and matching_capabilities is repeated once per Ability rather than sent as an array.Endpoint
PUT https://app.openhome.com/api/personalities/edit-personality/
multipart/form-data.
Headers
string
required
Your OpenHome API key.
Form fields
integer
required
The ID of the Agent to edit. Get it from List Agents.
integer
An Ability (capability) ID to assign to the Agent. Repeat the field once per Ability. The list replaces the Agent’s current Abilities, so send every ID the Agent should end up with. Omit the field to unassign all.
Example request
cURL
curl -X PUT https://app.openhome.com/api/personalities/edit-personality/ \
-H "X-API-KEY: YOUR_KEY" \
-F "personality_id=4727" \
-F "matching_capabilities=1" \
-F "matching_capabilities=2" \
-F "matching_capabilities=3"
Python
import requests
fields = [("personality_id", (None, "4727"))]
for capability_id in [1, 2, 3]:
fields.append(("matching_capabilities", (None, str(capability_id))))
requests.put(
"https://app.openhome.com/api/personalities/edit-personality/",
headers={"X-API-KEY": "YOUR_KEY"},
files=fields,
)

