# Get custom audience by ID

GET https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/{customAudienceId}

Retrieve one custom audience with its full detail. Returns more than the listing endpoint: Meta adds the fields relevant to the audience subtype (`retentionDays` and `customerFileSource` for customer lists, `rule` and `pixelId` for website audiences, `lookalikeSpec` for lookalikes), and this service appends `extras` describing the local smart-list or CSV source when the audience is a user-provided customer list.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `adPublishing.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `customAudienceId` | string | Yes | Custom audience identifier |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | Yes | Location identifier |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2023-02-21"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/ad-publishing/facebook/custom-audience/{customAudienceId}": {
      "get": {
        "summary": "Get custom audience by ID",
        "operationId": "getCustomAudienceById",
        "description": "Retrieve one custom audience with its full detail. Returns more than the listing endpoint: Meta adds the fields relevant to the audience subtype (`retentionDays` and `customerFileSource` for customer lists, `rule` and `pixelId` for website audiences, `lookalikeSpec` for lookalikes), and this service appends `extras` describing the local smart-list or CSV source when the audience is a user-provided customer list.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2023-02-21"
              ]
            }
          },
          {
            "name": "customAudienceId",
            "required": true,
            "in": "path",
            "description": "Custom audience identifier",
            "schema": {
              "example": "23851234567890123",
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "query",
            "description": "Location identifier",
            "schema": {
              "example": "HChooFuiyPpVYzeJ4HMe",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The audience with the fields relevant to its subtype",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacebookCustomAudienceDetailDTO"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "adPublishing.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "FacebookCustomAudienceDetailDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Audience id",
            "example": "120250373909070122"
          },
          "name": {
            "type": "string",
            "description": "Audience name",
            "example": "Website Visitors - Last 30 Days"
          },
          "description": {
            "type": "string",
            "description": "Audience description. Empty string when not set.",
            "example": ""
          },
          "subtype": {
            "type": "string",
            "description": "How the audience was built. `LOOKALIKE` for lookalikes; `CUSTOM`, `ENGAGEMENT`, `WEBSITE`, and `LEAD` for the rest.",
            "example": "ENGAGEMENT"
          },
          "approximateCountLowerBound": {
            "type": "number",
            "description": "Lower bound of the audience size. Facebook floors small audiences — `1000` and `20` are placeholders, not counts.",
            "example": 19900000
          },
          "approximateCountUpperBound": {
            "type": "number",
            "description": "Upper bound of the audience size",
            "example": 23400000
          },
          "deliveryStatus": {
            "description": "Whether the audience can be used in a campaign right now",
            "example": {
              "code": 200,
              "description": "This audience is ready for use."
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "number",
                    "description": "Meta status code. `200` is the healthy case; anything else is explained by `description`.",
                    "example": 200
                  },
                  "description": {
                    "type": "string",
                    "description": "Human-readable status, safe to show to a user",
                    "example": "This audience is ready for use."
                  }
                },
                "required": [
                  "code",
                  "description"
                ],
                "title": "FacebookAudienceStatusDTO"
              }
            ]
          },
          "operationStatus": {
            "description": "Whether Facebook is still building or refreshing the audience",
            "example": {
              "code": 200,
              "description": "This audience is ready for use."
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "number",
                    "description": "Meta status code. `200` is the healthy case; anything else is explained by `description`.",
                    "example": 200
                  },
                  "description": {
                    "type": "string",
                    "description": "Human-readable status, safe to show to a user",
                    "example": "This audience is ready for use."
                  }
                },
                "required": [
                  "code",
                  "description"
                ],
                "title": "FacebookAudienceStatusDTO"
              }
            ]
          },
          "dataSource": {
            "description": "Where the audience gets its members from",
            "example": {
              "type": "EVENT_BASED",
              "subType": "WEB_PIXEL_HITS",
              "creationParams": "[]"
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "How the audience is populated. Passed through from Meta, which does not publish a closed list — `EVENT_BASED`, `SEED_BASED`, and `UNKNOWN` are the values seen in practice, so treat this as an open string rather than an exhaustive enum.",
                    "example": "EVENT_BASED"
                  },
                  "subType": {
                    "type": "string",
                    "description": "More specific origin within `type`. Observed pairings are `EVENT_BASED` with `WEB_PIXEL_HITS` or `ENGAGEMENT_EVENTS`, `SEED_BASED` with `PAGE_FANS` or `PLATFORM_USERS`, and `UNKNOWN` with `ANYTHING`, which is what a customer-list upload reports. Also passed through from Meta and not a closed list.",
                    "example": "WEB_PIXEL_HITS"
                  },
                  "creationParams": {
                    "type": "string",
                    "description": "Facebook creation parameters, delivered as a JSON string rather than an object.",
                    "example": "[]"
                  }
                },
                "required": [
                  "type",
                  "subType",
                  "creationParams"
                ],
                "title": "FacebookAudienceDataSourceDTO"
              }
            ]
          },
          "timeCreated": {
            "type": "number",
            "description": "Creation time as a Unix timestamp in seconds, not milliseconds and not ISO-8601.",
            "example": 1787123977
          },
          "timeUpdated": {
            "type": "number",
            "description": "Last update time as a Unix timestamp in seconds. Equals `timeCreated` when never edited.",
            "example": 1787123977
          },
          "customerFileSource": {
            "type": "string",
            "description": "How the member list was supplied. Present on customer-list audiences.",
            "example": "USER_PROVIDED_ONLY"
          },
          "retentionDays": {
            "type": "number",
            "description": "How long a member stays in the audience. `0` means members never expire.",
            "example": 0
          },
          "rule": {
            "type": "object",
            "description": "Matching rule for a website audience, as Meta returns it. Structure varies with the rule and is passed through unchanged.",
            "additionalProperties": true,
            "example": {
              "inclusions": {
                "operator": "or",
                "rules": [
                  {
                    "event_sources": [
                      {
                        "type": "pixel",
                        "id": "2107520276278738"
                      }
                    ],
                    "retention_seconds": 2592000,
                    "filter": {
                      "operator": "and",
                      "filters": [
                        {
                          "field": "url",
                          "operator": "i_contains",
                          "value": "/pricing"
                        }
                      ]
                    }
                  }
                ]
              }
            }
          },
          "pixelId": {
            "type": "string",
            "description": "Pixel backing a website audience",
            "example": "2107520276278738"
          },
          "lookalikeSpec": {
            "type": "object",
            "description": "Seed and ratio settings for a lookalike audience, passed through from Meta",
            "additionalProperties": true,
            "example": {
              "type": "similarity",
              "ratio": 0.01,
              "country": "US",
              "origin": [
                {
                  "id": "120250373909070122",
                  "name": "Website visitors"
                }
              ]
            }
          },
          "lookalikeAudienceIds": {
            "description": "Ids of lookalikes derived from this audience",
            "example": [
              "120250373909070122",
              "120250393519390122"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "extras": {
            "description": "Local sourcing metadata. Added by this service only for user-provided customer lists that have a matching local record; absent otherwise.",
            "example": {
              "_id": "6a8668d9867e604d24f5a628",
              "locationId": "fRMewNQIxSyZ5R4nQyit",
              "audienceId": "120250393519390122",
              "type": "SMARTLIST",
              "dynamic": true,
              "sourceName": "contacts.csv",
              "smartLists": [
                {
                  "id": "Rd2L2sxaVc1hCQMDKfNm",
                  "name": "3 months ago"
                }
              ],
              "createdAt": "2026-08-20T02:39:21.290Z",
              "updatedAt": "2026-08-20T02:39:21.290Z",
              "__v": 0
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "_id": {
                    "type": "string",
                    "description": "Mongo id of the local record. Internal.",
                    "example": "6a8668d9867e604d24f5a628"
                  },
                  "locationId": {
                    "type": "string",
                    "description": "Owning location",
                    "example": "fRMewNQIxSyZ5R4nQyit"
                  },
                  "audienceId": {
                    "type": "string",
                    "description": "Meta audience id this record describes",
                    "example": "120250393519390122"
                  },
                  "type": {
                    "type": "string",
                    "description": "Where the membership came from",
                    "enum": [
                      "CSV",
                      "SMARTLIST"
                    ],
                    "example": "SMARTLIST"
                  },
                  "dynamic": {
                    "type": "boolean",
                    "description": "Whether membership re-syncs as the smart list changes, rather than being a one-off snapshot",
                    "example": true
                  },
                  "sourceName": {
                    "type": "string",
                    "description": "Display name of the source, used for CSV uploads",
                    "example": "contacts.csv"
                  },
                  "smartLists": {
                    "description": "Smart lists feeding the audience. Present for `SMARTLIST` sources.",
                    "example": [
                      {
                        "id": "Rd2L2sxaVc1hCQMDKfNm",
                        "name": "3 months ago"
                      }
                    ],
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Smart list id",
                          "example": "Rd2L2sxaVc1hCQMDKfNm"
                        },
                        "name": {
                          "type": "string",
                          "description": "Smart list name",
                          "example": "3 months ago"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "title": "FacebookAudienceSmartListDTO"
                    }
                  },
                  "createdAt": {
                    "type": "string",
                    "description": "Creation time, ISO-8601",
                    "example": "2026-08-20T02:39:21.290Z"
                  },
                  "updatedAt": {
                    "type": "string",
                    "description": "Last modification time, ISO-8601",
                    "example": "2026-08-20T02:39:21.290Z"
                  },
                  "__v": {
                    "type": "number",
                    "description": "Mongo version key. Internal — not part of the contract.",
                    "example": 0
                  }
                },
                "required": [
                  "_id",
                  "locationId",
                  "audienceId",
                  "type"
                ],
                "title": "FacebookCustomAudienceExtrasDTO"
              }
            ]
          }
        },
        "title": "FacebookCustomAudienceDetailDTO"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      },
      "InternalServerErrorDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code for an unexpected server error",
            "example": 500
          },
          "message": {
            "type": "string",
            "description": "Error message describing the server failure",
            "example": "Internal Server Error"
          }
        },
        "title": "InternalServerErrorDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/<customAudienceId>?locationId=<LOCATIONID>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2023-02-21'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: '2023-02-21'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/<customAudienceId>?locationId=<LOCATIONID>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/{customAudienceId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2023-02-21"
}

params = {
    "locationId": "<LOCATIONID>"
}

response = requests.get(url, params=params, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/<customAudienceId>?locationId=<LOCATIONID>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2023-02-21',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/<customAudienceId>?locationId=<LOCATIONID>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2023-02-21")
  .asString();
```

**Go**

```go
package main

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

func main() {
  url := "https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/<customAudienceId>?locationId=<LOCATIONID>"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2023-02-21")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

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

url = URI("https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/<customAudienceId>?locationId=<LOCATIONID>")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "2023-02-21"

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

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2023-02-21"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/<customAudienceId>?locationId=<LOCATIONID>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
