POST
/
meta
/
create_fb_csv_audience
Create Contact List Audience
curl --request POST \
  --url https://public.plai.io/meta/create_fb_csv_audience \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-key: <api-key>' \
  --form 'userId=<string>' \
  --form 'audienceName=<string>' \
  --form 'mode=<string>' \
  --form 'audienceId=<string>'
{
  "success": true,
  "results": {
    "success": true,
    "audienceId": "<string>",
    "audienceName": "<string>",
    "invalid_entry_samples": {},
    "num_invalid_entries": 123,
    "num_received": 123,
    "session_id": "<string>",
    "error": "<string>"
  }
}

Request Body

The request body for this endpoint should be sent as multipart/form-data. The following fields are expected:
userId
string
required
User ID, If not already created, make a user on create user page first. If already created, retrieve the user ID from get profile page.
audienceName
string
required
The name of the audience you are creating. This name will be displayed in your Facebook Ads account.
csvFile
file
required

Download Sample CSV

Sample CSV
Make sure to follow csv guidelines from here
Audience Csv. Ensure the file is in CSV format.
mode
string
default:"create"
Operation mode for the audience : create (default): Create a new audience. append: Add more entries to an existing audience. replace: Replace all entries in an existing audience. remove: Remove entries from an existing audience Required when modifying an existing audience.
audienceId
string
The ID of the existing audience to modify. Required when mode is append, replace, or remove.

Response

success
boolean
Indicates that the HTTP response was successful (status code 200 OK).
results
object