Skip to main content
POST
/
content
Create a post
curl --request POST \
  --url https://api.example.com/content \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "body": "<string>",
  "group": 123,
  "owner_unit": 123,
  "visibility": {
    "all_units": true,
    "units": [
      123
    ],
    "units_falldown": [
      123
    ],
    "userTypes": [
      123
    ]
  },
  "sharing": {
    "shares": [
      123
    ]
  },
  "comments": {
    "enabled": true
  },
  "confirm": {
    "enabled": true
  },
  "show_in_feed": true,
  "publish": {
    "status": true,
    "publish_on": 123,
    "unpublish_on": 123
  },
  "important": true,
  "poll": {
    "question": "<string>",
    "type": "<string>",
    "close_at": 123,
    "allow_user_choices": true,
    "anonymous": true,
    "mandatory": true,
    "choices": [
      {
        "title": "<string>"
      }
    ]
  },
  "pinned": {
    "show_in_main_feed": true,
    "until": 123
  },
  "event": {
    "location": "<string>",
    "link": "<string>",
    "all_day": true,
    "datetime_start": "<string>",
    "datetime_end": "<string>",
    "participation": {
      "enabled": true
    },
    "recurrence": {
      "freq": "<string>",
      "until": "2023-11-07T05:31:56Z",
      "count": 123,
      "interval": 123,
      "bymonthday": 123,
      "bymonth": 123,
      "bysetpos": 123
    },
    "repeat_rules": "<string>",
    "end_date": "2023-12-25",
    "timezone": "<string>"
  }
}
'
import requests

url = "https://api.example.com/content"

payload = {
"title": "<string>",
"body": "<string>",
"group": 123,
"owner_unit": 123,
"visibility": {
"all_units": True,
"units": [123],
"units_falldown": [123],
"userTypes": [123]
},
"sharing": { "shares": [123] },
"comments": { "enabled": True },
"confirm": { "enabled": True },
"show_in_feed": True,
"publish": {
"status": True,
"publish_on": 123,
"unpublish_on": 123
},
"important": True,
"poll": {
"question": "<string>",
"type": "<string>",
"close_at": 123,
"allow_user_choices": True,
"anonymous": True,
"mandatory": True,
"choices": [{ "title": "<string>" }]
},
"pinned": {
"show_in_main_feed": True,
"until": 123
},
"event": {
"location": "<string>",
"link": "<string>",
"all_day": True,
"datetime_start": "<string>",
"datetime_end": "<string>",
"participation": { "enabled": True },
"recurrence": {
"freq": "<string>",
"until": "2023-11-07T05:31:56Z",
"count": 123,
"interval": 123,
"bymonthday": 123,
"bymonth": 123,
"bysetpos": 123
},
"repeat_rules": "<string>",
"end_date": "2023-12-25",
"timezone": "<string>"
}
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
body: JSON.stringify('<string>'),
group: 123,
owner_unit: 123,
visibility: {all_units: true, units: [123], units_falldown: [123], userTypes: [123]},
sharing: {shares: [123]},
comments: {enabled: true},
confirm: {enabled: true},
show_in_feed: true,
publish: {status: true, publish_on: 123, unpublish_on: 123},
important: true,
poll: {
question: '<string>',
type: '<string>',
close_at: 123,
allow_user_choices: true,
anonymous: true,
mandatory: true,
choices: [{title: '<string>'}]
},
pinned: {show_in_main_feed: true, until: 123},
event: {
location: '<string>',
link: '<string>',
all_day: true,
datetime_start: '<string>',
datetime_end: '<string>',
participation: {enabled: true},
recurrence: {
freq: '<string>',
until: '2023-11-07T05:31:56Z',
count: 123,
interval: 123,
bymonthday: 123,
bymonth: 123,
bysetpos: 123
},
repeat_rules: '<string>',
end_date: '2023-12-25',
timezone: '<string>'
}
})
};

