{
  "openapi": "3.1.0",
  "info": {
    "title": "CoPlaid Messaging API",
    "version": "1.0.0",
    "summary": "Public endpoints for CoPlaid Messaging.",
    "description": "Public REST endpoints for CoPlaid Messaging. Keys are issued to partner accounts by CoPlaid administrators \u2014 there is no self-service key generation. Request access at admin@coplaid.ai. Full request and response schemas are published in the partner dashboard at https://core.coplaid.ai.\n\nAuthentication: send your key in the X-API-Key header. Keys are valid for 365 days and rate limited to 100 requests per hour per key.",
    "contact": {
      "name": "CoPlaid",
      "email": "admin@coplaid.ai",
      "url": "https://msg.coplaid.ai/developers"
    }
  },
  "servers": [
    {
      "url": "https://api.coplaid.ai",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Developer resources",
    "url": "https://msg.coplaid.ai/developers"
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Partner API key, issued by CoPlaid administrators."
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/partner/onboard-customer": {
      "post": {
        "operationId": "post_partner_onboard_customer",
        "summary": "Onboard a customer",
        "description": "Create a customer account under your partner account, including its messaging campaign setup. Partner accounts only.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Request accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The key is not permitted to perform this action."
          },
          "429": {
            "description": "Rate limit exceeded (100 requests per hour per key)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "See the full request schema in the partner dashboard at core.coplaid.ai."
              }
            }
          }
        }
      }
    },
    "/notify/": {
      "post": {
        "operationId": "post_notify",
        "summary": "Send a notification",
        "description": "Send a message to one or more recipients.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Request accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The key is not permitted to perform this action."
          },
          "429": {
            "description": "Rate limit exceeded (100 requests per hour per key)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "See the full request schema in the partner dashboard at core.coplaid.ai."
              }
            }
          }
        }
      }
    },
    "/notify/{msg_code}": {
      "post": {
        "operationId": "post_notify_msg_code",
        "summary": "Send a templated notification",
        "description": "Send a message using a stored template, identified by its message code.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Request accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The key is not permitted to perform this action."
          },
          "429": {
            "description": "Rate limit exceeded (100 requests per hour per key)."
          }
        },
        "parameters": [
          {
            "name": "msg_code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The msg code."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "See the full request schema in the partner dashboard at core.coplaid.ai."
              }
            }
          }
        }
      }
    },
    "/workflow/{workflow_code}": {
      "post": {
        "operationId": "post_workflow_workflow_code",
        "summary": "Trigger a workflow",
        "description": "Run a configured message workflow by its code.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Request accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The key is not permitted to perform this action."
          },
          "429": {
            "description": "Rate limit exceeded (100 requests per hour per key)."
          }
        },
        "parameters": [
          {
            "name": "workflow_code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The workflow code."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "See the full request schema in the partner dashboard at core.coplaid.ai."
              }
            }
          }
        }
      }
    },
    "/managesubs/{action}": {
      "post": {
        "operationId": "post_managesubs_action",
        "summary": "Manage subscriptions",
        "description": "Subscribe or unsubscribe recipients.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Request accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The key is not permitted to perform this action."
          },
          "429": {
            "description": "Rate limit exceeded (100 requests per hour per key)."
          }
        },
        "parameters": [
          {
            "name": "action",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The action."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "See the full request schema in the partner dashboard at core.coplaid.ai."
              }
            }
          }
        }
      }
    }
  }
}
