Help Center
Partially update collection
Update selected collection fields.
PATCH
/
organizations
/
{organization_id}
/
portal
/
collections
/
{pk}
/
Partially update collection
curl --request PATCH \
--url https://api.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/ \
--header 'Content-Type: application/json' \
--header 'X-Initdesk-Token: <api-key>' \
--data '
{
"parent": 123,
"name": "<string>",
"slug": "",
"meta_description": "<string>",
"icon": "<string>",
"position": 1073741823
}
'import requests
url = "https://api.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/"
payload = {
"parent": 123,
"name": "<string>",
"slug": "",
"meta_description": "<string>",
"icon": "<string>",
"position": 1073741823
}
headers = {
"X-Initdesk-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Initdesk-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
parent: 123,
name: '<string>',
slug: '',
meta_description: '<string>',
icon: '<string>',
position: 1073741823
})
};
fetch('https://api.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/', 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.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/",
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([
'parent' => 123,
'name' => '<string>',
'slug' => '',
'meta_description' => '<string>',
'icon' => '<string>',
'position' => 1073741823
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Initdesk-Token: <api-key>"
],
]);
$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.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/"
payload := strings.NewReader("{\n \"parent\": 123,\n \"name\": \"<string>\",\n \"slug\": \"\",\n \"meta_description\": \"<string>\",\n \"icon\": \"<string>\",\n \"position\": 1073741823\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Initdesk-Token", "<api-key>")
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.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/")
.header("X-Initdesk-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"parent\": 123,\n \"name\": \"<string>\",\n \"slug\": \"\",\n \"meta_description\": \"<string>\",\n \"icon\": \"<string>\",\n \"position\": 1073741823\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Initdesk-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"parent\": 123,\n \"name\": \"<string>\",\n \"slug\": \"\",\n \"meta_description\": \"<string>\",\n \"icon\": \"<string>\",\n \"position\": 1073741823\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"portal": 123,
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"parent": 123,
"slug": "",
"meta_description": "<string>",
"icon": "<string>",
"position": 1073741823
}Authorizations
Path Parameters
A unique integer value identifying this collection.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Response
200 - application/json
Maximum string length:
255Pattern:
^[-a-zA-Z0-9_]+$Maximum string length:
160Maximum string length:
32Required range:
0 <= x <= 2147483647Was this page helpful?
Previous
List collection treeReturn collections as a nested tree. Use include_articles to embed articles per collection node.
Next
⌘I
Partially update collection
curl --request PATCH \
--url https://api.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/ \
--header 'Content-Type: application/json' \
--header 'X-Initdesk-Token: <api-key>' \
--data '
{
"parent": 123,
"name": "<string>",
"slug": "",
"meta_description": "<string>",
"icon": "<string>",
"position": 1073741823
}
'import requests
url = "https://api.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/"
payload = {
"parent": 123,
"name": "<string>",
"slug": "",
"meta_description": "<string>",
"icon": "<string>",
"position": 1073741823
}
headers = {
"X-Initdesk-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Initdesk-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
parent: 123,
name: '<string>',
slug: '',
meta_description: '<string>',
icon: '<string>',
position: 1073741823
})
};
fetch('https://api.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/', 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.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/",
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([
'parent' => 123,
'name' => '<string>',
'slug' => '',
'meta_description' => '<string>',
'icon' => '<string>',
'position' => 1073741823
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Initdesk-Token: <api-key>"
],
]);
$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.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/"
payload := strings.NewReader("{\n \"parent\": 123,\n \"name\": \"<string>\",\n \"slug\": \"\",\n \"meta_description\": \"<string>\",\n \"icon\": \"<string>\",\n \"position\": 1073741823\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Initdesk-Token", "<api-key>")
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.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/")
.header("X-Initdesk-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"parent\": 123,\n \"name\": \"<string>\",\n \"slug\": \"\",\n \"meta_description\": \"<string>\",\n \"icon\": \"<string>\",\n \"position\": 1073741823\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.initdesk.com/organizations/{organization_id}/portal/collections/{pk}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Initdesk-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"parent\": 123,\n \"name\": \"<string>\",\n \"slug\": \"\",\n \"meta_description\": \"<string>\",\n \"icon\": \"<string>\",\n \"position\": 1073741823\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"portal": 123,
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"parent": 123,
"slug": "",
"meta_description": "<string>",
"icon": "<string>",
"position": 1073741823
}