memir

Developers

API documentation

Send your website's contact form requests into Memir's CRM. One key, one HTTP request, no duplicates.

The Memir API connects your own systems to the CRM: a website form, your own software or a Zapier flow can add leads with no copy and paste and no duplicates, and read, update and delete them.

This page is for whoever builds the integration: the site's developer, the web agency, or someone wiring a Zapier, Make or n8n flow. A key and one HTTP request are all it takes.

Authentication

Every request carries a personal API key in the X-API-Key header.

  1. In Memir open Settings > API access and press New key.
  2. Name the key (for example "Website"), choose its access and when it expires: one year from today by default, or never.
  3. Copy the key right away. Memir shows it only once: if you lose it, revoke it and create a new one.

Worth knowing:

  • There are two kinds of access, one or both. Write (the default) adds, changes and deletes leads: POST, PATCH and DELETE. Read lists and reads them, with the pipeline summary: the GET calls. The website, the web agency or a Zap need only Write; software that keeps the CRM in step needs both. A write-only key can still change and delete leads, so keep it on a server you control. A key without the access an endpoint needs gets 403.
  • The key acts as you. The leads it creates are yours, as if you had entered them by hand. It sees and edits the same leads you see; deleting a lead also takes being an owner or an admin.
  • Use it only on a server. A key in a page's JavaScript is a published key: anyone who opens the site can read it. The form posts to your server, and your server calls Memir.
  • Revoking takes one click. The bin in API access disables it at once, for every service using it. An expired key stops working and cannot be extended: create another. Changing or resetting your password, turning on two-factor authentication, leaving the organization or deleting the account revokes all your keys.
  • You can have up to 20 keys. Use one per service, so you can revoke one without stopping the others.

Quick start

The base address is:

https://api.memir.it/api/v1

Add a lead with a JSON POST. Only name is required: the company's name (or the person's, when there is no company):

curl -X POST https://api.memir.it/api/v1/leads \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Officine Ferri Srl",
    "domain": "officineferri.it",
    "contacts": [
      { "name": "Giulia Ferri", "email": "giulia.ferri@officineferri.it" }
    ],
    "message": "I would like a quote for 500 stainless steel flanges.",
    "page_url": "https://www.example.it/contatti"
  }'

The answer is the lead, with its id:

HTTPMeaning
201Memir created a new lead
200The company or a person was already there: that lead was filled in

For other languages (JavaScript, Python and PHP), the ready-made sample sits next to each endpoint, further down.

What happens to the lead

