> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.pinnacle.sh/v-2/api-reference/audiences/get/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pinnacle.sh/_mcp/server. # Get Audience GET https://api.pinnacle.sh/audiences Retrieve an audience by ID with optional pagination. Reference: https://docs.pinnacle.sh/api-reference/audiences/get ## Authentication - `PINNACLE-API-KEY` header (required) — API Key authentication via header ## Request ### Query parameters - `id` (string, required) — Audience ID. This identifier is a string that always begins with the prefix `aud_`, for example: `aud_abc123`. - `page` (integer, optional, default: 1) — Page number. If provided with or without limit, returns paginated contacts. - `limit` (integer, optional, default: 50) — Items per page. If provided with or without page, returns paginated contacts. ## Response ### 200 Successfully retrieved audience. - `audiences_get_Response_200` ## Errors ### 400 Bad Request Error Validation failed. The payload has missing required fields and/or invalid types. 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. 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. 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. ### 404 Not Found Error The requested resource could not be found. This may occur if the identifier is incorrect, the resource has been deleted, or you don't have permission to access it. - `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. 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 ### AudienceWithPagination - `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. - `contacts` (list of Contact, required) — Array of contact objects (paginated). - `contactCount` (integer, required) — Total number of contacts in audience. - `pagination` (Pagination, required) ### AudienceCountOnly - `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. ### 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 ### Contact - `id` (string, required) — Unique ID of the contact. This identifier is a string that always begins with the prefix `co_`, for example: `co_1234567890`. - `phoneNumber` (string, required) — Contact's phone number in E.164 format. - `description` (string, optional) — Additional information about the contact. - `email` (string, optional) — Contact's email address, if available. - `name` (string, optional) — Full name of the contact, if available. - `tags` (list of string, optional) — List of tags associated with the contact. ### Pagination - `page` (integer, required) — Current page number (1-indexed). - `limit` (integer, required) — Items per page (max 100, default 50). - `total` (integer, required) — Total number of contacts in the audience. - `hasMore` (boolean, required) — Whether more pages exist. ## Examples ### Paginated audience with contacts **Response** ```json { "id": "aud_abc123", "name": "VIP Customers", "description": "Our most valuable customers", "contacts": [ { "description": "Premium customer", "email": "john@example.com", "id": "co_def456", "name": "John Doe", "phoneNumber": "+12125551234", "tags": [ "vip", "enterprise" ] } ], "contactCount": 150, "pagination": { "page": 1, "limit": 50, "total": 150, "hasMore": true } } ``` **SDK Code** ```python Paginated audience with contacts import requests url = "https://api.pinnacle.sh/audiences" querystring = {"id":"aud_abc123","page":"1","limit":"50"} headers = {"PINNACLE-API-KEY": ""} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript Paginated audience with contacts const url = 'https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50'; const options = {method: 'GET', headers: {'PINNACLE-API-KEY': ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Paginated audience with contacts package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("PINNACLE-API-KEY", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Paginated audience with contacts require 'uri' require 'net/http' url = URI("https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["PINNACLE-API-KEY"] = '' response = http.request(request) puts response.read_body ``` ```java Paginated audience with contacts import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50") .header("PINNACLE-API-KEY", "") .asString(); ``` ```php Paginated audience with contacts request('GET', 'https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50', [ 'headers' => [ 'PINNACLE-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Paginated audience with contacts using RestSharp; var client = new RestClient("https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50"); var request = new RestRequest(Method.GET); request.AddHeader("PINNACLE-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Paginated audience with contacts import Foundation let headers = ["PINNACLE-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" 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 with no pagination **Response** ```json { "id": "aud_abc123", "name": "VIP Customers", "description": "Our most valuable customers", "contactCount": 150 } ``` **SDK Code** ```python Audience with no pagination import requests url = "https://api.pinnacle.sh/audiences" querystring = {"id":"aud_abc123","page":"1","limit":"50"} headers = {"PINNACLE-API-KEY": ""} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript Audience with no pagination const url = 'https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50'; const options = {method: 'GET', headers: {'PINNACLE-API-KEY': ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Audience with no pagination package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("PINNACLE-API-KEY", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Audience with no pagination require 'uri' require 'net/http' url = URI("https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["PINNACLE-API-KEY"] = '' response = http.request(request) puts response.read_body ``` ```java Audience with no pagination import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50") .header("PINNACLE-API-KEY", "") .asString(); ``` ```php Audience with no pagination request('GET', 'https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50', [ 'headers' => [ 'PINNACLE-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Audience with no pagination using RestSharp; var client = new RestClient("https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50"); var request = new RestRequest(Method.GET); request.AddHeader("PINNACLE-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Audience with no pagination import Foundation let headers = ["PINNACLE-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/audiences?id=aud_abc123&page=1&limit=50")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" 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() ``` > One API for RCS, iMessage, MMS, and SMS. Build, test, and scale every channel — send your first message in minutes, not weeks.