Skip to content
Start your 14-day trialNothing to pay during the trial, cancel any time

For directories API guide

Directory API guide

When a lab on My-Pepts asks to be listed on your directory, its store details reach you without anyone filling in a form. You choose how: we post each request to one endpoint of yours, or you read new requests from our API. Either way, you tell us when the store is listed, and the lab sees it on its dashboard.

Before you start

  1. Register your directory. Your account page shows your API secret (it starts with mpd_) straight away, so you can build while we review.
  2. Keep the secret on your server. It signs what we send you and is your key to our API. You can make a new one at any time.
  3. Labs see your directory once we have listed it. From then on a connected directory shows a one-click button; an unconnected one sends labs to your own form.

Option 1: we post to your endpoint

Give us one HTTPS address on your account page. We send every event there as a JSON POST, signed with your secret. Saving the address sends a ping event; answer it with any 2xx and you are connected.

POST https://your-directory.example/api/my-pepts
Content-Type: application/json
X-MyPepts-Event: listing.submitted
X-MyPepts-Timestamp: 1794477600
X-MyPepts-Signature: v1=5f2c...e91a

{
  "event": "listing.submitted",
  "api_version": "v1",
  "sent_at": "2026-11-12T10:00:00.000Z",
  "listing": {
    "id": "dls_7k2m9q4x1c8v5b3n6z0h",
    "store": {
      "name": "Acme Labs",
      "url": "https://acmelabs.com",
      "country": "US",
      "currency": "USD",
      "language": "en"
    },
    "visit_url": "https://my-pepts.com/go/dls_7k2m9q4x1c8v5b3n6z0h",
    "contact_email": "owner@acmelabs.com",
    "research_use_only": true,
    "platform": "My-Pepts",
    "submitted_at": "2026-11-12T10:00:00.000Z"
  }
}

Events

  • ping: a connection test, with no listing.
  • listing.submitted: a store asks to be listed.
  • listing.updated: the same store asks again, for example after changing its domain. The id is the one you already have.
  • listing.removed: the store wants its listing taken down.

Your answer

Answer within 8 seconds with a 2xx. The body decides what the lab sees. listed with the store's page on your directory, pending if you review first, or rejected with a reason the lab can act on. An empty 2xx counts as pending. Anything else counts as not delivered, and the lab can send it again.

HTTP/1.1 200 OK
Content-Type: application/json

{ "status": "listed", "url": "https://your-directory.example/vendors/acme-labs" }

Checking the signature

The signature is an HMAC-SHA256, in hex, of the timestamp, a period and the raw body, keyed with your secret. Refuse anything older than five minutes.

import { createHmac, timingSafeEqual } from "node:crypto";

// rawBody: the request body exactly as received, before any JSON parsing.
export function fromMyPepts(req, rawBody, secret) {
  const timestamp = req.headers["x-mypepts-timestamp"];
  const signature = req.headers["x-mypepts-signature"] ?? "";
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false; // older than 5 minutes
  const expected = "v1=" + createHmac("sha256", secret).update(timestamp + "." + rawBody).digest("hex");
  return expected.length === signature.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
}

Option 2: you read our API

No endpoint to host: read your requests on a schedule, hourly is plenty. Send your secret as a bearer token. A directory that has read its listings in the last 7 days counts as connected.

curl https://my-pepts.com/api/directories/v1/listings?status=pending \
  -H "Authorization: Bearer mpd_your_secret"

{
  "api_version": "v1",
  "listings": [
    {
      "id": "dls_7k2m9q4x1c8v5b3n6z0h",
      "store": { "name": "Acme Labs", "url": "https://acmelabs.com", "country": "US", "currency": "USD", "language": "en" },
      "visit_url": "https://my-pepts.com/go/dls_7k2m9q4x1c8v5b3n6z0h",
      "contact_email": "owner@acmelabs.com",
      "research_use_only": true,
      "platform": "My-Pepts",
      "submitted_at": "2026-11-12T10:00:00.000Z",
      "status": "pending",
      "url": null,
      "updated_at": "2026-11-12T10:00:00.000Z"
    }
  ]
}

status filters by pending, listed, rejected or removed, comma separated; leave it out for everything. GET https://my-pepts.com/api/directories/v1/ping checks your key.

Telling us your decision

Whichever option you use, post your decision when it is made later than your first answer. The lab's dashboard updates at once.

curl -X POST https://my-pepts.com/api/directories/v1/listings/dls_7k2m9q4x1c8v5b3n6z0h \
  -H "Authorization: Bearer mpd_your_secret" \
  -H "Content-Type: application/json" \
  -d '{ "status": "listed", "url": "https://your-directory.example/vendors/acme-labs" }'

What you can count on

  • Every My-Pepts store sells for research use only under its terms with us; research_use_only is always true.
  • store.url is the address shoppers use: the lab's own domain when it has one.
  • visit_url is the link to put behind the store's name or its "Visit store" button. It sends the visitor straight on to store.url and counts the visit, so the lab sees how many visitors you send it; a directory that sends visitors is one labs stay with. Show store.url as the address people read.
  • A listing id is stable for one store on your directory, so an event you have seen before is safe to apply again.
  • We send only what the storefront already shows, plus the contact email. No customer or order data, ever.
  • New fields may be added to the JSON; nothing is removed or renamed within v1.

Be featured

Join the referral program when you register and your account page gives you banners that carry your referral link. While one is on your site, your directory is featured: it leads the list every lab sees, and each lab that subscribes through it earns you a commission. How the program works

Questions while you build? Write to hello@my-pepts.com.