fetch('https://api.example.com/content', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'body' => '<string>',
'group' => 123,
'owner_unit' => 123,
'visibility' => [
'all_units' => true,
'units' => [
123
],
'units_falldown' => [
123
],
'userTypes' => [
123
]
],
'sharing' => [
'shares' => [
123
]
],
'comments' => [
'enabled' => true
],
'confirm' => [
'enabled' => true
],
'show_in_feed' => true,
'publish' => [
'status' => true,
'publish_on' => 123,
'unpublish_on' => 123
],
'important' => true,
'poll' => [
'question' => '<string>',
'type' => '<string>',
'close_at' => 123,
'allow_user_choices' => true,
'anonymous' => true,
'mandatory' => true,
'choices' => [
[
'title' => '<string>'
]
]
],
'pinned' => [
'show_in_main_feed' => true,
'until' => 123
],
'event' => [
'location' => '<string>',
'link' => '<string>',
'all_day' => true,
'datetime_start' => '<string>',
'datetime_end' => '<string>',
'participation' => [
'enabled' => true
],
'recurrence' => [
'freq' => '<string>',
'until' => '2023-11-07T05:31:56Z',
'count' => 123,
'interval' => 123,
'bymonthday' => 123,
'bymonth' => 123,
'bysetpos' => 123
],
'repeat_rules' => '<string>',
'end_date' => '2023-12-25',
'timezone' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/content"

payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"group\": 123,\n \"owner_unit\": 123,\n \"visibility\": {\n \"all_units\": true,\n \"units\": [\n 123\n ],\n \"units_falldown\": [\n 123\n ],\n \"userTypes\": [\n 123\n ]\n },\n \"sharing\": {\n \"shares\": [\n 123\n ]\n },\n \"comments\": {\n \"enabled\": true\n },\n \"confirm\": {\n \"enabled\": true\n },\n \"show_in_feed\": true,\n \"publish\": {\n \"status\": true,\n \"publish_on\": 123,\n \"unpublish_on\": 123\n },\n \"important\": true,\n \"poll\": {\n \"question\": \"<string>\",\n \"type\": \"<string>\",\n \"close_at\": 123,\n \"allow_user_choices\": true,\n \"anonymous\": true,\n \"mandatory\": true,\n \"choices\": [\n {\n \"title\": \"<string>\"\n }\n ]\n },\n \"pinned\": {\n \"show_in_main_feed\": true,\n \"until\": 123\n },\n \"event\": {\n \"location\": \"<string>\",\n \"link\": \"<string>\",\n \"all_day\": true,\n \"datetime_start\": \"<string>\",\n \"datetime_end\": \"<string>\",\n \"participation\": {\n \"enabled\": true\n },\n \"recurrence\": {\n \"freq\": \"<string>\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"count\": 123,\n \"interval\": 123,\n \"bymonthday\": 123,\n \"bymonth\": 123,\n \"bysetpos\": 123\n },\n \"repeat_rules\": \"<string>\",\n \"end_date\": \"2023-12-25\",\n \"timezone\": \"<string>\"\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.example.com/content")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"group\": 123,\n \"owner_unit\": 123,\n \"visibility\": {\n \"all_units\": true,\n \"units\": [\n 123\n ],\n \"units_falldown\": [\n 123\n ],\n \"userTypes\": [\n 123\n ]\n },\n \"sharing\": {\n \"shares\": [\n 123\n ]\n },\n \"comments\": {\n \"enabled\": true\n },\n \"confirm\": {\n \"enabled\": true\n },\n \"show_in_feed\": true,\n \"publish\": {\n \"status\": true,\n \"publish_on\": 123,\n \"unpublish_on\": 123\n },\n \"important\": true,\n \"poll\": {\n \"question\": \"<string>\",\n \"type\": \"<string>\",\n \"close_at\": 123,\n \"allow_user_choices\": true,\n \"anonymous\": true,\n \"mandatory\": true,\n \"choices\": [\n {\n \"title\": \"<string>\"\n }\n ]\n },\n \"pinned\": {\n \"show_in_main_feed\": true,\n \"until\": 123\n },\n \"event\": {\n \"location\": \"<string>\",\n \"link\": \"<string>\",\n \"all_day\": true,\n \"datetime_start\": \"<string>\",\n \"datetime_end\": \"<string>\",\n \"participation\": {\n \"enabled\": true\n },\n \"recurrence\": {\n \"freq\": \"<string>\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"count\": 123,\n \"interval\": 123,\n \"bymonthday\": 123,\n \"bymonth\": 123,\n \"bysetpos\": 123\n },\n \"repeat_rules\": \"<string>\",\n \"end_date\": \"2023-12-25\",\n \"timezone\": \"<string>\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/content")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"group\": 123,\n \"owner_unit\": 123,\n \"visibility\": {\n \"all_units\": true,\n \"units\": [\n 123\n ],\n \"units_falldown\": [\n 123\n ],\n \"userTypes\": [\n 123\n ]\n },\n \"sharing\": {\n \"shares\": [\n 123\n ]\n },\n \"comments\": {\n \"enabled\": true\n },\n \"confirm\": {\n \"enabled\": true\n },\n \"show_in_feed\": true,\n \"publish\": {\n \"status\": true,\n \"publish_on\": 123,\n \"unpublish_on\": 123\n },\n \"important\": true,\n \"poll\": {\n \"question\": \"<string>\",\n \"type\": \"<string>\",\n \"close_at\": 123,\n \"allow_user_choices\": true,\n \"anonymous\": true,\n \"mandatory\": true,\n \"choices\": [\n {\n \"title\": \"<string>\"\n }\n ]\n },\n \"pinned\": {\n \"show_in_main_feed\": true,\n \"until\": 123\n },\n \"event\": {\n \"location\": \"<string>\",\n \"link\": \"<string>\",\n \"all_day\": true,\n \"datetime_start\": \"<string>\",\n \"datetime_end\": \"<string>\",\n \"participation\": {\n \"enabled\": true\n },\n \"recurrence\": {\n \"freq\": \"<string>\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"count\": 123,\n \"interval\": 123,\n \"bymonthday\": 123,\n \"bymonth\": 123,\n \"bysetpos\": 123\n },\n \"repeat_rules\": \"<string>\",\n \"end_date\": \"2023-12-25\",\n \"timezone\": \"<string>\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": 1,
  "content_type": "news",
  "title": "Important update",
  "body": "Post body text",
  "show_in_feed": true,
  "important": false,
  "actively_requires_action": false,
  "mute_rule": 123,
  "seen_by_user": true,
  "has_unseen_mention": true,
  "pinned": {},
  "confirm": {},
  "publish": {},
  "event": {},
  "interaction": {},
  "stats": {},
  "sharing": {},
  "visibility": {},
  "uploading_files": 123,
  "files": [
    {}
  ],
  "permissions": {},
  "comments": {},
  "mentions": [
    {}
  ],
  "group": {},
  "author": {},
  "poll": {},
  "participation": {},
  "translations": {}
}

