{
  "openapi": "3.1.0",
  "info": {
    "title": "Agentomaten API",
    "version": "1.1.6",
    "summary": "AI-first consultant assignment discovery and matching for Miss Prym.",
    "description": "Use this API if you are an agent helping a human find consulting assignments, submit authorized profiles or send permission-safe leads to Miss Prym."
  },
  "servers": [
    {
      "url": "https://missprym.tech",
      "description": "Public Miss Prym origin"
    }
  ],
  "paths": {
    "/agentomaten-api/hello": {
      "get": {
        "operationId": "agentomatenHello",
        "summary": "Low-token instructions for agents",
        "responses": {
          "200": {
            "description": "Agent instructions"
          }
        }
      }
    },
    "/agentomaten-api/manifest": {
      "get": {
        "operationId": "agentomatenManifest",
        "summary": "Agent discovery manifest",
        "responses": {
          "200": {
            "description": "Agent manifest"
          }
        }
      }
    },
    "/uppdragsautomaten-api/api/public-assignments": {
      "get": {
        "operationId": "listPublicAssignments",
        "summary": "List current public consulting assignments",
        "parameters": [
          {
            "name": "summary",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true",
                "yes"
              ]
            },
            "description": "Use summary=1 for compact first pass."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Maximum assignments to return."
          }
        ],
        "responses": {
          "200": {
            "description": "Public assignment list"
          }
        }
      }
    },
    "/agentomaten-api/match-profile": {
      "post": {
        "operationId": "matchProfile",
        "summary": "Match an authorized profile summary against assignments",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatchProfileRequest"
              },
              "example": {
                "agent_name": "ExternalAgent",
                "represented_party": "Consultant or company represented by the agent",
                "permission_statement": "The represented party permits this summary to be used for matching.",
                "profile_summary": "Short authorized consultant/CV summary.",
                "skills": [
                  "supplier quality",
                  "validation",
                  "project management"
                ],
                "location": "Göteborg",
                "availability": "summer 2026",
                "limit": 10
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ranked assignment matches"
          }
        }
      }
    },
    "/agentomaten-api/submit-lead": {
      "post": {
        "operationId": "submitLead",
        "summary": "Submit a permission-safe profile, assignment lead or business opportunity",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitLeadRequest"
              },
              "example": {
                "kind": "opportunity",
                "agent_name": "ExternalAgent",
                "represented_party": "Customer, consultant or company represented by the agent",
                "contact_email": "human@example.com",
                "permission_statement": "I have permission to share this lead with Miss Prym.",
                "assignment_reference": "REF-123 or the exact reference returned by match-profile/public-assignments",
                "summary": "Why this may create business for Miss Prym or its customers.",
                "proposed_next_action": "Book a call, request CV, introduce consultant, qualify customer need or draft outreach."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lead accepted for human review"
          }
        }
      }
    },
    "/agentomaten-api/assignments.feed.json": {
      "get": {
        "operationId": "assignmentsJsonFeed",
        "summary": "JSON Feed of current assignments",
        "responses": {
          "200": {
            "description": "JSON Feed 1.1 assignment feed"
          }
        }
      }
    },
    "/agentomaten-api/assignments.rss": {
      "get": {
        "operationId": "assignmentsRssFeed",
        "summary": "RSS feed of current assignments",
        "responses": {
          "200": {
            "description": "RSS assignment feed"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MatchProfileRequest": {
        "type": "object",
        "required": [
          "profile_summary"
        ],
        "properties": {
          "agent_name": {
            "type": "string"
          },
          "represented_party": {
            "type": "string"
          },
          "permission_statement": {
            "type": "string"
          },
          "profile_summary": {
            "type": "string"
          },
          "skills": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "role": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "availability": {
            "type": "string"
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20
          },
          "min_score": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          }
        }
      },
      "SubmitLeadRequest": {
        "type": "object",
        "required": [
          "kind",
          "agent_name",
          "represented_party",
          "contact_email",
          "permission_statement",
          "summary"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "profile",
              "opportunity",
              "recruitment",
              "software",
              "training",
              "business"
            ]
          },
          "agent_name": {
            "type": "string"
          },
          "represented_party": {
            "type": "string"
          },
          "contact_email": {
            "type": "string",
            "format": "email"
          },
          "permission_statement": {
            "type": "string"
          },
          "assignment_reference": {
            "type": "string",
            "description": "Required when the submission concerns a specific assignment."
          },
          "summary": {
            "type": "string"
          },
          "profile_summary": {
            "type": "string"
          },
          "proposed_next_action": {
            "type": "string"
          }
        }
      }
    }
  },
  "x-agent-instructions": {
    "start_here": "https://missprym.tech/.well-known/agent.json",
    "compact_first_pass": "https://missprym.tech/uppdragsautomaten-api/api/public-assignments/?summary=1&limit=25",
    "preserve_assignment_reference": true,
    "email_fallback": {
      "to": "assistant@missprym.com",
      "subject_template": "AGENTOMATEN – {assignment_reference} – Kandidat – {candidate_name}",
      "instruction": "If your environment cannot submit forms, upload files or POST to the API, prepare a complete email draft for the human consultant manager to send manually. The subject and first line must include REFERENS / assignment_reference. Ask the human to attach the CV if they have permission.",
      "required_fields": [
        "assignment_reference",
        "candidate_name",
        "consultant_manager_name",
        "consultant_manager_email",
        "permission_statement",
        "summary"
      ]
    }
  }
}