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

# Create a User Profile

> Створіть новий User Profile під вашим Primary 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. Після успішного створення User Profile API-відповідь буде включати Profile Key, пов'язаний із новоствореним профілем. Надійно зберігайте Profile Key у вашій системі, оскільки він знадобиться для виконання API-викликів від імені вашого користувача.

Зверніть увагу, що з міркувань безпеки Profile Keys повертаються лише у двох конкретних випадках:

1. Створення User Profile: коли створюється новий User Profile.
2. У Ayrshare Dashboard: ви можете знайти Profile Key для кожного профілю в Ayrshare Dashboard. Переключіться на User Profile і потім перейдіть на сторінку Profile Key.

Ми рекомендуємо надійно зберігати Profile Key у вашій системі.

## Керування соціальними мережами

Використовуйте поле 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 або їхнього використання у клієнтському коді чи публічних репозиторіях.</li>
    <li>Profile Keys — це чутливі credentials, які використовуються для автентифікації та авторизації доступу до User Profiles.</li>
    <li>Дуже важливо зберігати Profile Keys надійно у вашій системі з відповідним контролем доступу, щоб підтримувати цілісність і конфіденційність даних ваших користувачів.</li>
    <li>З міркувань безпеки Profile Key не можна отримати знову через API. Однак ви можете отримати Profile Key з [dashboard](/multiple-users/manage-user-profiles#get-the-profile-key).</li>
    <li>`refId` також слід зберігати, щоб пов'язати профіль із поверненням endpoint.</li>
  </ul>
</Warning>

## Header Parameters

<HeaderAPI noProfileKey />

## Body Parameters

<ParamField body="title" type="string" required>
  Назва нового профілю. Має бути унікальною. Ця назва відображатиметься на сторінці прив'язки соціальних облікових записів.
</ParamField>

<ParamField body="messagingActive" type="boolean" default={false}>
  Встановіть true, щоб активувати messaging для цього user profile. Спочатку messaging має бути ввімкнено для вашого облікового запису Ayrshare.
</ParamField>

<ParamField body="hideTopHeader" type="boolean" default={false}>
  Приховати верхній заголовок на сторінці прив'язки соціальних облікових записів.
</ParamField>

<ParamField body="hideLogo" type="boolean" default={false}>
  Приховати логотип компанії на сторінці прив'язки соціальних облікових записів лише для цього user profile. Логотип на рівні облікового запису для інших профілів не змінюється. Корисно для white-labeling окремих партнерських профілів, зберігаючи брендинг на решті.
</ParamField>

<ParamField body="topHeader" type="string">
  Змінити заголовок на сторінці прив'язки соціальних облікових записів. Якщо не встановлено, відображається: "Social Accounts for "title"", де "title" — це назва профілю.
</ParamField>

<ParamField body="disableSocial" type="array">
  Масив соціальних мереж, які вимкнено для профілю цього користувача. Список вимкнених соціальних мереж primary profile має перевагу.

  Доступні мережі: `bluesky`, `facebook`, `gmb`, `instagram`, `linkedin`, `pinterest`, `reddit`, `snapchat`, `telegram`, `threads`, `tiktok`, `twitter` та `youtube`.

  Див. [enable or disable social networks](/apis/profiles/overview#enable-or-disable-social-networks) для отримання додаткової інформації.
</ParamField>

<ParamField body="team" type="boolean" default={false}>
  Створити новий user profile як team member, встановивши `team: true`. Поле `email` буде використано для надсилання листа-запрошення. Див. [інструкції з запрошення team member](/multiple-users/manage-user-profiles#invite-a-team-member) для деталей щодо вимог.
</ParamField>

<ParamField body="email" type="string">
  Дійсна адреса електронної пошти, на яку буде надіслано запрошення team member. Обов'язкова, якщо `team: true`
</ParamField>

<ParamField body="subHeader" type="string">
  Змінити підзаголовок на сторінці прив'язки соціальних облікових записів. Наразі відображається "Click an icon to link a social network". Встановіть порожній рядок, щоб видалити.

  Див., як змінити [help link](/multiple-users/manage-user-profiles#help-links-visible).
</ParamField>

<ParamField body="tags" type="array">
  Позначайте user profiles за допомогою масиву рядків. Ці теги слугують внутрішнім інструментом організації для ефективної категоризації та керування вашими 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>
