profiles

Profiles API Endpoint: Create and manage multiple user profiles.

Business Plan required for accessing these endpoints.

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

User Profile API Endpoint

Click the in the endpoint to view details.

Post to a User Profile

POST https://app.ayrshare.com/api/post

In addition to the /post endpoint spec, you can post to a User Profile by adding the Profile Key in the header or using the "profileKey" body parameter. 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 (see below) or in Ayrshare's Web Dashboard GUI by switching to the profile and going to Profile Key page.

Request Body

NameTypeDescription

profileKey

string

The User Profile Key. You must be the owner of these user profile to post. See post verification for restrictions. If the body parameter is not specified, add the Profile Key in the header.

{
    "status": "success",
    "posts": [
        {
            "status": "success",
            "errors": [],
            "postIds": [
                {
                    "status": "success",
                    "id": "1381620827414728708",
                    "platform": "twitter"
                }
            ],
            "id": "DQf4P4tBf0rpAibpt3Gm",
            "profileTitle": "Good Fun",
            "refId": "da19d0d2875afb2a516cde881172eb6c1002c592",
            "post": "I love to post"
        },
        {
            "status": "success",
            "errors": [],
            "postIds": [
                {
                    "status": "success",
                    "id": "1381620827397951497",
                    "platform": "twitter"
                }
            ],
            "id": "jnKLGKcNcGS2iSPWnakw",
            "profileTitle": "Digg It",
            "refId": "866a36e1185b45e63f019386f941f320972b8e70",
            "post": "I love to post"
        }
    ]
}

If a response of an array is required instead of an object, please include the body parameter arrayResponse with the boolean value of true. For example, arrayResponse: true

It is important to follow the rules of the social networks, especially in regards to duplicate or similar content. Please see here for details:

pagePost Verification

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"post": "Today is a great day!", "platforms": ["twitter", "facebook", "instagram", "linkedin"], "profileKey": "PROFILE_KEY", "mediaUrls": ["https://img.ayrshare.com/012/gb.jpg"]}' \
-X POST https://app.ayrshare.com/api/post

Create a User Profile

POST https://app.ayrshare.com/api/profiles/profile

Create a new profile under your primary account. The Profile Key of the newly created profile is returned. Use the Profile Key to manage and post on behalf of your client.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Request Body

NameTypeDescription

title*

string

Title of the new profile. Must be unique.

hideTopHeader

boolean

Hide the top header on the social accounts linkage page. Boolean true to not display.

topHeader

string

Change the header on the social accounts linkage page. Currently displays: "Social Accounts for {title}" where {title} is the profile title.

disableSocial

array

Array of social networks that are disabled for this user's profile. The primary profile's list of disabled social networks takes precedence. Available networks: twitter, facebook, fbg, instagram, linkedin, telegram, gmb, youtube, tiktok, pinterest, and reddit.

See here for more information.

team

boolean

Create a new user profile as a team member by setting team: true. The email field will be used to send an invite email. See inviting a team member for details on the requirements.

email

string

A valid email address where the team member invite will be sent. Required if team: true

subHeader

string

Change the sub header on the social accounts linakge page. Currently displays "Click an icon to link a social network". Set to an empty string to remove.

See how to change the help link.

{
    "status": "success",
    "title": "Digg It",
    "refId": "140b8709bd6ade099b242d895e268fb886130c53",
    "profileKey": "7TVRLEZ-24A43C0-NJW0Z82-F11984N"
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"title": "ACME Profile"}' \
-X POST https://app.ayrshare.com/api/profiles/profile

The Profile Key returned should be securely stored in your system with appropriate access controls. For security reasons, the Profile Key can't not be retrieved again via the API. However, you can retrieve the Profile Key via the dashboard.

The refId should also be stored to associate a profile to an endpoint return.


Delete a User Profile

DELETE https://app.ayrshare.com/api/profiles/profile

Delete a user profile you are the owner of. Deleting is irrevocable and can not be undone.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Profile-Key*

