Skip to main content
Typefully API
Updated over a week ago

Welcome to Typefully’s API, which will let you create drafts programmatically, schedule them, get existing drafts, and more.

To see a production example of our API, check the source code for Typefully’s Raycast Extension.

Authentication

Get an API key

You can get an API key from Settings > Integrations.

API keys let you use the API for a given 𝕏 / Twitter account you have connect to Typefully. Switch account from the account menu to generate keys for another account.

Authorizing API requests

Include this header in all the requests you make:

X-API-KEY

Bearer TYPEFULLY_API_KEY


Endpoints

API root URL: https://api.typefully.com/v1

Create a draft

Create a draft given some plain-text content.

POST /v1/drafts/

Payload (JSON):

{ "content": "First tweet of a beautiful thread" }

Options:

Name

Required

Type

Description

content

Yes

string

You can split into multiple tweets by adding 4 consecutive newlines between tweets in the content.

threadify

No

boolean

Content will be automatically split into multiple tweets.

share

No

boolean

If true, returned payload will include a share_url.

schedule-date

No

string or "next-free-slot"

Can either be an ISO formatted date (e.g.:2022-06-13T11:13:31.662Z) or next-free-slot

auto_retweet_enabled

No

boolean

If true, the post will have an AutoRT enabled, according to the one set on Typefully for the account.

auto_plug_enabled

No

boolean

If true, the post will have an AutoPlug enabled, according to the one set on Typefully for the account.

Get recently scheduled drafts

GET /v1/drafts/recently-scheduled/

This will return a list of all the most recently scheduled drafts in Typefully.

Options:

Name

Description

Values

content_filter

Filters the list of drafts to only include tweets or threads.

threads, tweets

Get recently published drafts

GET /v1/drafts/recently-published/

This will return a list of all the most recently published drafts in Typefully.

Options:


Get latest notifications

GET /v1/notifications/

Options:

Name

Description

Values

kind

If given, will filter notifications based on whether they are inbox notifications (e.g. comments, replies) or activity events (e.g. “tweet published”).

inbox, activity

Response (example)

{ "accounts": { 123: { // account ID "id": int, "screen_name": str, "profile_image_url": str, "name": str, } }, "notifications": { 123: { "inbox": [ { "created_at": str, "kind": "inbox" | "activity", // Typefully user, recipient of the notification. // It's the main account that was used to sign-up to Typefully. // Usually corresponds to a personal Twitter account. "user": { "screen_name": str, "profile_image_url": str, "name": str }, // Twitter account connected to the above-mentioned Typefully user. // (e.g. account whose draft is impacted by the notification event) "account": { "id": int, "screen_name": str, "profile_image_url": str, "name": str }, // [optional: ✅ inbox, ❌ activity] // Typefully user that created the event this notification refers to. // It correponds to the main account for that Typefully user (usually a personal one). "author": { "screen_name": str, "profile_image_url": str, "name": str }, // URL to open the notification on Typefully. Will point to Twitter/LinkedIn/... for published posts. "url": "..." // Notification content that depends on the notification kind. See Payload specs below. "payload": {...}, ... } ], "activity": [ // Same notification objects as above, but for the activity events (e.g. drafts published) {...} ], } }, }
// AutoPlugPublishedPayload { action: "auto_plug_published"; draft_id: number; success: boolean; first_tweet_text: string; num_tweets: number; tweet_url: string; auto_plug_tweet_url: string; scheduled: boolean; auto_plug_text: string; }; // AutoRetweetPublishedPayload { action: "auto_retweet_published"; draft_id: number; success: boolean; first_tweet_text: string; num_tweets: number; tweet_url: string; scheduled: boolean; }; // NewReplyPayload { action: "new_reply"; draft_id: number; draft_share_id?: string; shared_draft?: boolean; reply_text: string; comment_text: string; comment_author: NotificationUser; comment_stack_id: string; reply_id: string; }; // NewCommentPayload { action: "new_comment"; draft_id: number; draft_share_id?: string; tweet_id: string; comment_stack_id: string; quoted_text: string; comment_text: string; }; // DraftPublishedPayload { action: "draft_published" | "scheduled_draft_published"; draft_id: number; // if sucess == true success: true; tweet_url: string; linkedin_url: string; // if success == false success: false; error: string; // if platform == twitter platform: "twitter"; first_tweet_text: string; num_tweets: number; // if platform == linkedin platform: "linkedin"; excerpt: string; linkedin_account: { profile_image_url: string; name: string; headline: string; }; }

Mark notifications read

POST /v1/notifications/mark-all-read/

Options:

Name

Description

Values

kind

If given, will mark read notifications based on whether they are inbox notifications (e.g. comments, replies) or activities (e.g. publishing events).

inbox, activity

account_id

If given, it will only mark read notifications for that specific account.

string


Did this answer your question?