> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Audience Members

> Instagram customer-list audience में लोगों को जोड़ें या हटाएँ, उनके email, phone या अन्य identifiers के SHA-256 hashes भेजकर।

[Audience बनाएँ](https://www.ayrshare.com/docs/apis/ads/instagram/create-audience.md) से बनाई गई customer-list audience (`type: customerList`) में लोगों को जोड़ें, या उन्हें हटाएँ। आप हर व्यक्ति को उसके normalized identifiers के SHA-256 hashes के रूप में भेजते हैं; Meta hashes का accounts से मिलान करता है; raw मान कभी आपके सिस्टम से बाहर नहीं जाते।

`DELETE /ads/instagram/audiences/{id}/users` वही body लेता है और इसके बजाय लोगों को हटाता है।

<ul>
  <li>Meta के कम से कम 100 लोगों का मिलान करने पर सूची boost में उपयोग की जा सकती है, जिसमें 48 घंटे तक लग सकते हैं। ऐसा होने पर [Audiences](https://www.ayrshare.com/docs/apis/ads/instagram/get-audiences.md) `status.ready` दिखाता है।</li>
  <li>हर request में अधिकतम 10,000 rows और अधिकतम 10 MiB की body होती है। बड़ी सूची कई requests में भेजें।</li>
  <li>GraphQL के ज़रिए, `addAdAudienceUsers` और `removeAdAudienceUsers` छोटा batch ले जाते हैं: एक `schema` column के साथ लगभग 900 rows, ज़्यादा columns के साथ कम। बड़े GraphQL request को `Request body too large.` मिलता है। पूरे 10,000-row batches इन REST endpoints पर भेजें।</li>
  <li>अगर बड़े upload का कोई एक request विफल होता है, तो उससे पहले के requests audience में बने रहते हैं। विफल request दोबारा भेजें: Meta duplicate rows हटा देता है।</li>
  <li>Id, `accountId` से बताए गए ad account की custom audience होनी चाहिए। कोई भी अन्य id `code: 101` वाला `400` लौटाता है।</li>
</ul>

## Hashed identifiers personal data हैं

Hashed email या phone number फिर भी GDPR और इसी तरह के कानूनों के तहत personal data है। जब आप सूची upload करते हैं:

<ul>
  <li>**आप data controller हैं।** विज्ञापन के लिए लोगों का डेटा उपयोग करने के लिए आपको एक कानूनी आधार चाहिए, आमतौर पर सूची के लोगों की सहमति, जैसा आपकी privacy policy और Meta की [Custom Audience terms](https://www.facebook.com/legal/terms/customaudience) माँगती हैं।</li>
  <li>**Ayrshare एक processor है।** हम hashes को Meta तक पहुँचाते हैं और counts के अलावा कुछ नहीं रखते: body की कोई row log, cache या store नहीं की जाती, और response कभी कोई row नहीं दोहराता।</li>
  <li>**भेजने से पहले hash आप करते हैं।** Ayrshare कभी आपके लिए hash नहीं करता। जो मान hash नहीं है, उसे Meta को कुछ भी भेजे जाने से पहले अस्वीकार कर दिया जाता है।</li>
</ul>

### Hash कैसे करें

हर मान को Meta के [customer list rules](https://developers.facebook.com/docs/marketing-api/audiences/guides/custom-audiences#hash) के अनुसार normalize करें, फिर उसे SHA-256 से hash करें और परिणाम को 64 lowercase hex characters के रूप में भेजें। संक्षेप में:

<ul>
  <li>`EMAIL`: spaces हटाएँ और lowercase करें, उदाहरण के लिए `jane@example.com`।</li>
  <li>`PHONE`: सिर्फ़ अंक, country code के साथ और बिना leading zeros या `+` के, उदाहरण के लिए `14155551234`।</li>
  <li>`FN`, `LN`, `CT`, `ST`, `COUNTRY`: lowercase, बिना punctuation या spaces के; `COUNTRY` दो-अक्षर के code के रूप में; `ST` US राज्य के लिए दो-अक्षर का code, अन्यथा क्षेत्र का नाम।</li>
  <li>`ZIP`: lowercase, बिना spaces के; US codes के लिए पहले पाँच अंक।</li>
  <li>`GEN`: `m` या `f`। `DOBY`: चार अंकों का वर्ष। `DOBM` और `DOBD`: दो अंक।</li>
  <li>`FI`: पहले नाम का पहला अक्षर, lowercase में।</li>
</ul>

Meta के पेज पर पूरे नियम हैं, जिनमें दूसरे देशों के formats के नियम भी शामिल हैं।

## हैडर पैरामीटर

**Authorization** `string` *required*

[API Key](https://www.ayrshare.com/docs/apis/overview.md#authorization) of the Primary Profile.

Format: `Authorization: Bearer API_KEY`
**Profile-Key** `string`

[Profile Key](https://www.ayrshare.com/docs/apis/overview.md#profile-key-format) of a User Profile.

Format: `Profile-Key: PROFILE_KEY`

## पाथ पैरामीटर

**id** `string` *required*

Customer-list audience id, [Audience बनाएँ](https://www.ayrshare.com/docs/apis/ads/instagram/create-audience.md) या [Audiences](https://www.ayrshare.com/docs/apis/ads/instagram/get-audiences.md) से।

## बॉडी पैरामीटर

**accountId** `string` *required*

वह ad account जिससे audience संबंधित है, `act_` prefix के साथ या उसके बिना।

**schema** `array` *required*

हर column में identifier, क्रम से। समर्थित: `EMAIL`, `PHONE`, `GEN`, `DOBY`, `DOBM`, `DOBD`, `FN`, `LN`, `FI`, `CT`, `ST`, `ZIP`, `COUNTRY`। Meta `MADID`, `EXTERN_ID` और `PAGEUID` को बिना hash के लेता है, इसलिए वे यहाँ स्वीकार नहीं किए जाते।

**data** `array` *required*

हर व्यक्ति के लिए एक row: हर `schema` column के लिए एक SHA-256 hash वाला array, 64 lowercase hex characters के रूप में। अधिकतम 10,000 rows।

ऐसा cell जो इस तरह का hash नहीं है, गलत चौड़ाई वाली row, या असमर्थित key, Meta को कुछ भी भेजे जाने से पहले `code: 101` वाला `400` लौटाता है। संदेश row और column बताता है, मान कभी नहीं, उदाहरण के लिए `data[1][0] (EMAIL) is not a hash: expected 64 lowercase hex characters.`

## Response

सिर्फ़ counts:

<ul>
  <li>`received`: वे rows जिन्हें Meta ने लिया।</li>
  <li>`invalid`: वे rows जिन्हें Meta पढ़ नहीं सका।</li>
  <li>`batches`: rows कितने uploads में भेजी गईं।</li>
</ul>

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123/users \
-d '{"accountId": "1234567890", "schema": ["EMAIL", "PHONE"], "data": [["5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7", "a3f1c2d4e5f60718293a4b5c6d7e8f9012345678abcdef0123456789abcdef01"]]}'
```

```javascript JavaScript theme={"system"}
const API_KEY = "API_KEY";

fetch("https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123/users", {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${API_KEY}`,
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
    "accountId": "1234567890",
    "schema": [
      "EMAIL",
      "PHONE"
    ],
    "data": [
      [
        "5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7",
        "a3f1c2d4e5f60718293a4b5c6d7e8f9012345678abcdef0123456789abcdef01"
      ]
    ]
  })
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);
```

```python Python theme={"system"}
import requests

headers = {'Authorization': 'Bearer API_KEY', 'Content-Type': 'application/json'}
payload = {
  "accountId": "1234567890",
  "schema": [
    "EMAIL",
    "PHONE"
  ],
  "data": [
    [
      "5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7",
      "a3f1c2d4e5f60718293a4b5c6d7e8f9012345678abcdef0123456789abcdef01"
    ]
  ]
}

r = requests.post('https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123/users', json=payload, headers=headers)

print(r.json())
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "id": "23851234567890123",
  "received": 1,
  "invalid": 0,
  "batches": 1
}
```

```json 400: A raw value theme={"system"}
{
  "action": "request",
  "status": "error",
  "code": 101,
  "message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
  "details": "data[0][0] (EMAIL) is not a hash: expected 64 lowercase hex characters."
}
```

```json 400: Too many rows theme={"system"}
{
  "action": "request",
  "status": "error",
  "code": 101,
  "message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
  "details": "data has 12000 rows; the limit is 10000 per request."
}
```

```json 400: Not an audience of this account theme={"system"}
{
  "action": "request",
  "status": "error",
  "code": 101,
  "message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
  "details": "id 23851234567890123 is not a custom audience of ad account 123456789."
}
```

```json 413: Body over 10 MiB theme={"system"}
{
  "action": "request",
  "status": "error",
  "code": 525,
  "message": "The request body is too large. Please reduce the size of the request."
}
```

```json 400: Meta refused the upload theme={"system"}
{
  "action": "ads",
  "status": "error",
  "code": 369,
  "message": "Unable to add people to the audience. Please try again.",
  "details": "Meta's reason"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.