Benchmark Email API

The current Benchmark Email REST API on the benchmarkemail.io platform. Manages contacts, contact structures and custom fields, lists, email campaigns, email templates, sending domains and performance reports. Authenticated with a scoped X-API-Key and served from a per-account regional base URL. Campaign scheduling and sending, and sending-domain verification, are deliberately web-only.

Documentation

Specifications

Other Resources

OpenAPI Specification

benchmark-email-api-openapi.json Raw ↑
{
  "components": {
    "securitySchemes": {
      "apiKeyAuth": {
        "description": "API key authentication",
        "in": "header",
        "name": "X-API-Key",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "description": "Public REST API for Benchmark Email.\n\nAuthenticate every request by including your API key in the `X-API-Key` header.\nEach key is issued with one or more scopes that control which endpoints it may call.\n\nRate limits: 60 requests per minute per account.\nMonthly quota: determined by your subscription plan.",
    "title": "Benchmark Email API",
    "version": "1.0.0"
  },
  "openapi": "3.0.0",
  "paths": {
    "/api/contact": {
      "get": {
        "operationId": "get_api_contact",
        "responses": {
          "200": {
            "description": "Successful"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Get all contacts",
        "tags": [
          "contact"
        ],
        "x-api-key-scope": "contacts:read"
      },
      "post": {
        "operationId": "post_api_contact",
        "requestBody": {
          "content": {
            "application/json": {}
          }
        },
        "responses": {
          "200": {
            "description": "Successfully created"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Create a new contact",
        "tags": [
          "contact"
        ],
        "x-api-key-scope": "contacts:write"
      }
    },
    "/api/contact-structure": {
      "get": {
        "operationId": "get_api_contact_structure",
        "responses": {
          "200": {
            "description": "Successful"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Get all contact structures",
        "tags": [
          "contact-structure"
        ],
        "x-api-key-scope": "contacts:read"
      },
      "post": {
        "operationId": "post_api_contact_structure",
        "requestBody": {
          "content": {
            "application/json": {}
          }
        },
        "responses": {
          "200": {
            "description": "Successfully created"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Create a new contact structure",
        "tags": [
          "contact-structure"
        ],
        "x-api-key-scope": "contacts:write"
      }
    },
    "/api/contact-structure/{contactStructureId}": {
      "get": {
        "operationId": "get_api_contact_structure_by_contactStructureId",
        "parameters": [
          {
            "in": "path",
            "name": "contactStructureId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Get a contact structure by id",
        "tags": [
          "contact-structure"
        ],
        "x-api-key-scope": "contacts:read"
      },
      "put": {
        "operationId": "put_api_contact_structure_by_contactStructureId",
        "parameters": [
          {
            "in": "path",
            "name": "contactStructureId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {}
          }
        },
        "responses": {
          "200": {
            "description": "Successfully updated"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "errors": {
                      "description": "List of application errors",
                      "items": {
                        "properties": {
                          "debug": {
                            "properties": {
                              "affectedForms": {
                                "description": "Forms that reference the contact field(s) being removed",
                                "items": {
                                  "properties": {
                                    "_id": {
                                      "description": "Form ID",
                                      "type": "string"
                                    },
                                    "name": {
                                      "description": "Form name",
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "_id",
                                    "name"
                                  ],
                                  "type": "object"
                                },
                                "type": "array"
                              }
                            },
                            "required": [
                              "affectedForms"
                            ],
                            "type": "object"
                          },
                          "errorType": {
                            "description": "Error code (e.g. ContactFieldInUseError, ValidationError)",
                            "type": "string"
                          },
                          "field": {
                            "description": "Field path when applicable",
                            "type": "string"
                          },
                          "fieldId": {
                            "description": "Field identifier when applicable",
                            "type": "string"
                          },
                          "message": {
                            "description": "Human-readable error message",
                            "type": "string"
                          }
                        },
                        "required": [
                          "message",
                          "errorType",
                          "debug"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "errors"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Contact field(s) cannot be removed because they are used by one or more forms (ContactFieldInUseError). Response body includes errors[].debug.affectedForms (array of { _id, name }) for UI display. Update or unpublish the affected forms first."
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Update a contact structure by id",
        "tags": [
          "contact-structure"
        ],
        "x-api-key-scope": "contacts:write"
      }
    },
    "/api/contact-structure/{contactStructureId}/lists": {
      "delete": {
        "operationId": "delete_api_contact_structure_by_contactStructureId_lists",
        "parameters": [
          {
            "in": "path",
            "name": "contactStructureId",
            "required": true,
            "schema": {
              "format": "mongo-id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {}
          }
        },
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "400": {
            "description": "Invalid request"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Delete multiple lists",
        "tags": [
          "lists"
        ],
        "x-api-key-scope": "contacts:write"
      },
      "get": {
        "operationId": "get_api_contact_structure_by_contactStructureId_lists",
        "parameters": [
          {
            "in": "path",
            "name": "contactStructureId",
            "required": true,
            "schema": {
              "format": "mongo-id",
              "type": "string"
            }
          },
          {
            "description": "page number",
            "in": "query",
            "name": "page",
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "page size",
            "in": "query",
            "name": "size",
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Sorting parameter with the format 'field:direction'. Supported fields: name, createdAt, updatedAt.",
            "examples": {
              "ascSort": {
                "summary": "ascending sort by name",
                "value": "name:asc"
              },
              "descSort": {
                "summary": "descending sort by createdAt",
                "value": "createdAt:desc"
              }
            },
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "pattern": "^[a-zA-Z0-9_]+:(asc|desc)$",
              "type": "string"
            }
          },
          {
            "description": "A string used to filter the search results. The maximum length is 50 characters.",
            "in": "query",
            "name": "criteria",
            "schema": {
              "maxLength": 50,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "properties": {
                      "__v": {
                        "type": "number"
                      },
                      "_id": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "totalCampaigns": {
                        "type": "number"
                      },
                      "totalContacts": {
                        "type": "number"
                      },
                      "type": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Successful"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Get paginated lists",
        "tags": [
          "lists"
        ],
        "x-api-key-scope": "contacts:read"
      },
      "post": {
        "operationId": "post_api_contact_structure_by_contactStructureId_lists",
        "parameters": [
          {
            "in": "path",
            "name": "contactStructureId",
            "required": true,
            "schema": {
              "format": "mongo-id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {}
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "__v": {
                      "type": "number"
                    },
                    "_id": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Successfully created"
          },
          "400": {
            "description": "Invalid request"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Create a new list",
        "tags": [
          "lists"
        ],
        "x-api-key-scope": "contacts:write"
      }
    },
    "/api/contact-structure/{contactStructureId}/lists/all": {
      "get": {
        "operationId": "get_api_contact_structure_by_contactStructureId_lists_all",
        "parameters": [
          {
            "in": "path",
            "name": "contactStructureId",
            "required": true,
            "schema": {
              "format": "mongo-id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Successful"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Get all lists",
        "tags": [
          "lists"
        ],
        "x-api-key-scope": "contacts:read"
      }
    },
    "/api/contact-structure/{contactStructureId}/lists/merge": {
      "post": {
        "operationId": "post_api_contact_structure_by_contactStructureId_lists_merge",
        "parameters": [
          {
            "in": "path",
            "name": "contactStructureId",
            "required": true,
            "schema": {
              "format": "mongo-id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {}
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "__v": {
                      "type": "number"
                    },
                    "_id": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Successfully merged lists"
          },
          "400": {
            "description": "Invalid request"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Merge lists into a new list.",
        "tags": [
          "lists"
        ],
        "x-api-key-scope": "contacts:write"
      }
    },
    "/api/contact-structure/{contactStructureId}/lists/{listId}": {
      "delete": {
        "operationId": "delete_api_contact_structure_by_contactStructureId_lists_by_listId",
        "parameters": [
          {
            "in": "path",
            "name": "contactStructureId",
            "required": true,
            "schema": {
              "format": "mongo-id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "listId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "400": {
            "description": "Invalid request"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Delete a list by id",
        "tags": [
          "lists"
        ],
        "x-api-key-scope": "contacts:write"
      },
      "get": {
        "operationId": "get_api_contact_structure_by_contactStructureId_lists_by_listId",
        "parameters": [
          {
            "in": "path",
            "name": "contactStructureId",
            "required": true,
            "schema": {
              "format": "mongo-id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "listId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "__v": {
                      "type": "number"
                    },
                    "_id": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Successful"
          },
          "400": {
            "description": "Invalid request"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Get a list by id",
        "tags": [
          "lists"
        ],
        "x-api-key-scope": "contacts:read"
      },
      "patch": {
        "operationId": "patch_api_contact_structure_by_contactStructureId_lists_by_listId",
        "parameters": [
          {
            "in": "path",
            "name": "contactStructureId",
            "required": true,
            "schema": {
              "format": "mongo-id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "listId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {}
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "__v": {
                      "type": "number"
                    },
                    "_id": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Successfully updated"
          },
          "400": {
            "description": "Invalid request"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Update a list by id",
        "tags": [
          "lists"
        ],
        "x-api-key-scope": "contacts:write"
      }
    },
    "/api/contact-structure/{contactStructureId}/lists/{listId}/duplicate": {
      "post": {
        "operationId": "post_api_contact_structure_by_contactStructureId_lists_by_listId_duplicate",
        "parameters": [
          {
            "in": "path",
            "name": "contactStructureId",
            "required": true,
            "schema": {
              "format": "mongo-id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "listId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {}
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "__v": {
                      "type": "number"
                    },
                    "_id": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Successfully duplicated"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not found"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Duplicate a list",
        "tags": [
          "lists"
        ],
        "x-api-key-scope": "contacts:write"
      }
    },
    "/api/contact/events": {
      "get": {
        "description": "Get all contact events for the account",
        "operationId": "get_api_contact_events",
        "parameters": [
          {
            "description": "Filter events by type",
            "example": [
              "contact-created",
              "contact-updated"
            ],
            "explode": false,
            "in": "query",
            "name": "types",
            "schema": {
              "items": {
                "enum": [
                  "contact-created",
                  "contact-updated",
                  "contact-update-failed",
                  "contact-unsubscribed",
                  "contact-reactivated",
                  "email-sent",
                  "email-bounced",
                  "email-delivered",
                  "email-delayed",
                  "email-rejected",
                  "email-complaint",
                  "email-opened",
                  "email-clicked",
                  "email-skipped"
                ],
                "type": "string"
              },
              "type": "array"
            }
          },
          {
            "description": "Filter events from the last N days (1-90). Defaults to 30 when omitted",
            "example": 30,
            "in": "query",
            "name": "pastDays",
            "required": false,
            "schema": {
              "default": 30,
              "maximum": 90,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "page number",
            "in": "query",
            "name": "page",
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "page size",
            "in": "query",
            "name": "size",
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "records": {
                      "items": {
                        "properties": {
                          "contactId": {
                            "type": "string"
                          },
                          "emailBounceDiagCode": {
                            "type": "string"
                          },
                          "emailBounceSubType": {
                            "type": "string"
                          },
                          "emailBounceType": {
                            "type": "string"
                          },
                          "emailCampaignId": {
                            "type": "string"
                          },
                          "emailCampaignName": {
                            "type": "string"
                          },
                          "emailComplaintFeedbackType": {
                            "type": "string"
                          },
                          "emailDelayType": {
                            "type": "string"
                          },
                          "emailLinkId": {
                            "type": "string"
                          },
                          "emailRejectReason": {
                            "type": "string"
                          },
                          "emailSender": {
                            "type": "string"
                          },
                          "emailSenderName": {
                            "type": "string"
                          },
                          "emailSmtpResponse": {
                            "type": "string"
                          },
                          "emailSubject": {
                            "type": "string"
                          },
                          "emailTargetUrl": {
                            "type": "string"
                          },
                          "emailTo": {
                            "type": "string"
                          },
                          "importId": {
                            "type": "string"
                          },
                          "importOriginalFileName": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "timestamp": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "triggeredBy": {
                            "description": "Present on contact-created/contact-updated events when a triggering user is recorded. The type and userId fields come from the event index.",
                            "properties": {
                              "type": {
                                "description": "The type of actor that triggered the event (e.g. 'user', 'admin')",
                                "type": "string"
                              },
                              "userId": {
                                "description": "The ID of the user who triggered the event",
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "total": {
                      "type": "integer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Contact events for the account"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Get account contact events",
        "tags": [
          "contact"
        ],
        "x-api-key-scope": "contacts:read"
      }
    },
    "/api/contact/export": {
      "post": {
        "operationId": "post_api_contact_export",
        "requestBody": {
          "content": {
            "application/json": {}
          }
        },
        "responses": {
          "200": {
            "content": {
              "text/csv": {}
            },
            "description": "Successful"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "summary": "Export contacts",
        "tags": [
          "contact"
        ],
        "x-api-key-scope": "contacts:read"
      }
    },
    "/api/contact/search": {
      "post": {
        "operationId": "post_api_contact_search",
        "requestBody": {
          "content": {
            "application/json": {}
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "contacts": {
                      "items": {
                        "properties": {
                          "_id": {
                            "description": "Id of the contact",
                            "type": "string"
                          },
                          "contactStructureId": {
                            "description": "Id of the contact structure",
                            "type": "string"
                          },
                          "createdAt": {
                            "description": "Date of creation",
                            "type": "string"
                          },
                          "fields": {
                            "items": {
                              "properties": {
                                "_id": {
                                  "description": "Id of the field",
                                  "type": "string"
                                },
                                "value": {
                                  "description": "Value of the field",
                                  "type": "string"
                                }
                              },
                              "type": "object"
                            },
                            "type": "array"
                          },
                          "key": {
                            "description": "Primary key of the contact",
                            "type": "string"
                          },
                          "tags": {
                            "items": {
                              "properties": {
                                "_id": {
                                  "description": "Id of the tag",
                                  "type": "string"
                                }
                              },
                              "type": "object"
                            },
                            "type": "array"
                          },
                          "updatedAt": {
                 

# --- truncated at 32 KB (177 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/benchmark-email/refs/heads/main/openapi/benchmark-email-api-openapi.json