> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.pinnacle.sh/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pinnacle.sh/_mcp/server.

# Create Audience

POST https://api.pinnacle.sh/audiences
Content-Type: application/json

Create a new audience with optional initial contacts. Phone numbers that don't exist will be auto-created as contacts.

Reference: https://docs.pinnacle.sh/api-reference/audiences/create

## Authentication

- `PINNACLE-API-KEY` header (required) — API Key authentication via header

## Request

### Body (application/json)

This endpoint expects a CreateAudienceRequest.

- `name` (string, required) — Audience name.
- `description` (string, optional) — Audience description.
- `contacts` (list of string, optional) — Optional array of phone numbers (E.164 format) or contact IDs.

## Response

### 200

Successfully created the audience.

- `id` (string, required) — Audience public ID. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`.
- `name` (string, required) — Audience name.
- `description` (string, required) — Audience description.
- `contactCount` (integer, required) — Total number of contacts in audience. Use the [Get Audience](/api-reference/audiences/get) endpoint with the pagination parameters to get the audience with its contacts.

## Errors

### 400 Bad Request Error

Validation failed. The payload has missing required fields and/or invalid types.&#x20; See [https://zod.dev/error-formatting](https://zod.dev/error-formatting) for more information.

- `description` (string, required) — Human-readable summary of validation failures.
- `errors` (ZodErrorErrors, required) — Structured dictionary of issues containing two main sections: - `errors`: Array of global validation errors not tied to specific fields - `properties`: Object mapping field names to their specific validation errors, where each field contains an `errors` array

### 401 Unauthorized Error

The request lacks valid authentication credentials or the provided credentials are invalid.&#x20; Ensure you're including a valid API key in the request headers and that your account has the necessary permissions to access this endpoint.

- `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code.

### 403 Forbidden Error

Your subscription does not include access to this feature.&#x20; This occurs when attempting to use functionality that requires a higher subscription tier. Please upgrade your subscription to access this feature.

- `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code.

### 500 Internal Server Error

An unexpected error occurred on Pinnacle's servers while processing your request.&#x20; If this error persists, please contact support with the request details.

- `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code.

## Types

### ZodErrorErrors

Structured dictionary of issues containing two main sections: - `errors`: Array of global validation errors not tied to specific fields - `properties`: Object mapping field names to their specific validation errors, where each field contains an `errors` array

## Examples

### Audience Created

**Response**

```json
{
  "id": "aud_abc123",
  "name": "Marketing Campaign Q1",
  "description": "Contacts for Q1 marketing push",
  "contactCount": 2
}
```

**SDK Code**

```python Audience Created
import requests

url = "https://api.pinnacle.sh/audiences"

headers = {"PINNACLE-API-KEY": "<apiKey>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Audience Created
const url = 'https://api.pinnacle.sh/audiences';
const options = {method: 'POST', headers: {'PINNACLE-API-KEY': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Audience Created
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.pinnacle.sh/audiences"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("PINNACLE-API-KEY", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Audience Created
require 'uri'
require 'net/http'

url = URI("https://api.pinnacle.sh/audiences")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["PINNACLE-API-KEY"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Audience Created
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.pinnacle.sh/audiences")
  .header("PINNACLE-API-KEY", "<apiKey>")
  .asString();
```

```php Audience Created
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.pinnacle.sh/audiences', [
  'headers' => [
    'PINNACLE-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Audience Created
using RestSharp;

var client = new RestClient("https://api.pinnacle.sh/audiences");
var request = new RestRequest(Method.POST);
request.AddHeader("PINNACLE-API-KEY", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Audience Created
import Foundation

let headers = ["PINNACLE-API-KEY": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/audiences")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Audience without contacts

**Request**

```json
{
  "name": "Marketing Campaign Q1",
  "description": "Contacts for Q1 marketing push"
}
```

**Response**

```json
{
  "id": "aud_abc123",
  "name": "Marketing Campaign Q1",
  "description": "Contacts for Q1 marketing push",
  "contactCount": 2
}
```

**SDK Code**

```python Audience without contacts
import requests

url = "https://api.pinnacle.sh/audiences"

