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
| Field | Type |
|---|---|
draftsThe queue | object[] |
platformWhere it should go | string |
actsAsWhose name it goes out under | string |
contentThe post itself | string |
titleA title, where the site wants… | string |
targetWhere on the site: a community,… | string |
mediaAnything to attach, as workspace paths | string[] |
scheduledAtWhen it should go out, in… | number |
statusWhere it is: proposed by the… | "proposed" | "approved" | "posting" | "posted" … (5) |
createdAtWhen it was written, in milliseconds | number |
postingAtWhen sending started, in milliseconds | number |
postedAtWhen it went out, in milliseconds | number |
postedUrlWhere it landed, when the site… | string |
errorWhy it failed, written as a… | string |
idThe draft's id | string |
invalidDrafts that could not be read… | string[] |
answered in this tab
curl "$SANDBOX/drafts" \
-H "x-intentic-control: $INTENTIC_TOKEN"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
| Field | Type | Where |
|---|---|---|
platformrequiredWhere it should go | string | body |
actsAsWhose name it goes out under | string | body |
contentrequiredThe post itself | string | body |
titleA title, where the site wants… | string | body |
targetWhere on the site: a community,… | string | body |
mediaAnything to attach, as workspace paths | string[] | body |
scheduledAtWhen it should go out, in… | number | body |
statusWhere it is: proposed by the… | "proposed" | "approved" | "posting" | "posted" … (5) | body |
createdAtWhen it was written, in milliseconds | number | body |
postingAtWhen sending started, in milliseconds | number | body |
postedAtWhen it went out, in milliseconds | number | body |
postedUrlWhere it landed, when the site… | string | body |
errorWhy it failed, written as a… | string | body |
idrequiredThe draft's id | string | body |
What comes back
| Field | Type |
|---|---|
okAlways true | true |
answered in this tab
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"}'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
| Field | Type | Where |
|---|---|---|
idrequiredWhich draft | string | address |
What comes back
| Field | Type |
|---|---|
okAlways true | true |
answered in this tab
curl -X DELETE "$SANDBOX/drafts/a1b2c3d4" \
-H "x-intentic-control: $INTENTIC_TOKEN"import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.drafts.remove({
"id": "a1b2c3d4"
});More in Ship and share