Skip to content

The moment it happens

Post a tweet by sending text to a link

Send text and an optional image from any tool and it's posted on X, with the tweet URL sent back.

Runs
The moment it happens
Apps
X
AI
Not needed
Access
tweet.write media.write

Send this to your assistant

Create a ClickRuntime automation: give me a link I can send text and an optional image URL to. Post each one as a tweet and reply with the tweet link.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Posting to X from wherever you work is surprisingly awkward. A shop owner wants a new product photo to go out the moment it is uploaded, a coach wants a form on their site to post a customer win, and a developer wants a script to tweet when a build is released. Each of them ends up opening X and doing the post by hand.

The automation gives you a trigger link. When text, and optionally an image URL, is sent to it, the image is downloaded and uploaded to X, the post is created, and the link of the live tweet is returned to the sender so the calling tool knows it worked.

Developers, no-code builders and small teams who want other apps to be able to tweet use it as a bridge.

What you get out of it

  • Any app can post to X

    Forms, scripts, spreadsheets and other tools that can call a URL gain the ability to publish a tweet, which extends your toolkit well beyond X's own apps. That turns X into one more destination for whatever you already build or use.

  • Images are handled for you

    Downloading the image and uploading it to X takes care of a step that is normally the hardest part of automating a post with a picture. Pictures raise engagement, and doing the upload for you removes the hardest step.

  • The sender learns the result

    Returning the tweet URL means a form or script can store the link, show it to the user or log it, which closes the loop on the action. A returned link lets your form or script keep a record of what was posted.

  • Posts happen the moment you send

    With a trigger link, the tweet is created when the request arrives, so a product launch or release note goes out exactly when it is ready. Timeliness is the point of social posting, and nothing waits for a human to open X.

  • Credentials stay in one place

    Your X keys are kept as secrets, so the tools that send content never need the keys and the risk of exposing them in a script is reduced. Keeping keys in one place is safer than pasting them into every tool that wants to post.

How it works

What happens, step by step

  1. When you send text (and optionally an image link) to the automation's private link, for example from a form, it starts.

  2. If you included an image, it is uploaded to X first.

  3. The tweet is posted on your X account.

  4. You get a reply with the link to the new tweet.

Before it runs live

  • Connect X
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Post a tweet by sending text to a linkjust nowSucceeded
X · @acmecoffeePosted: "New single-origin from Huila just landed. Bright, citrusy, gone by Friday." https://x.com/i/web/status/1847...

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other X steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
tweet_from_a_link_or_form.pyexample
from clickruntime import on_event, http, credentials

@on_event
def handle(event):
    body = event.json or {}
    auth = {"Authorization": "Bearer " + credentials.connection("x", "main")}
    tweet = {"text": body["text"][:280]}
    if body.get("image_url"):
        media = http.post("https://api.x.com/2/media/upload", headers=auth,
                          files={"media": http.get(body["image_url"]).content}, data={"media_category": "tweet_image"}).json()
        tweet["media"] = {"media_ids": [media["data"]["id"]]}
    resp = http.post("https://api.x.com/2/tweets", headers=auth, json=tweet)
    resp.raise_for_status()
    tweet_id = resp.json()["data"]["id"]
    return {"url": f"https://x.com/i/web/status/{tweet_id}"}

FAQ

Common questions

What image formats work?
Common formats such as JPG, PNG and GIF work, within X's size limits for images. The image must be reachable at a public URL when the request arrives, so a link to a private file or a login-protected page will not work.
Can I stop strangers from posting through the link?
The link is a unique address and should be treated as a secret. You can also require a shared token in the request, which your AI assistant can add, so only your own tools can make the account post.
Is there a limit on how many tweets I can send?
X applies posting limits that depend on your API access level, and the automation cannot exceed them. If you plan high-volume use, check your tier's allowances first and consider spacing posts to avoid being limited.
What permissions does it need?
tweet.write media.write. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Post a tweet by sending text to a link” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.