# Ayrshare

Ayrshare provides a Social Media API that enables developers to programmatically manage and automate social media posts, analytics, and interactions across multiple platforms.

- **Category:** social media marketing
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 4
- **Triggers:** 0
- **Slug:** `AYRSHARE`
- **Version:** 20260211_00

## Tools

### Create Auto Schedule

**Slug:** `AYRSHARE_CREATE_AUTO_SCHEDULE`

Tool to create a new auto-post schedule with specified times and optional weekday filters. Use when setting up recurring posting plans.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `title` | string | No | The title of the schedule. Defaults to 'default'. |
| `schedule` | array | Yes | List of scheduled times in HH:MMZ format, e.g., ['13:05Z', '22:14Z'] |
| `daysOfWeek` | array | No | Optional days of the week to post (0=Sunday ... 6=Saturday). Defaults to every day if omitted. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete a previously published Ayrshare post

**Slug:** `AYRSHARE_DELETE_DELETE_POST`

Tool to delete an Ayrshare post. Use when you need to remove a published or scheduled post by its Ayrshare Post ID, after confirming the correct ID. Note: Instagram and TikTok published posts cannot be deleted via API; set `mark_manual_deleted=True` or remove manually.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | No | Ayrshare Post ID to delete. Required if neither `bulk` nor `delete_all_scheduled` is set. |
| `bulk` | array | No | List of Ayrshare Post IDs to delete in bulk. Required if neither `id` nor `delete_all_scheduled` is set. |
| `markManualDeleted` | boolean | No | If true, marks the post as deleted in Ayrshare without calling social APIs. Use when a post was manually removed on the networks. |
| `deleteAllScheduled` | boolean | No | If true, deletes all pending scheduled posts for this profile. Ignores `id` and `bulk` when set. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Post History

**Slug:** `AYRSHARE_GET_POST_HISTORY`

Tool to retrieve Ayrshare post history with metrics. Use when you need to fetch and filter past posts by date, status, or record count.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Number of records to return per page (default 20; max 500). |
| `status` | string ("success" | "error" | "processing" | "pending" | "deleted" | "awaiting approval") | No | Filter by post status. |
| `endDate` | string | No | End date in ISO 8601 format (inclusive). |
| `lastDays` | integer | No | Return posts from the last X days (default 30; 0 returns all posts). |
| `startDate` | string | No | Start date in ISO 8601 format (inclusive). |
| `Profile-Key` | string | No | Profile Key of a User Profile. Omit to use the primary profile. |
| `lastRecords` | integer | No | Return the last X posts, regardless of date filters. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
