Skip to main content
PATCH
/
content
/
{content}
Update a post
curl --request PATCH \
  --url https://api.example.com/content/{content} \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "body": "<string>",
  "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": [
      {
        "id": 123,
        "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/{content}"

payload = {
"title": "<string>",
"body": "<string>",
"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": [
{
"id": 123,
"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.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
body: JSON.stringify('<string>'),
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: [{id: 123, 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/{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/{content}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'body' => '<string>',
'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' => [
[
'id' => 123,
'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/{content}"

payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"body\": \"<string>\",\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 \"id\": 123,\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("PATCH", 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.patch("https://api.example.com/content/{content}")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"body\": \"<string>\",\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 \"id\": 123,\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/{content}")

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

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"body\": \"<string>\",\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 \"id\": 123,\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

Path Parameters

content
integer
required

Content ID

Body

application/json
title
string | null
Maximum string length: 255
body
string | null
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

204

Post updated