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

# User Profile बनाएँ

> अपने Primary Profile के तहत एक नया User Profile बनाएँ।

export const PlansAvailable = ({plans = [], maxPackRequired}) => {
  let displayPlans = plans;
  if (plans && plans.length === 1) {
    const lowerCasePlan = plans[0].toLowerCase();
    if (lowerCasePlan === "business") {
      displayPlans = ["Launch", "Business", "Enterprise"];
    } else if (lowerCasePlan === "premium") {
      displayPlans = ["Premium", "Launch", "Business", "Enterprise"];
    }
  }
  return <Note>
Available on {displayPlans.length === 1 ? "the " : ""}
{displayPlans.join(", ").replace(/\b\w/g, l => l.toUpperCase())}{" "}
{displayPlans.length > 1 ? "plans" : "plan"}.

{maxPackRequired && <span onClick={() => window.open('https://www.ayrshare.com/docs/additional/maxpack', '_self')} className="flex items-center mt-2 cursor-pointer">
 <span className="px-1.5 py-0.5 rounded text-sm" style={{
    backgroundColor: '#C264B6',
    color: 'white',
    fontSize: '12px'
  }}>
   Max Pack required
 </span>
</span>}
</Note>;
};

export const HeaderAPI = ({noProfileKey, profileKeyRequired}) => <>
    <ParamField header="Authorization" type="string" required>
      <a href="/apis/overview#authorization">API Key</a> of the Primary Profile.
      <br />
      <br />
      Format: <code>Authorization: Bearer API_KEY</code>
    </ParamField>
    {!noProfileKey && (profileKeyRequired ? <ParamField header="Profile-Key" type="string" required>
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField> : <ParamField header="Profile-Key" type="string">
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField>)}
  </>;

<PlansAvailable plans={["business"]} maxPackRequired={false} />

अपने Primary Profile के तहत एक नया profile बनाएँ। User Profile के सफल निर्माण पर, API प्रतिक्रिया में नए बनाए गए profile से जुड़ी Profile Key शामिल होगी। Profile Key को अपने सिस्टम में सुरक्षित रूप से store करें, क्योंकि यह आपके user की ओर से API कॉल करने के लिए आवश्यक होगी।

कृपया ध्यान दें कि सुरक्षा कारणों से, Profile Keys केवल दो विशिष्ट मामलों में लौटाई जाती हैं:

1. User Profile निर्माण: जब एक नया User Profile बनाया जाता है।
2. Ayrshare Dashboard में: आप Ayrshare Dashboard के भीतर प्रत्येक profile के लिए Profile Key पा सकते हैं। User Profile पर स्विच करें और फिर Profile Key पेज पर navigate करें।

हम अनुशंसा करते हैं कि आप Profile Key को अपने सिस्टम में सुरक्षित रूप से store करें।

## Social Networks का प्रबंधन

