# Create calendar

URL: https://docs.hanzo.ai/docs/openapi/marketing/post-marketing-calendar

> Adds a post to the content calendar.

`POST /v1/marketing/calendar`

> [Marketing →](https://docs.hanzo.ai/docs/openapi/marketing) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                              |
| ------------- | -------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/marketing/calendar` |
| **Method**    | `POST`                                       |
| **Operation** | `post_marketing_calendar`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`       |

Adds a post to the content calendar. Channel and body are
required. A scheduledAt in the future makes the post "scheduled" and the
durable sweep publishes it when it comes due — claimed once, so a post
publishes at most once; without one it stays a draft.

## Request

10 fields, body `application/json` (required).

| Field         | In   | Type            | Required | Description                                                                                                                           |
| ------------- | ---- | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `body`        | body | string          | —        | Body is the post text.                                                                                                                |
| `channel`     | body | string          | —        | Channel is the target network: x, facebook, instagram, linkedin, tiktok, youtube or threads.                                          |
| `createdAt`   | body | integer (int64) | —        | CreatedAt is unix seconds when the post was added, server-assigned and never rewritten.                                               |
| `error`       | body | string          | —        | Error is the exact reason the last publish attempt failed — the honest record behind a "failed" status, never a faked success.        |
| `id`          | body | string          | —        | ID is the server-assigned post id ("cal\_" + 128 random bits).                                                                        |
| `publishedAt` | body | integer (int64) | —        | PublishedAt is when the publish succeeded; 0 until it does.                                                                           |
| `scheduledAt` | body | integer (int64) | —        | ScheduledAt is the unix publish time; 0 leaves the post a draft, and any value makes it "scheduled" for the durable sweep to pick up. |
| `status`      | body | string          | —        | Status is draft, scheduled, published, failed or canceled.                                                                            |
| `title`       | body | string          | —        | Title is the post's internal label, capped at 1024 bytes.                                                                             |
| `updatedAt`   | body | integer (int64) | —        | UpdatedAt is unix seconds of the last write, server-assigned.                                                                         |

## Response

| Status    | Body                   | Meaning |
| --------- | ---------------------- | ------- |
| `200`     | marketing.CalendarPost | ok      |
| `default` | problem-details        | refused |

`200` body — 10 fields.

| Field         | In   | Type            | Always | Description                                                                                                                           |
| ------------- | ---- | --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| `body`        | body | string          | —      | Body is the post text.                                                                                                                |
| `channel`     | body | string          | —      | Channel is the target network: x, facebook, instagram, linkedin, tiktok, youtube or threads.                                          |
| `createdAt`   | body | integer (int64) | —      | CreatedAt is unix seconds when the post was added, server-assigned and never rewritten.                                               |
| `error`       | body | string          | —      | Error is the exact reason the last publish attempt failed — the honest record behind a "failed" status, never a faked success.        |
| `id`          | body | string          | —      | ID is the server-assigned post id ("cal\_" + 128 random bits).                                                                        |
| `publishedAt` | body | integer (int64) | —      | PublishedAt is when the publish succeeded; 0 until it does.                                                                           |
| `scheduledAt` | body | integer (int64) | —      | ScheduledAt is the unix publish time; 0 leaves the post a draft, and any value makes it "scheduled" for the durable sweep to pick up. |
| `status`      | body | string          | —      | Status is draft, scheduled, published, failed or canceled.                                                                            |
| `title`       | body | string          | —      | Title is the post's internal label, capped at 1024 bytes.                                                                             |
| `updatedAt`   | body | integer (int64) | —      | UpdatedAt is unix seconds of the last write, server-assigned.                                                                         |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo marketing calendar create
```

**SDK**

**.ts**

```ts
import { Configuration, MarketingApi } from 'hanzoai';

const api = new MarketingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postMarketingCalendar({ body: "<body>", channel: "<channel>" });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import MarketingApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = MarketingApi(client).post_marketing_calendar(body="<body>", channel="<channel>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.MarketingAPI.PostMarketingCalendar(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, marketing_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = marketing_api::post_marketing_calendar(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.MarketingApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new MarketingApi(client).postMarketingCalendar();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/marketing/calendar \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "body": "<body>",
       "channel": "<channel>"
     }'
```

**MCP**

MCP reaches **marketing** through the `marketing` tool, which names its 35 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_marketing_audiences"
         }
       }
     }'
```

---

[Marketing API](https://docs.hanzo.ai/docs/openapi/marketing) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
