{
  "openapi": "3.1.0",
  "info": {
    "title": "Didit agent forms API",
    "version": "1.0.0",
    "description": "Talk to Didit sales or apply to the partner program from an AI agent, with email verification. See the guide at /agent-forms.md for curl examples and the corporate-email fallback."
  },
  "servers": [
    {
      "url": "https://didit.me"
    }
  ],
  "paths": {
    "/api/agent/v1/email-code": {
      "post": {
        "operationId": "requestEmailCode",
        "summary": "Email a six-digit verification code",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "email",
                  "form"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "form": {
                    "type": "string",
                    "enum": [
                      "demo",
                      "partner"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Code sent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "verificationId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expiresInSeconds": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or non-corporate email.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "options": {
        "operationId": "requestEmailCodePreflight",
        "summary": "CORS preflight",
        "responses": {
          "204": {
            "description": "CORS preflight."
          }
        }
      }
    },
    "/api/agent/v1/submit": {
      "post": {
        "operationId": "submitAgentForm",
        "summary": "Submit a verified sales request or partner application",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "form",
                      "email",
                      "code",
                      "fields"
                    ],
                    "properties": {
                      "form": {
                        "const": "demo"
                      },
                      "email": {
                        "type": "string",
                        "format": "email"
                      },
                      "code": {
                        "type": "string",
                        "pattern": "^[0-9]{6}$"
                      },
                      "fields": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "companyName",
                          "volume",
                          "products",
                          "fullName",
                          "jobRole"
                        ],
                        "properties": {
                          "companyName": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "volume": {
                            "type": "string",
                            "enum": [
                              "Just testing / under 1,000 a month",
                              "1,000 – 10,000 a month",
                              "10,000 – 50,000 a month",
                              "50,000+ a month"
                            ]
                          },
                          "products": {
                            "type": "array",
                            "minItems": 1,
                            "uniqueItems": true,
                            "items": {
                              "type": "string",
                              "enum": [
                                "kyc",
                                "aml",
                                "kyb",
                                "transactions",
                                "investigator",
                                "messages"
                              ]
                            }
                          },
                          "fullName": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "jobRole": {
                            "type": "string",
                            "enum": [
                              "Founder / CEO",
                              "Risk & Fraud / Compliance",
                              "CTO / Developer / PM",
                              "Other"
                            ]
                          },
                          "payment": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "debit",
                                  "card",
                                  "transfer"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "default": "debit"
                          },
                          "message": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 4000
                          },
                          "phone": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 32,
                            "description": "Optional phone in international format, e.g. +34600111222."
                          },
                          "intent": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 64,
                            "description": "The page or plan the lead came from, e.g. product-aml or pricing-enterprise. Lowercase letters, digits and hyphens."
                          }
                        }
                      }
                    }
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "form",
                      "email",
                      "code",
                      "fields"
                    ],
                    "properties": {
                      "form": {
                        "const": "partner"
                      },
                      "email": {
                        "type": "string",
                        "format": "email"
                      },
                      "code": {
                        "type": "string",
                        "pattern": "^[0-9]{6}$"
                      },
                      "fields": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "companyName",
                          "industries",
                          "clients",
                          "region",
                          "fullName"
                        ],
                        "properties": {
                          "companyName": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "website": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 2048
                          },
                          "track": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "Refer clients",
                                  "Resell Didit",
                                  "Build Didit into our platform",
                                  "Implement Didit for clients",
                                  "Join the KYC network",
                                  "Investor or accelerator",
                                  "Not sure yet"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "default": "Refer clients"
                          },
                          "message": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 4000
                          },
                          "industries": {
                            "type": "array",
                            "minItems": 1,
                            "uniqueItems": true,
                            "items": {
                              "type": "string",
                              "enum": [
                                "iGaming",
                                "Crypto",
                                "Fintech & payments",
                                "Lending",
                                "Marketplaces",
                                "Telecom",
                                "Other"
                              ]
                            }
                          },
                          "clients": {
                            "type": "string",
                            "enum": [
                              "1–10",
                              "11–50",
                              "51–200",
                              "201+",
                              "We are the platform"
                            ]
                          },
                          "region": {
                            "type": "string",
                            "enum": [
                              "Europe",
                              "Latin America",
                              "North America",
                              "Middle East and Africa",
                              "Asia-Pacific",
                              "Global"
                            ]
                          },
                          "fullName": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "phone": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 50
                          },
                          "currentIdentityVendor": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 200
                          },
                          "intent": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 64,
                            "description": "The page or track the application came from, e.g. partner-refer. Lowercase letters, digits and hyphens."
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submission delivered.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Declined or email-policy rejection.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Submission conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Code expired or already used.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Retryable delivery error when retryable is true; otherwise the request may already be recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Delivery temporarily unavailable, or an unknown outcome (ERR_EFFECT_UNKNOWN). Check retryable before resubmitting.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "options": {
        "operationId": "submitAgentFormPreflight",
        "summary": "CORS preflight",
        "responses": {
          "204": {
            "description": "CORS preflight."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "requestId",
          "code",
          "message"
        ],
        "properties": {
          "requestId": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string",
            "description": "Machine-readable error code."
          },
          "message": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean",
            "description": "Demo and partner delivery failures only. When false, the request may already be recorded: do not resubmit."
          },
          "details": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "DemoFields": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "companyName",
          "volume",
          "products",
          "fullName",
          "jobRole"
        ],
        "properties": {
          "companyName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "volume": {
            "type": "string",
            "enum": [
              "Just testing / under 1,000 a month",
              "1,000 – 10,000 a month",
              "10,000 – 50,000 a month",
              "50,000+ a month"
            ]
          },
          "products": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "kyc",
                "aml",
                "kyb",
                "transactions",
                "investigator",
                "messages"
              ]
            }
          },
          "fullName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "jobRole": {
            "type": "string",
            "enum": [
              "Founder / CEO",
              "Risk & Fraud / Compliance",
              "CTO / Developer / PM",
              "Other"
            ]
          },
          "payment": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "debit",
                  "card",
                  "transfer"
                ]
              },
              {
                "type": "null"
              }
            ],
            "default": "debit"
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 32,
            "description": "Optional phone in international format, e.g. +34600111222."
          },
          "intent": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The page or plan the lead came from, e.g. product-aml or pricing-enterprise. Lowercase letters, digits and hyphens."
          }
        }
      },
      "PartnerFields": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "companyName",
          "industries",
          "clients",
          "region",
          "fullName"
        ],
        "properties": {
          "companyName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "website": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "track": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "Refer clients",
                  "Resell Didit",
                  "Build Didit into our platform",
                  "Implement Didit for clients",
                  "Join the KYC network",
                  "Investor or accelerator",
                  "Not sure yet"
                ]
              },
              {
                "type": "null"
              }
            ],
            "default": "Refer clients"
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000
          },
          "industries": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "iGaming",
                "Crypto",
                "Fintech & payments",
                "Lending",
                "Marketplaces",
                "Telecom",
                "Other"
              ]
            }
          },
          "clients": {
            "type": "string",
            "enum": [
              "1–10",
              "11–50",
              "51–200",
              "201+",
              "We are the platform"
            ]
          },
          "region": {
            "type": "string",
            "enum": [
              "Europe",
              "Latin America",
              "North America",
              "Middle East and Africa",
              "Asia-Pacific",
              "Global"
            ]
          },
          "fullName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "currentIdentityVendor": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "intent": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The page or track the application came from, e.g. partner-refer. Lowercase letters, digits and hyphens."
          }
        }
      }
    }
  }
}