openapi: 3.1.0
info:
  title: PlatPhorm Meetups API
  version: 1.0.0
  description: Plan, publish, and federate real-world and virtual meetups across the PlatPhorm News network.
servers:
  - url: https://meetup.platphormnews.com
security:
  - PlatPhormApiKey: []
components:
  securitySchemes:
    PlatPhormApiKey:
      type: apiKey
      in: header
      name: X-PlatPhorm-API-Key
      description: Use PLATPHORM_API_KEY. Authorization: Bearer is also accepted.
  schemas:
    ApiEnvelope:
      type: object
      required: [ok]
      properties:
        ok:
          type: boolean
        data:
          type: object
        error:
          type: object
paths:
  /api/v1/audit:
    get:
      summary: Protected mutation audit log and launch controls status
      responses:
        '200':
          description: Recent redacted audit entries and ephemeral control status
        '401':
          description: Missing PLATPHORM_API_KEY
  /api/health:
    get:
      summary: Public platform health
      security: []
      responses:
        '200':
          description: Health payload
  /api/v1/events:
    get:
      summary: List public events
      security: []
      parameters:
        - in: query
          name: category
          schema: { type: string }
        - in: query
          name: format
          schema: { type: string, enum: [in_person, online, hybrid] }
        - in: query
          name: q
          schema: { type: string }
      responses:
        '200':
          description: Event list
    post:
      summary: Create an event
      responses:
        '201':
          description: Event created
        '401':
          description: Missing PLATPHORM_API_KEY
  /api/v1/events/import:
    post:
      summary: Clone event draft fields from a trusted public URL
      responses:
        '200':
          description: Imported event draft payload
        '401':
          description: Missing PLATPHORM_API_KEY
  /api/v1/vercel/connect/status:
    get:
      summary: Public Vercel Connect readiness status
      security: []
      responses:
        '200':
          description: Vercel Connect status
  /api/v1/vercel/connect/token:
    post:
      summary: Request a Vercel Connect runtime provider token with the SDK
      responses:
        '200':
          description: Token metadata with token value redacted
        '401':
          description: Missing PLATPHORM_API_KEY
  /api/v1/vercel/connect/authorize:
    post:
      summary: Start Vercel Connect authorization or device flow
      responses:
        '200':
          description: Authorization metadata
        '401':
          description: Missing PLATPHORM_API_KEY
  /api/v1/vercel/connect/trigger:
    post:
      summary: Receive a protected Vercel Connect trigger event
      responses:
        '200':
          description: Trigger accepted
        '401':
          description: Missing PLATPHORM_API_KEY or trigger secret
  /api/v1/events/{slug}:
    get:
      summary: Get public event details
      security: []
      parameters:
        - in: path
          name: slug
          required: true
          schema: { type: string }
      responses:
        '200':
          description: Event detail
    patch:
      summary: Update an event
      parameters:
        - in: path
          name: slug
          required: true
          schema: { type: string }
      responses:
        '200':
          description: Event updated
    delete:
      summary: Delete an event
      parameters:
        - in: path
          name: slug
          required: true
          schema: { type: string }
      responses:
        '200':
          description: Event deleted
  /api/v1/events/{slug}/rsvps:
    post:
      summary: Public RSVP with capacity-aware waitlist fallback
      security: []
      parameters:
        - in: path
          name: slug
          required: true
          schema: { type: string }
      responses:
        '201':
          description: RSVP accepted
    get:
      summary: Protected attendee list
      parameters:
        - in: path
          name: slug
          required: true
          schema: { type: string }
      responses:
        '200':
          description: Attendee list
  /api/mcp:
    get:
      summary: MCP endpoint metadata
      security: []
      responses:
        '200':
          description: MCP metadata
    post:
      summary: MCP JSON-RPC 2.0 endpoint
      responses:
        '200':
          description: JSON-RPC result or error
