# Tạo tệp đối tượng tùy chỉnh

* Tạo tệp đối tượng tùy chỉnh.
* **Chú ý**:
  * Để gửi [Tin nhắn quảng cáo](https://vpage.nhanh.vn/app/chatbot/marketing/index) (Facebook Marketing Message), bạn không thể tạo tệp trực tiếp ở trên Facebook, mà bắt buộc phải tạo qua **Vpage.nhanh.vn**.
  * Do Facebook cần thời gian để tìm số điện thoại, email, bạn cần đảm bảo các tệp Custom Audience được tạo và [thêm khách hàngvào tệp](/v3/vpage/marketing/custom_audience_addsubscriber.md) từ sớm (khoảng trước 1 ngày) và có trạng thái sẵn sàng trên Vpage trước khi tạo [chiến dịch gửi tin nhắn quảng cáo](https://github.com/nvndocs/docs-pos-openapi/blob/v3/docs/vpage/marketing/\(/docs/vpage/marketing/ad_account_list.md\)).

## Request

* Xem [common request params](/v3/readme.md#request-params).
* Chú ý:
  * Bạn cần kết nối tài khoản quảng cáo trên Vpage, để lấy adAccountId từ [API ad\_account\_list](/v3/vpage/marketing/ad_account_list.md).
  * Để gửi Marketing Message: bạn cần set **subtype** = **MESSENGER\_SUBSCRIBER\_LIST**.
  * Để tạo tệp custom (Chỉ dùng để chạy quảng cáo): bạn set **subtype** = **CUSTOM**.

```curl
curl --location 'https://vpage.open.nhanh.vn/v3.0/marketing/customaudiencecreate?appId={{appId}}&businessId={{businessId}}' \
--header 'Authorization: {{accessToken}}' \
--data '{
    "adAccountId": "Ad account id",
    "pageId": "page id",
    "subtype": "MESSENGER_SUBSCRIBER_LIST",
    "name": "Tên của tệp (Maxlength: 50)",
    "description": "Mô tả của tệp (Maxlength: 100)"
}'
```

## Response

* Xem cấu trúc chung [tại đây](/v3/readme.md#response).

### Failed response

* Xem các mã lỗi chung [tại đây](/v3/readme.md#failed-response).

### Successful response

```json
{
  "code": 1,
  "data": {
      "audienceId": "(string) Audience ID của tệp vừa tạo"
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.nhanh.vn/v3/vpage/marketing/custom_audience_create.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
