Skip to content

Commit 5b75695

Browse files
committed
feat: fix docs
1 parent 0deb120 commit 5b75695

File tree

1 file changed

+84
-54
lines changed

1 file changed

+84
-54
lines changed

pages/public-api.mdx

Lines changed: 84 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ title: Public API
33
description: "How to use Postiz public API"
44
---
55

6-
import {Callout} from 'nextra/components';
6+
import { Callout } from "nextra/components";
77

88
<Callout type="warning">
9-
**Warning:** This Feature is currently in Beta and is in active-development. It does **not** provide all of the Postiz Features currently.
9+
**Warning:** This Feature is currently in Beta and is in active-development.
10+
It does **not** provide all of the Postiz Features currently.
1011
</Callout>
1112

1213
## For NodeJS users
14+
1315
You can use the <a href="https://www.npmjs.com/package/@postiz/node" target="_blank">Postiz NodeJS SDK</a> to interact with the Postiz Public API.<br />
1416

1517
For a custom n8n node check <a href="https://www.npmjs.com/package/n8n-nodes-postiz" target="_blank">Postiz n8n custom node</a><br />
@@ -22,12 +24,22 @@ If you are using the hosted version of Postiz the URL will be `https://api.posti
2224
If you are self-hosting Postiz the URL will be `https://{NEXT_PUBLIC_BACKEND_URL}/public/v1`.<br /><br />
2325

2426
<u>There is a limit of **30** requests per hour.</u>
27+
It does not mean you can post only 30 posts per hour, it means you can make 30
28+
requests to the API per hour. If you plan ahead, you can have a lot more every
29+
hour.
30+
2531
<br />
26-
Here are the following API endpoints you can use:
32+
33+
<strong>
34+
NOTE: The UI representation is a `channel`, but on the API it is called
35+
`integration`. So when you see `integration` in the API, it means a `channel`.
36+
</strong>
2737

2838
<br />
2939

30-
> NOTE: The UI representation is a `channel`, but on the API it is called `integration`. So when you see `integration` in the API, it means a `channel`.
40+
Here are the following API endpoints you can use:
41+
42+
<br />
3143

3244
### Get all added channels
3345

