Skip to main content
PATCH
/
engine
/
v2
/
items
Patch Multiple Items
curl --request PATCH \
  --url https://platform.ai.gloo.com/engine/v2/items \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "filter": {
    "item_ids": [
      "<string>"
    ],
    "types": [
      "<string>"
    ],
    "statuses": [
      "<string>"
    ],
    "authors": [
      "<string>"
    ],
    "tags": [
      "<string>"
    ],
    "evergreen": true,
    "visible_in_search": true,
    "visible_in_chat": true,
    "search": "<string>",
    "created_after": "<string>",
    "created_before": "<string>",
    "updated_after": "<string>",
    "updated_before": "<string>"
  },
  "ops": [
    {
      "field": "<string>",
      "value": "<unknown>"
    }
  ],
  "limit": 100
}
'
import requests

url = "https://platform.ai.gloo.com/engine/v2/items"

payload = {
"filter": {
"item_ids": ["<string>"],
"types": ["<string>"],
"statuses": ["<string>"],
"authors": ["<string>"],
"tags": ["<string>"],
"evergreen": True,
"visible_in_search": True,
"visible_in_chat": True,
"search": "<string>",
"created_after": "<string>",
"created_before": "<string>",
"updated_after": "<string>",
"updated_before": "<string>"
},
"ops": [
{
"field": "<string>",
"value": "<unknown>"
}
],
"limit": 100
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: {
item_ids: ['<string>'],
types: ['<string>'],
statuses: ['<string>'],
authors: ['<string>'],
tags: ['<string>'],
evergreen: true,
visible_in_search: true,
visible_in_chat: true,
search: '<string>',
created_after: '<string>',
created_before: '<string>',
updated_after: '<string>',
updated_before: '<string>'
},
ops: [{field: '<string>', value: '<unknown>'}],
limit: 100
})
};

fetch('https://platform.ai.gloo.com/engine/v2/items', 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://platform.ai.gloo.com/engine/v2/items",
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([
'filter' => [
'item_ids' => [
'<string>'
],
'types' => [
'<string>'
],
'statuses' => [
'<string>'
],
'authors' => [
'<string>'
],
'tags' => [
'<string>'
],
'evergreen' => true,
'visible_in_search' => true,
'visible_in_chat' => true,
'search' => '<string>',
'created_after' => '<string>',
'created_before' => '<string>',
'updated_after' => '<string>',
'updated_before' => '<string>'
],
'ops' => [
[
'field' => '<string>',
'value' => '<unknown>'
]
],
'limit' => 100
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://platform.ai.gloo.com/engine/v2/items"

payload := strings.NewReader("{\n \"filter\": {\n \"item_ids\": [\n \"<string>\"\n ],\n \"types\": [\n \"<string>\"\n ],\n \"statuses\": [\n \"<string>\"\n ],\n \"authors\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"evergreen\": true,\n \"visible_in_search\": true,\n \"visible_in_chat\": true,\n \"search\": \"<string>\",\n \"created_after\": \"<string>\",\n \"created_before\": \"<string>\",\n \"updated_after\": \"<string>\",\n \"updated_before\": \"<string>\"\n },\n \"ops\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"limit\": 100\n}")

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

req.Header.Add("Authorization", "Bearer <token>")
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://platform.ai.gloo.com/engine/v2/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"item_ids\": [\n \"<string>\"\n ],\n \"types\": [\n \"<string>\"\n ],\n \"statuses\": [\n \"<string>\"\n ],\n \"authors\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"evergreen\": true,\n \"visible_in_search\": true,\n \"visible_in_chat\": true,\n \"search\": \"<string>\",\n \"created_after\": \"<string>\",\n \"created_before\": \"<string>\",\n \"updated_after\": \"<string>\",\n \"updated_before\": \"<string>\"\n },\n \"ops\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"limit\": 100\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://platform.ai.gloo.com/engine/v2/items")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {\n \"item_ids\": [\n \"<string>\"\n ],\n \"types\": [\n \"<string>\"\n ],\n \"statuses\": [\n \"<string>\"\n ],\n \"authors\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"evergreen\": true,\n \"visible_in_search\": true,\n \"visible_in_chat\": true,\n \"search\": \"<string>\",\n \"created_after\": \"<string>\",\n \"created_before\": \"<string>\",\n \"updated_after\": \"<string>\",\n \"updated_before\": \"<string>\"\n },\n \"ops\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"limit\": 100\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "total_matched": 123,
  "total_patched": 123,
  "total_failed": 123,
  "results": [
    {
      "item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "success": true,
      "error": "<string>",
      "etag": "<string>",
      "updated_at": "<string>"
    }
  ],
  "message": "<string>",
  "filter_applied": {
    "item_ids": [
      "<string>"
    ],
    "types": [
      "<string>"
    ],
    "statuses": [
      "<string>"
    ],
    "authors": [
      "<string>"
    ],
    "tags": [
      "<string>"
    ],
    "evergreen": true,
    "visible_in_search": true,
    "visible_in_chat": true,
    "search": "<string>",
    "created_after": "<string>",
    "created_before": "<string>",
    "updated_after": "<string>",
    "updated_before": "<string>"
  }
}

Error Reference: Content Controls

Common errors: missing patch operations (400), publisher not found (400), validation errors (422), bulk patch failure (500).

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

publisher_id
string<uuid>
required

Body

application/json
filter
MultiItemPatchFilter · object
required
ops
PatchOperation · object[]
required
Minimum array length: 1
limit
integer
default:100
Required range: 1 <= x <= 10000

Response

Successful Response

success
boolean
required
total_matched
integer
required
total_patched
integer
required
total_failed
integer
required
results
ItemPatchResult · object[]
required
message
string
required
filter_applied
MultiItemPatchFilter · object
required