Update a persona
curl --request PATCH \
--url https://api.avina.io/v1/personas/{persona_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"job_titles": [
"<string>"
],
"contacts_per_company": 50,
"enrich_emails": true,
"enrich_phones": true,
"contact_countries": [
"<string>"
]
}
'import requests
url = "https://api.avina.io/v1/personas/{persona_id}"
payload = {
"name": "<string>",
"job_titles": ["<string>"],
"contacts_per_company": 50,
"enrich_emails": True,
"enrich_phones": True,
"contact_countries": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
job_titles: ['<string>'],
contacts_per_company: 50,
enrich_emails: true,
enrich_phones: true,
contact_countries: ['<string>']
})
};
fetch('https://api.avina.io/v1/personas/{persona_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.avina.io/v1/personas/{persona_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'job_titles' => [
'<string>'
],
'contacts_per_company' => 50,
'enrich_emails' => true,
'enrich_phones' => true,
'contact_countries' => [
'<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://api.avina.io/v1/personas/{persona_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"job_titles\": [\n \"<string>\"\n ],\n \"contacts_per_company\": 50,\n \"enrich_emails\": true,\n \"enrich_phones\": true,\n \"contact_countries\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.avina.io/v1/personas/{persona_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"job_titles\": [\n \"<string>\"\n ],\n \"contacts_per_company\": 50,\n \"enrich_emails\": true,\n \"enrich_phones\": true,\n \"contact_countries\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avina.io/v1/personas/{persona_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"job_titles\": [\n \"<string>\"\n ],\n \"contacts_per_company\": 50,\n \"enrich_emails\": true,\n \"enrich_phones\": true,\n \"contact_countries\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "persona",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"job_titles": [
"<string>"
],
"contacts_per_company": 123,
"enrich_emails": true,
"enrich_phones": true,
"contact_countries": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "foo is not a recognized field",
"request_id": "req_8f2a",
"details": [
{
"field": "foo",
"message": "is not a recognized field"
}
]
}
}{
"error": {
"code": "invalid_api_key",
"message": "The API key is invalid or revoked.",
"request_id": "req_8f2a"
}
}{
"error": {
"code": "not_found",
"message": "Persona not found.",
"request_id": "req_8f2a"
}
}Personas
Update a persona
Fields you omit are unchanged. job_titles replaces the whole list.
PATCH
/
personas
/
{persona_id}
Update a persona
curl --request PATCH \
--url https://api.avina.io/v1/personas/{persona_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"job_titles": [
"<string>"
],
"contacts_per_company": 50,
"enrich_emails": true,
"enrich_phones": true,
"contact_countries": [
"<string>"
]
}
'import requests
url = "https://api.avina.io/v1/personas/{persona_id}"
payload = {
"name": "<string>",
"job_titles": ["<string>"],
"contacts_per_company": 50,
"enrich_emails": True,
"enrich_phones": True,
"contact_countries": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
job_titles: ['<string>'],
contacts_per_company: 50,
enrich_emails: true,
enrich_phones: true,
contact_countries: ['<string>']
})
};
fetch('https://api.avina.io/v1/personas/{persona_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.avina.io/v1/personas/{persona_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'job_titles' => [
'<string>'
],
'contacts_per_company' => 50,
'enrich_emails' => true,
'enrich_phones' => true,
'contact_countries' => [
'<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://api.avina.io/v1/personas/{persona_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"job_titles\": [\n \"<string>\"\n ],\n \"contacts_per_company\": 50,\n \"enrich_emails\": true,\n \"enrich_phones\": true,\n \"contact_countries\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.avina.io/v1/personas/{persona_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"job_titles\": [\n \"<string>\"\n ],\n \"contacts_per_company\": 50,\n \"enrich_emails\": true,\n \"enrich_phones\": true,\n \"contact_countries\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avina.io/v1/personas/{persona_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"job_titles\": [\n \"<string>\"\n ],\n \"contacts_per_company\": 50,\n \"enrich_emails\": true,\n \"enrich_phones\": true,\n \"contact_countries\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "persona",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"job_titles": [
"<string>"
],
"contacts_per_company": 123,
"enrich_emails": true,
"enrich_phones": true,
"contact_countries": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "foo is not a recognized field",
"request_id": "req_8f2a",
"details": [
{
"field": "foo",
"message": "is not a recognized field"
}
]
}
}{
"error": {
"code": "invalid_api_key",
"message": "The API key is invalid or revoked.",
"request_id": "req_8f2a"
}
}{
"error": {
"code": "not_found",
"message": "Persona not found.",
"request_id": "req_8f2a"
}
}Authorizations
Workspace API key from the Avina dashboard (Settings → API keys).
Path Parameters
Body
application/json
Maximum string length:
191Minimum array length:
1Required range:
1 <= x <= 100Countries where the contacts are located (ISO 3166-1 alpha-2), not the company headquarters. null or [] = worldwide.
Pattern:
^[A-Za-z]{2}$Response
The updated persona.
Allowed value:
"persona"Countries where the contacts are located, uppercase; null or [] = worldwide.

