{
  "openapi": "3.1.0",
  "info": {
    "title": "SignAIBeam API",
    "version": "1.0.0",
    "description": "Bulk AI-visibility scans of public websites: the same check as the free scan on signaibeam.com (score out of 100, 11 categories of structure and readability by Google and AI assistants, up to 30 pages per site), plus up to 8 priorities with their fix code. No AI is involved: the AI audit (phase 2) and digital reach (phase 3) are not available through the API. Authenticate with a bearer key created in the agency space. Each scanned domain uses one unit of the monthly quota or one prepaid credit; when none is left the API answers 402 Payment Required with a link to buy credits."
  },
  "servers": [
    {
      "url": "https://signaibeam.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "sk_signaibeam_… key"
      }
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/api/v1/scans": {
      "post": {
        "summary": "Start a batch of scans",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domains"
                ],
                "properties": {
                  "domains": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    },
                    "minItems": 1,
                    "maxItems": 100
                  },
                  "phrases": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 5,
                    "description": "Target searches (optional)"
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "fr",
                      "en"
                    ]
                  },
                  "label": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Batch created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batch": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "total": {
                          "type": "integer"
                        },
                        "done": {
                          "type": "integer"
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "queued",
                                  "running",
                                  "done",
                                  "failed"
                                ]
                              },
                              "result": {
                                "type": "object",
                                "description": "Score out of 100, site type, category scores, priorities with fix code."
                              }
                            }
                          }
                        }
                      }
                    },
                    "rejected": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "fr": {
                      "type": "string"
                    },
                    "en": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required: not enough prepaid credit (one credit per domain). Buy credits at the `buy` address, then retry.",
            "headers": {
              "Link": {
                "schema": {
                  "type": "string"
                },
                "description": "<purchase page>; rel=\"payment\""
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "const": "PAYMENT_REQUIRED"
                    },
                    "fr": {
                      "type": "string"
                    },
                    "en": {
                      "type": "string"
                    },
                    "needed": {
                      "type": "integer"
                    },
                    "creditsLeft": {
                      "type": "integer"
                    },
                    "priceEURPerScan": {
                      "type": "number"
                    },
                    "packs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "credits": {
                            "type": "integer"
                          },
                          "eur": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "buy": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "List batches",
        "responses": {
          "200": {
            "description": "Batches",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "total": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "fr": {
                      "type": "string"
                    },
                    "en": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/scans/{id}": {
      "get": {
        "summary": "Batch status and results",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Batch",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "done": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "queued",
                              "running",
                              "done",
                              "failed"
                            ]
                          },
                          "result": {
                            "type": "object",
                            "description": "Score out of 100, site type, category scores, priorities with fix code."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "fr": {
                      "type": "string"
                    },
                    "en": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "fr": {
                      "type": "string"
                    },
                    "en": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}