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

# Tổng quan API Profiles

> Tạo và quản lý nhiều 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>;
};

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

<Info>
  Chỉ định một User Profile trong lệnh gọi API bằng cách [thêm Profile Key trong header](/apis/overview#profile-key-format).
</Info>

User Profile là một trong những khái niệm cốt lõi của Ayrshare cho phép bạn tạo và quản lý nhiều người dùng. Mỗi người dùng của nền tảng của bạn sẽ có một hoặc nhiều Ayrshare User Profile. Mỗi User Profile có thể có một kết nối tới mỗi mạng xã hội được hỗ trợ.

## Profile Key

Nhiều endpoint, chẳng hạn như /user, /analytics, hoặc /delete, có thể được gọi thay mặt cho một Profile account bằng cách [thêm tham số "Profile-Key"](/apis/overview#profile-key-format) trong Header.

Ví dụ, endpoint /delete có thể được gọi để xóa bài đăng của một Profile account với *post* *id* đã cho cho *Profile Key* được cung cấp.

```javascript theme={"system"}
const API_KEY = "API_KEY";
const PROFILE_KEY = "PROFILE_KEY";
const id = "Post ID";

fetch("https://api.ayrshare.com/api/delete", {
      method: "DELETE",
      headers: {
        "Content-Type": "application/json",
        "Authorization": `Bearer ${API_KEY}`
        "Profile-Key": PROFILE_KEY
      },
      body: JSON.stringify({
        id: id
      }),
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);
```

## Bật hoặc tắt mạng xã hội

Bạn có thể tắt và bật các mạng xã hội ở cấp toàn cầu hoặc ở cấp User Profile.

<ul class="custom-bullets">
  <li>[Quản lý truy cập social account toàn cầu](/multiple-users/manage-user-profiles#set-social-networks-access) trong bảng điều khiển.</li>
  <li>Quản lý truy cập social account cho một User Profile khi [tạo](/apis/profiles/create-profile) hoặc [cập nhật](/apis/profiles/update-profile).</li>
</ul>

Điều quan trọng cần lưu ý là các mạng xã hội bị tắt trong cài đặt toàn cầu, được đặt qua bảng điều khiển, sẽ ghi đè cài đặt User Profile.

Ví dụ, nếu bạn tắt truy cập TikTok trong bảng điều khiển, thì không User Profile nào có thể truy cập TikTok. Mặt khác, nếu bạn bật truy cập TikTok trong bảng điều khiển nhưng tắt nó cho một User Profile cụ thể, tất cả các User Profile sẽ có quyền truy cập vào TikTok ngoại trừ profile cụ thể đó.

## Lấy các social account đã liên kết

Truy xuất các social account mà User Profile đã liên kết bằng [endpoint /profiles](/apis/profiles/get-profiles) hoặc [endpoint /user](/apis/user/profile-details).

## Đăng vào User Profile

Với endpoint [/post](/apis/post/post), bạn có thể đăng vào User Profile bằng cách thêm Profile Key trong header. Kết quả trả về sẽ là một mảng các bài đăng hoặc kết quả lỗi, với một trạng thái tổng thể. Nếu tất cả các bài đăng thành công, "success", hoặc nếu bất kỳ bài đăng nào thất bại, "error".

Bạn có thể lấy Profile Key của người dùng khi profile được tạo bằng endpoint [/create-profile](/apis/profiles/create-profile) hoặc trong Ayrshare's Web Dashboard GUI bằng cách chuyển sang profile và vào trang **Profile Key**.
