webhooks

Register a webhook to receive asynchronous updates.

Register a Webhook

A webhook allows you to be notified when certain system actions occur via a call to a URL you provide. Register a webhook by providing your URL and the type of action you wish to be notified. When the action occurs a POST message will be sent to the provided URL.

post
Register Webhook

https://app.ayrshare.com/api/hook/webhook
Register a new webhook. See below sections for more details on the actions.
Request
Response
Request
Headers
Authorization
required
string
Format: Authorization: Bearer API_KEY. See Overview for more information.
Body Parameters
action
required
string
Available actions: "feed", "social".
url
required
string
Your URL to be called on action. URL must be in a valid format and begin with https://
Response
200: OK
{
"status": "success"
}

delete
Unregister Webhook

https://app.ayrshare.com/api/hook/webhook
Unregister the webhook associated with the action.
Request
Response
Request
Headers
Authorization
required
string
Format: Authorization: Bearer API_KEY. See Overview for more information.
Body Parameters
action
required
string
Available actions: "feed", "social".
Response
200: OK
{
"status": "success"
}

get
List Registered Webhooks

https://app.ayrshare.com/api/hook/webhook
List the registered webhooks.
Request
Response
Request
Path Parameters
Authorization
required
string
Format: Authorization: Bearer API_KEY. See Overview for more information.
Response
200: OK
{
"status": "success"
"feed": "https://mywebsite/feed",
"social:": "https://mywebsite/social",
"updated": {
"_seconds": 1621388448,
"_nanoseconds": 799000000
}
}

Actions

Scheduled Action

Notification when a scheduled post has been processed.

Premium or Business Plan required.

POST Action to Your URL

{
action: "scheduled", // The action taken
refId: "140b8700bd6ade089b242d845e268fb886130c53", // User Reference ID
status: "success", // success or error
id: "TBAAAqAMMpoweA9wKHUp", // Ayrshare id of post
errors: [], // List of errors if any occurred
postIds: [ // Individual successful posts status
{
"postUrl" :"https://www.facebook.com/102775127855689_361718068618052",
"platform": "facebook",
"status":"success",
"id":"102775127855689_361718068618052"
}
]
}

Social Action

Notification when a user's profile links or unlinks a social network.

Enterprise Plan required.

POST Action to Your URL

{
action: "social", // The action taken
refId: "140b8700bd6ade089b242d845e268fb886130c53", // User Reference ID
type: "link", // Type of action: link or unlink
platform: "instagram", // The social platform the action occured
displayName: "Instagram Title" // if a user account name is present at the social network
}

Feed Action

Notification when a new RSS feed item is found for registered RSS feeds. Note: if the webhook is active, new RSS items will not be automatically posted to the social networks.

Enterprise Plan required.

POST Action to Your URL

{
"action": "feed",
"refId": "140b8700bd6ade089b242d845e268fb886130c53", // User Reference ID
"title": "Title of profile if available",
"data": { ... }
}