payload = {
    "name": "Marketing Campaign Q1",
    "description": "Contacts for Q1 marketing push"
}
headers = {
    "PINNACLE-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Audience without contacts
const url = 'https://api.pinnacle.sh/audiences';
const options = {
  method: 'POST',
  headers: {'PINNACLE-API-KEY': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"Marketing Campaign Q1","description":"Contacts for Q1 marketing push"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Audience without contacts
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.pinnacle.sh/audiences"

	payload := strings.NewReader("{\n  \"name\": \"Marketing Campaign Q1\",\n  \"description\": \"Contacts for Q1 marketing push\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("PINNACLE-API-KEY", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Audience without contacts
require 'uri'
require 'net/http'

url = URI("https://api.pinnacle.sh/audiences")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["PINNACLE-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Marketing Campaign Q1\",\n  \"description\": \"Contacts for Q1 marketing push\"\n}"

response = http.request(request)
puts response.read_body
```

```java Audience without contacts
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.pinnacle.sh/audiences")
  .header("PINNACLE-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Marketing Campaign Q1\",\n  \"description\": \"Contacts for Q1 marketing push\"\n}")
  .asString();
```

```php Audience without contacts
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.pinnacle.sh/audiences', [
  'body' => '{
  "name": "Marketing Campaign Q1",
  "description": "Contacts for Q1 marketing push"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'PINNACLE-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Audience without contacts
using RestSharp;

var client = new RestClient("https://api.pinnacle.sh/audiences");
var request = new RestRequest(Method.POST);
request.AddHeader("PINNACLE-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Marketing Campaign Q1\",\n  \"description\": \"Contacts for Q1 marketing push\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Audience without contacts
import Foundation

let headers = [
  "PINNACLE-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Marketing Campaign Q1",
  "description": "Contacts for Q1 marketing push"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/audiences")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Audience with contacts

**Request**

```json
{
  "name": "VIP Customers",
  "description": "Our best customers",
  "contacts": [
    "+12125551234",
    "+13105551234"
  ]
}
```

**Response**

```json
{
  "id": "aud_abc123",
  "name": "Marketing Campaign Q1",
  "description": "Contacts for Q1 marketing push",
  "contactCount": 2
}
```

**SDK Code**

```python Audience with contacts
import requests

url = "https://api.pinnacle.sh/audiences"

payload = {
    "name": "VIP Customers",
    "description": "Our best customers",
    "contacts": ["+12125551234", "+13105551234"]
}
headers = {
    "PINNACLE-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Audience with contacts
const url = 'https://api.pinnacle.sh/audiences';
const options = {
  method: 'POST',
  headers: {'PINNACLE-API-KEY': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"VIP Customers","description":"Our best customers","contacts":["+12125551234","+13105551234"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Audience with contacts
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.pinnacle.sh/audiences"

	payload := strings.NewReader("{\n  \"name\": \"VIP Customers\",\n  \"description\": \"Our best customers\",\n  \"contacts\": [\n    \"+12125551234\",\n    \"+13105551234\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("PINNACLE-API-KEY", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Audience with contacts
require 'uri'
require 'net/http'

url = URI("https://api.pinnacle.sh/audiences")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["PINNACLE-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"VIP Customers\",\n  \"description\": \"Our best customers\",\n  \"contacts\": [\n    \"+12125551234\",\n    \"+13105551234\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Audience with contacts
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.pinnacle.sh/audiences")
  .header("PINNACLE-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"VIP Customers\",\n  \"description\": \"Our best customers\",\n  \"contacts\": [\n    \"+12125551234\",\n    \"+13105551234\"\n  ]\n}")
  .asString();
```

```php Audience with contacts
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.pinnacle.sh/audiences', [
  'body' => '{
  "name": "VIP Customers",
  "description": "Our best customers",
  "contacts": [
    "+12125551234",
    "+13105551234"
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'PINNACLE-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Audience with contacts
using RestSharp;

var client = new RestClient("https://api.pinnacle.sh/audiences");
var request = new RestRequest(Method.POST);
request.AddHeader("PINNACLE-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"VIP Customers\",\n  \"description\": \"Our best customers\",\n  \"contacts\": [\n    \"+12125551234\",\n    \"+13105551234\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Audience with contacts
import Foundation

let headers = [
  "PINNACLE-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "VIP Customers",
  "description": "Our best customers",
  "contacts": ["+12125551234", "+13105551234"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/audiences")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Audience with mixed identifiers

**Request**

```json
{
  "name": "Mixed Audience",
  "contacts": [
    "+12125551234",
    "co_abc123",
    "+13105551234"
  ]
}
```

**Response**

```json
{
  "id": "aud_abc123",
  "name": "Marketing Campaign Q1",
  "description": "Contacts for Q1 marketing push",
  "contactCount": 2
}
```

**SDK Code**

```python Audience with mixed identifiers
import requests

url = "https://api.pinnacle.sh/audiences"

payload = {
    "name": "Mixed Audience",
    "contacts": ["+12125551234", "co_abc123", "+13105551234"]
}
headers = {
    "PINNACLE-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Audience with mixed identifiers
const url = 'https://api.pinnacle.sh/audiences';
const options = {
  method: 'POST',
  headers: {'PINNACLE-API-KEY': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"Mixed Audience","contacts":["+12125551234","co_abc123","+13105551234"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Audience with mixed identifiers
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.pinnacle.sh/audiences"

	payload := strings.NewReader("{\n  \"name\": \"Mixed Audience\",\n  \"contacts\": [\n    \"+12125551234\",\n    \"co_abc123\",\n    \"+13105551234\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("PINNACLE-API-KEY", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Audience with mixed identifiers
require 'uri'
require 'net/http'

url = URI("https://api.pinnacle.sh/audiences")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["PINNACLE-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Mixed Audience\",\n  \"contacts\": [\n    \"+12125551234\",\n    \"co_abc123\",\n    \"+13105551234\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Audience with mixed identifiers
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.pinnacle.sh/audiences")
  .header("PINNACLE-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Mixed Audience\",\n  \"contacts\": [\n    \"+12125551234\",\n    \"co_abc123\",\n    \"+13105551234\"\n  ]\n}")
  .asString();
```

```php Audience with mixed identifiers
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.pinnacle.sh/audiences', [
  'body' => '{
  "name": "Mixed Audience",
  "contacts": [
    "+12125551234",
    "co_abc123",
    "+13105551234"
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'PINNACLE-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Audience with mixed identifiers
using RestSharp;

var client = new RestClient("https://api.pinnacle.sh/audiences");
var request = new RestRequest(Method.POST);
request.AddHeader("PINNACLE-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Mixed Audience\",\n  \"contacts\": [\n    \"+12125551234\",\n    \"co_abc123\",\n    \"+13105551234\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Audience with mixed identifiers
import Foundation

let headers = [
  "PINNACLE-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Mixed Audience",
  "contacts": ["+12125551234", "co_abc123", "+13105551234"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/audiences")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```