{"openapi":"3.1.0","info":{"title":"ActionMode connected workflows","version":"1.0.0","description":"Project-scoped automation bridge. Requires operator enablement. No sending or payment actions."},"servers":[{"url":"/api/v1"}],"security":[{"connectionKey":[]}],"components":{"securitySchemes":{"connectionKey":{"type":"http","scheme":"bearer","bearerFormat":"amc_ + 64 hex characters"}},"schemas":{"IntakeEvent":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"lead.upsert"},"data":{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":200},"name":{"type":"string","minLength":1,"maxLength":200},"company":{"default":"","type":"string","maxLength":200},"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"default":"","type":"string","maxLength":200},"website":{"type":"string","maxLength":2000,"format":"uri"}},"required":["external_id","name"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"note.add"},"data":{"type":"object","properties":{"lead_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["lead_id","body"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"reply.received"},"data":{"type":"object","properties":{"outreach_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from_email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"subject":{"default":"","type":"string","maxLength":300},"body":{"type":"string","minLength":1,"maxLength":10000},"message_id":{"type":"string","minLength":1,"maxLength":998}},"required":["outreach_id","from_email","body"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"outreach.requested"},"data":{"type":"object","properties":{"lead_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"brief":{"type":"string","minLength":1,"maxLength":2000}},"required":["lead_id","brief"],"additionalProperties":false}},"required":["type","data"],"additionalProperties":false}]}}},"paths":{"/events":{"post":{"operationId":"submitEvent","summary":"Queue work, requiring the event's write scope","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"},"description":"Persist per command and reuse with identical content on retries."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntakeEvent"}}}},"responses":{"200":{"description":"Existing receipt for identical request"},"202":{"description":"Saved receipt: id, status, result, replayed, status_url"},"400":{"description":"Invalid event or missing UUID"},"401":{"description":"Missing, expired or revoked bearer key"},"403":{"description":"Permission required"},"404":{"description":"Unavailable or outside project scope"},"409":{"description":"Request UUID reused with changed content"},"413":{"description":"Body exceeds 32768 bytes"},"415":{"description":"application/json required"},"429":{"description":"Rate limited. Retry-After: 60"},"503":{"description":"Temporarily unavailable; retry with identical request ID and body"}}}},"/events/{id}":{"get":{"operationId":"readReceipt","summary":"Read this connection's receipt","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"id, type, status, result, error, attempts, created_at; status: queued | processing | succeeded | failed"},"401":{"description":"Missing, expired or revoked bearer key"},"403":{"description":"Permission required"},"404":{"description":"Unavailable or outside project scope"},"429":{"description":"Rate limited. Retry-After: 60"},"503":{"description":"Temporarily unavailable; retry with identical request ID and body"}}}},"/leads":{"get":{"operationId":"listLeads","summary":"Read project leads (data.read)","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"after","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"data array and next_cursor (ID order)"},"400":{"description":"Invalid pagination"},"401":{"description":"Missing, expired or revoked bearer key"},"403":{"description":"Permission required"},"404":{"description":"Unavailable or outside project scope"},"429":{"description":"Rate limited. Retry-After: 60"},"503":{"description":"Temporarily unavailable; retry with identical request ID and body"}}}},"/leads/{id}":{"get":{"operationId":"read_leads","summary":"Read project leads record (data.read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Record wrapped in data"},"401":{"description":"Missing, expired or revoked bearer key"},"403":{"description":"Permission required"},"404":{"description":"Unavailable or outside project scope"},"429":{"description":"Rate limited. Retry-After: 60"},"503":{"description":"Temporarily unavailable; retry with identical request ID and body"}}}},"/outreach/{id}":{"get":{"operationId":"read_outreach","summary":"Read project outreach record (data.read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Record wrapped in data"},"401":{"description":"Missing, expired or revoked bearer key"},"403":{"description":"Permission required"},"404":{"description":"Unavailable or outside project scope"},"429":{"description":"Rate limited. Retry-After: 60"},"503":{"description":"Temporarily unavailable; retry with identical request ID and body"}}}},"/replies/{id}":{"get":{"operationId":"read_replies","summary":"Read project replies record (data.read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Record wrapped in data"},"401":{"description":"Missing, expired or revoked bearer key"},"403":{"description":"Permission required"},"404":{"description":"Unavailable or outside project scope"},"429":{"description":"Rate limited. Retry-After: 60"},"503":{"description":"Temporarily unavailable; retry with identical request ID and body"}}}},"/runs/{id}":{"get":{"operationId":"read_runs","summary":"Read project runs record (data.read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Record wrapped in data"},"401":{"description":"Missing, expired or revoked bearer key"},"403":{"description":"Permission required"},"404":{"description":"Unavailable or outside project scope"},"429":{"description":"Rate limited. Retry-After: 60"},"503":{"description":"Temporarily unavailable; retry with identical request ID and body"}}}}}}