---
title: Publish a post through the API
description: End-to-end guide: sign in, mint upload signatures, PUT bytes, create post, poll status.
last_updated: 2026-09-04
meta:
  contentType: how-to
---

# Publish a post through the API

1. Sign in first: [/docs/sign-in-lightning.md](/docs/sign-in-lightning.md) or [/docs/sign-in-nostr.md](/docs/sign-in-nostr.md).

2. Mint upload signatures in one batch:

```bash
curl -s -b cookies.txt -X POST https://bitsimp.com/api/uploads \
  -H 'content-type: application/json' \
  -d '{"files":[{"mime":"image/png"}]}'
```

3. Upload bytes directly to Supabase Storage (no auth headers needed):

```bash
curl -X PUT '<signedUrl>' \
  -H 'content-type: image/png' \
  --data-binary @./my-image.png
```

4. Create the post referencing uploaded objects:

```bash
curl -s -b cookies.txt -X POST https://bitsimp.com/api/posts \
  -H 'content-type: application/json' \
  -d '{"title":"Hello","price":0,"files":[{"bucketName":"images","objectName":"u/<accountId>/<uuid>.png"}]}'
```

5. Poll until file processing is complete:

```bash
curl -s -b cookies.txt https://bitsimp.com/api/posts/<postId>
```

Files start as `processing_status: "pending"` and later transition to `ready` or `failed`.