string

The Profile Key of the profile to delete, returned from /create-profile. May also use the API Key found in the web dashboard.

Request Body

NameTypeDescription

title

string

Title of the User Profile to delete. Must be present if profileKey is not passed. title is case-sensitive and must match the User Profile title.

{
    "status": "success",
    "refId": "823nd82nd92jsnn2932"
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-H 'Profile-Key: PROFILE_KEY' \
-X DELETE https://app.ayrshare.com/api/profiles/profile

Update a User Profile

PUT https://app.ayrshare.com/api/profiles/profile

Update an existing profile's title, hide title, list of disabled social platforms, or display the title.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Profile-Key*

string

Profile Key for a user profile.

Request Body

NameTypeDescription

disableSocial

array

Update the list of disabled profiles. The array will overwrite the previous list of disabled social networks. Remove all disabled social by sending an empty array []. Available networks: twitter, facebook, fbg, instagram, linkedin, telegram, gmb, youtube, tiktok, pinterest, and reddit.

See here for more information.

title

string

Updated title.

hideTitle

boolean

Update hide title.

displayTitle

string

Update display title.

{
    "status": "success",
    "refId": "b1eb30ce50607a40000b220c01c20a88a49fe76f"
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"profileKey": "Jokdf-903Js-j9sd0-Pow02-QS9n3", "title": "ACME Profile"}' \
-X PUT https://app.ayrshare.com/api/profiles/profile

Get User Profiles

GET https://app.ayrshare.com/api/profiles

Get all the profiles associated with the primary account.

Query Parameters

NameTypeDescription

title

string

Return only the profile associated with the URL encoded title. Optional.

refId

string

Return only the profile associated with the given refId. The refId was returned during the profile creation or from the /user endpoint. Optional.

Headers

NameTypeDescription

Authorization

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

{
    "profiles": [
        {
            "title": "Digg It Title",
            "displayTitle": "Your title",
            "created": {
                "_seconds": 1604094099,
                "_nanoseconds": 530000000
            },
            "createdUTC": "2022-03-02T16:11:00.839Z",
            "refId": "160c8700bd6ade099b242d845e268fb986130c53",
            "activeSocialAccounts": [
                "twitter",
                "facebook",
                "linkedin",
                "instagram"
            ],
        },
        {
            "title": "Super Profile",
            "created": {
                "_seconds": 1604377627,
                "_nanoseconds": 252000000
            },
            "createdUTC": "2022-03-02T16:11:00.839Z",
            "refId": "170a8700bd6ade099b242d845e268fb986130c53"
        },
        {
            "title": "Good Fun Title"
            "created": {
                "_seconds": 1605107864,
                "_nanoseconds": 96000000
            },
            "createdUTC": "2022-03-02T16:11:00.839Z",
            "refId": "180s8700bd6ade099b242d845e268fb986130c53",
            "activeSocialAccounts": [
                "facebook",
                "linkedin",
                "youtube"
            ],
        }
    ]
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://app.ayrshare.com/api/profiles

DELETE https://app.ayrshare.com/api/profiles/social

Unlink a social network for a given user profile. For example, if a user profile is linked to TikTok, unlink TikTok by making this endpoint request. A successful 200 response will be returned even if the platform is not linked. If the Profile-Key is not provided the Primary Profile's social account will be unlinked.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Profile-Key*

string

The Profile Key of a user profile.

Request Body

NameTypeDescription

platform*

string

Platform to unlink: "facebook", "fbg", gmb", "instagram", "linkedin", "reddit", "telegram", "tiktok", "twitter", "youtube".

{
    "status": "success",
    "platform": "twitter",
    "refId": "13a9wa9e0df1183b7a6a1fc2c61b8023fa9a32a1"
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-H 'Profile-Key: PROFILE_KEY' \
-d '{"platform": "twitter"}' \
-X DELETE https://app.ayrshare.com/api/profiles/social