> ## 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

> Snapchat customer-list segment में लोगों को जोड़ें या हटाएँ, उनके email, phone या mobile ad id के SHA-256 hashes भेजकर।

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

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

<ul>
  <li>हर request में एक identifier: emails, phones और mobile ad ids अलग-अलग requests में भेजें।</li>
  <li>हर request में अधिकतम 10,000 rows और अधिकतम 10 MiB की body होती है। बड़ी list को कई requests में भेजें।</li>
  <li>जब Snapchat पर्याप्त लोगों को match कर लेता है, तब segment boost में उपयोग किया जा सकता है। तब [Audiences](https://www.ayrshare.com/docs/apis/ads/snapchat/get-audiences.md) `status.ready` दिखाता है।</li>
  <li>id, `accountId` में बताए गए ad account का customer-list segment होना चाहिए। कोई भी अन्य id, हटाया गया या अज्ञात id भी, `code: 101` के साथ `400` लौटाता है, और कुछ भी नहीं भेजा जाता।</li>
</ul>

## Hashed identifiers personal data हैं

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

<ul>
  <li>**आप data controller हैं।** विज्ञापन के लिए list के लोगों का data उपयोग करने के लिए आपको एक lawful basis चाहिए, आमतौर पर उनकी सहमति, जैसा आपकी privacy policy और Snapchat की advertising terms माँगती हैं।</li>
  <li>**Ayrshare एक processor है।** हम hashes को Snapchat तक पहुँचाते हैं और गिनती के अलावा कुछ नहीं रखते: body की कोई row log, cache या store नहीं की जाती, और response कभी कोई row वापस नहीं दिखाता।</li>
  <li>**भेजने से पहले आप hash करते हैं।** Ayrshare कभी आपके लिए hash नहीं करता। जो मान hash नहीं है, उसे Snapchat को कुछ भी भेजे जाने से पहले अस्वीकार कर दिया जाता है।</li>
</ul>

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

हर मान को वैसे normalize करें जैसा Snapchat के [customer list rules](https://developers.snap.com/marketing-api/Ads-API/audience-creation/customer-lists) बताते हैं, फिर उसे SHA-256 से hash करें और परिणाम 64 lowercase hex characters के रूप में भेजें। संक्षेप में:

<ul>
  <li>`EMAIL`: spaces हटाएँ और lowercase करें, उदाहरण के लिए `jane@example.com`।</li>
  <li>`PHONE`: केवल अंक, country code के साथ, शुरुआती `00` या राष्ट्रीय शुरुआती `0` के बिना, उदाहरण के लिए `14155551234` या `448444124653`।</li>
  <li>`MADID`: mobile ad id (IDFA या Android advertising id) lowercase में, hyphens को बनाए रखते हुए।</li>
</ul>

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

**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 segment id, [Audience बनाएँ](https://www.ayrshare.com/docs/apis/ads/snapchat/create-audience.md) या [Audiences](https://www.ayrshare.com/docs/apis/ads/snapchat/get-audiences.md) से।

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

**accountId** `string` *required*

वह ad account जिससे segment जुड़ा है।

**schema** `array` *required*

Rows में मौजूद एक identifier: `["EMAIL"]`, `["PHONE"]` या `["MADID"]`। ये वही नाम हैं जो Facebook और Instagram लेते हैं।

**data** `array` *required*

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

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

## Response

केवल गिनती:

<ul>
  <li>`received`: Snapchat द्वारा ली गई rows।</li>
  <li>`invalid`: वे rows जिन्हें Snapchat ने नहीं लिया।</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/snapchat/audiences/8c1e2f3a-0000-4000-8000-000000000101/users \
-d '{"accountId": "5a0d1b2c-0000-4000-8000-000000000003", "schema": ["EMAIL"], "data": [["5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7"], ["a3f1c2d4e5f60718293a4b5c6d7e8f9012345678abcdef0123456789abcdef01"]]}'
```

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

fetch("https://api.ayrshare.com/api/ads/snapchat/audiences/8c1e2f3a-0000-4000-8000-000000000101/users", {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${API_KEY}`,
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        accountId: "5a0d1b2c-0000-4000-8000-000000000003",
        schema: ["EMAIL"],
        data: [
          ["5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7"],
          ["a3f1c2d4e5f60718293a4b5c6d7e8f9012345678abcdef0123456789abcdef01"]
        ]
      })
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);
```

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

payload = {
    'accountId': '5a0d1b2c-0000-4000-8000-000000000003',
    'schema': ['EMAIL'],
    'data': [
        ['5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7'],
        ['a3f1c2d4e5f60718293a4b5c6d7e8f9012345678abcdef0123456789abcdef01']
    ]
}
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer API_KEY'}

r = requests.post('https://api.ayrshare.com/api/ads/snapchat/audiences/8c1e2f3a-0000-4000-8000-000000000101/users', json=payload, headers=headers)

print(r.json())
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "id": "8c1e2f3a-0000-4000-8000-000000000101",
  "received": 2,
  "invalid": 0,
  "batches": 1
}
```

```json 400: Not a hash 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[1][0] (EMAIL) is not a hash: expected 64 lowercase hex characters."
}
```

```json 400: More than one identifier 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": "schema takes one key per request on snapchat: send EMAIL, PHONE and MADID in separate requests."
}
```

```json 400: Not a customer list 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 8c1e2f3a-0000-4000-8000-000000000102 is a lookalike audience; members can be added to or removed from a customerList audience only."
}
```


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