@@ -90,6 +102,7 @@ GET https://api.postiz.com/public/v1/posts
90102
```
91103

92104
Payload
105+
93106
```json
94107
{
95108
"startDate": "UTC date in ISO format - ex. 2024-12-14T08:18:54.274Z",
@@ -102,21 +115,21 @@ Response:
102115

103116
```json
104117
{
105-
"posts": [
106-
{
107-
"id": "cm4gklk8o00008copo77fa0f8",
108-
"content": "blabla",
109-
"publishDate": "2024-12-09T05:06:00.000Z",
110-
"releaseURL": "https://twitter.com/nevodavid/status/1865986385708204316",
111-
"state": "QUEUE|PUBLISHED|ERROR|DRAFT",
112-
"integration": {
113-
"id": "cm4ean69r0003w8w1cdomox9n",
114-
"providerIdentifier": "x",
115-
"name": "Nevo David",
116-
"picture": "https://uploads.gitroom.com/5g9mEIVCAq.jpeg"
117-
}
118-
}
119-
]
118+
"posts": [
119+
{
120+
"id": "cm4gklk8o00008copo77fa0f8",
121+
"content": "blabla",
122+
"publishDate": "2024-12-09T05:06:00.000Z",
123+
"releaseURL": "https://twitter.com/nevodavid/status/1865986385708204316",
124+
"state": "QUEUE|PUBLISHED|ERROR|DRAFT",
125+
"integration": {
126+
"id": "cm4ean69r0003w8w1cdomox9n",
127+
"providerIdentifier": "x",
128+
"name": "Nevo David",
129+
"picture": "https://uploads.gitroom.com/5g9mEIVCAq.jpeg"
130+
}
131+
}
132+
]
120133
}
121134
```
122135

@@ -164,47 +177,55 @@ Payload:
164177
Response:
165178

166179
```json
167-
[{"postId":"POST_ID","integration":"INTEGRATION_ID"}]
180+
[{ "postId": "POST_ID", "integration": "INTEGRATION_ID" }]
168181
```
169182

170-
<iframe style={{width: "100%", height: "680px", zoom: 0.8}} src="https://platform.postiz.com/modal/dark/all"></iframe>
183+
<iframe
184+
style={{ width: "100%", height: "680px", zoom: 0.8 }}
185+
src="https://platform.postiz.com/modal/dark/all"
186+
></iframe>
171187

172188
### Request
173-
| Property | Type | Required | Description |
174-
| --- | --- | --- | --- |
175-
| type | `draft` \| `schedule` \| `now` | Yes | Type of post creation |
176-
| order | string | No | Order of posts |
177-
| shortLink | boolean | Yes | Whether to use short link |
178-
| inter | number | No | Interval |
179-
| date | string (Date) | Yes | Date of post |
180-
| tags | Tags[] | Yes | Array of tags |
181-
| posts | Post[] | Yes (if type !== 'draft') | Array of posts |
189+
190+
| Property | Type | Required | Description |
191+
| --------- | ------------------------------ | ------------------------- | ------------------------- |
192+
| type | `draft` \| `schedule` \| `now` | Yes | Type of post creation |
193+
| order | string | No | Order of posts |
194+
| shortLink | boolean | Yes | Whether to use short link |
195+
| inter | number | No | Interval |
196+
| date | string (Date) | Yes | Date of post |
197+
| tags | Tags[] | Yes | Array of tags |
198+
| posts | Post[] | Yes (if type !== 'draft') | Array of posts |
182199

183200
### Posts
184-
| Property | Type | Required | Description |
185-
| --- | --- | --- | --- |
186-
| integration | Integration | Yes | Integration details |
187-
| value | PostContent[] | Yes | Array of post content |
188-
| group | string | No | Group name |
189-
| settings | AllProvidersSettings | No | Settings for providers |
201+
202+
| Property | Type | Required | Description |
203+
| ----------- | -------------------- | -------- | ---------------------- |
204+
| integration | Integration | Yes | Integration details |
205+
| value | PostContent[] | Yes | Array of post content |
206+
| group | string | No | Group name |
207+
| settings | AllProvidersSettings | No | Settings for providers |
190208

191209
### Post Value
192-
| Property | Type | Required | Description |
193-
| --- | --- | --- | --- |
194-
| content | string | Yes | Post content |
195-
| id | string | No | Post ID |
196-
| image | MediaDto[] | No | Array of media |
210+
211+
| Property | Type | Required | Description |
212+
| -------- | ---------- | -------- | -------------- |
213+
| content | string | Yes | Post content |
214+
| id | string | No | Post ID |
215+
| image | MediaDto[] | No | Array of media |
197216

198217
### Integration
199-
| Property | Type | Required | Description |
200-
| --- | --- | --- | --- |
201-
| id | string | Yes | Integration ID |
218+
219+
| Property | Type | Required | Description |
220+
| -------- | ------ | -------- | -------------- |
221+
| id | string | Yes | Integration ID |
202222

203223
### Tags
204-
| Property | Type | Required | Description |
205-
| --- | --- | --- | --- |
206-
| value | string | Yes | Tag value |
207-
| label | string | Yes | Tag label |
224+
225+
| Property | Type | Required | Description |
226+
| -------- | ------ | -------- | ----------- |
227+
| value | string | Yes | Tag value |
228+
| label | string | Yes | Tag label |
208229

209230
---
210231

@@ -228,19 +249,24 @@ Response:
228249
## NEW! (Generate videos with AI)
229250

230251
Request:
252+
231253
```http
232254
POST https://api.postiz.com/public/v1/generate-video
233255
```
234256

235257
Response:
258+
236259
```json
237-
[{
238-
"id": "string",
239-
"path": "URL of the generated video"
240-
}]
260+
[
261+
{
262+
"id": "string",
263+
"path": "URL of the generated video"
264+
}
265+
]
241266
```
242267

243268
### Payload (Slides of images)
269+
244270
```json
245271
{
246272
"type": "image-text-slides",
@@ -253,11 +279,13 @@ Response:
253279
```
254280

255281
Get voices
282+
256283
```http
257284
POST https://api.postiz.com/public/v1/video/function
258285
```
259286

260287
Payload
288+
261289
```json
262290
{
263291
"functionName": "loadVoices",
@@ -266,6 +294,7 @@ Payload
266294
```
267295

268296
Response
297+
269298
```json
270299
{
271300
"voices": [
@@ -278,14 +307,15 @@ Response
278307
```
279308

280309
### Payload (VEO3 fast video) - Subscribed users after trial
310+
281311
```json
282312
{
283313
"type": "veo3",
284314
"output": "vertical|horizontal",
285315
"customParams": {
286316
"prompt": "",
287317
// images - optional (Maximum 3 images)
288-
"images": [{"id": "string", "path": "string"}]
318+
"images": [{ "id": "string", "path": "string" }]
289319
}
290320
}
291-
```
321+
```

0 commit comments

Comments
 (0)