# Schedule Message — Hootsuite

> Schedules a message on your Hootsuite account. See the documentation

- Key: `hootsuite-schedule-message`
- Type: Action (Write)
- Version: 0.0.4
- App: Hootsuite (`hootsuite`) — https://pipedream.com/apps/hootsuite.md
- This page (HTML): https://pipedream.com/apps/hootsuite/actions/schedule-message
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/hootsuite/actions/schedule-message/schedule-message.mjs

## Description

Schedules a message on your Hootsuite account. [See the documentation](https://apidocs.hootsuite.com/docs/api/index.html#operation/scheduleMessage)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `text` | `string` | Yes | The message text to publish. |
| `socialProfileIds` | `string[]` | Yes | The social profiles that the message will be posted to. Options are loaded from the connected account. |
| `scheduledSendTime` | `string` | No | The time the message is scheduled to be sent in UTC time, ISO-8601 format. Missing or different timezones will not be accepted, to ensure there is no ambiguity about scheduled time. Dates must end with 'Z' to be accepted. |
| `webhookUrls` | `string[]` | No | The webhook URL(s) to call to when the message's state changes. |
| `tags` | `string[]` | No | The Hootsuite message tags to apply to the message. To set tags the social profile must belong to an organization. Tags are case sensitive. Limited permission members can only use the existing tags for organization and cannot create new ones. See more about message tags at the Hootsuite Help Center. Not supported by Pinterest. |
| `targetingFacebookPageAgeMin` | `string` | No | Minimum age to target the message at. |
| `targetingFacebookPageEducation` | `string[]` | No | The education level of the Facebook page to target. |
| `targetingFacebookPageInterestIn` | `string[]` | No | Interested in preferences to target the message at. |
| `targetingFacebookPageRelationshipStatus` | `string[]` | No | Relationship status to target the message at. |
| `targetingFacebookPageCountry` | `string[]` | No | Country to target the message at. 2-digit ISO 3166 format code as provided by Facebook. Format: [{"k": "Canada", "v": "CA"}] See the documentation for more information. |
| `targetingFacebookPageRegions` | `string[]` | No | Region to target the message at. Note that regions can only be specified when there is exactly one country targeted. Limit 200. Format: [{"k": "British Columbia", "v": "2"}] See the documentation for more information. |
| `targetingFacebookPageCities` | `string[]` | No | City to target the message at. Note that cities can only be specified when there is exactly one country targeted. Limit 250. Format: [{"k": "Burnaby, BC", "v": "292466"}] See the documentation for more information. |
| `targetingFacebookPageZips` | `string[]` | No | Zip/Postal Code to target the message at. Limit 50,000. Format: [{"k": "K1S", "v": "CA:K1S"}] See the documentation for more information. |
| `targetingLinkedInCompanySize` | `string[]` | No | Company size to target the message at. |
| `targetingLinkedInCompanyGeography` | `string[]` | No | Geography to target the message at. |
| `targetingLinkedInCompanyIndustry` | `string[]` | No | Industry to target the message at. |
| `targetingLinkedInCompanyJobFunction` | `string[]` | No | Job function to target the message at. |
| `targetingLinkedInCompanySeniority` | `string[]` | No | Seniority to target the message at. |
| `targetingLinkedInV2CompanyLocations` | `string[]` | No | Locations to target the message at, expected format of urn:li:geo:{CODE}. Geo Locations reference, Geo Typeahead Locations reference |
| `targetingLinkedInV2CompanyStaffCountRange` | `string[]` | No | Staff count to target the message at, expected format of SIZE_{VALUES}. Staff count codes reference |
| `targetingLinkedInV2CompanySeniorities` | `string[]` | No | Seniorities to target the message at, expected format of urn:li:seniority:{CODE}. Seniorities codes reference |
| `targetingLinkedInV2CompanyIndustries` | `string[]` | No | Industries to target the message at, expected format of urn:li:industry:{CODE}. Industries codes reference |
| `targetingLinkedInV2CompanyInterfaceLocations` | `string[]` | No | Languages to target the message at, expected format of {"country":"COUNTRY","language":"language"}. Language codes reference Languages can be interpreted as this format: language_COUNTRY, replace in request as necessary. |
| `privacyFacebookVisibility` | `string` | No | Facebook visibility rule. |
| `privacyLinkedInVisibility` | `string` | No | LinkedIn visibility rule. |
| `latitude` | `string` | No | The latitude in decimal degrees. Must be between -90 to 90. |
| `longitude` | `string` | No | The longitude in decimal degrees. Must be between -180 to 180. |
| `emailNotification` | `boolean` | No | A flag to determine whether email notifications are sent when the message is published. |
| `mediaUrls` | `string[]` | No | The ow.ly media to attach to the message |
| `media` | `string[]` | No | The media id(s) returned at Create Media Upload Job action to attach to the message |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "hootsuite",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "hootsuite-schedule-message",
  arguments: {
    text: "Text",
    socialProfileIds: ["Social Profile IDs"],
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "hootsuite-schedule-message",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    hootsuite: { authProvisionId: "apn_xxxxxxx" },
    text: "Text",
    socialProfileIds: ["Social Profile IDs"],
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "hootsuite-schedule-message",
    "configured_props": {
      "hootsuite": { "authProvisionId": "apn_xxxxxxx" },
      "text": "Text",
      "socialProfileIds": ["Social Profile IDs"]
    }
  }'
```

---

- App: https://pipedream.com/apps/hootsuite.md · All apps: https://pipedream.com/apps
