> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hookmyapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish

> Post text, links, photos, videos and reels to your Page, and delete posts.

## Text and links

```bash theme={null}
# Text post
curl -X POST "https://gateway.hookmyapp.com/meta/v25.0/${PAGE_ID}/feed" \
  -H "Authorization: Bearer ${PAGE_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ "message": "We are open today until 8pm." }'
# → { "id": "100000000000001_500000000000001" }

# Link post, message optional
curl -X POST "https://gateway.hookmyapp.com/meta/v25.0/${PAGE_ID}/feed" \
  -H "Authorization: Bearer ${PAGE_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ "link": "https://example.com/new", "message": "New this week" }'
```

The returned `id` is the post id, `{pageId}_{postId}`. Keep it: comments, insights and delete all take it.

## Photos

```bash theme={null}
curl -X POST "https://gateway.hookmyapp.com/meta/v25.0/${PAGE_ID}/photos" \
  -H "Authorization: Bearer ${PAGE_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/photo.jpg", "message": "New drop" }'
# → { "id": "700000000000001", "post_id": "100000000000001_500000000000002" }
```

`post_id` is the post; `id` is the photo object. Use `post_id` everywhere else.

## Videos

```bash theme={null}
curl -X POST "https://gateway.hookmyapp.com/meta/v25.0/${PAGE_ID}/videos" \
  -H "Authorization: Bearer ${PAGE_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ "file_url": "https://example.com/clip.mp4", "description": "Behind the scenes" }'
```

Media URLs must be public https. Photos as JPG or PNG, videos and reels as MP4.

A video publish answers with the video `id` alone. The post it created is `{pageId}_{videoId}`; use that with comments, insights and delete.

## Reels

A reel is a three-step upload session on Meta's side. HookMyApp runs it for you behind one call.

```bash theme={null}
curl -X POST "https://api.hookmyapp.com/channels/${CHANNEL_ID}/facebook/reels" \
  -H "Authorization: Bearer hmok_..." \
  -H "X-Workspace-Id: ws_..." \
  -H "Content-Type: application/json" \
  -d '{ "videoUrl": "https://example.com/clip.mp4", "description": "Behind the scenes" }'
# → { "channelId": "ch_xxxxxxxx", "postId": "100000000000001_500000000000003", "videoId": "500000000000003", "kind": "reel" }
```

This route takes an `hmok_` API key and the workspace header, like every channel route. The CLI and MCP go through the same path.

## List posts

```bash theme={null}
curl "https://gateway.hookmyapp.com/meta/v25.0/${PAGE_ID}/posts?fields=id,message,created_time,permalink_url,status_type" \
  -H "Authorization: Bearer ${PAGE_ACCESS_TOKEN}"
```

Newest first, paginated with `paging.cursors.after`.

## Delete a post

```bash theme={null}
curl -X DELETE "https://gateway.hookmyapp.com/meta/v25.0/${POST_ID}" \
  -H "Authorization: Bearer ${PAGE_ACCESS_TOKEN}"
```

Only posts published by the Page can be deleted. Deleting is irreversible.

## Publish with the CLI

```bash theme={null}
# Text
hookmyapp facebook publish --channel ch_xxxxxxxx --message "We are open today"

# Link
hookmyapp facebook publish --channel ch_xxxxxxxx --link https://example.com/new --message "New this week"

# Photo
hookmyapp facebook publish --channel ch_xxxxxxxx --photo https://example.com/photo.jpg --message "New drop"

# Video
hookmyapp facebook publish --channel ch_xxxxxxxx --video https://example.com/clip.mp4 --description "Behind the scenes"

# Reel
hookmyapp facebook publish --channel ch_xxxxxxxx --reel https://example.com/clip.mp4 --description "Behind the scenes"

# List and delete
hookmyapp facebook posts --channel ch_xxxxxxxx
hookmyapp facebook delete-post --channel ch_xxxxxxxx --post <page-id>_<post-id>
```

## Publish with MCP

`publish_facebook_post` takes a `kind` (`text`, `link`, `photo`, `video` or `reel`) with `message`, `link`, `mediaUrl` and `description` as the kind needs, and returns the `postId` (always `{pageId}_{id}`, so comments, insights and delete accept it) and, for videos and reels, the `mediaId`. `list_facebook_posts` and `delete_facebook_post` cover the rest.

```text theme={null}
Use HookMyApp MCP to publish https://example.com/photo.jpg to Facebook channel ch_xxxxxxxx with the message "New drop".
```

Every publish call publishes again. Do not retry blindly: check the Page first.

## Next steps

* [Comments](/facebook/comments): Work the comments on what you publish.
* [Insights](/facebook/insights): See how the post performs.
