FansquareAPI reference
Open the app

Publishing

Posts, rotations and hashtags

Schedule MYM posts and stories with their hashtags, run rotations that publish a pool of media in turn, and keep hashtag sets, by hand or with an AI agent.

Three things publish on MYM for a creator, as in Publish in the app:

  • a publication: one post or story, now or at a date;

  • a rotation: a pool of media published in turn, a number of times a day, each post removed or made private after a while;

  • a hashtag set: a named list of hashtags a rotation draws from.

Everything is available here, and as tools for an AI agent: ask it « put the summer hashtags on Léa's rotation », it shows you the rotation and its next posts, and changes them once you agree.

A public post is seen by everyone on MYM. An agent shows you what will go out and waits for your yes before it publishes.

Hashtags

A post carries up to 5 hashtags. Fansquare keeps them as MYM does: a leading # removed, lowercase, accents stripped, then 3 to 30 letters, digits or underscores. #Été becomes ete, and a hashtag repeated once normalized counts once. An invalid one is refused before anything is written (validation_failed, the hashtags listed in hashtags).

MYM may still refuse a hashtag when the post goes out. The post is published without it, and the hashtag is listed in removed_hashtags of the publication.

Publications

POST /v1/publications schedules a post or a story, with its hashtags for a post. Its media must be in the creator's vault (unknown_media otherwise). PATCH /v1/publications/{publication_id} changes a publication that has not gone out yet: its media, caption, date or hashtags (hashtags replaces the list, [] removes them).

Rotations

A rotation publishes its pool per_day times a day, within its window (window_start, window_end, week_days, in timezone). Each post stays presence_seconds, then is deleted or made private (post_auto_action). The same media is never online twice: the pool must be large enough for the rhythm (validation_failed with the min it needs).

The hashtags of each post come from hashtag_mode. A story rotation carries none: hashtags sent with it are refused.

hashtag_modeHashtags of each post
nonenone
fixedhashtags, the same on every post
per_itemthe hashtags of each media of items
set5 drawn from the set hashtag_set_id, a different 5 from one post to the next

GET /v1/rotations/{rotation_id} shows the rotation and its next sends, the posts already planned for the next days, with the media, caption and hashtags each will carry. PATCH /v1/rotations/{rotation_id} changes only the fields sent; the next sends are planned again with the new rules, and posts already online stay as they are. status: paused stops it, active resumes it.

POST /v1/rotations/{rotation_id}/skip skips one send, given by its occurrence_at in next_sends. A completed rotation, which published its whole pool, cannot be changed (rotation_not_editable).

Media are MYM media uuids of the creator's vault, like the ones read on her publications and rotations. A media from elsewhere is refused (unknown_media).

Hashtag sets

A set holds 1 to 30 hashtags, for one creator or for the whole agency (creator_id null). A rotation draws from a set of the whole agency or of its own creator.

Changing the hashtags of a set changes the next posts of every rotation that draws from it. A set used by a rotation cannot be deleted (hashtag_set_in_use). A set of the whole agency is written with a key for all creators only (hashtag_set_needs_all_creators): it feeds the rotations of every creator.

Retrying

A create that gets no response or a 503 may still have gone through: list the publications or the rotations before trying again, or the retry publishes twice.