---
title: "Restore a deleted post"
method: POST
path: "/posts/{id}/restore"
tags: ["Posts"]
---

# Restore a deleted post

`POST /posts/{id}/restore`

## Request

- Base URL: `https://api.rizamo.com/v1`
- URL: `https://api.rizamo.com/v1/posts/{id}/restore`
- Auth: HTTP bearer

Within 30 days of deleting it. A scheduled post whose time has passed, or with a target whose account is no longer in its profile (moved to another), comes back as a draft. A post moved to Deleted because its account was removed comes back as it was: its parts on that account (`accountRemoved`) go out only once the account is connected again. Until then they fail at their time, saying why, and scheduling or publishing the post is refused.

## Path parameters

- `id` string, required: The post's id (`post_`).

## Headers

- `Idempotency-Key` string

## Response `200`

OK

- Post
  - `id` string, required
  - `profileId` string, required
  - `status` 'draft' | 'scheduled' | 'published' | 'partially_published' | 'failed', required: partially_published: some targets went out and others failed, or a target's chain stopped partway (its `chainResults` say where); each target has its own status.
  - `text` string, required
  - `media` Media[], required
    - `id` string, required
    - `type` 'image' | 'video' | 'document', required: document: a PDF, which LinkedIn publishes as a document post.
    - `url` string, nullable, required: A link that expires after a few hours: get the media again for a fresh one. Null until the file is uploaded.
    - `alt` string, required
    - `status` 'uploading' | 'ready' | 'failed', required: uploading: waiting for its file. Only ready media can go on a post.
    - `contentType` string, required
    - `size` integer, required: Bytes, once uploaded.
    - `width` integer, nullable, required: Pixels, as shown: read from the file once it is uploaded.
    - `height` integer, nullable, required
    - `duration` number, nullable, required: Seconds, for video.
    - `pages` integer, nullable, required: Pages, for a PDF: read from the file once it is uploaded. Null when they could not be read.
    - `profileId` string, nullable, required: The profile it belongs to: the one it was added for, or else the first post that used it. Null until then, when only whoever added it and people who reach every profile reach it. Keys and people limited to some profiles reach their own media and their profiles'.
  - `chain` ChainPart[], required: More posts after this one, each published as a reply to the one before: a thread on Threads. Networks that publish chains get every part; the others get the first post alone. Empty for a single post.
    - `text` string, required
    - `media` Media[], required: Its files: none, one image or video, or several as a carousel where the network takes one.
      - `id` string, required
      - `type` 'image' | 'video' | 'document', required: document: a PDF, which LinkedIn publishes as a document post.
      - `url` string, nullable, required: A link that expires after a few hours: get the media again for a fresh one. Null until the file is uploaded.
      - `alt` string, required
      - `status` 'uploading' | 'ready' | 'failed', required: uploading: waiting for its file. Only ready media can go on a post.
      - `contentType` string, required
      - `size` integer, required: Bytes, once uploaded.
      - `width` integer, nullable, required: Pixels, as shown: read from the file once it is uploaded.
      - `height` integer, nullable, required
      - `duration` number, nullable, required: Seconds, for video.
      - `pages` integer, nullable, required: Pages, for a PDF: read from the file once it is uploaded. Null when they could not be read.
      - `profileId` string, nullable, required: The profile it belongs to: the one it was added for, or else the first post that used it. Null until then, when only whoever added it and people who reach every profile reach it. Keys and people limited to some profiles reach their own media and their profiles'.
  - `targets` PostTarget[], required
    - `accountId` string, required
    - `network` 'instagram' | 'facebook' | 'threads' | 'linkedin' | 'tiktok' | 'youtube' | 'x' | 'pinterest' | 'google', required
    - `format` 'feed' | 'carousel' | 'reel' | 'story' | 'video' | 'short' | 'photo' | 'document' | 'pin', required: The format asked for, or the one its media leads to: one video is a reel or video, several images a carousel, otherwise a feed post.
    - `text` string, nullable, required
    - `media` Media[], nullable, required
      - `id` string, required
      - `type` 'image' | 'video' | 'document', required: document: a PDF, which LinkedIn publishes as a document post.
      - `url` string, nullable, required: A link that expires after a few hours: get the media again for a fresh one. Null until the file is uploaded.
      - `alt` string, required
      - `status` 'uploading' | 'ready' | 'failed', required: uploading: waiting for its file. Only ready media can go on a post.
      - `contentType` string, required
      - `size` integer, required: Bytes, once uploaded.
      - `width` integer, nullable, required: Pixels, as shown: read from the file once it is uploaded.
      - `height` integer, nullable, required
      - `duration` number, nullable, required: Seconds, for video.
      - `pages` integer, nullable, required: Pages, for a PDF: read from the file once it is uploaded. Null when they could not be read.
      - `profileId` string, nullable, required: The profile it belongs to: the one it was added for, or else the first post that used it. Null until then, when only whoever added it and people who reach every profile reach it. Keys and people limited to some profiles reach their own media and their profiles'.
    - `options` TargetOptions, required: Network-specific options, under the target's network: for example `{ "tiktok": { "isAiGenerated": true } }`.
      - `instagram` object
        - `shareToFeed` boolean: Reels: also show in the profile grid. Default true.
        - `coverUrl` string, uri: Reels, and a single video sent as a feed post (Instagram makes it a reel): an image as the cover, at a public link Instagram downloads when the post goes out. Not with `coverOffsetMs`.
        - `coverOffsetMs` integer: Reels, and a single video sent as a feed post: the frame this many milliseconds in becomes the cover. Instagram's default is 0, the first frame. Not with `coverUrl`.
        - `collaborators` string[]: Feed posts, carousels and reels: up to 3 usernames invited as collaborators. Not sent on stories.
        - `locationId` string: Feed posts, carousels and reels: a Facebook Page id used as the location. Not sent on stories.
        - `fit` 'fill' | 'crop': Feed images taller than 9:16 or wider than 1.91:1, which Instagram refuses: fill keeps all of the image over a blurred copy of itself (default), crop cuts it to the nearest shape.
        - `music` object: Music from Instagram's library, for reels only. Accounts connected through Facebook Login only.
          - `audioId` string, required: A track's `id` from `Search music` on this account.
          - `volume` integer: The music's volume, 1 to 100. Default 100 (Instagram's).
          - `videoVolume` integer: The video's own sound under it, 1 to 100. Default 100 (Instagram's): lower it to let the music lead.
        - `isAiGenerated` boolean: Labels the post as made with AI (Instagram's "AI info"): feed posts, carousels (the label covers the whole carousel), reels and stories.
        - `userTags` object[]: People tagged on the post, up to 20 on each file, public accounts only. Images need `x` and `y` for each tag; videos and reels take the username alone; on stories `x` and `y` are optional. On a carousel, `mediaIndex` picks the file.
          - `username` string, required: A public Instagram account's username, with or without the @.
          - `x` number: How far from the left edge, from 0 to 1. Required on images, with `y`; optional on stories; not on videos or reels.
          - `y` number: How far from the top edge, from 0 to 1.
          - `mediaIndex` integer: Carousels: which file the tag goes on, from 0 (the first, the default).
        - `trialReel` 'manual' | 'performance': Reels: publish it as a trial reel, shown to people who do not follow the account first. manual: someone shares it with followers in the Instagram app. performance: Instagram shares it with followers if it does well.
      - `facebook` object
        - `link` string, uri: Feed posts without files: a link shown as a preview card. Not sent with photos or a video. With `callToAction`, a button under it opens it too.
        - `callToAction` object: Link posts (a feed post with `link` and no files): a button under the link card that opens the post's `link`, as Meta asks, so its clicks count with the card's. Not on photos, videos, reels or stories. Set before the post goes out: Meta cannot change it on a live post.
          - `type` 'learn_more' | 'sign_up' | 'book_travel' | 'download' | 'install_app' | 'use_app' | 'listen_music' | 'watch_more' | 'watch_video', required: What the button says: learn_more (Learn More), sign_up (Sign Up), book_travel (Book Now), download (Download), install_app (Install Now), use_app (Use App), listen_music (Listen Music), watch_more (Watch More), watch_video (Watch Video). Meta keeps its other buttons (Shop Now, Call Now, Send Message, Get Quote...) for ads.
        - `locationId` string: A Facebook Page id with a location, tagged as the post's place: feed posts (text, a link or photos) and reels. Not on a feed video or a story.
        - `isAiGenerated` boolean: Reels: labels the reel as made or edited with AI. Facebook's API takes the label on reels only.
      - `tiktok` object
        - `disableComments` boolean: Required. Turns comments off. Ask the person; true when the account's creator info says comments are off.
        - `disableDuet` boolean: Required for videos. Turns Duet off. Ask the person; true when the account's creator info says Duet is off.
        - `disableStitch` boolean: Required for videos. Turns Stitch off. Ask the person; true when the account's creator info says Stitch is off.
        - `isYourBrand` boolean: Required. The post promotes the person's own business: TikTok labels it "Promotional content".
        - `isBrandedContent` boolean: Required. A paid partnership with a third party: TikTok labels it "Paid partnership". It cannot be private (`only_me`).
        - `isAiGenerated` boolean: Required for videos. Labels the video as AI-generated.
        - `privacyLevel` 'everyone' | 'friends' | 'followers' | 'only_me': Required for photos (videos are always public): one of the account's `privacyLevels` from its creator info.
        - `title` string: Photos: a title shown above the caption, up to 90 characters.
        - `autoAddMusic` boolean: Photos: let TikTok pick the music. Not together with `music`.
        - `music` object: Music from TikTok's library, for a video or photo post that publishes (not a draft, not with autoAddMusic). Photos take only trackId.
          - `trackId` string, required: A track's `id` from `Search music` on this account.
          - `volume` integer: Videos, required: the music's volume, 0 to 100. TikTok's app uses 50.
          - `videoVolume` integer: Videos: the video's own sound under the music, 0 to 100. Default 50, as in TikTok's app; 0 mutes it.
          - `startMs` integer: Videos: where in the track the music starts, in milliseconds. Default 0.
          - `endMs` integer: Videos: where in the track it ends, in milliseconds, after startMs. Default: startMs plus the video's length.
        - `coverOffsetMs` integer: Videos: the frame this many milliseconds in becomes the cover. It must be within the video: TikTok fails a post whose cover is past its end. TikTok's default is 0, the first frame. Not with `coverMediaId`, nor in a draft, where TikTok ignores it.
        - `coverMediaId` string: Videos: an image uploaded to Rizamo, by its media id, as the cover: JPG, PNG or WebP, at least 360 by 360 pixels. TikTok downloads covers only from Rizamo's own media links, so a cover is media, not a link. Not with `coverOffsetMs`.
        - `coverIndex` integer: Photos: which photo is the cover, from 0 (the first, TikTok's default).
        - `draft` boolean: Send it to the creator's TikTok inbox as a draft instead of publishing. The person finishes it in the TikTok app, where TikTok asks for every other choice; the target is published once it reaches the inbox, with no link.
        - `consent` unknown
      - `threads` object
        - `linkAttachment` string, uri: Text posts (no image or video) without a poll: a link shown as a preview card. Left out, Threads makes the card from the first link in the text. A post takes at most 5 different links, this one included.
        - `poll` object: Text posts (no image or video) without a link card: a poll. Threads decides when it ends.
          - `options` string[], required: 2 to 4 answers, each 1 to 25 characters.
        - `topicTag` string: The post's topic, 1 to 50 characters, without periods (.) or ampersands (&). One per post.
        - `replyControl` 'everyone' | 'accounts_you_follow' | 'mentioned_only' | 'parent_post_author_only' | 'followers_only': Who may reply: everyone (Threads' default), accounts_you_follow, mentioned_only, parent_post_author_only or followers_only. On a chain, every post of it.
        - `quotePostId` string: Quote another Threads post, by its id on Threads (a network post's `networkPostId`).
        - `isAiGenerated` boolean: Labels the post as made with AI (Threads' "AI info"): text, image, video and carousel posts, and every post of its chain.
      - `linkedin` object
        - `title` string: Documents (required) and videos: the title LinkedIn shows on the file. Not on other posts.
        - `poll` object: Feed posts without files: a poll under the text. No link card goes with it, and nothing of it changes once it is live.
          - `question` string, required: Up to 140 characters. LinkedIn bars questions on political opinions, health and other sensitive data.
          - `options` string[], required: 2 to 4 answers, each up to 30 characters.
          - `days` union: How long it stays open: 1, 3, 7 or 14 days. Left out: 7.
            - unknown
            - unknown
            - unknown
            - unknown
        - `thumbnailMediaId` string: Videos: an image uploaded to Rizamo, by its media id, as the video's thumbnail.
        - `visibility` 'public' | 'connections': Profiles only: who sees the post, anyone (public, the default) or the person's connections.
        - `disableComments` boolean: Turns comments off, right after the post goes out: LinkedIn takes it as a second call, which deletes any comment made in between, so not with a first comment. If that call fails, the post stays live with comments on and the target's `error` says so.
        - `disableReshare` boolean: Stops other people from resharing the post.
        - `reshareOf` string: Reshare a LinkedIn post, by its URN (a network post's `networkId`), with the target's text above it. No files, poll or title.
        - `callToAction` object: Link posts only: a button on the post's link card that opens its link, the first link in the text. Not with files, a poll or a reshare: LinkedIn shows none on images, videos or documents. If Rizamo cannot read the link's page to make the card, the post goes without the button and the target's `error` says so.
          - `label` 'learn_more' | 'sign_up' | 'register' | 'apply' | 'download' | 'subscribe' | 'join' | 'attend' | 'request_demo' | 'see_more' | 'view_quote' | 'buy_now' | 'shop_now', required: What the button says: learn_more (Learn more), sign_up (Sign up), register (Register), and LinkedIn's others.
      - `youtube` object
        - `title` string: The video's title, 1 to 100 characters, without < or >. Left out: the text's first line, cut at 100 characters. The text is the description.
        - `privacy` 'public' | 'unlisted' | 'private': Who can watch it: public (YouTube's default when left out), unlisted or private. With `publishAt`, private.
        - `madeForKids` boolean: Whether the video is made for kids (YouTube's audience setting, COPPA). Required to schedule or publish, with no default: ask the person. Made for kids turns off comments and personalized ads on YouTube.
        - `tags` string[]: Keywords, at most 500 characters in all as YouTube counts them (a comma between tags, quotes around a tag with a space).
        - `categoryId` string: YouTube's video category id, such as 22 (People & Blogs) or 28 (Science & Technology). Left out, YouTube picks the channel's default.
        - `publishAt` string, date-time: When YouTube makes the video public, after Rizamo uploads it as private at the post's time (YouTube's own scheduling). In the future, and with `privacy` private or left out. To have Rizamo upload it later instead, schedule the post.
        - `isAiGenerated` boolean: Discloses realistic altered or synthetic content (YouTube's `containsSyntheticMedia`).
        - `thumbnailMediaId` string: An image to use as the thumbnail (JPEG or PNG, up to 2 MB), set once the video is live. YouTube takes custom thumbnails only from channels it has verified.
        - `notifySubscribers` boolean: Whether YouTube tells subscribers about the video. Left out: yes, YouTube's default.
        - `license` 'youtube' | 'creativeCommon': The video's license: youtube (the standard YouTube license, the default) or creativeCommon.
        - `embeddable` boolean: Whether other sites may embed it. Left out: yes, YouTube's default.
      - `pinterest` object
        - `boardId` string
        - `title` string
        - `link` string, uri
    - `firstComment` string, nullable, required
    - `chain` ChainPart[], nullable, required: Its own chain instead of the post's; null uses the post's. Networks that publish chains only (Threads).
      - `text` string, required
      - `media` Media[], required: Its files: none, one image or video, or several as a carousel where the network takes one.
        - `id` string, required
        - `type` 'image' | 'video' | 'document', required: document: a PDF, which LinkedIn publishes as a document post.
        - `url` string, nullable, required: A link that expires after a few hours: get the media again for a fresh one. Null until the file is uploaded.
        - `alt` string, required
        - `status` 'uploading' | 'ready' | 'failed', required: uploading: waiting for its file. Only ready media can go on a post.
        - `contentType` string, required
        - `size` integer, required: Bytes, once uploaded.
        - `width` integer, nullable, required: Pixels, as shown: read from the file once it is uploaded.
        - `height` integer, nullable, required
        - `duration` number, nullable, required: Seconds, for video.
        - `pages` integer, nullable, required: Pages, for a PDF: read from the file once it is uploaded. Null when they could not be read.
        - `profileId` string, nullable, required: The profile it belongs to: the one it was added for, or else the first post that used it. Null until then, when only whoever added it and people who reach every profile reach it. Keys and people limited to some profiles reach their own media and their profiles'.
    - `chainResults` ChainPartResult[], required: How each part of its chain went, in order, once the first post is live: a part missing here has not gone out. A part that failed stops the rest, the parts before it stay live, and publishing the post again goes on from the part that failed. Empty without a chain.
      - `status` 'published' | 'failed' | 'unknown', required: published: live, as a reply to the part before it. failed: the network refused it (`error` says why) and the parts after it did not go. unknown: the network did not confirm it; check the account before publishing again.
      - `url` string, nullable, required
      - `error` string, nullable, required
    - `changes` MediaChange[], required: What Rizamo does to this target's files so the network takes them. Empty when they go as they are.
      - `mediaId` string, required
      - `kinds` string[], required: format: another file type, or for video H.264 and AAC. size: compressed under the limit. width: made narrower. fill: all of it over a blurred copy, in the shape the network takes. crop: cut to that shape. fps: another frame rate. faststart: the video's header moved to the front for streaming, nothing else changed.
      - `message` string, required
    - `scheduledAt` string, date-time, nullable, required: When this target goes out. Today it is always the post's `scheduledAt`; a time per target may come later (ADR 0027), so read a target's time here.
    - `status` 'pending' | 'publishing' | 'published' | 'failed' | 'unknown', required: pending: waiting for its time. publishing: going out now. unknown: the network did not confirm and we could not tell whether it went out; check the account before publishing again.
    - `url` string, nullable, required
    - `error` string, nullable, required: Why it failed or is unknown. On a published target, what to know about it: a chain stopped partway, a YouTube video still processing when Rizamo last asked, or a thumbnail YouTube did not take. Null otherwise.
    - `removal` 'removed' | 'not_supported' | 'failed' | 'kept', nullable, required: After the post is deleted: removed from the network, not_supported (still live there, analytics keep flowing), failed (the network refused or did not answer: `error` says why, and deleting the post again tries again) or kept (still live there: the post moved to Deleted because its account was removed from Rizamo, which never deletes anything on the network). Null otherwise.
    - `accountRemoved` object, nullable, required: Set when the target's account was removed from Rizamo. A post with other accounts keeps the part that went out, with its `url` and without its numbers, and loses the part that did not; a post that went to it alone moved to Deleted. Such a part is never sent or edited again. Connecting the account again clears it. Null otherwise.
      - `handle` string, required: The account's handle when it was removed, which names the part for as long as the post exists.
      - `at` string, date-time, required
  - `scheduledAt` string, date-time, nullable, required
  - `queued` boolean, required: It took `scheduledAt` from its profile's queue (`queue: true`): the time stays as it was given when the queue's times change.
  - `publishedAt` string, date-time, nullable, required
  - `createdBy` union, required
    - object
      - `type` 'agent', required
      - `agent` 'claude' | 'chatgpt' | 'claudecode' | 'cursor' | 'codex' | 'gemini' | 'perplexity' | 'openclaw' | 'n8n' | 'make' | 'zapier', nullable, required
      - `name` string, required
      - `agentId` string
      - `onBehalfOf` object: The person whose agent it is, who connected it and whom it acts as, with their role: "Ana via Claude Code". Events from before 2026-11-02 have it too, with the person's name now. Left out of an agent with no person, and of other records from before. After the person's erasure, `name` is "A former member" and `userId` empty.
        - `userId` string, required
        - `name` string, required
    - object
      - `type` 'user', required
      - `userId` string, required
      - `name` string, required
      - `initials` string, required
    - object
      - `type` 'api_key', required
      - `keyId` string, required
      - `name` string, required
    - object
      - `type` 'automation', required
      - `automationId` string, required
      - `name` string, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required
  - `fields` object, required
  - `metrics` PostMetrics, nullable, required: The totals of the post's targets on their networks, from each network post's latest numbers (`List posts on the networks` has them one by one): a number is there when at least one network gives a value it does not hide. Null until one of them has numbers. A target whose network post has none adds nothing, and that post's `metricsUnavailable` says why, such as a Facebook story that ended before Rizamo read it.
    - `views` integer: Times it was played or shown on its networks, replays included: the main number. Missing where no network gives it, such as a Facebook Page read without insights, or every network hides it (`masked`).
    - `reach` integer: People who saw it, added up per network: one person on two networks counts twice.
    - `impressions` integer: Only from networks that still count impressions (not Instagram or Facebook since 2025).
    - `engagements` integer
    - `likes` integer
    - `comments` integer
    - `shares` integer
    - `saves` integer
    - `clicks` integer
    - `follows` integer: Accounts that followed from it: Instagram feed posts and stories, Facebook reels, TikTok posts. Missing unless a target gave a number the network did not hide.
    - `profileVisits` integer: Visits to the profile from it (`profile_visits` on a network post): Instagram feed posts and stories, TikTok posts. Missing unless a target gave a number the network did not hide.
    - `engagementRate` number: Engagements per 100 people reached, to two decimals, over the targets whose reach is above 0 (their engagements over their reach), as Analytics rates each post. A target with no reach, such as Threads or a Facebook reel, is left out. Missing when none has reach. It is not capped at 100: a post with more engagements than people reached, as when one person likes, comments and shares, rates above it.
    - `masked` string[]: The numbers every target that has them hides because they are small (Meta: under 5), by the names above: missing from the totals rather than 0. Missing when none is.
  - `deletedAt` string, date-time, nullable, required: Restore a deleted post within 30 days. After that it goes for good, unless a target is still live on its network.
  - `sharedUntil` string, date-time, nullable, required: When its preview links stop working, while it is shared (`Share a preview of a post`). Null when it is not.

## Other responses

- `400`: `invalid_request`: A field is missing or wrong, or the request cannot be done as asked: the message names the field or says what to change.
- `401`: `unauthorized`: No API key or sign-in, or the key does not work: it was deleted, or it expired.
- `403`: `forbidden`: The caller may not do this: the key or agent lacks the scope (the message names it), or the action needs another role or a fresh sign-in.
- `404`: `not_found`: No such object, or it is outside your team or the profiles your key reaches.
- `409`: `conflict`: The object's state does not allow it now, such as an account that needs a new login. `queue_empty`: A post with `queue: true` whose profile has no posting times: set them, or give a `scheduledAt`. `queue_full`: No posting time free for the post's accounts in the next 90 days: add times, or give a `scheduledAt`. `idempotency_key_in_use`: A request with this `Idempotency-Key` is still running: try again in a moment.
- `413`: `payload_too_large`: The body is over 1 MB: files go up through the upload links of `POST /v1/media`.
- `415`: `unsupported_media_type`: The body is not JSON: send it with `Content-Type: application/json`.
- `422`: `capability_missing`: The account cannot do this: see its `capabilities`. `idempotency_key_reused`: This `Idempotency-Key` was used for a different request in the last 24 hours: send a new key.
- `429`: `rate_limited`: Over one of Rizamo's limits, or a network asked Rizamo to slow down: wait for `Retry-After` seconds, or as long as the message says.
- `500`: `internal`: Our side failed: retry, and send the `requestId` if it keeps failing.
- `503`: `timeout`: The request took too long to work out, most often a report: try again in a moment, or ask a report for a shorter period or one profile.

---

[API](https://skmtc.dev/rizamo/apis/rizamo-api.md) - [All operations](https://skmtc.dev/rizamo/apis/rizamo-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rizamo/apis/rizamo-api/revisions/31b0c1b1ffb5?raw)
