Skip to content

Create a post in a community

POST
/categories/{category}/posts
curl --request POST \
--url https://feed.work.optidata.cloud/api/categories/864/posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "content": "{\"ops\":[{\"insert\":\"Welcome to the team!\\n\"}]}", "tags": "[\"hr\"]", "status": "published" }'

Publishes (or drafts/schedules) a post in a community. Requires permission to post there. Send content as a JSON-encoded Quill delta, or a hero_type with its payload. Set status to draft or scheduled (with published_at) to not publish immediately.

category
required
integer

Numeric id of the community.

Media typeapplication/json
Any of:

A post to create.

object
content
required
string
>= 1 characters
tags

A JSON-encoded array of tag names, e.g. "[\"hr\"]".

string | null
status
string
Allowed values: draft scheduled published
published_at

Required when status is scheduled; a future time.

string | null format: date-time
hero_type

The kind of rich hero the post carries, or null.

string | null
Allowed values: image video link poll embed attachment
hero_url

Required when hero_type is link.

string | null
poll

Required when hero_type is poll: a JSON-encoded object with question (string), duration_days (one of 1, 3, 7, 14) and options (2 to 15 strings of at most 70 characters), e.g. "{\"question\":\"Lunch?\",\"duration_days\":3,\"options\":[\"Pizza\",\"Sushi\"]}".

string | null
embeds

Required when hero_type is embed.

Array | null
attachments

Required when hero_type is attachment: a JSON-encoded array of Drive files. Each entry carries identifier (string), source (SOURCE_OPTIWORK_DRIVE or SOURCE_USER_FILE_SYSTEM), mime_type (string), size_bytes (integer, ≥ 0) and meta — the Drive node, at least its id. The caller must be able to read the node; name, MIME type and size are then taken from Drive.

string | null
Examples
Exampleexample
{
"content": "{\"ops\":[{\"insert\":\"Welcome to the team!\\n\"}]}",
"tags": "[\"hr\"]",
"status": "published"
}

The created post.

Media typeapplication/json

A post in a community or the general feed.

object
id
required
integer
category_id

The community, or null in the general feed.

integer | null
user_id
required
integer
title
string | null
content
required

A JSON-encoded Quill delta.

string | null
type
string | null
meta

Link preview metadata, for a link hero.

object | null
status
required
string
Allowed values: draft scheduled published
published_at
string | null format: date-time
hero_type

The kind of rich hero the post carries, or null.

string | null
Allowed values: image video link poll embed attachment
hero_url
string | null
hero_thumbnail_url
string | null
hero_embeds
Array | null
images_count
integer | null
pinned_at
string | null format: date-time
globally_pinned_at
string | null format: date-time
comments_count
integer | null
reacting_users_count
integer | null
has_hero
boolean
has_tags
boolean
is_pinned
boolean
is_globally_pinned
boolean
reaction_summary
One of:
object
key
additional properties
integer
created_at
string format: date-time
updated_at
string format: date-time
deleted_at
string | null format: date-time
user
Any of:

A user of the company.

object
id
required
integer
uuid
required
string format: uuid
cuid

Identifier of the company.

string
username
string
email
string
name
required
string | null
company_name
string | null
role
string
status
string | null
created_at
string format: date-time
updated_at
string format: date-time
deleted_at
string | null format: date-time
avatar_url
string | null
settings
object | null
category
Any of:

A community (shared space) for posts.

object
id
required
integer
cuid
string
name
required
string
slug
required
string
description
string | null
emoji
string | null
cover_url
string | null
color

Hex colour, or null.

string | null
visibility
required

public — everyone in the company; private — only the people and groups it is shared with.

string
Allowed values: public private
group_id

Set when the community mirrors an Optiwork group; such communities are managed through the group, not here.

integer | null
created_at
string format: date-time
updated_at
string format: date-time
deleted_at
string | null format: date-time
pivot

Present when the community is returned as a pinned community.

object
key
additional properties
any
tags
Array<object>

A tag that labels posts.

object
id
required
integer
name
required
string
slug
string
type
string | null
description
string | null
color
required
string
Allowed values: primary secondary success danger warning info dark
order_column
integer | null
created_at
string format: date-time
updated_at
string format: date-time
poll
Any of:

A poll attached to a post.

object
id
required
integer
question
required
string
duration_days
integer
Allowed values: 1 3 7 14
pollable_type
string
pollable_id
integer
options
required
Array<object>
object
id
required
integer
poll_id
required
integer
label
required
string
created_at
string format: date-time
updated_at
string format: date-time
created_at
string format: date-time
updated_at
string format: date-time
attachments
Array<object>

A file attached to a post.

