Create a persona
curl --request POST \
--url https://api.avina.io/v1/personas \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Sales leaders",
"job_titles": [
"VP Sales",
"CRO",
"Head of Sales"
],
"contacts_per_company": 2,
"enrich_emails": true,
"enrich_phones": false,
"contact_countries": [
"US",
"CA"
]
}
'import requests
url = "https://api.avina.io/v1/personas"
payload = {
"name": "Sales leaders",
"job_titles": ["VP Sales", "CRO", "Head of Sales"],
"contacts_per_company": 2,
"enrich_emails": True,
"enrich_phones": False,
"contact_countries": ["US", "CA"]
}
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({
name: 'Sales leaders',
job_titles: ['VP Sales', 'CRO', 'Head of Sales'],
contacts_per_company: 2,
enrich_emails: true,
enrich_phones: false,
contact_countries: ['US', 'CA']
})
};
fetch('https://api.avina.io/v1/personas', 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",
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([
'name' => 'Sales leaders',
'job_titles' => [
'VP Sales',
'CRO',
'Head of Sales'
],
'contacts_per_company' => 2,
'enrich_emails' => true,
'enrich_phones' => false,
'contact_countries' => [
'US',
'CA'
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"Sales leaders\",\n \"job_titles\": [\n \"VP Sales\",\n \"CRO\",\n \"Head of Sales\"\n ],\n \"contacts_per_company\": 2,\n \"enrich_emails\": true,\n \"enrich_phones\": false,\n \"contact_countries\": [\n \"US\",\n \"CA\"\n ]\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://api.avina.io/v1/personas")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Sales leaders\",\n \"job_titles\": [\n \"VP Sales\",\n \"CRO\",\n \"Head of Sales\"\n ],\n \"contacts_per_company\": 2,\n \"enrich_emails\": true,\n \"enrich_phones\": false,\n \"contact_countries\": [\n \"US\",\n \"CA\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avina.io/v1/personas")
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 \"name\": \"Sales leaders\",\n \"job_titles\": [\n \"VP Sales\",\n \"CRO\",\n \"Head of Sales\"\n ],\n \"contacts_per_company\": 2,\n \"enrich_emails\": true,\n \"enrich_phones\": false,\n \"contact_countries\": [\n \"US\",\n \"CA\"\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"
}
}Personas
Create a persona
POST
/
personas
Create a persona
curl --request POST \
--url https://api.avina.io/v1/personas \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Sales leaders",
"job_titles": [
"VP Sales",
"CRO",
"Head of Sales"
],
"contacts_per_company": 2,
"enrich_emails": true,
"enrich_phones": false,
"contact_countries": [
"US",
"CA"
]
}
'import requests
url = "https://api.avina.io/v1/personas"
payload = {
"name": "Sales leaders",
"job_titles": ["VP Sales", "CRO", "Head of Sales"],
"contacts_per_company": 2,
"enrich_emails": True,
"enrich_phones": False,
"contact_countries": ["US", "CA"]
}
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({
name: 'Sales leaders',
job_titles: ['VP Sales', 'CRO', 'Head of Sales'],
contacts_per_company: 2,
enrich_emails: true,
enrich_phones: false,
contact_countries: ['US', 'CA']
})
};
fetch('https://api.avina.io/v1/personas', 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",
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([
'name' => 'Sales leaders',
'job_titles' => [
'VP Sales',
'CRO',
'Head of Sales'
],
'contacts_per_company' => 2,
'enrich_emails' => true,
'enrich_phones' => false,
'contact_countries' => [
'US',
'CA'
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"Sales leaders\",\n \"job_titles\": [\n \"VP Sales\",\n \"CRO\",\n \"Head of Sales\"\n ],\n \"contacts_per_company\": 2,\n \"enrich_emails\": true,\n \"enrich_phones\": false,\n \"contact_countries\": [\n \"US\",\n \"CA\"\n ]\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://api.avina.io/v1/personas")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Sales leaders\",\n \"job_titles\": [\n \"VP Sales\",\n \"CRO\",\n \"Head of Sales\"\n ],\n \"contacts_per_company\": 2,\n \"enrich_emails\": true,\n \"enrich_phones\": false,\n \"contact_countries\": [\n \"US\",\n \"CA\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avina.io/v1/personas")
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 \"name\": \"Sales leaders\",\n \"job_titles\": [\n \"VP Sales\",\n \"CRO\",\n \"Head of Sales\"\n ],\n \"contacts_per_company\": 2,\n \"enrich_emails\": true,\n \"enrich_phones\": false,\n \"contact_countries\": [\n \"US\",\n \"CA\"\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"
}
}Authorizations
Workspace API key from the Avina dashboard (Settings → API keys).
Headers
Any unique string. Retrying with the same key returns the first response instead of repeating the action.
Maximum string length:
255Body
application/json
Minimum array length:
1Maximum string length:
191Required range:
1 <= x <= 100Phone enrichment costs extra credits.
Countries where the contacts are located (ISO 3166-1 alpha-2), not the company headquarters. null or [] = worldwide.
Pattern:
^[A-Za-z]{2}$Example:
["US", "CA"]
Response
The created persona.
Allowed value:
"persona"Countries where the contacts are located, uppercase; null or [] = worldwide.