Memir avoids duplicates. For each lead it looks, in this order, for:

  1. The company, by the domain field (a URL or a domain, https://www.officineferri.it/contatti counts as officineferri.it).
  2. A person, by a contact's email, among your leads' contacts.
  3. The same name, as long as website and city do not say otherwise (a blank says nothing). This is how a system that syncs the same company every night lands on the same lead.

It never matches by the email's domain: every @gmail.com sender would land on the same lead.

If it finds nothing it creates a new lead in the CRM, with the people in contacts and the message in the notes. Unless you name one, the lead's source is api.

Stage, owner and follow-ups are not set from here, even if you send them: the lead is yours and starts as every new lead does. So you can forward a form's body as it is. PATCH changes them.

If it finds one it creates nothing new and overwrites nothing:

  • the lead's blank fields are filled with the ones you send, notes included; those already written stay as they are (PATCH changes them);
  • the website (domain) is added only when the lead was found by an email on that domain, the company inbox (email) only when it is on the company's domain, the switchboard (phone) never: anyone can type any address;
  • new people become contacts of the lead if their email is on the company's domain;
  • a person who is not added (no email, an email off the domain, or a lead that already has 20 contacts) is written in the notes under "Non aggiunti ai contatti", with email and phone, once even if you send them again: nothing you send is lost;
  • if the company was only in a list and you send a message, it enters the CRM as qualified. Without a message it stays in the list, filled in.

With message the lead counts as someone who wrote to you: the message is added to the notes with its date, page and sender, its email sequence stops, as when someone replies, and its next action becomes "Ha scritto", so it stands out in the CRM. Notes already written are never cut: if there is not enough room the message is shortened, and with full notes it is not saved.

A company that sits only in a colleague's private list is left alone: the request becomes a separate lead, with no website (the website goes into the notes, since a domain belongs to one lead only). The next requests for the same company find that lead by name.

One tip: always send domain when you know it. Without it, two people of the same company with different emails become two leads.

Company fields

If your organization has company fields (in Memir, Settings > Service preferences > CRM > Company fields), fill them in with fields, in both POST and PATCH. Each field is named by its label, in any case, or by its id:

{
  "name": "Officine Ferri Srl",
  "domain": "officineferri.it",
  "fields": {
    "Esporta": true,
    "Certificazioni": ["ISO 9001", "IATF 16949"],
    "Fornitore attuale": "Rossi Srl"
  }
}
  • A choice takes an option's label (or its id), a multiple choice a list; a yes/no true or false; a date YYYY-MM-DD; a number a number.
  • With POST on a lead that was already there, only the fields still empty are written, as for the other data. A field a person emptied on purpose stays empty. With PATCH written ones change too, and null or "" empties a field. The other fields stay as they are.
  • Memir never writes over a value that came from the API: if it reads something else on the company's website, it leaves it as a proposal beside yours. Writing that field with PATCH answers the proposal, as a person would.
  • In the response the values are in fields, with options as ids.
  • A field that does not exist, a wrong option or a value of the wrong type answers 422 with code VALIDATION_ERROR and a message saying what it takes, for example "Plastica" is not an option of "Materiali". Use one of: "Inox", "Alluminio".. Then nothing is saved.

The other endpoints

Reads (GET) need a key with Read, PATCH and DELETE one with Write.

  • GET /leads lists the leads, with the CRM page's own filters. A filter with several values is repeated (?status=qualified&status=negotiation); page with skip and limit (at most 100), and total counts every match.
  • GET /leads/summary gives open deals, pipeline value and win rates.
  • GET, PATCH and DELETE /leads/{lead_id} read, update and delete one lead. PATCH changes only the fields you send.

To keep your own system in step: store the id Memir returns and use it for later updates.

Limits

  • 60 requests a minute per key. Plenty for a form filled in by people; a wall for a runaway loop.
  • 10 wrong keys a minute (100 an hour) from the same IP address, after which requests are refused for a while.
  • The message can be up to 5,000 characters; a PEC (Italian certified mail) address is not accepted as email.

Over a limit the answer is 429: wait a few seconds and try again.

Errors

Errors always have the same shape:

{
  "error": {
    "code": "AUTHENTICATION_ERROR",
    "message": "Invalid API key",
    "details": null
  }
}
HTTPWhenWhat to do
400The pipeline refuses the status change, or a lead to delete has documents linked to itThe message says why
401X-API-Key header missing, key wrong, revoked or expired, account disabledCheck the key in API access, create a new one if needed
403The key lacks the access the endpoint needs: Read for GET, Write for POST, PATCH and DELETECreate a key with that access
403The key's creator no longer belongs to the organization, or the organization is suspendedCreate the key with an active user
404No lead with that id in your organizationCheck the id
409With PATCH, another lead already has that domainCheck the domain
422A field is wrong: invalid email, a PEC, empty name, text too longThe body says which field and why
422A company field in fields does not exist, or an option or value does not fitThe message says what that field takes
429Too many requestsWait and try again

A 422 has FastAPI's standard shape: {"detail": [{"loc": [...], "msg": "...", "type": "..."}]}. A company field's has the shape of the other errors instead, with the field in details.field.

List leads

GET/api/v1/leads

The CRM's leads, filtered, searched and sorted as on the CRM page.

A filter that takes several values is repeated: ?status=qualified&status=negotiation. Page with skip and limit (at most 100); total counts every match.

Authorization

headerX-API-Keystring

Your personal key, from Settings > API access.

Parameters

  • queryqstringmax 120

    Free text

  • querystatusstring[]

    Pipeline status, or discarded:<no_reply|not_interested|do_not_contact|other>

  • queryindustrystring[]

    Sector, as written on the lead

  • querycitystring[]
  • querycountrystring[]

    ISO 3166-1 alpha-2 code

  • queryemployeesstring[]

    Size band, e.g. "11-50"

  • queryrevenue_verdictstring[]

    Verified revenue status. Use 'none' for unchecked leads.

  • querysourcestring[]

    Where the lead came from

  • queryowner_user_idstring[]

    Assigned colleague's user id

  • querylast_contactstring[]

    When it was last written to

  • queryactivitystring[]

    Mail state: a reply, a draft waiting, a failed send

  • querysegmentstring

    Whose move it is

  • queryreachstring[]

    How it can be reached

  • queryfieldstring[]

    A company field's value as "<field_id>:<option_id|true|false|__none__>"

  • querycreated_fromstring<date>

    Created on or after this day

  • querycreated_tostring<date>

    Created on or before this day

  • queryperiod_fromstring<date>

    First day of a period: every lead still in play, plus the won, lost and discarded ones that moved in it. Goes with period_to

  • queryperiod_tostring<date>

    Last day of the period, included

  • querymineboolean

    Only leads assigned to me

  • querylist_idstring<uuid>

    One contact list's members, in the CRM or not

  • querysearchesboolean

    What my customer searches found: members of my lists an automation fills

  • querysortstring

    Column to sort by

  • queryorderstring
  • queryopen_deals_firstboolean

    Leads holding an open quote first, then the sort

  • queryskipinteger

    Items to skip

  • querylimitinteger

    Max items to return

Responses

curl -X GET "https://api.memir.it/api/v1/leads" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "items": [
    {
      "id": "3f6c1b8e-2a4d-4f7e-9c1a-5b8d2e7f0a91",
      "organization_id": "8a2e4c6d-1b3f-4a5c-9e7d-0f1a2b3c4d5e",
      "name": "Officine Ferri Srl",
      "domain": "officineferri.it",
      "industry": "Metalworking",
      "city": "Bergamo",
      "country": "IT",
      "status": "qualified",
      "owner_user_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
      "owner": "Giulia Ferri",
      "source": "api",
      "next_action": "Send the quote for 500 flanges",
      "open_deals": 1,
      "pipeline_value": "12500.00",
      "contacts": [
        {
          "id": "5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b",
          "name": "Luca Bianchi",
          "role": "Purchasing manager",
          "email": "luca.bianchi@officineferri.it"
        }
      ],
      "created_at": "2026-10-07T09:30:00+02:00"
    }
  ],
  "total": 1
}

