---
title: "Post drafts · intentic sandbox API"
description: "Posts the agent has proposed, waiting for you to approve them. Every route in the post drafts group of the intentic sandbox API, with its input, its answer and a playground."
url: "https://intentic.dev/api/drafts/"
---

Ship and share

# Post drafts

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

**On this page (3 sections)**

- [Posts waiting for your approval](#drafts-list)
- [Approve, edit or retry a draft](#drafts-upsert)
- [Reject a draft](#drafts-remove)

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`/drafts` Posts 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 |
| --- | --- |
| `drafts` The queue | object[] |
| `platform` Where it should go | string |
| `actsAs` Whose name it goes out under | string |
| `content` The post itself | string |
| `title` A title, where the site wants… | string |
| `target` Where on the site: a community,… | string |
| `media` Anything to attach, as workspace paths | string[] |
| `scheduledAt` When it should go out, in… | number |
| `status` Where it is: proposed by the… | "proposed" | "approved" | "posting" | "posted" … (5) |
| `createdAt` When it was written, in milliseconds | number |
| `postingAt` When sending started, in milliseconds | number |
| `postedAt` When it went out, in milliseconds | number |
| `postedUrl` Where it landed, when the site… | string |
| `error` Why it failed, written as a… | string |
| `id` The draft's id | string |
| `invalid` Drafts that could not be read… | string[] |

Try it answered in this tab

curl

```bash
curl "$SANDBOX/drafts" \
 -H "x-intentic-control: $INTENTIC_TOKEN"
```

TypeScript

```typescript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.drafts.list();
```

**POST`/drafts` Approve, 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 |
| --- | --- | --- |
| `platform` required Where it should go | string | body |
| `actsAs` Whose name it goes out under | string | body |
| `content` required The post itself | string | body |
| `title` A title, where the site wants… | string | body |
| `target` Where on the site: a community,… | string | body |
| `media` Anything to attach, as workspace paths | string[] | body |
| `scheduledAt` When it should go out, in… | number | body |
| `status` Where it is: proposed by the… | "proposed" | "approved" | "posting" | "posted" … (5) | body |
| `createdAt` When it was written, in milliseconds | number | body |
| `postingAt` When sending started, in milliseconds | number | body |
| `postedAt` When it went out, in milliseconds | number | body |
| `postedUrl` Where it landed, when the site… | string | body |
| `error` Why it failed, written as a… | string | body |
| `id` required The draft's id | string | body |

### What comes back

| Field | Type |
| --- | --- |
| `ok` Always true | true |

Try it answered in this tab

curl

```bash
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

```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

| Field | Type | Where |
| --- | --- | --- |
| `id` required Which draft | string | address |

### What comes back

| Field | Type |
| --- | --- |
| `ok` Always true | true |

Try it answered in this tab

curl

```bash
curl -X DELETE "$SANDBOX/drafts/a1b2c3d4" \
 -H "x-intentic-control: $INTENTIC_TOKEN"
```

TypeScript

```typescript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.drafts.remove({
 "id": "a1b2c3d4"
});
```

More in Ship and share

[Previous ← Sharing](https://intentic.dev/api/share/)
