Notes
A note in a shared conversation, for the team only.
An SDK signs every request with your key: Authentication. To sign one yourself, see Calling the API without an SDK.
On this page
notes.add
Leave a note in a shared conversation, for the team only.
POST/v1/notes.add
API token
Parameters
The conversation’s id.
The note, up to 10,000 characters.
At most 10,000 characters.
Returns
data is an object with:
The note’s id.
Who wrote it, or null when they are gone.
What it says.
When it was written, in milliseconds since 1970.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.notes.add({
text: "I called them. They pay on Friday.",
threadId: "t_5d2c8a1f9e3b47c6a0d1e2f3",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.notes.add(
{
"text": "I called them. They pay on Friday.",
"thread_id": "t_5d2c8a1f9e3b47c6a0d1e2f3",
}
)
print(answer)
package main
import (
"context"
"fmt"
"log"
mailset "mailset.app/go"
)
func main() {
// Reads MAILSET_TOKEN from the environment.
client, err := mailset.NewClient()
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
params := &mailset.NotesAddParams{
Text: "I called them. They pay on Friday.",
ThreadID: "t_5d2c8a1f9e3b47c6a0d1e2f3",
}
answer, err := client.Notes.Add(ctx, params)
if err != nil {
log.Fatal(err)
}
fmt.Println(answer)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.notes.add(
text: 'I called them. They pay on Friday.',
thread_id: 't_5d2c8a1f9e3b47c6a0d1e2f3'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->notes->add([
'text' => 'I called them. They pay on Friday.',
'threadId' => 't_5d2c8a1f9e3b47c6a0d1e2f3',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Note;
import app.mailset.model.NotesAddParams;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = NotesAddParams.builder()
.text("I called them. They pay on Friday.")
.threadId("t_5d2c8a1f9e3b47c6a0d1e2f3")
.build();
Note answer = mailset.notes().add(params);
System.out.println(answer);
use mailset::types::NotesAddParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.notes()
.add(NotesAddParams {
thread_id: "t_5d2c8a1f9e3b47c6a0d1e2f3".into(),
text: "I called them. They pay on Friday.".into(),
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/notes.add \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"text":"I called them. They pay on Friday.","threadId":"t_5d2c8a1f9e3b47c6a0d1e2f3"}}'
curl can’t sign a request. $TOKEN is your credential’s token, and $MS_TIME and $MS_PROOF sign this exact body: Calling the API without an SDK shows how.
mailset notes add t_5d2c8a1f9e3b47c6a0d1e2f3 --text "I called them. They pay on Friday."
{
"ok": true,
"data": {
"id": "out_3f9a1c0e7b2d",
"author": {
"email": "moc.elpmaxe@olleh",
"name": "Acme API",
"deactivated": true
},
"text": "text",
"at": 1796048940000
}
}