Add a lead

POST/api/v1/leads

Add a company to the CRM, with its people in contacts. Lands on the lead already there.

Memir looks for the company by domain, then for a person by a contact's email, then for the same name when website and city do not differ. Not found: a new lead, assigned to the key's owner, and the answer is 201. Found: blank fields are filled in, new people with an address on the company's domain are added (the others are written in the notes), and the answer is 200. Nothing already written is overwritten.

fields sets the organization's company fields, each named by its label (any case) or id: {"Esporta": true, "Certificazioni": ["ISO 9001", "IATF 16949"]}. A choice takes an option's label or id, a yes/no true or false, a date YYYY-MM-DD. On a lead already there only the fields still empty are written, and one a person emptied stays empty. A field, option or value that does not fit answers 422 VALIDATION_ERROR, naming it and what it takes, and nothing is saved.

Stage, owner and follow-ups are not taken here, so a form's body can be forwarded as it is: set them with PATCH. Needs a key with write access.

With message, the lead is marked as having written in: the message is appended to its notes, its follow-ups stop, its next action becomes "Ha scritto", and a lead that was only in a list moves into the CRM.

Call it from your server, never from the browser: the key would be public.

Authorization

headerX-API-Keystring

Your personal key, from Settings > API access.

Request bodyapplication/json

  • name*stringmax 255
  • domainstringmax 255
  • industrystringmax 128
  • employeesstringmax 32

    Band, e.g. "11-50"

  • citystringmax 128
  • countrystringmax 2

    ISO 3166-1 alpha-2

  • linkedin_urlstringmax 512
  • atecostringmax 16

    ATECO 2025 code

  • vat_numberstringmax 32

    P.IVA / VAT id

  • addressstringmax 255
  • postal_codestringmax 16
  • emailstringmax 255

    Generic company inbox, e.g. info@

  • phonestringmax 64

    Company switchboard

  • sourcestringmax 64

    Where it came from

  • notesstringmax 5000
  • contactsobject[]

    The people: objects with `name` and optionally role, email, phone

  • messagestringmax 5000

    What the person wrote. Appended, dated, to the notes, and the lead is marked as having written in: its follow-ups stop.

  • page_urlstringmax 512

    The page the request came from

  • fieldsobject

    Company fields by label or id, e.g. `{"Esporta": true, "Certificazioni": ["ISO 9001"]}`. Options by label or id, a date as YYYY-MM-DD. Written only where the lead has no value yet

