Contacts
Your address book: add, merge, import and export.
An SDK signs every request with your key: Authentication. To sign one yourself, see Calling the API without an SDK.
On this page
The Contact object
A person in your contacts, with every field you keep of them.
Attributes
The contact’s id.
The full name as shown.
The labels on the contact, by name.
A short-lived URL for their photo. Null: none, so show initials.
When it was saved, in ms since the epoch.
When it last changed, in ms since the epoch.
Answered by
{
"id": "out_3f9a1c0e7b2d",
"name": "Acme API",
"firstName": "text",
"middleName": "text",
"lastName": "text",
"prefix": "text",
"suffix": "text",
"nickname": "text",
"company": "text",
"title": "text",
"department": "text",
"emails": [
{
"value": "text",
"label": "text"
}
],
contacts.list
List your contacts, by name.
POST/v1/contacts.list
Parameters
How many contacts a page holds, 1 to 200.
Default
50. From 1 to 200.The
nextof the page before, for the page after it.Only contacts with this label.
At most 64 characters.
Returns
data is an object with:
Pass as
afterfor the next page. Null at the end.Rises with every change to the address book.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.list({
label: "Customers",
limit: 100,
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.list(
{"label": "Customers", "limit": 100}
)
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.ContactsListParams{
Label: mailset.String("Customers"),
Limit: mailset.Int(100),
}
answer, err := client.Contacts.List(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.contacts.list(
label: 'Customers',
limit: 100
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->list([
'label' => 'Customers',
'limit' => 100,
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ContactPage;
import app.mailset.model.ContactsListParams;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ContactsListParams.builder()
.label("Customers")
.limit(100L)
.build();
ContactPage answer = mailset.contacts().list(params);
System.out.println(answer);
use mailset::types::ContactsListParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.contacts()
.list(ContactsListParams {
limit: Some(100),
label: Some("Customers".into()),
..Default::default()
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/contacts.list \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"label":"Customers","limit":100}}'
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 contacts list --label Customers --limit 100
{
"ok": true,
"data": {
"contacts": [
{
"id": "out_3f9a1c0e7b2d",
"name": "Acme API",
"emails": [
"moc.elpmaxe@olleh"
],
"phones": [
"text"
],
"company": "text",
"title": "text",
"labels": [
"text"
],
"picture": "text"
}
],
"next": "eyJhIjoxNzk2MDkyNDQyfQ",
"total": 12,
"revision": 1
}
}
contacts.search
Search your contacts: name, address, phone, company, notes, labels.
POST/v1/contacts.search
Parameters
What to find, in a name, address, phone, company, note or label.
At most 200 characters.
How many contacts a page holds, 1 to 200.
Default
50. From 1 to 200.The
nextof the page before, for the page after it.
Returns
data is an object with:
Pass as
afterfor the next page. Null at the end.Rises with every change to the address book.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.search({
query: "maria",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.search({"query": "maria"})
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.ContactsSearchParams{
Query: "maria",
}
answer, err := client.Contacts.Search(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.contacts.search(query: 'maria')
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->search([
'query' => 'maria',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ContactPage;
import app.mailset.model.ContactsSearchParams;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ContactsSearchParams.builder()
.query("maria")
.build();
ContactPage answer = mailset.contacts().search(params);
System.out.println(answer);
use mailset::types::ContactsSearchParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.contacts()
.search(ContactsSearchParams {
query: "maria".into(),
..Default::default()
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/contacts.search \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"query":"maria"}}'
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 contacts search maria
{
"ok": true,
"data": {
"contacts": [
{
"id": "out_3f9a1c0e7b2d",
"name": "Acme API",
"emails": [
"moc.elpmaxe@olleh"
],
"phones": [
"text"
],
"company": "text",
"title": "text",
"labels": [
"text"
],
"picture": "text"
}
],
"next": "eyJhIjoxNzk2MDkyNDQyfQ",
"total": 12,
"revision": 1
}
}
contacts.get
Show one contact.
POST/v1/contacts.get
Parameters
The contact’s id.
Returns
data is the Contact object.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.get({
id: "con_4e9a2c7f1b6d3058a3c7e1b9",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.get(
{"id": "con_4e9a2c7f1b6d3058a3c7e1b9"}
)
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.ContactsGetParams{
ID: "con_4e9a2c7f1b6d3058a3c7e1b9",
}
answer, err := client.Contacts.Get(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.contacts.get(
id: 'con_4e9a2c7f1b6d3058a3c7e1b9'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->get([
'id' => 'con_4e9a2c7f1b6d3058a3c7e1b9',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Contact;
import app.mailset.model.ContactsGetParams;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ContactsGetParams.builder()
.id("con_4e9a2c7f1b6d3058a3c7e1b9")
.build();
Contact answer = mailset.contacts().get(params);
System.out.println(answer);
use mailset::types::ContactsGetParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.contacts()
.get(ContactsGetParams {
id: "con_4e9a2c7f1b6d3058a3c7e1b9".into(),
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/contacts.get \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"id":"con_4e9a2c7f1b6d3058a3c7e1b9"}}'
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 contacts get con_4e9a2c7f1b6d3058a3c7e1b9
{
"ok": true,
"data": {
"id": "out_3f9a1c0e7b2d",
"name": "Acme API",
"firstName": "text",
"middleName": "text",
"lastName": "text",
"prefix": "text",
"suffix": "text",
"nickname": "text",
"company": "text",
"title": "text",
"department": "text",
"emails": [
{
"value": "text",
"label": "text"
contacts.add
Save someone.
POST/v1/contacts.add
Parameters
The full name as shown. Left empty, it is put together from the parts.
At most 200 characters.
Their first name.
At most 200 characters.
Their middle name.
At most 200 characters.
Their last name.
At most 200 characters.
What goes before the name: Dr.
At most 200 characters.
What goes after it: Jr.
At most 200 characters.
What you call them.
At most 200 characters.
Where they work.
At most 200 characters.
Their job title.
At most 200 characters.
Their department.
At most 200 characters.
Addresses, the first is primary. Each is an address, or
{ value, label }. Up to 20.At most 20 items.
Phone numbers, each a number or
{ value, label }. Up to 20.At most 20 items.
Postal addresses, each as text or
{ value, label }. Up to 10.At most 10 items.
Websites, each a URL or
{ value, label }. Up to 10.At most 10 items.
Their birthday, as written:
1990-04-12.At most 32 characters.
Your own notes about them.
At most 20,000 characters.
The labels on the contact, by name. Up to 50.
At most 50 items.
Anything else a contact came with: events, relations, custom fields.
At most 50 items.
Returns
data is the Contact object.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.add({
emails: [
"moc.elpmaxe@airam",
],
phones: [
"+1 555 0100",
],
company: "Example Inc",
name: "Maria Lopez",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.add(
{
"emails": ["moc.elpmaxe@airam"],
"phones": ["+1 555 0100"],
"company": "Example Inc",
"name": "Maria Lopez",
}
)
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.ContactsAddParams{
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.contacts.add(
emails: ['moc.elpmaxe@airam'],
phones: ['+1 555 0100'],
company: 'Example Inc',
name: 'Maria Lopez'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->add([
'emails' => ['moc.elpmaxe@airam'],
'phones' => ['+1 555 0100'],
'company' => 'Example Inc',
'name' => 'Maria Lopez',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Contact;
import app.mailset.model.ContactsAddParams;
import java.util.List;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ContactsAddParams.builder()
.emails(List.of("moc.elpmaxe@airam"))
.phones(List.of("+1 555 0100"))
.company("Example Inc")
.name("Maria Lopez")
.build();
Contact answer = mailset.contacts().add(params);
System.out.println(answer);
use mailset::types::ContactsAddParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.contacts()
.add(ContactsAddParams {
name: Some("Maria Lopez".into()),
company: Some("Example Inc".into()),
emails: Some(vec!["moc.elpmaxe@airam".into()]),
phones: Some(vec!["+1 555 0100".into()]),
..Default::default()
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/contacts.add \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"emails":["moc.elpmaxe@airam"],"phones":["+1 555 0100"],"company":"Example Inc","name":"Maria Lopez"}}'
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 contacts add "Maria Lopez" --emails moc.elpmaxe@airam --phones "+1 555 0100" --company "Example Inc"
{
"ok": true,
"data": {
"id": "out_3f9a1c0e7b2d",
"name": "Acme API",
"firstName": "text",
"middleName": "text",
"lastName": "text",
"prefix": "text",
"suffix": "text",
"nickname": "text",
"company": "text",
"title": "text",
"department": "text",
"emails": [
{
"value": "text",
"label": "text"
contacts.update
Change a contact. Only the fields you pass change.
POST/v1/contacts.update
Parameters
The full name as shown. Left empty, it is put together from the parts.
At most 200 characters.
Their first name.
At most 200 characters.
Their middle name.
At most 200 characters.
Their last name.
At most 200 characters.
What goes before the name: Dr.
At most 200 characters.
What goes after it: Jr.
At most 200 characters.
What you call them.
At most 200 characters.
Where they work.
At most 200 characters.
Their job title.
At most 200 characters.
Their department.
At most 200 characters.
Addresses, the first is primary. Each is an address, or
{ value, label }. Up to 20.At most 20 items.
Phone numbers, each a number or
{ value, label }. Up to 20.At most 20 items.
Postal addresses, each as text or
{ value, label }. Up to 10.At most 10 items.
Websites, each a URL or
{ value, label }. Up to 10.At most 10 items.
Their birthday, as written:
1990-04-12.At most 32 characters.
Your own notes about them.
At most 20,000 characters.
The labels on the contact, by name. Up to 50.
At most 50 items.
Anything else a contact came with: events, relations, custom fields.
At most 50 items.
The contact’s id.
Returns
data is the Contact object.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.update({
company: "Example Inc",
title: "Head of Finance",
id: "con_4e9a2c7f1b6d3058a3c7e1b9",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.update(
{
"company": "Example Inc",
"title": "Head of Finance",
"id": "con_4e9a2c7f1b6d3058a3c7e1b9",
}
)
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.ContactsUpdateParams{
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.contacts.update(
company: 'Example Inc',
title: 'Head of Finance',
id: 'con_4e9a2c7f1b6d3058a3c7e1b9'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->update([
'company' => 'Example Inc',
'title' => 'Head of Finance',
'id' => 'con_4e9a2c7f1b6d3058a3c7e1b9',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Contact;
import app.mailset.model.ContactsUpdateParams;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ContactsUpdateParams.builder()
.company("Example Inc")
.title("Head of Finance")
.id("con_4e9a2c7f1b6d3058a3c7e1b9")
.build();
Contact answer = mailset.contacts().update(params);
System.out.println(answer);
use mailset::types::ContactsUpdateParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.contacts()
.update(ContactsUpdateParams {
company: Some("Example Inc".into()),
title: Some("Head of Finance".into()),
id: "con_4e9a2c7f1b6d3058a3c7e1b9".into(),
..Default::default()
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/contacts.update \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"company":"Example Inc","title":"Head of Finance","id":"con_4e9a2c7f1b6d3058a3c7e1b9"}}'
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 contacts update con_4e9a2c7f1b6d3058a3c7e1b9 --company "Example Inc" --title "Head of Finance"
{
"ok": true,
"data": {
"id": "out_3f9a1c0e7b2d",
"name": "Acme API",
"firstName": "text",
"middleName": "text",
"lastName": "text",
"prefix": "text",
"suffix": "text",
"nickname": "text",
"company": "text",
"title": "text",
"department": "text",
"emails": [
{
"value": "text",
"label": "text"
contacts.remove
Delete contacts and their photos.
POST/v1/contacts.remove
Parameters
One contact’s id, or a list of up to 200.
1 to 200 items.
Returns
data is an object with:
How many were deleted.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.remove({
ids: [
"con_4e9a2c7f1b6d3058a3c7e1b9",
],
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.remove(
{"ids": ["con_4e9a2c7f1b6d3058a3c7e1b9"]}
)
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.ContactsRemoveParams{
IDs: []string{"con_4e9a2c7f1b6d3058a3c7e1b9"},
}
answer, err := client.Contacts.Remove(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.contacts.remove(
ids: ['con_4e9a2c7f1b6d3058a3c7e1b9']
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->remove([
'ids' => ['con_4e9a2c7f1b6d3058a3c7e1b9'],
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ContactsRemoveParams;
import app.mailset.model.ContactsRemoveResult;
import java.util.List;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ContactsRemoveParams.builder()
.ids(List.of("con_4e9a2c7f1b6d3058a3c7e1b9"))
.build();
ContactsRemoveResult answer =
mailset.contacts().remove(params);
System.out.println(answer);
use mailset::types::ContactsRemoveParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.contacts()
.remove(ContactsRemoveParams {
ids: vec!["con_4e9a2c7f1b6d3058a3c7e1b9".into()],
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/contacts.remove \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"ids":"con_4e9a2c7f1b6d3058a3c7e1b9"}}'
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 contacts remove con_4e9a2c7f1b6d3058a3c7e1b9
{
"ok": true,
"data": {
"removed": 1
}
}
contacts.duplicates
Find contacts that look like the same person.
POST/v1/contacts.duplicates
Parameters
It takes no input: send an empty object.
Returns
data is a list of objects, each with:
One of
emailphonename
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.duplicates();
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.duplicates()
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()
answer, err := client.Contacts.Duplicates(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(answer)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.contacts.duplicates
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->duplicates();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.DuplicateGroup;
import java.util.List;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
List<DuplicateGroup> answer =
mailset.contacts().duplicates();
System.out.println(answer);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset.contacts().duplicates().await?;
println!("{answer:?}");
curl https://mailset.app/v1/contacts.duplicates \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{}}'
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 contacts duplicates
{
"ok": true,
"data": [
{
"reason": "email",
"contacts": [
{
"id": "out_3f9a1c0e7b2d",
"name": "Acme API",
"emails": [
"moc.elpmaxe@olleh"
],
"phones": [
"text"
],
"company": "text",
"title": "text",
"labels": [
"text"
],
"picture": "text"
}
]
}
]
}
contacts.merge
Merge duplicates.
POST/v1/contacts.merge
Parameters
The contacts to merge, 2 to 50. The first is kept.
2 to 50 items.
Merge every group
contacts duplicatesfinds.
Returns
data is an object with:
Contacts folded into another and gone.
Who was left standing.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.merge({
ids: [
"con_4e9a2c7f1b6d3058a3c7e1b9",
"con_a1c6e3b9f2d74058b6e2a9c4",
],
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.merge(
{
"ids": [
"con_4e9a2c7f1b6d3058a3c7e1b9",
"con_a1c6e3b9f2d74058b6e2a9c4",
],
}
)
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.ContactsMergeParams{
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.contacts.merge(
ids: [
'con_4e9a2c7f1b6d3058a3c7e1b9',
'con_a1c6e3b9f2d74058b6e2a9c4'
]
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->merge([
'ids' => [
'con_4e9a2c7f1b6d3058a3c7e1b9',
'con_a1c6e3b9f2d74058b6e2a9c4',
],
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ContactsMergeParams;
import app.mailset.model.MergeResult;
import java.util.List;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ContactsMergeParams.builder()
.ids(List.of(
"con_4e9a2c7f1b6d3058a3c7e1b9",
"con_a1c6e3b9f2d74058b6e2a9c4"))
.build();
MergeResult answer = mailset.contacts().merge(params);
System.out.println(answer);
use mailset::types::ContactsMergeParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.contacts()
.merge(ContactsMergeParams {
ids: Some(vec![
"con_4e9a2c7f1b6d3058a3c7e1b9".into(),
"con_a1c6e3b9f2d74058b6e2a9c4".into(),
]),
..Default::default()
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/contacts.merge \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"ids":["con_4e9a2c7f1b6d3058a3c7e1b9","con_a1c6e3b9f2d74058b6e2a9c4"]}}'
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 contacts merge --ids con_4e9a2c7f1b6d3058a3c7e1b9,con_a1c6e3b9f2d74058b6e2a9c4
{
"ok": true,
"data": {
"removed": 1,
"kept": [
"text"
]
}
}
contacts.import
Import a Google Contacts CSV or a vCard file.
POST/v1/contacts.import
Parameters
The file’s name.
At most 255 characters.
The file, base64.
The body may be up to 45 MB.
Returns
data is an object with:
One of
csvvcardRows or cards found in the file.
Already saved: anything new in the file was added to them.
Already saved, with nothing new to add.
Rows or cards left out, and why. Up to 200 are listed;
skippedTotalcounts them all.Show child attributesHide child attributes
Every photo kept, inline or fetched.
Inline photos refused for their type or size.
Links anywhere but Google’s photo hosts: Mailset doesn’t fetch them.
Links on Google’s photo hosts, fetched and kept. Counted in
addedtoo.Links on Google’s photo hosts that gave no usable photo.
Links on Google’s photo hosts this import had no room or time for. Importing the file again fetches them.
Columns or properties with data that Mailset has no field for.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.import({
name: "contacts.vcf",
data: "<the message as base64>",
});
console.log(answer);
<the message as base64> is a whole email, headers and body: Send your own MIME.
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.import_contacts(
{
"name": "contacts.vcf",
"data": "<the message as base64>",
}
)
print(answer)
<the message as base64> is a whole email, headers and body: Send your own MIME.
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.ContactsImportParams{
Name: "contacts.vcf",
Data: "<the message as base64>",
}
answer, err := client.Contacts.Import(ctx, params)
if err != nil {
log.Fatal(err)
}
fmt.Println(answer)
}
<the message as base64> is a whole email, headers and body: Send your own MIME.
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.contacts.import(
name: 'contacts.vcf',
data: '<the message as base64>'
)
p answer
<the message as base64> is a whole email, headers and body: Send your own MIME.
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->import([
'name' => 'contacts.vcf',
'data' => '<the message as base64>',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
<the message as base64> is a whole email, headers and body: Send your own MIME.
import app.mailset.Mailset;
import app.mailset.model.ContactImportReport;
import app.mailset.model.ContactsImportParams;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ContactsImportParams.builder()
.name("contacts.vcf")
.data("<the message as base64>")
.build();
ContactImportReport answer =
mailset.contacts().importContacts(params);
System.out.println(answer);
<the message as base64> is a whole email, headers and body: Send your own MIME.
use mailset::types::ContactsImportParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.contacts()
.import(ContactsImportParams {
name: "contacts.vcf".into(),
data: "<the message as base64>".into(),
})
.await?;
println!("{answer:?}");
<the message as base64> is a whole email, headers and body: Send your own MIME.
curl https://mailset.app/v1/contacts.import \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"name":"contacts.vcf","data":"<base64 of the file>"}}'
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 contacts import --file contacts.vcf
{
"ok": true,
"data": {
"format": "csv",
"read": 1,
"added": 1,
"merged": 1,
"unchanged": 1,
"skipped": [
{
"at": 1796048940000,
"who": "text",
"reason": "The day’s sending limit is reached."
}
],
"skippedTotal": 12,
"photos": {
"added": 1,
contacts.export
Print your contacts as vCard or CSV.
POST/v1/contacts.export
Parameters
vcardorcsv.One of
vcardcsvDefault
vcard.Inline each photo in a vCard.
Default
true.
Returns
data is an object with:
One of
vcardcsvPhotos left out of the vCard to keep the file a sensible size.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.export({
format: "csv",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.export({"format": "csv"})
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.ContactsExportParams{
Format: mailset.ContactsExportParamsFormatCSV,
}
answer, err := client.Contacts.Export(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.contacts.export(format: 'csv')
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->export(['format' => 'csv']);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ContactExport;
import app.mailset.model.ContactsExportParams;
import app.mailset.model.ContactsExportParamsFormat;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ContactsExportParams.builder()
.format(ContactsExportParamsFormat.CSV)
.build();
ContactExport answer = mailset.contacts().export(params);
System.out.println(answer);
use mailset::types::{
ContactsExportParams, ContactsExportParamsFormat,
};
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.contacts()
.export(ContactsExportParams {
format: Some(ContactsExportParamsFormat::Csv),
..Default::default()
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/contacts.export \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"format":"csv"}}'
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 contacts export --format csv
{
"ok": true,
"data": {
"format": "vcard",
"filename": "text",
"contentType": "text",
"count": 12,
"photosOmitted": 1,
"text": "text"
}
}
contacts.others
People you’ve exchanged mail with and haven’t saved.
POST/v1/contacts.others
Parameters
How many people a page holds, 1 to 200.
Default
50. From 1 to 200.The
nextof the page before, for the page after it.Only people whose name or address has this in it.
At most 200 characters.
Returns
data is an object with:
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.others({
query: "example.com",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.others({"query": "example.com"})
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.ContactsOthersParams{
Query: mailset.String("example.com"),
}
answer, err := client.Contacts.Others(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.contacts.others(query: 'example.com')
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->others([
'query' => 'example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ContactsOthersParams;
import app.mailset.model.OtherContactPage;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ContactsOthersParams.builder()
.query("example.com")
.build();
OtherContactPage answer =
mailset.contacts().others(params);
System.out.println(answer);
use mailset::types::ContactsOthersParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.contacts()
.others(ContactsOthersParams {
query: Some("example.com".into()),
..Default::default()
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/contacts.others \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"query":"example.com"}}'
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 contacts others --query example.com
{
"ok": true,
"data": {
"people": [
{
"email": "moc.elpmaxe@olleh",
"name": "Acme API",
"count": 12,
"lastAt": 1796048940000
}
],
"next": "eyJhIjoxNzk2MDkyNDQyfQ",
"total": 12
}
}
contacts.forget
Take someone off your other contacts.
POST/v1/contacts.forget
Parameters
The person’s address.
Returns
data is an object with:
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.forget({
address: "moc.elpmaxe@airam",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.forget(
{"address": "moc.elpmaxe@airam"}
)
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.ContactsForgetParams{
Address: "moc.elpmaxe@airam",
}
answer, err := client.Contacts.Forget(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.contacts.forget(
address: 'moc.elpmaxe@airam'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->forget([
'address' => 'moc.elpmaxe@airam',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ContactsForgetParams;
import app.mailset.model.ContactsForgetResult;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ContactsForgetParams.builder()
.address("moc.elpmaxe@airam")
.build();
ContactsForgetResult answer =
mailset.contacts().forget(params);
System.out.println(answer);
use mailset::types::ContactsForgetParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.contacts()
.forget(ContactsForgetParams {
address: "moc.elpmaxe@airam".into(),
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/contacts.forget \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"address":"moc.elpmaxe@airam"}}'
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 contacts forget moc.elpmaxe@airam
{
"ok": true,
"data": {
"removed": true
}
}
contacts.photo.set
Set a contact’s photo from a PNG, JPEG or WebP file.
POST/v1/contacts.photo.set
Parameters
The contact’s id.
The photo file’s name.
At most 255 characters.
The file, base64.
The body may be up to 7 MB.
Returns
data is an object with:
The contact’s id.
A short-lived URL for the photo.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.photo.set({
id: "con_4e9a2c7f1b6d3058a3c7e1b9",
name: "maria.jpg",
data: "<the message as base64>",
});
console.log(answer);
<the message as base64> is a whole email, headers and body: Send your own MIME.
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.photo.set(
{
"id": "con_4e9a2c7f1b6d3058a3c7e1b9",
"name": "maria.jpg",
"data": "<the message as base64>",
}
)
print(answer)
<the message as base64> is a whole email, headers and body: Send your own MIME.
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.ContactsPhotoSetParams{
<the message as base64> is a whole email, headers and body: Send your own MIME.
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.contacts.photo.set(
id: 'con_4e9a2c7f1b6d3058a3c7e1b9',
name: 'maria.jpg',
data: '<the message as base64>'
)
p answer
<the message as base64> is a whole email, headers and body: Send your own MIME.
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->photo->set([
'id' => 'con_4e9a2c7f1b6d3058a3c7e1b9',
'name' => 'maria.jpg',
'data' => '<the message as base64>',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
<the message as base64> is a whole email, headers and body: Send your own MIME.
import app.mailset.Mailset;
import app.mailset.model.ContactsPhotoSetParams;
import app.mailset.model.ContactsPhotoSetResult;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ContactsPhotoSetParams.builder()
.id("con_4e9a2c7f1b6d3058a3c7e1b9")
.name("maria.jpg")
.data("<the message as base64>")
.build();
ContactsPhotoSetResult answer =
mailset.contacts().photo().set(params);
System.out.println(answer);
<the message as base64> is a whole email, headers and body: Send your own MIME.
use mailset::types::ContactsPhotoSetParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.contacts()
.photo()
.set(ContactsPhotoSetParams {
id: "con_4e9a2c7f1b6d3058a3c7e1b9".into(),
name: "maria.jpg".into(),
data: "<the message as base64>".into(),
})
.await?;
println!("{answer:?}");
<the message as base64> is a whole email, headers and body: Send your own MIME.
curl https://mailset.app/v1/contacts.photo.set \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"id":"con_4e9a2c7f1b6d3058a3c7e1b9","name":"maria.jpg","data":"<base64 of the file>"}}'
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 contacts photo set con_4e9a2c7f1b6d3058a3c7e1b9 --file maria.jpg
{
"ok": true,
"data": {
"id": "out_3f9a1c0e7b2d",
"picture": "text"
}
}
contacts.photo.remove
Remove a contact’s photo.
POST/v1/contacts.photo.remove
Parameters
The contact’s id.
Returns
data is an object with:
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.contacts.photo.remove({
id: "con_4e9a2c7f1b6d3058a3c7e1b9",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.contacts.photo.remove(
{"id": "con_4e9a2c7f1b6d3058a3c7e1b9"}
)
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.ContactsPhotoRemoveParams{
ID: "con_4e9a2c7f1b6d3058a3c7e1b9",
}
answer, err := client.Contacts.Photo.Remove(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.contacts.photo.remove(
id: 'con_4e9a2c7f1b6d3058a3c7e1b9'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->contacts->photo->remove([
'id' => 'con_4e9a2c7f1b6d3058a3c7e1b9',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ContactsPhotoRemoveParams;
import app.mailset.model.ContactsPhotoRemoveResult;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ContactsPhotoRemoveParams.builder()
.id("con_4e9a2c7f1b6d3058a3c7e1b9")
.build();
ContactsPhotoRemoveResult answer =
mailset.contacts().photo().remove(params);
System.out.println(answer);
use mailset::types::ContactsPhotoRemoveParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.contacts()
.photo()
.remove(ContactsPhotoRemoveParams {
id: "con_4e9a2c7f1b6d3058a3c7e1b9".into(),
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/contacts.photo.remove \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"id":"con_4e9a2c7f1b6d3058a3c7e1b9"}}'
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 contacts photo remove con_4e9a2c7f1b6d3058a3c7e1b9
{
"ok": true,
"data": {
"removed": true
}
}