Available on Business, Enterprise plans.

Specify a User Profile in an API call by adding the Profile Key in the header.

User Profiles are one of the core concepts of Ayrshare that allow you to create and manage multiple users. Each one of the users of your platform will have one or more Ayrshare User Profiles. Each User Profile can have one connection to every supported social network.

Profile Key

Many endpoints, such as /user, /analytics, or /delete, can be called on behalf of a Profile account by adding the “Profile-Key” parameter in the Header.

For example, the /delete endpoint can be called to delete a Profile account’s post for the given post id for the provided Profile Key.

const API_KEY = "API_KEY";
const PROFILE_KEY = "PROFILE_KEY";
const id = "Post ID";

fetch("https://app.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);

Enable or Disable Social Networks

You can disable and enable social networks at either the global level or at the User Profile level.

It is important to note that disabled social networks in the global setting, set via the dashboard, override User Profile settings.

For example, if you turn disable TikTok access in the dashboard, then no User Profile can access TikTok. On the other hand, if you turn on TikTok access in the dashboard but disable it for a specific User Profile, all User Profiles will have access to TikTok except that particular one.

Get the Linked Social Accounts

Retrieve the social accounts a User Profile has linked with either the /profiles endpoint or the /user endpoint.

Post to a User Profile

With the /post endpoint, you can post to a User Profile by adding the Profile Key in the header. The return will be an array of posts or error results, with an overall status. If all posts successful, “success”, or if any post failed, “error”.

You may obtain a user’s Profile Key via either the when the profile is created with the /create-profile endpoint or in Ayrshare’s Web Dashboard GUI by switching to the profile and going to Profile Key page.