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

# إنشاء ملف تعريف مستخدم

> أنشئ ملف تعريف مستخدم جديد ضمن ملفك التعريفي الأساسي.

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} />

أنشئ ملفًا شخصيًا جديدًا ضمن ملفك التعريفي الأساسي. عند إنشاء ملف تعريف المستخدم بنجاح، ستتضمّن استجابة API مفتاح Profile Key المرتبط بالملف الشخصي الذي تم إنشاؤه حديثًا. قم بتخزين Profile Key بشكل آمن في نظامك، لأنه سيكون مطلوبًا لإجراء استدعاءات API نيابةً عن المستخدم.

يُرجى ملاحظة أنه لأسباب أمنية، تُعاد Profile Keys فقط في حالتين محدّدتين:

1. إنشاء ملف تعريف المستخدم: عند إنشاء ملف تعريف مستخدم جديد.
2. في لوحة تحكم Ayrshare: يمكنك العثور على Profile Key لكل ملف شخصي في لوحة تحكم Ayrshare. بدّل إلى ملف تعريف المستخدم ثم انتقل إلى صفحة Profile Key.

نوصي بتخزين Profile Key بشكل آمن في نظامك.

## إدارة الشبكات الاجتماعية

استخدم حقل disableSocial لإدارة (إضافة/إزالة) الشبكات الاجتماعية من العرض. يُرجى الاطلاع على [إدارة الحسابات الاجتماعية](/apis/profiles/overview#enable-or-disable-social-networks) لمزيد من المعلومات.

## إدارة ملفات تعريف المستخدمين النشطة

يُرجى الاطلاع هنا على بعض التوصيات حول [إدارة ملفات تعريف المستخدمين النشطة](/multiple-users/manage-user-profiles#managing-active-user-profiles).

## اعتبارات أمنية مهمّة

<Warning>
  <ul className="custom-bullets">
    <li>تجنّب مشاركة Profile Keys بشكل عام أو الكشف عنها في كود جانب العميل أو المستودعات العامة.</li>
    <li>Profile Keys هي بيانات اعتماد حسّاسة تُستخدم للمصادقة وتفويض الوصول إلى ملفات تعريف المستخدمين.</li>
    <li>من الأهمية بمكان تخزين Profile Keys بشكل آمن في نظامك مع ضوابط وصول مناسبة للحفاظ على سلامة وسرّية بيانات المستخدمين.</li>
    <li>لأسباب أمنية، لا يمكن استرداد Profile Key مرة أخرى باستخدام API. ومع ذلك، يمكنك استرداد Profile Key من [لوحة التحكم](/multiple-users/manage-user-profiles#get-the-profile-key).</li>
    <li>يجب أيضًا تخزين `refId` لربط ملف شخصي بإرجاع نقطة نهاية.</li>
  </ul>
</Warning>

## معلمات الرأس

<HeaderAPI noProfileKey />

## معلمات الجسم

<ParamField body="title" type="string" required>
  عنوان الملف الشخصي الجديد. يجب أن يكون فريدًا. سيتم عرض هذا العنوان على صفحة ربط الحساب الاجتماعي.
</ParamField>

<ParamField body="messagingActive" type="boolean" default={false}>
  عيّن إلى true لتفعيل الرسائل لملف تعريف المستخدم هذا. يجب أولاً تفعيل الرسائل لحساب Ayrshare الخاص بك.
</ParamField>

<ParamField body="hideTopHeader" type="boolean" default={false}>
  إخفاء الرأس العلوي في صفحة ربط الحسابات الاجتماعية.
</ParamField>

<ParamField body="hideLogo" type="boolean" default={false}>
  إخفاء شعار الشركة في صفحة ربط الحسابات الاجتماعية لملف تعريف المستخدم هذا فقط. الشعار على مستوى الحساب في الملفات الأخرى لا يتأثّر. مفيد لعلامة بيضاء لملفات شركاء فردية مع الاحتفاظ بالعلامة التجارية على البقية.
</ParamField>

<ParamField body="topHeader" type="string">
  تغيير الرأس في صفحة ربط الحسابات الاجتماعية. إذا لم يتم تعيينه، فيعرض: "Social Accounts for "title" حيث "title" هو عنوان الملف الشخصي.
</ParamField>

<ParamField body="disableSocial" type="array">
  مصفوفة من الشبكات الاجتماعية المعطّلة لملف تعريف هذا المستخدم. تأخذ قائمة الشبكات الاجتماعية المعطّلة في الملف الأساسي الأسبقية.

  الشبكات المتاحة: `bluesky` و`facebook` و`gmb` و`instagram` و`linkedin` و`pinterest` و`reddit` و`snapchat` و`telegram` و`threads` و`tiktok` و`twitter` و`youtube`.

  راجع [تفعيل أو تعطيل الشبكات الاجتماعية](/apis/profiles/overview#enable-or-disable-social-networks) لمزيد من المعلومات.
</ParamField>

<ParamField body="team" type="boolean" default={false}>
  أنشئ ملف تعريف مستخدم جديد كعضو فريق بتعيين `team: true`. سيتم استخدام حقل `email` لإرسال رسالة دعوة عبر البريد الإلكتروني. راجع [دعوة عضو في الفريق](/multiple-users/manage-user-profiles#invite-a-team-member) للحصول على تفاصيل حول المتطلبات.
</ParamField>

<ParamField body="email" type="string">
  عنوان بريد إلكتروني صالح ستُرسل إليه دعوة عضو الفريق. مطلوب إذا كان `team: true`
</ParamField>

<ParamField body="subHeader" type="string">
  تغيير الرأس الفرعي في صفحة ربط الحسابات الاجتماعية. يعرض حاليًا "Click an icon to link a social network". عيّن إلى سلسلة فارغة للإزالة.

  راجع كيفية تغيير [رابط المساعدة](/multiple-users/manage-user-profiles#help-links-visible).
</ParamField>

<ParamField body="tags" type="array">
  ضع علامات على ملفات تعريف المستخدمين باستخدام مصفوفة من السلاسل. تعمل هذه العلامات كأداة تنظيمية داخلية لتصنيف ملفات تعريف المستخدمين وإدارتها بفعالية.
</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>