object
id
integer
mime_type
string
size_bytes
integer
source
string
Allowed values: SOURCE_OPTIWORK_DRIVE SOURCE_USER_FILE_SYSTEM
key
additional properties
any
reactions
Array<object>
object
id
required
integer
user_id
required
integer
reactable_type
string
reactable_id
integer
type
required
string
created_at
string format: date-time
updated_at
string format: date-time
user

A user of the company.

object
id
required
integer
uuid
required
string format: uuid
cuid

Identifier of the company.

string
username
string
email
string
name
required
string | null
company_name
string | null
role
string
status
string | null
created_at
string format: date-time
updated_at
string format: date-time
deleted_at
string | null format: date-time
avatar_url
string | null
settings
object | null
comments
Array<object>

A comment on a post.

object
id
required
integer
post_id
required
integer
user_id
required
integer
content
required

A JSON-encoded Quill delta.

string
meta
object | null
created_at
string format: date-time
updated_at
string format: date-time
deleted_at
string | null format: date-time
pinned_at
string | null format: date-time
reacting_users_count
integer
reaction_summary
One of:
object
key
additional properties
integer
user

A user of the company.

object
id
required
integer
uuid
required
string format: uuid
cuid

Identifier of the company.

string
username
string
email
string
name
required
string | null
company_name
string | null
role
string
status
string | null
created_at
string format: date-time
updated_at
string format: date-time
deleted_at
string | null format: date-time
avatar_url
string | null
settings
object | null
Examples
Exampleexample
{
"id": 2289,
"category_id": 864,
"user_id": 38,
"title": null,
"content": "{\"ops\":[{\"insert\":\"Welcome to the team!\\n\"}]}",
"type": "text",
"meta": null,
"created_at": "2026-10-19T14:38:26.000000Z",
"updated_at": "2026-10-19T14:38:26.000000Z",
"deleted_at": null,
"hero_url": null,
"hero_type": null,
"pinned_at": null,
"status": "published",
"published_at": "2026-10-19T14:38:26.000000Z",
"images_count": null,
"hero_thumbnail_url": null,
"hero_embeds": null,
"globally_pinned_at": null,
"comments_count": 0,
"reacting_users_count": 0,
"has_hero": false,
"has_tags": false,
"is_pinned": false,
"is_globally_pinned": false,
"reaction_summary": [],
"user": {
"id": 38,
"uuid": "9ba64b0e-69b4-4639-a01b-4ac5c5f70a24",
"cuid": "7f3c2a10-5b8e-4d21-9c6a-0e4f1b2d3c4a",
"username": "ana.souza@example.com",
"email": "ana.souza@example.com",
"name": "Ana Souza",
"company_name": "Acme",
"role": "user",
"status": "active",
"created_at": "2026-03-25T19:47:41.000000Z",
"updated_at": "2026-09-16T17:25:41.000000Z",
"deleted_at": null,
"avatar_url": "https://media.optidata.cloud/avatars/ana.webp",
"settings": {
"language": "pt_BR",
"language_source": "company",
"theme": "light",
"timezone": null,
"user_id": 214
}
},
"tags": [],
"category": {
"id": 864,
"cuid": "7f3c2a10-5b8e-4d21-9c6a-0e4f1b2d3c4a",
"name": "Announcements",
"slug": "announcements",
"description": "Company-wide announcements.",
"created_at": "2026-09-02T12:10:14.000000Z",
"updated_at": "2026-09-02T12:10:14.000000Z",
"deleted_at": null,
"emoji": "📣",
"cover_url": null,
"color": "#863bff",
"visibility": "public",
"group_id": null
}
}

No authentication key was sent.

Media typeapplication/json

Authentication failures use an error key.

object
error
required
string
Examples
Exampleexample
{
"error": "JWT passport exception: Missing bearer token in request"
}

The caller is not allowed to perform this action.

Media typeapplication/json
object
message
required
string
Examples
Exampleexample
{
"message": "This action is unauthorized."
}

No matching resource, or it is not reachable through this path.

Media typeapplication/json
object
message
required
string
Examples
Exampleexample
{
"message": "No query results for model [App\\Models\\Category] 864"
}

The authentication key is expired or not recognised. Get a fresh one and retry.

Media typeapplication/json

Authentication failures use an error key.

object
error
required
string
Examples
Exampleexample
{
"error": "JWT passport expired: Passport expired"
}

The request failed validation.

Media typeapplication/json
object
message
required

The first validation message.

string
errors
required

Messages keyed by field name.

object
key
additional properties
Array<string>
Examples
Exampleexample
{
"message": "The name field is required.",
"errors": {
"name": [
"The name field is required."
]
}
}