Contacts

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
  1. The Contact object
  2. contacts.list
  3. contacts.search
  4. contacts.get
  5. contacts.add
  6. contacts.update
  7. contacts.remove
  8. contacts.duplicates
  9. contacts.merge
  10. contacts.import
  11. contacts.export
  12. contacts.others
  13. contacts.forget
  14. contacts.photo.set
  15. contacts.photo.remove

The Contact object

A person in your contacts, with every field you keep of them.

Attributes

  • idstring

    The contact’s id.

  • namestring

    The full name as shown.

  • firstNamestring
  • middleNamestring
  • lastNamestring
  • prefixstring
  • suffixstring
  • nicknamestring
  • companystring
  • titlestring
  • departmentstring
  • emailsarray of objects
    Show child attributesHide child attributes
    • valuestring

      The address, number, URL or text.

    • labelstring

      What it’s for: work, home. Empty when unlabelled.

  • phonesarray of objects
    Show child attributesHide child attributes
    • valuestring

      The address, number, URL or text.

    • labelstring

      What it’s for: work, home. Empty when unlabelled.

  • addressesarray of objects
    Show child attributesHide child attributes
    • valuestring

      The address, number, URL or text.

    • labelstring

      What it’s for: work, home. Empty when unlabelled.

  • websitesarray of objects
    Show child attributesHide child attributes
    • valuestring

      The address, number, URL or text.

    • labelstring

      What it’s for: work, home. Empty when unlabelled.

  • birthdaystring
  • notesstring
  • labelsarray of strings

    The labels on the contact, by name.

  • otherarray of objects
    Show child attributesHide child attributes
    • valuestring

      The address, number, URL or text.

    • labelstring

      What it’s for: work, home. Empty when unlabelled.

  • picturenullable string

    A short-lived URL for their photo. Null: none, so show initials.

  • createdAtnumber

    When it was saved, in ms since the epoch.

  • updatedAtnumber

    When it last changed, in ms since the epoch.

Answered by

contacts.getcontacts.addcontacts.update

