Skip to main content

Generate and edit Post graphics through the API

Use the app’s authenticated tRPC client in your selected Organization. These methods require current TypeOrb access and permission to change the Post. Members can work on their own Posts; Organization owners and admins can work on behalf of the author. Published Posts and Posts currently publishing cannot replace attachments. Graphic templates must be readable in that Organization. Their exact File and artifact are captured before model work; a changed File requires a new request.

Generate from saved Post copy​

Call carousel.generate for a carousel or carousel.generateTextImage for a single text image:

{
"requestId": "a0c984bd-4da3-4cff-9367-6b9018937dd7",
"contentId": "post-id",
"content": "The exact current saved Post copy",
"templateId": "graphic-template-id"
}

Create a new UUID requestId for each deliberate generation, rewrite or edited-save action. Keep that identifier and exactly the same inputs when retrying a network request. A completed request returns its saved result without generating or uploading again, while its original funding, access, evidence and saved result remain current. Reusing an identifier for different inputs returns CONFLICT. An in-progress or uncertain request refuses another model call; inspect the existing attachment before deliberately starting a new action with a new UUID.

Save the Post first. Stale supplied copy returns CONFLICT. Carousel results contain id, temporary pdfUrl and slides; text-image results contain id, temporary url and one entry in slides. Each slide has slideNumber and text. Retain the Media identifier rather than treating a download URL as a permanent asset address. Download links expire after five minutes; an already issued link can remain usable until it expires.

Generate a Post image or Graphic template​

Call content.generatePostImage with a new UUID requestId, the Post id, aspectRatio (for example, "1:1") and an optional note. Save and approve the Post copy first. The response contains id and a temporary url.

Organization owners and admins can call media.generateGraphicTemplate with a new UUID requestId and optional note. This returns the saved Media item with type: "template"; it does not attach the template to a Post.

Keep the same UUID and identical inputs when retrying either request. An unchanged completed request returns its saved result without another model call or upload, while its original funding, access and supporting material remain current. A running or uncertain request refuses another generation. Inspect the existing result before deliberately requesting a new image with a new UUID. A changed Brand, Post, attachment, permission or funding period can refuse a late result or a retry. Generated images become available only after their stored bytes are verified; a storage failure leaves the result unavailable.

Rewrite and save wording​

carousel.rewrite requires its own UUID requestId, mediaId and scope: "all". For a carousel, scope: "slide" also accepts the current slides array of strings and a zero-based slideIndex. The response contains slides as strings. A text image supports a single rewrite and returns one string. Rewriting does not replace the saved attachment until you save it.

Call carousel.regenerate with a new UUID requestId, mediaId, edited slides and optional templateId to render a carousel. Use carousel.regenerateTextImage with the same fields and exactly one slide to save a text image. These return the same respective result shapes as generation. Keep the same UUID and identical inputs for a network retry. An unchanged completed save returns its saved result without rendering or uploading again. A running, interrupted or uncertain save refuses another upload; inspect the current attachment before a deliberate new save with a new UUID. Changing the original funding period, content generation, template File or supporting material refuses an earlier save even after access is restored. Edited saves do not call a model. The API accepts at most 512 edited slides; a text-image save still requires exactly one.

Rendered carousel PDFs and text images are checked against their pinned stored versions before publication, including the preview PNG. The rendered PDF and preview (or the text image) must total at most 128 MiB; larger output is refused. A storage mismatch leaves the output unavailable; it does not replace the current attachment. Refresh and inspect the result before deliberately starting fresh work.

Generation, rewriting and edited saves require current Organization funding. An interrupted request keeps its original funding period and content generation; restoring access does not automatically restart that earlier work.

Edited wording and gallery copies retain the restrictions of their supporting material. Changed copy, template, attachment or access can refuse an in-flight result. Refresh before retrying. Withdrawn evidence withholds the affected attachment and its downloads; editing the wording cannot restore permission. Adding or changing an attachment withdraws Post approval and scheduled publication. Review and approve the complete Post again before publishing. After an edited save, unfinished removal of its old scheduled job can be retried separately. Repeating a completed save does not repeat that cleanup or regenerate the attachment. Cleanup cannot remove a job that has already started; review the Post’s publication status before scheduling it again.

Ordinary independent gallery uploads use the upload interface; generated text-image bytes are rendered and saved by these methods. A Source original cannot be registered as a gallery upload. See Post review and gallery instructions for the corresponding screen workflow.

When generation stops​

These generation requests stop further model calls when the provider refuses payment or rate-limits the request. Review the existing result before deliberately starting fresh work; a new generation can incur additional usage.