{
  "openapi": "3.1.0",
  "info": {
    "title": "AutoSend API",
    "description": "AutoSend REST API for managing contacts and sending emails",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.autosend.com/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/contacts": {
      "post": {
        "summary": "Create Contact",
        "description": "Creates a new contact in your AutoSend project."
      }
    },
    "/contacts/email": {
      "post": {
        "summary": "Upsert Contact",
        "description": "Creates a new contact or updates an existing contact if the email already exists."
      }
    },
    "/contacts/{id}": {
      "get": {
        "summary": "Get Contact by ID",
        "description": "Retrieves a single contact by its unique identifier."
      },
      "delete": {
        "summary": "Delete Contact by Id",
        "description": "Deletes a contact by its id."
      }
    },
    "/contacts/search/emails": {
      "post": {
        "summary": "Search Contacts by Emails",
        "description": "Searches for multiple contacts by their email addresses in a single request. Returns all matching contacts found in your project."
      }
    },
    "/contacts/email/duplicate": {
      "post": {
        "summary": "Duplicate Contact",
        "description": "Creates a duplicate of an existing contact with a new email address. Copies all data from the source contact including custom fields, tags, and other attributes."
      }
    },
    "/contacts/email/{email}/custom-fields": {
      "patch": {
        "summary": "Update Custom Fields",
        "description": "Updates or adds custom fields for a contact identified by email address. Custom fields are merged - new fields are added, existing fields are updated, and fields not mentioned remain unchanged."
      }
    },
    "/contacts/email/userId/{userId}": {
      "delete": {
        "summary": "Delete Contact by User ID",
        "description": "Permanently deletes a contact identified by the userId field (your application's user identifier)."
      }
    },
    "/contacts/bulk-update": {
      "post": {
        "summary": "Bulk Update Contacts",
        "description": "Updates or creates multiple contacts in a single API request. Each contact is either created (if it doesn't exist) or updated (if it does) based on the email address. Maximum limit: 100 contacts per request."
      }
    },
    "/contacts/remove": {
      "post": {
        "summary": "Remove Contacts by Emails",
        "description": "Removes one or more contacts by their email addresses. Returns the IDs of the contacts that were successfully removed."
      }
    },
    "/contacts/{id}/unsubscribe-groups": {
      "get": {
        "summary": "Get Contact's Unsubscribe Groups",
        "description": "Returns an array of unsubscribe group"
      }
    }
  }
}