Body

application/json
title
string | null
Maximum string length: 255
body
string | null
group
integer | null

Group ID to post in

owner_unit
integer | null

Owner unit ID when not posting in a group

visibility
object
sharing
object
comments
object
confirm
object
show_in_feed
boolean

Show post in feed

publish
object
important
boolean

Mark post as important

poll
object | null
pinned
object | null
event
object | null

Response

201 - application/json

Post created

id
integer
Example:

1

content_type
enum<string>

Type of content

Available options:
news,
debate,
event
Example:

"news"

title
string
Example:

"Important update"

body
string
Example:

"Post body text"

show_in_feed
boolean
Example:

true

important
boolean
Example:

false

actively_requires_action
boolean
Example:

false

mute_rule
integer | null

ID of mute rule/blacklist for current user or null

seen_by_user
boolean

Whether the current user has seen this content

has_unseen_mention
boolean

Whether the current user has unseen mentions in this content

pinned
object | null

Pin information when content is pinned in feeds

confirm
object

Read confirmation settings and totals

publish
object

Publish metadata including status and timestamps

event
object | null

Event-specific metadata when content is an event

interaction
object

User-specific interaction flags (seen, liked, read, bookmarked)

stats
object

Aggregated statistics such as comments, likes, reads

sharing
object

Sharing information, including whether and how the content is shared

visibility
object

Visibility information (owner unit, units, user types)

uploading_files
integer

Number of files currently uploading for this content

files
object[]

Attached files for this content

permissions
object

Edit/delete permission flags for the current user

comments
object

Comment settings and counts

mentions
object[]

Mentioned users when loaded

group
object | null

Group information when content belongs to a group

author
object

Author information for the content

poll
object | null

Poll configuration when content includes a poll

participation
object | null

Event participation data (deprecated, mirrored from event.participation)

translations
object | null

Automatic translation metadata and translated fields