curl --request POST \
--url https://api.getmodus.com/api/v1/context/notes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Q3 churn analysis",
"content": "## Findings\n\nChurn rate increased 2.3% MoM."
}
'import requests
url = "https://api.getmodus.com/api/v1/context/notes"
payload = {
"title": "Q3 churn analysis",
"content": "## Findings
Churn rate increased 2.3% MoM."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Q3 churn analysis',
content: '## Findings\n\nChurn rate increased 2.3% MoM.'
})
};
fetch('https://api.getmodus.com/api/v1/context/notes', 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/notes",
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' => 'Q3 churn analysis',
'content' => '## Findings
Churn rate increased 2.3% MoM.'
]),
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/notes"
payload := strings.NewReader("{\n \"title\": \"Q3 churn analysis\",\n \"content\": \"## Findings\\n\\nChurn rate increased 2.3% MoM.\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.getmodus.com/api/v1/context/notes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Q3 churn analysis\",\n \"content\": \"## Findings\\n\\nChurn rate increased 2.3% MoM.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmodus.com/api/v1/context/notes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Q3 churn analysis\",\n \"content\": \"## Findings\\n\\nChurn rate increased 2.3% MoM.\"\n}"
response = http.request(request)
puts response.read_body{
"contextItemId": "7a3f9d2c-1111-4000-a000-000000000abc",
"kind": "note",
"s3Key": "context_notes/7a3f9d2c.../Q3_churn_analysis.md",
"title": "Q3 churn analysis"
}{
"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"
}
}Create a note context item
Stores a markdown-formatted note in the caller’s tenant S3 bucket and a row in context_items so the note participates in selection / search like any other context item.
Requires: context:write
curl --request POST \
--url https://api.getmodus.com/api/v1/context/notes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Q3 churn analysis",
"content": "## Findings\n\nChurn rate increased 2.3% MoM."
}
'import requests
url = "https://api.getmodus.com/api/v1/context/notes"
payload = {
"title": "Q3 churn analysis",
"content": "## Findings
Churn rate increased 2.3% MoM."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Q3 churn analysis',
content: '## Findings\n\nChurn rate increased 2.3% MoM.'
})
};
fetch('https://api.getmodus.com/api/v1/context/notes', 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/notes",
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' => 'Q3 churn analysis',
'content' => '## Findings
Churn rate increased 2.3% MoM.'
]),
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/notes"
payload := strings.NewReader("{\n \"title\": \"Q3 churn analysis\",\n \"content\": \"## Findings\\n\\nChurn rate increased 2.3% MoM.\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.getmodus.com/api/v1/context/notes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Q3 churn analysis\",\n \"content\": \"## Findings\\n\\nChurn rate increased 2.3% MoM.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmodus.com/api/v1/context/notes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Q3 churn analysis\",\n \"content\": \"## Findings\\n\\nChurn rate increased 2.3% MoM.\"\n}"
response = http.request(request)
puts response.read_body{
"contextItemId": "7a3f9d2c-1111-4000-a000-000000000abc",
"kind": "note",
"s3Key": "context_notes/7a3f9d2c.../Q3_churn_analysis.md",
"title": "Q3 churn analysis"
}{
"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>.
Body
Display title for the note. Used in the SPA list and as the s3 object filename.
"Q3 churn analysis"
Note body — markdown text. Stored in tenant S3 + context_items.
"## Findings\n\nChurn rate increased 2.3% MoM."
Show child attributes
Show child attributes
Response
UUID of the newly-created context item. Use it on subsequent GET / PATCH / DELETE calls.
"7a3f9d2c-1111-4000-a000-000000000abc"
Kind of context item created.
note, saved_query, link "note"
Tenant S3 key for the raw content blob (notes, saved queries, links). Null for kinds without S3 backing.
"context_notes/7a3f9d2c.../Q3_churn_analysis.md"
Resolved title for the created item. Null for kinds without a title field.
"Q3 churn analysis"