Display से social networks को प्रबंधित (जोड़ने/हटाने) करने के लिए disableSocial फ़ील्ड का उपयोग करें। अधिक जानकारी के लिए कृपया [Manage Social Accounts](/apis/profiles/overview#enable-or-disable-social-networks) देखें।

## सक्रिय User Profiles प्रबंधित करें

[सक्रिय User Profiles प्रबंधित करने](/multiple-users/manage-user-profiles#managing-active-user-profiles) के लिए कुछ अनुशंसाओं के लिए कृपया यहाँ देखें।

## महत्वपूर्ण सुरक्षा विचार

<Warning>
  <ul className="custom-bullets">
    <li>Profile Keys को सार्वजनिक रूप से साझा करने या उन्हें client-side कोड या सार्वजनिक repositories में उजागर करने से बचें।</li>
    <li>Profile Keys संवेदनशील credentials हैं जो User Profiles तक पहुँच को authenticate और authorize करने के लिए उपयोग किए जाते हैं।</li>
    <li>अपने users के डेटा की अखंडता और गोपनीयता बनाए रखने के लिए Profile Keys को उचित access controls के साथ अपने सिस्टम में सुरक्षित रूप से store करना महत्वपूर्ण है।</li>
    <li>सुरक्षा कारणों से, Profile Key को API का उपयोग करके दोबारा प्राप्त नहीं किया जा सकता। हालाँकि, आप [dashboard](/multiple-users/manage-user-profiles#get-the-profile-key) से Profile Key प्राप्त कर सकते हैं।</li>
    <li>`refId` को भी profile को endpoint return से जोड़ने के लिए store किया जाना चाहिए।</li>
  </ul>
</Warning>

## Header Parameters

<HeaderAPI noProfileKey />

## Body Parameters

<ParamField body="title" type="string" required>
  नए profile का शीर्षक। अद्वितीय होना चाहिए। यह शीर्षक social account linking पेज पर प्रदर्शित होगा।
</ParamField>

<ParamField body="messagingActive" type="boolean" default={false}>
  इस user profile के लिए messaging को सक्रिय करने के लिए true पर सेट करें। पहले आपके Ayrshare खाते के लिए messaging सक्षम होनी चाहिए।
</ParamField>

<ParamField body="hideTopHeader" type="boolean" default={false}>
  social accounts linkage पेज पर top header छिपाएँ।
</ParamField>

<ParamField body="hideLogo" type="boolean" default={false}>
  केवल इस user profile के लिए social accounts linkage पेज पर कंपनी का लोगो छिपाएँ। अन्य profiles पर खाता-व्यापी लोगो अप्रभावित रहता है। शेष पर branding रखते हुए व्यक्तिगत partner profiles को white-label करने के लिए उपयोगी।
</ParamField>

<ParamField body="topHeader" type="string">
  social accounts linkage पेज पर header बदलें। यदि सेट नहीं किया गया है, तो प्रदर्शित होता है: "Social Accounts for "title" जहाँ "title" profile शीर्षक है।
</ParamField>

<ParamField body="disableSocial" type="array">
  Social networks का Array जो इस user के profile के लिए अक्षम हैं। Primary profile की अक्षम social networks की सूची को प्राथमिकता मिलती है।

  उपलब्ध नेटवर्क: `bluesky`, `facebook`, `gmb`, `instagram`, `linkedin`, `pinterest`, `reddit`, `snapchat`, `telegram`, `threads`, `tiktok`, `twitter`, और `youtube`।

  अधिक जानकारी के लिए [social networks को सक्षम या अक्षम करना](/apis/profiles/overview#enable-or-disable-social-networks) देखें।
</ParamField>

<ParamField body="team" type="boolean" default={false}>
  `team: true` सेट करके एक नया user profile team member के रूप में बनाएँ। `email` फ़ील्ड का उपयोग invite email भेजने के लिए किया जाएगा। आवश्यकताओं पर विवरण के लिए [team member को आमंत्रित करना](/multiple-users/manage-user-profiles#invite-a-team-member) देखें।
</ParamField>

<ParamField body="email" type="string">
  एक वैध email पता जहाँ team member invite भेजा जाएगा। यदि `team: true` तो आवश्यक।
</ParamField>

<ParamField body="subHeader" type="string">
  social accounts linkage पेज पर sub header बदलें। वर्तमान में "Click an icon to link a social network" प्रदर्शित करता है। हटाने के लिए एक खाली स्ट्रिंग पर सेट करें।

  [help link](/multiple-users/manage-user-profiles#help-links-visible) को बदलने का तरीका देखें।
</ParamField>

<ParamField body="tags" type="array">
  Strings के एक array का उपयोग करके user profiles को टैग करें। ये tags आपके user profiles को प्रभावी ढंग से वर्गीकृत और प्रबंधित करने के लिए एक आंतरिक संगठनात्मक टूल के रूप में कार्य करते हैं।
</ParamField>

<RequestExample>
  ```javascript cURL theme={"system"}
  curl \
  -H "Authorization: Bearer API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"title": "ACME Profile"}' \
  -X POST https://api.ayrshare.com/api/profiles
  ```

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

  fetch("https://api.ayrshare.com/api/profiles", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "Authorization": `Bearer ${API_KEY}`
        },
        body: JSON.stringify({
          title: "ACME Profile", // required
        }),
      })
        .then((res) => res.json())
        .then((json) => console.log(json))
        .catch(console.error);
  ```

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

  payload = {'title': 'ACME Profile'}
  headers = {'Content-Type': 'application/json',
          'Authorization': 'Bearer API_KEY'}

  r = requests.post('https://api.ayrshare.com/api/profiles',
      json=payload,
      headers=headers)

  print(r.json())
  ```

  ```php PHP theme={"system"}
  <?php
  require 'vendor/autoload.php';    // Composer auto-loader using Guzzle. See .../guzzlephp.org/en/stable/overview.html

  $client = new GuzzleHttp\Client();
  $res = $client->request(
      'POST',
      'https://api.ayrshare.com/api/profiles',
      [
          'headers' => [
              'Content-Type'      => 'application/json',
              'Authorization'     => 'Bearer API_KEY'
          ],
          'title' => ['ACME Profile'],
      ]
  );

  echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
  ```

  ```go Go theme={"system"}
  package main

  import (
  	"bytes"
  	"encoding/json"
  	"log"
  	"net/http"
  )

  func main() {
  	message := map[string]interface{}{
  		"title": "ACME Profile"
  	}

  	bytesRepresentation, err := json.Marshal(message)
  	if err != nil {
  		log.Fatalln(err)
  	}

  	req, _ := http.NewRequest("POST", "https://api.ayrshare.com/api/profiles",
  		bytes.NewBuffer(bytesRepresentation))

  	req.Header.Add("Content-Type", "application/json; charset=UTF-8")
  	req.Header.Add("Authorization", "Bearer API_KEY")

  	res, err := http.DefaultClient.Do(req)
  	if err != nil {
  		log.Fatal("Error:", err)
  	}

  	res.Body.Close()
  }
  ```

  ```csharp C# theme={"system"}
  using System;
  using System.Net.Http;
  using System.Text;
  using System.Threading.Tasks;

  namespace CreateProfilePOSTRequest_csharp 
  {
    class CreateProfile
    {
        static async Task Main(string[] args)
        {
            string API_KEY = "API_KEY";
            string url = "https://api.ayrshare.com/api/profiles";
            string json = "{\"title\": \"ACME Profile\"}";

            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);

                try
                {
                    var content = new StringContent(json, Encoding.UTF8, "application/json");
                    HttpResponseMessage response = await client.PostAsync(url, content);
                    
                    response.EnsureSuccessStatusCode();
                    string responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine(responseBody);
                }
                catch (HttpRequestException e)
                {
                    Console.WriteLine($"Error: {e.Message}");
                }
            }
        }
    }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200: Success theme={"system"}
  {
      "status": "success",
      "title": "Digg It",
      "refId": "140b8709bd6ade099b242d895e268fb886130c53",
      "profileKey": "7TVRLEZ-24A43C0-NJW0Z82-F11984N",
      "messagingActive": true // true if messaging for this user profile is active
  }
  ```

  ```json 400: Profile Title Already Exists theme={"system"}
  {
    "action": "create",
    "status": "error",
    "code": 146,
    "message": "Profile title already exists."
  }
  ```
</ResponseExample>
