X (Twitter)
Create tweets, search content, and manage your presence on X (Twitter).
Connect
Auth type: OAuth (oauth2). Click Connect and approve access on the provider's page. Appbricx runs the OAuth flow (signed single-use state, PKCE where the provider supports it), stores the tokens encrypted and refreshes them before they expire.
Scopes requested: tweet.readtweet.writeusers.read
OAuth needs an OAuth app: the platform's when the operator configured one, or your own (admin panel, Integrations, Configure). You can also bring your own credentials.
- In the editor: Backend panel, Integrations tab, then Connect. This connects it for the project.
- For every project in a workspace: Workspace settings, Integrations.
- Owners and admins choose which integrations members may connect in the admin panel (Integrations tab), and can attach their own OAuth app there.
Call it from a workflow
Pass the action name and its input. The call resolves with { success, output, error? }; a missing connection resolves with success false and the reason. See ctx.integrations.invoke and ctx.integrations.call.
// .workflow.js (native ctx)
export async function run(ctx) {
const res = await ctx.integrations.invoke("twitter", "create-tweet", {
"text": "<text>"
});
if (!res.success) throw new Error(res.error);
ctx.log.info("X (Twitter) answered", { output: res.output });
}// defineWorkflow module (@app/sdk ctx)
import { defineWorkflow } from "@app/sdk";
export default defineWorkflow({
id: "twitter-create-tweet",
name: "X (Twitter): Create Tweet",
description: "Calls X (Twitter) when a row is created.",
trigger: { type: "entity_event", entity: "tickets", event: "created" },
async run(ctx, event) {
const res = await ctx.integrations.call("twitter", {
"action": "create-tweet",
"text": "<text>"
}) as { success: boolean; error?: string };
if (!res.success) throw new Error(res.error);
},
});curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/twitter/create-tweet" \
-H "Authorization: Bearer $APP_KEY" \
-H "content-type: application/json" \
-d '{"props":{"text":"<text>"}}'Actions
create-tweetin catalog
Create Tweet. Create a tweet
| Input | Type | Description |
|---|---|---|
textrequired | long text | The text of the tweet |
image_1optional | file | An image, video or GIF url or base64 to attach to the tweet |
image_2optional | file | An image, video or GIF url or base64 to attach to the tweet |
image_3optional | file | An image, video or GIF url or base64 to attach to the tweet |
create-reply
Create Reply. Reply to a tweet.
| Input | Type | Description |
|---|---|---|
tweet_idrequired | long text | The ID of the tweet to reply too. |
textrequired | long text | The text of the tweet |
image_1optional | file | An image, video or GIF url or base64 to attach to the tweet |
image_2optional | file | An image, video or GIF url or base64 to attach to the tweet |
image_3optional | file | An image, video or GIF url or base64 to attach to the tweet |
Details
- Id
twitter- Category
- Social media
- Tags
- social, twitter, x, tweets, microblogging
- Package
@activepieces/piece-twitter@0.3.3- Tier
- Built in