curl --request PATCH \
--url https://api.getmodus.com/api/v1/context/custom-items/{uid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme renewal contract",
"description": "Updated internal billing metadata.",
"topics": [
"billing",
"verified"
]
}
'import requests
url = "https://api.getmodus.com/api/v1/context/custom-items/{uid}"
payload = {
"name": "Acme renewal contract",
"description": "Updated internal billing metadata.",
"topics": ["billing", "verified"]
}
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({
name: 'Acme renewal contract',
description: 'Updated internal billing metadata.',
topics: ['billing', 'verified']
})
};
fetch('https://api.getmodus.com/api/v1/context/custom-items/{uid}', 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.getmodus.com/api/v1/context/custom-items/{uid}",
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([
'name' => 'Acme renewal contract',
'description' => 'Updated internal billing metadata.',
'topics' => [
'billing',
'verified'
]
]),
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://api.getmodus.com/api/v1/context/custom-items/{uid}"
payload := strings.NewReader("{\n \"name\": \"Acme renewal contract\",\n \"description\": \"Updated internal billing metadata.\",\n \"topics\": [\n \"billing\",\n \"verified\"\n ]\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://api.getmodus.com/api/v1/context/custom-items/{uid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme renewal contract\",\n \"description\": \"Updated internal billing metadata.\",\n \"topics\": [\n \"billing\",\n \"verified\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmodus.com/api/v1/context/custom-items/{uid}")
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 \"name\": \"Acme renewal contract\",\n \"description\": \"Updated internal billing metadata.\",\n \"topics\": [\n \"billing\",\n \"verified\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"uid": "<string>"
}{
"error": {
"code": "BAD_REQUEST",
"status": "INVALID_ARGUMENT",
"message": "Invalid value for query parameter `pageSize`.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
}
}{
"error": {
"code": "UNAUTHORIZED",
"status": "UNAUTHENTICATED",
"message": "Missing or invalid access token.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
}
}{
"error": {
"code": "FORBIDDEN",
"status": "PERMISSION_DENIED",
"message": "Missing required scope(s) for this operation.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS",
"info": {
"missing": [
"<required-scope>"
]
}
}
}{
"error": {
"code": "NOT_FOUND",
"status": "NOT_FOUND",
"message": "Resource not found.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
}
}{
"error": {
"code": "CONFLICT",
"status": "ALREADY_EXISTS",
"message": "A resource with that identifier already exists.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
}
}{
"error": {
"code": "VALIDATION",
"status": "INVALID_ARGUMENT",
"message": "Updates that would revoke your own access are not allowed.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"status": "INTERNAL",
"message": "An unexpected error occurred.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
}
}Update a custom context item
Updates mutable fields on a customer-created custom context item. Integration-derived context items cannot be updated through this endpoint.
Requires: context:write
curl --request PATCH \
--url https://api.getmodus.com/api/v1/context/custom-items/{uid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme renewal contract",
"description": "Updated internal billing metadata.",
"topics": [
"billing",
"verified"
]
}
'import requests
url = "https://api.getmodus.com/api/v1/context/custom-items/{uid}"
payload = {
"name": "Acme renewal contract",
"description": "Updated internal billing metadata.",
"topics": ["billing", "verified"]
}
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({
name: 'Acme renewal contract',
description: 'Updated internal billing metadata.',
topics: ['billing', 'verified']
})
};
fetch('https://api.getmodus.com/api/v1/context/custom-items/{uid}', 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.getmodus.com/api/v1/context/custom-items/{uid}",
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([
'name' => 'Acme renewal contract',
'description' => 'Updated internal billing metadata.',
'topics' => [
'billing',
'verified'
]
]),
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://api.getmodus.com/api/v1/context/custom-items/{uid}"
payload := strings.NewReader("{\n \"name\": \"Acme renewal contract\",\n \"description\": \"Updated internal billing metadata.\",\n \"topics\": [\n \"billing\",\n \"verified\"\n ]\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://api.getmodus.com/api/v1/context/custom-items/{uid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme renewal contract\",\n \"description\": \"Updated internal billing metadata.\",\n \"topics\": [\n \"billing\",\n \"verified\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmodus.com/api/v1/context/custom-items/{uid}")
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 \"name\": \"Acme renewal contract\",\n \"description\": \"Updated internal billing metadata.\",\n \"topics\": [\n \"billing\",\n \"verified\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"uid": "<string>"
}{
"error": {
"code": "BAD_REQUEST",
"status": "INVALID_ARGUMENT",
"message": "Invalid value for query parameter `pageSize`.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
}
}{
"error": {
"code": "UNAUTHORIZED",
"status": "UNAUTHENTICATED",
"message": "Missing or invalid access token.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
}
}{
"error": {
"code": "FORBIDDEN",
"status": "PERMISSION_DENIED",
"message": "Missing required scope(s) for this operation.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS",
"info": {
"missing": [
"<required-scope>"
]
}
}
}{
"error": {
"code": "NOT_FOUND",
"status": "NOT_FOUND",
"message": "Resource not found.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
}
}{
"error": {
"code": "CONFLICT",
"status": "ALREADY_EXISTS",
"message": "A resource with that identifier already exists.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
}
}{
"error": {
"code": "VALIDATION",
"status": "INVALID_ARGUMENT",
"message": "Updates that would revoke your own access are not allowed.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"status": "INTERNAL",
"message": "An unexpected error occurred.",
"requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
}
}Authorizations
A Modus personal access token (modus_<orgUuid>_<prefix>_<secret>) or an OAuth 2.1 access token, sent as Authorization: Bearer <token>.
Path Parameters
Uid of the custom context item.
"00000000-0000-4000-a000-000000000abc"
Body
Replacement display name.
"Acme renewal contract"
Replacement customer-defined entity or field type.
"contract"
Replacement description.
"Updated internal billing metadata."
Replacement main textual or structured content.
Replacement customer-facing URL.
"https://internal.example.com/contracts/contract-123"
Replacement structured attributes.
Show child attributes
Show child attributes
Replacement field data type.
"timestamp"
Replacement representative field value.
Replacement representative samples.
Replacement customer-specific raw fields.
Replacement topic tags. Pass [] to clear all tags.
["billing", "verified"]
Response
Patch applied.