Responses

curl -X POST "https://api.memir.it/api/v1/leads" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "city": "Bergamo",
    "contacts": [
      {
        "email": "giulia.ferri@officineferri.it",
        "name": "Giulia Ferri",
        "phone": "+39 035 123 4567",
        "role": "Responsabile acquisti"
      }
    ],
    "domain": "officineferri.it",
    "message": "Buongiorno, vorrei un preventivo per 500 flange in acciaio inox.",
    "name": "Officine Ferri Srl",
    "page_url": "https://www.example.it/contatti"
  }'
{
  "id": "3f6c1b8e-2a4d-4f7e-9c1a-5b8d2e7f0a91",
  "organization_id": "8a2e4c6d-1b3f-4a5c-9e7d-0f1a2b3c4d5e",
  "name": "Officine Ferri Srl",
  "domain": "officineferri.it",
  "industry": "Metalworking",
  "city": "Bergamo",
  "country": "IT",
  "status": "qualified",
  "owner_user_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "owner": "Giulia Ferri",
  "source": "api",
  "next_action": "Send the quote for 500 flanges",
  "open_deals": 1,
  "pipeline_value": "12500.00",
  "contacts": [
    {
      "id": "5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b",
      "name": "Luca Bianchi",
      "role": "Purchasing manager",
      "email": "luca.bianchi@officineferri.it"
    }
  ],
  "created_at": "2026-10-07T09:30:00+02:00"
}

Pipeline summary

GET/api/v1/leads/summary

Open deals, pipeline value and win rates over the leads the filters match.

Takes the same filters as the list; list_id, skip, limit and the sort are ignored.

Authorization

headerX-API-Keystring

Your personal key, from Settings > API access.

Parameters

  • queryqstringmax 120

    Free text

  • querystatusstring[]

    Pipeline status, or discarded:<no_reply|not_interested|do_not_contact|other>

  • queryindustrystring[]

    Sector, as written on the lead

  • querycitystring[]
  • querycountrystring[]

    ISO 3166-1 alpha-2 code

  • queryemployeesstring[]

    Size band, e.g. "11-50"

  • queryrevenue_verdictstring[]

    Verified revenue status. Use 'none' for unchecked leads.

  • querysourcestring[]

    Where the lead came from

  • queryowner_user_idstring[]

    Assigned colleague's user id

  • querylast_contactstring[]

    When it was last written to

  • queryactivitystring[]

    Mail state: a reply, a draft waiting, a failed send

  • querysegmentstring

    Whose move it is

  • queryreachstring[]

    How it can be reached

  • queryfieldstring[]

    A company field's value as "<field_id>:<option_id|true|false|__none__>"

  • querycreated_fromstring<date>

    Created on or after this day

  • querycreated_tostring<date>

    Created on or before this day

  • queryperiod_fromstring<date>

    First day of a period: every lead still in play, plus the won, lost and discarded ones that moved in it. Goes with period_to

  • queryperiod_tostring<date>

    Last day of the period, included

  • querymineboolean

    Only leads assigned to me

  • querylist_idstring<uuid>

    One contact list's members, in the CRM or not

  • querysearchesboolean

    What my customer searches found: members of my lists an automation fills

  • querysortstring

    Column to sort by

  • queryorderstring
  • queryopen_deals_firstboolean

    Leads holding an open quote first, then the sort

  • queryskipinteger

    Items to skip

  • querylimitinteger

    Max items to return

Responses

curl -X GET "https://api.memir.it/api/v1/leads/summary" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "open_deals": 4,
  "pipeline_value": "48200.00",
  "weighted_value": "19280.00",
  "stages": {
    "contacted": 12,
    "qualified": 6,
    "negotiation": 4,
    "customer": 9
  },
  "win_rates": {
    "qualified": 0.25,
    "negotiation": 0.4
  }
}

Get a lead

GET/api/v1/leads/{lead_id}

One lead of your organization, with its contacts.

Authorization