The Contact object
{
  "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

API token

Parameters

  • limitintegeroptional

    How many contacts a page holds, 1 to 200.

    Default 50. From 1 to 200.

  • afterstringoptional

    The next of the page before, for the page after it.

  • labelstringoptional

    Only contacts with this label.

    At most 64 characters.

Returns

data is an object with:

  • contactsarray of objects
    Show child attributesHide child attributes
    • idstring
    • namestring
    • emailsarray of strings
    • phonesarray of strings
    • companystring
    • titlestring
    • labelsarray of strings
    • picturenullable string
  • nextnullable string

    Pass as after for the next page. Null at the end.

  • totalnumber
  • revisionnumber

    Rises with every change to the address book.

In the CLIErrors

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
Response
{
  "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

API token

Parameters

  • querystringrequired

    What to find, in a name, address, phone, company, note or label.

    At most 200 characters.

  • limitintegeroptional

    How many contacts a page holds, 1 to 200.

    Default 50. From 1 to 200.

  • afterstringoptional

    The next of the page before, for the page after it.

Returns

data is an object with:

  • contactsarray of objects
    Show child attributesHide child attributes
    • idstring
    • namestring
    • emailsarray of strings
    • phonesarray of strings
    • companystring
    • titlestring
    • labelsarray of strings
    • picturenullable string
  • nextnullable string

    Pass as after for the next page. Null at the end.

  • totalnumber
  • revisionnumber

    Rises with every change to the address book.

In the CLIErrors

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
Response
{
  "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

API token

Parameters

  • idstringrequired

    The contact’s id.

Returns

data is the Contact object.

In the CLIErrors

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
Response
{
  "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

API token

Parameters

  • namestringoptional

    The full name as shown. Left empty, it is put together from the parts.

    At most 200 characters.

  • firstNamestringoptional

    Their first name.

    At most 200 characters.

  • middleNamestringoptional

    Their middle name.

    At most 200 characters.

  • lastNamestringoptional

    Their last name.

    At most 200 characters.

  • prefixstringoptional

    What goes before the name: Dr.

    At most 200 characters.

  • suffixstringoptional

    What goes after it: Jr.

    At most 200 characters.

  • nicknamestringoptional

    What you call them.

    At most 200 characters.

  • companystringoptional

    Where they work.

    At most 200 characters.

  • titlestringoptional

    Their job title.

    At most 200 characters.

  • departmentstringoptional

    Their department.

    At most 200 characters.

  • emailsarray of strings or objectsoptional

    Addresses, the first is primary. Each is an address, or { value, label }. Up to 20.

    At most 20 items.

    Show child attributesHide child attributes
    • valuestringrequired

      The address, number, URL or text.

    • labelstringoptional

      What it’s for: work, home.

      At most 64 characters.

  • phonesarray of strings or objectsoptional

    Phone numbers, each a number or { value, label }. Up to 20.

    At most 20 items.

    Show child attributesHide child attributes
    • valuestringrequired

      The address, number, URL or text.

      At most 64 characters.

    • labelstringoptional

      What it’s for: work, home.

      At most 64 characters.

  • addressesarray of strings or objectsoptional

    Postal addresses, each as text or { value, label }. Up to 10.

    At most 10 items.

    Show child attributesHide child attributes
    • valuestringrequired

      The address, number, URL or text.

      At most 1,000 characters.

    • labelstringoptional

      What it’s for: work, home.

      At most 64 characters.

  • websitesarray of strings or objectsoptional

    Websites, each a URL or { value, label }. Up to 10.

    At most 10 items.

    Show child attributesHide child attributes
    • valuestringrequired

      The address, number, URL or text.

      At most 1,000 characters.

    • labelstringoptional

      What it’s for: work, home.

      At most 64 characters.

  • birthdaystringoptional

    Their birthday, as written: 1990-04-12.

    At most 32 characters.

  • notesstringoptional

    Your own notes about them.

    At most 20,000 characters.

  • labelsarray of stringsoptional

    The labels on the contact, by name. Up to 50.

    At most 50 items.

  • otherarray of strings or objectsoptional

    Anything else a contact came with: events, relations, custom fields.

    At most 50 items.

    Show child attributesHide child attributes
    • valuestringrequired

      The address, number, URL or text.

      At most 1,000 characters.

    • labelstringoptional

      What it’s for: work, home.

      At most 64 characters.

Returns

data is the Contact object.

In the CLIErrors

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"
Response
{
  "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

API token

Parameters

  • namestringoptional

    The full name as shown. Left empty, it is put together from the parts.

    At most 200 characters.

  • firstNamestringoptional

    Their first name.

    At most 200 characters.

  • middleNamestringoptional

    Their middle name.

    At most 200 characters.

  • lastNamestringoptional

    Their last name.

    At most 200 characters.

  • prefixstringoptional

    What goes before the name: Dr.

    At most 200 characters.

  • suffixstringoptional

    What goes after it: Jr.

    At most 200 characters.

  • nicknamestringoptional

    What you call them.

    At most 200 characters.

  • companystringoptional

    Where they work.

    At most 200 characters.

  • titlestringoptional

    Their job title.

    At most 200 characters.

  • departmentstringoptional

    Their department.

    At most 200 characters.

  • emailsarray of strings or objectsoptional

    Addresses, the first is primary. Each is an address, or { value, label }. Up to 20.

    At most 20 items.

    Show child attributesHide child attributes
    • valuestringrequired

      The address, number, URL or text.

    • labelstringoptional

      What it’s for: work, home.

      At most 64 characters.

  • phonesarray of strings or objectsoptional

    Phone numbers, each a number or { value, label }. Up to 20.

    At most 20 items.

    Show child attributesHide child attributes
    • valuestringrequired

      The address, number, URL or text.

      At most 64 characters.

    • labelstringoptional

      What it’s for: work, home.

      At most 64 characters.

  • addressesarray of strings or objectsoptional

    Postal addresses, each as text or { value, label }. Up to 10.

    At most 10 items.

    Show child attributesHide child attributes
    • valuestringrequired

      The address, number, URL or text.

      At most 1,000 characters.

    • labelstringoptional

      What it’s for: work, home.

      At most 64 characters.

  • websitesarray of strings or objectsoptional

    Websites, each a URL or { value, label }. Up to 10.

    At most 10 items.

    Show child attributesHide child attributes
    • valuestringrequired

      The address, number, URL or text.

      At most 1,000 characters.

    • labelstringoptional

      What it’s for: work, home.

      At most 64 characters.

  • birthdaystringoptional

    Their birthday, as written: 1990-04-12.

    At most 32 characters.

  • notesstringoptional

    Your own notes about them.

    At most 20,000 characters.

  • labelsarray of stringsoptional

    The labels on the contact, by name. Up to 50.

    At most 50 items.

  • otherarray of strings or objectsoptional

    Anything else a contact came with: events, relations, custom fields.

    At most 50 items.

    Show child attributesHide child attributes
    • valuestringrequired

      The address, number, URL or text.

      At most 1,000 characters.

    • labelstringoptional

      What it’s for: work, home.

      At most 64 characters.

  • idstringrequired

    The contact’s id.

Returns

data is the Contact object.

In the CLIErrors

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"
Response
{
  "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

API token

Parameters

  • idsarray of stringsrequired

    One contact’s id, or a list of up to 200.

    1 to 200 items.

Returns

data is an object with:

  • removednumber

    How many were deleted.

In the CLIErrors

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
Response
{
  "ok": true,
  "data": {
    "removed": 1
  }
}

contacts.duplicates

Find contacts that look like the same person.

POST/v1/contacts.duplicates

API token

Parameters

It takes no input: send an empty object.

Returns

data is a list of objects, each with:

  • reasonenum

    One ofemailphonename

  • contactsarray of objects
    Show child attributesHide child attributes
    • idstring
    • namestring
    • emailsarray of strings
    • phonesarray of strings
    • companystring
    • titlestring
    • labelsarray of strings
    • picturenullable string

In the CLIErrors

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
Response
{
  "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

API token

Parameters

  • idsarray of stringsoptional

    The contacts to merge, 2 to 50. The first is kept.

    2 to 50 items.

  • allbooleanoptional

    Merge every group contacts duplicates finds.

Returns

data is an object with:

  • removednumber

    Contacts folded into another and gone.

  • keptarray of strings

    Who was left standing.

In the CLIErrors

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
Response
{
  "ok": true,
  "data": {
    "removed": 1,
    "kept": [
      "text"
    ]
  }
}

contacts.import

Import a Google Contacts CSV or a vCard file.

POST/v1/contacts.import

API token

Parameters

  • namestringrequired

    The file’s name.

    At most 255 characters.

  • datastringrequired

    The file, base64.

The body may be up to 45 MB.

Returns

data is an object with:

  • formatenum

    One ofcsvvcard

  • readnumber

    Rows or cards found in the file.

  • addednumber
  • mergednumber

    Already saved: anything new in the file was added to them.

  • unchangednumber

    Already saved, with nothing new to add.

  • skippedarray of objects

    Rows or cards left out, and why. Up to 200 are listed; skippedTotal counts them all.

    Show child attributesHide child attributes
    • atnumber

      The row or card it was, counting from 1.

    • whostring

      What’s known of it, so you can find it in your file.

    • reasonstring
  • skippedTotalnumber
  • photosobject
    Show child attributesHide child attributes
    • addednumber

      Every photo kept, inline or fetched.

    • refusednumber

      Inline photos refused for their type or size.

    • remotenumber

      Links anywhere but Google’s photo hosts: Mailset doesn’t fetch them.

    • fetchednumber

      Links on Google’s photo hosts, fetched and kept. Counted in added too.

    • failednumber

      Links on Google’s photo hosts that gave no usable photo.

    • remainingnumber

      Links on Google’s photo hosts this import had no room or time for. Importing the file again fetches them.

  • ignoredarray of strings

    Columns or properties with data that Mailset has no field for.

In the CLIErrors

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
Response
{
  "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

API token

Parameters

  • formatenumoptional

    vcard or csv.

    One ofvcardcsv

    Default vcard.

  • photosbooleanoptional

    Inline each photo in a vCard.

    Default true.

Returns

data is an object with:

  • formatenum

    One ofvcardcsv

  • filenamestring
  • contentTypestring
  • countnumber
  • photosOmittednumber

    Photos left out of the vCard to keep the file a sensible size.

  • textstring

In the CLIErrors

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
Response
{
  "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

API token

Parameters

  • limitintegeroptional

    How many people a page holds, 1 to 200.

    Default 50. From 1 to 200.

  • afterstringoptional

    The next of the page before, for the page after it.

  • querystringoptional

    Only people whose name or address has this in it.

    At most 200 characters.

Returns

data is an object with:

  • peoplearray of objects
    Show child attributesHide child attributes
    • emailstring
    • namestring
    • countnumber

      How many times you’ve exchanged mail with them.

    • lastAtnumber
  • nextnullable string
  • totalnumber

In the CLIErrors

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
Response
{
  "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

API token

Parameters

  • addressstringrequired

    The person’s address.

Returns

data is an object with:

  • removedboolean

In the CLIErrors

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
Response
{
  "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

API token

Parameters

  • idstringrequired

    The contact’s id.

  • namestringrequired

    The photo file’s name.

    At most 255 characters.

  • datastringrequired

    The file, base64.

The body may be up to 7 MB.

Returns

data is an object with:

  • idstring

    The contact’s id.

  • picturestring

    A short-lived URL for the photo.

In the CLIErrors

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
Response
{
  "ok": true,
  "data": {
    "id": "out_3f9a1c0e7b2d",
    "picture": "text"
  }
}

contacts.photo.remove

Remove a contact’s photo.

POST/v1/contacts.photo.remove

API token

Parameters

  • idstringrequired

    The contact’s id.

Returns

data is an object with:

  • removedboolean

In the CLIErrors

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
Response
{
  "ok": true,
  "data": {
    "removed": true
  }
}