intentic
Create your workspace
Ship and share

Post drafts

Posts the agent has proposed, waiting for you to approve them

On this page(3 sections)

The owner's side of the queue. The agent writes drafts directly; this is the inbox, the one call that covers approving, editing and retrying, and the deletion that is a rejection.

GET/draftsPosts waiting for your approval

The queue of things an agent has written and would like to publish. Nothing here has gone anywhere yet.

What you send

Nothing. Call it as it is.

What comes back

FieldType
draftsThe queueobject[]
platformWhere it should gostring
actsAsWhose name it goes out understring
contentThe post itselfstring
titleA title, where the site wants…string
targetWhere on the site: a community,…string
mediaAnything to attach, as workspace pathsstring[]
scheduledAtWhen it should go out, in…number
statusWhere it is: proposed by the…"proposed" | "approved" | "posting" | "posted" … (5)
createdAtWhen it was written, in millisecondsnumber
postingAtWhen sending started, in millisecondsnumber
postedAtWhen it went out, in millisecondsnumber
postedUrlWhere it landed, when the site…string
errorWhy it failed, written as a…string
idThe draft's idstring
invalidDrafts that could not be read…string[]
Try itanswered in this tab
curl
curl "$SANDBOX/drafts" \
  -H "x-intentic-control: $INTENTIC_TOKEN"
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.drafts.list();
POST/draftsApprove, edit or retry a draft

All three are the same act with a different field changed, so they share one call. Send the draft back as you want it.

What you send

FieldTypeWhere
platformrequiredWhere it should gostringbody
actsAsWhose name it goes out understringbody
contentrequiredThe post itselfstringbody
titleA title, where the site wants…stringbody
targetWhere on the site: a community,…stringbody
mediaAnything to attach, as workspace pathsstring[]body
scheduledAtWhen it should go out, in…numberbody
statusWhere it is: proposed by the…"proposed" | "approved" | "posting" | "posted" … (5)body
createdAtWhen it was written, in millisecondsnumberbody
postingAtWhen sending started, in millisecondsnumberbody
postedAtWhen it went out, in millisecondsnumberbody
postedUrlWhere it landed, when the site…stringbody
errorWhy it failed, written as a…stringbody
idrequiredThe draft's idstringbody

What comes back

FieldType
okAlways truetrue
Try itanswered in this tab
curl
curl -X POST "$SANDBOX/drafts" \
  -H "x-intentic-control: $INTENTIC_TOKEN" \
  -H "content-type: application/json" \
  -d '{"platform":"…","actsAs":"…","content":"export const start = () => listen(PORT);\n","title":"Update the changelog","target":"…","media":["…","…"],"scheduledAt":1,"status":"proposed","createdAt":1,"postingAt":1,"postedAt":1,"postedUrl":"https://sandbox-a1b2c3d4e5f6.intentic.dev","error":"The repository has no remote configured.","id":"a1b2c3d4"}'
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.drafts.upsert({
  "platform": "",
  "actsAs": "",
  "content": "export const start = () => listen(PORT);\n",
  "title": "Update the changelog",
  "target": "",
  "media": [
    "",
    ""
  ],
  "scheduledAt": 1,
  "status": "proposed",
  "createdAt": 1,
  "postingAt": 1,
  "postedAt": 1,
  "postedUrl": "https://sandbox-a1b2c3d4e5f6.intentic.dev",
  "error": "The repository has no remote configured.",
  "id": "a1b2c3d4"
});
DELETE/drafts/{id}Reject a draft

Throws one away unposted.

What you send

FieldTypeWhere
idrequiredWhich draftstringaddress

What comes back

FieldType
okAlways truetrue
Try itanswered in this tab
curl
curl -X DELETE "$SANDBOX/drafts/a1b2c3d4" \
  -H "x-intentic-control: $INTENTIC_TOKEN"
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.drafts.remove({
  "id": "a1b2c3d4"
});
More in Ship and share

Type to search every page, in the docs and the API reference.