{
  "openapi": "3.1.0",
  "info": {
    "title": "Agora Merit Free Agent Assessment",
    "version": "1.0.0",
    "description": "Free job responsibility assessment and private human review links. No payment is authorized by these operations. Confirm the user permits sharing the document with Agora Merit before submitting.",
    "contact": {
      "email": "support@agoramerit.com"
    }
  },
  "servers": [
    {
      "url": "https://agoramerit.com"
    }
  ],
  "paths": {
    "/api/agents/assess": {
      "post": {
        "operationId": "assessJobResponsibilities",
        "summary": "Assess authorized job responsibilities for free",
        "description": "Runs the website assessment engine, returns findings and a report quote when available, and saves a seven-day private review link. Anyone with the link can read the submitted responsibilities. Incomplete assessments are not a clean pass. Allow up to a minute; requests are rate limited.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title",
                  "responsibilities",
                  "confirmed_permission"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 140
                  },
                  "responsibilities": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 30000,
                    "description": "User-authorized responsibilities or duties. Remove unnecessary personal or confidential information."
                  },
                  "confirmed_permission": {
                    "type": "boolean",
                    "const": true,
                    "description": "True only after the user authorizes sharing this document with Agora Merit."
                  },
                  "referral_source": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$",
                    "description": "Optional public integration slug for attribution. No personal information. Use agora_qa for synthetic tests."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Free assessment and private review link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAssessment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "Rate limit reached. Retry later."
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AgentAssessment": {
        "type": "object",
        "required": [
          "title",
          "assessment",
          "reviewUrl",
          "reviewExpiresAt",
          "currency",
          "amountChargedCents",
          "nextStep",
          "reviewLinkPrivacy"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "assessment": {
            "type": "object",
            "required": [
              "findings",
              "findingCount",
              "assessmentStatus",
              "zeroDecisionStatus",
              "pricing"
            ],
            "properties": {
              "findings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "findingCount": {
                "type": "integer",
                "minimum": 0
              },
              "assessmentStatus": {
                "enum": [
                  "complete",
                  "incomplete"
                ]
              },
              "zeroDecisionStatus": {
                "enum": [
                  "passed",
                  "findings",
                  "inconclusive"
                ]
              },
              "pricing": {
                "type": "object",
                "properties": {
                  "status": {
                    "enum": [
                      "free",
                      "paid",
                      "unavailable"
                    ]
                  },
                  "amountCents": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0
                  },
                  "label": {
                    "type": "string"
                  }
                },
                "additionalProperties": true
              }
            },
            "additionalProperties": true
          },
          "reviewUrl": {
            "type": "string",
            "format": "uri",
            "description": "Private bearer link for the intended human reviewer. Contains no document text. Do not post publicly."
          },
          "reviewExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "currency": {
            "const": "USD"
          },
          "amountChargedCents": {
            "type": "integer",
            "const": 0
          },
          "nextStep": {
            "type": "string"
          },
          "reviewLinkPrivacy": {
            "type": "string"
          },
          "referral": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "source": {
                "type": "string"
              },
              "channel": {
                "enum": [
                  "mcp",
                  "api"
                ]
              }
            }
          }
        }
      }
    },
    "responses": {
      "Error": {
        "description": "Request rejected or temporarily unavailable.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