headerX-API-Keystring

Your personal key, from Settings > API access.

Parameters

  • pathlead_id*string<uuid>

Responses

curl -X GET "https://api.memir.it/api/v1/leads/{lead_id}" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "id": "3f6c1b8e-2a4d-4f7e-9c1a-5b8d2e7f0a91",
  "organization_id": "8a2e4c6d-1b3f-4a5c-9e7d-0f1a2b3c4d5e",
  "name": "Officine Ferri Srl",
  "domain": "officineferri.it",
  "industry": "Metalworking",
  "city": "Bergamo",
  "country": "IT",
  "status": "qualified",
  "owner_user_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "owner": "Giulia Ferri",
  "source": "api",
  "next_action": "Send the quote for 500 flanges",
  "open_deals": 1,
  "pipeline_value": "12500.00",
  "contacts": [
    {
      "id": "5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b",
      "name": "Luca Bianchi",
      "role": "Purchasing manager",
      "email": "luca.bianchi@officineferri.it"
    }
  ],
  "created_at": "2026-10-07T09:30:00+02:00"
}

Update a lead

PATCH/api/v1/leads/{lead_id}

Change only the fields you send; the others stay as they are.

contacts, when sent, replaces the whole list of people. fields changes only the company fields it names, as in POST, over any value; null or "" empties one. Writing a field answers a proposal Memir left on it: the same value accepts it, another dismisses it.

Authorization

headerX-API-Keystring

Your personal key, from Settings > API access.

Parameters

  • pathlead_id*string<uuid>

Request bodyapplication/json

  • namestringmax 255
  • domainstringmax 255
  • industrystringmax 128
  • employeesstringmax 32
  • citystringmax 128
  • countrystringmax 2
  • linkedin_urlstringmax 512
  • atecostringmax 16
  • ateco_matchboolean
  • vat_numberstringmax 32
  • addressstringmax 255
  • postal_codestringmax 16
  • emailstringmax 255
  • phonestringmax 64
  • statusstring
  • sourcestringmax 64
  • notesstringmax 5000
  • contactsobject[]
  • next_actionstringmax 255

    What to do next with this company, as the CRM shows it

  • next_action_atstring<date-time>

    On a lead already contacted, a future date holds Memir's next email back until then

  • next_action_kindstring

    Who acts: `email` is Memir's move, `call`, `meeting` and `task` a person's

  • lost_reasonstring

    Why the deal is off; only with status `lost`, and optional there

  • lost_reason_textstringmax 500

    What happened: required with lost_reason `other`, and only there

  • fieldsobject

    Company fields by label or id, e.g. `{"Esporta": true, "Certificazioni": ["ISO 9001"]}`. Only the fields named change; null or "" empties one

Responses

curl -X PATCH "https://api.memir.it/api/v1/leads/{lead_id}" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "notes": "Quote sent on 7 October.",
    "status": "negotiation"
  }'
{
  "id": "3f6c1b8e-2a4d-4f7e-9c1a-5b8d2e7f0a91",
  "organization_id": "8a2e4c6d-1b3f-4a5c-9e7d-0f1a2b3c4d5e",
  "name": "Officine Ferri Srl",
  "domain": "officineferri.it",
  "industry": "Metalworking",
  "city": "Bergamo",
  "country": "IT",
  "status": "qualified",
  "owner_user_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "owner": "Giulia Ferri",
  "source": "api",
  "next_action": "Send the quote for 500 flanges",
  "open_deals": 1,
  "pipeline_value": "12500.00",
  "contacts": [
    {
      "id": "5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b",
      "name": "Luca Bianchi",
      "role": "Purchasing manager",
      "email": "luca.bianchi@officineferri.it"
    }
  ],
  "created_at": "2026-10-07T09:30:00+02:00"
}

Delete a lead

DELETE/api/v1/leads/{lead_id}

Delete a lead and its contacts. Only a key with write access, of an owner or admin, can.

Deleting twice is not an error: a lead already gone answers 204 as well.

Authorization

headerX-API-Keystring

Your personal key, from Settings > API access.

Parameters

  • pathlead_id*string<uuid>

Responses

curl -X DELETE "https://api.memir.it/api/v1/leads/{lead_id}" \
  -H "X-API-Key: YOUR_API_KEY"

No example body.