{"openapi":"3.1.0","info":{"title":"Coastguard API","version":"1.0.0","description":"Coastguard deployment management API"},"components":{"schemas":{},"parameters":{}},"paths":{"/api/v1/applications":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"yellowpages_service_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"yellowpages_team_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"sox_compliance_required","in":"query"},{"schema":{"type":"string"},"required":false,"name":"pipeline_pr_approval_required","in":"query"},{"schema":{"type":"string"},"required":false,"name":"name","in":"query"},{"schema":{"type":"string"},"required":false,"name":"permission","in":"query"},{"schema":{"type":"string"},"required":false,"name":"deleting","in":"query"},{"schema":{"type":"string"},"required":false,"name":"enable_pipeline_status_checks","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page_size","in":"query"}],"responses":{"200":{"description":"List of applications","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next":{"type":"string"},"prev":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"yellowpages_service_id":{"type":"string","maxLength":128},"description":{"type":"string"},"delete_protected":{"type":"boolean"},"sox_compliance_required":{"type":"boolean","default":false},"aws_namespace":{"type":"object","additionalProperties":{"nullable":true}},"pipeline_pr_approval_required":{"type":"boolean","default":false},"pipeline_repo_location":{"type":"string","default":""},"istio_enabled":{"type":"boolean","default":false},"created_by":{"type":"string"},"created_at":{"type":"string"},"deleting":{"type":"boolean"},"time_set_to_deleting":{"type":"string","nullable":true,"format":"date-time"},"published_at":{"type":"string","nullable":true,"format":"date-time"},"spinnaker_application":{"type":"string"},"pipeline_repo":{"type":"string"},"permission":{"type":"string","pattern":"^standard|privileged|extended$","default":"standard"},"in_jail":{"type":"boolean","default":false},"enable_pipeline_status_checks":{"type":"boolean","default":false},"quotas":{"type":"object","additionalProperties":{"type":"object","properties":{"cpu":{"type":"integer"},"memory":{"type":"integer"},"jobs":{"type":"integer"},"last_modified_by":{"type":"string"},"last_modified_at":{"type":"string","nullable":true,"format":"date-time"}}}},"owned_namespaces":{"type":"array","items":{"type":"string"}},"extended_resources":{"type":"array","items":{"nullable":true}}},"required":["id","name","yellowpages_service_id","aws_namespace","created_by","created_at","deleting","time_set_to_deleting","published_at"]}}},"required":["total","next","prev","items"]}}}}}},"post":{"responses":{"201":{"description":"Application created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"yellowpages_service_id":{"type":"string","maxLength":128},"description":{"type":"string"},"delete_protected":{"type":"boolean"},"sox_compliance_required":{"type":"boolean","default":false},"aws_namespace":{"type":"object","additionalProperties":{"nullable":true}},"pipeline_pr_approval_required":{"type":"boolean","default":false},"pipeline_repo_location":{"type":"string","default":""},"istio_enabled":{"type":"boolean","default":false},"created_by":{"type":"string"},"created_at":{"type":"string"},"deleting":{"type":"boolean"},"time_set_to_deleting":{"type":"string","nullable":true,"format":"date-time"},"published_at":{"type":"string","nullable":true,"format":"date-time"},"spinnaker_application":{"type":"string"},"pipeline_repo":{"type":"string"},"permission":{"type":"string","pattern":"^standard|privileged|extended$","default":"standard"},"in_jail":{"type":"boolean","default":false},"enable_pipeline_status_checks":{"type":"boolean","default":false},"quotas":{"type":"object","additionalProperties":{"type":"object","properties":{"cpu":{"type":"integer"},"memory":{"type":"integer"},"jobs":{"type":"integer"},"last_modified_by":{"type":"string"},"last_modified_at":{"type":"string","nullable":true,"format":"date-time"}}}},"owned_namespaces":{"type":"array","items":{"type":"string"}},"extended_resources":{"type":"array","items":{"nullable":true}}},"required":["id","name","yellowpages_service_id","aws_namespace","created_by","created_at","deleting","time_set_to_deleting","published_at"]}}}},"400":{"description":"mode grants other-write or other-delete"},"403":{"description":"No org membership"},"409":{"description":"Application already exists"}}}},"/api/v1/applications/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Application details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"yellowpages_service_id":{"type":"string","maxLength":128},"description":{"type":"string"},"delete_protected":{"type":"boolean"},"sox_compliance_required":{"type":"boolean","default":false},"aws_namespace":{"type":"object","additionalProperties":{"nullable":true}},"pipeline_pr_approval_required":{"type":"boolean","default":false},"pipeline_repo_location":{"type":"string","default":""},"istio_enabled":{"type":"boolean","default":false},"created_by":{"type":"string"},"created_at":{"type":"string"},"deleting":{"type":"boolean"},"time_set_to_deleting":{"type":"string","nullable":true,"format":"date-time"},"published_at":{"type":"string","nullable":true,"format":"date-time"},"spinnaker_application":{"type":"string"},"pipeline_repo":{"type":"string"},"permission":{"type":"string","pattern":"^standard|privileged|extended$","default":"standard"},"in_jail":{"type":"boolean","default":false},"enable_pipeline_status_checks":{"type":"boolean","default":false},"quotas":{"type":"object","additionalProperties":{"type":"object","properties":{"cpu":{"type":"integer"},"memory":{"type":"integer"},"jobs":{"type":"integer"},"last_modified_by":{"type":"string"},"last_modified_at":{"type":"string","nullable":true,"format":"date-time"}}}},"owned_namespaces":{"type":"array","items":{"type":"string"}},"extended_resources":{"type":"array","items":{"nullable":true}}},"required":["id","name","yellowpages_service_id","aws_namespace","created_by","created_at","deleting","time_set_to_deleting","published_at"]}}}},"404":{"description":"Not found"}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Application updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"yellowpages_service_id":{"type":"string","maxLength":128},"description":{"type":"string"},"delete_protected":{"type":"boolean"},"sox_compliance_required":{"type":"boolean","default":false},"aws_namespace":{"type":"object","additionalProperties":{"nullable":true}},"pipeline_pr_approval_required":{"type":"boolean","default":false},"pipeline_repo_location":{"type":"string","default":""},"istio_enabled":{"type":"boolean","default":false},"created_by":{"type":"string"},"created_at":{"type":"string"},"deleting":{"type":"boolean"},"time_set_to_deleting":{"type":"string","nullable":true,"format":"date-time"},"published_at":{"type":"string","nullable":true,"format":"date-time"},"spinnaker_application":{"type":"string"},"pipeline_repo":{"type":"string"},"permission":{"type":"string","pattern":"^standard|privileged|extended$","default":"standard"},"in_jail":{"type":"boolean","default":false},"enable_pipeline_status_checks":{"type":"boolean","default":false},"quotas":{"type":"object","additionalProperties":{"type":"object","properties":{"cpu":{"type":"integer"},"memory":{"type":"integer"},"jobs":{"type":"integer"},"last_modified_by":{"type":"string"},"last_modified_at":{"type":"string","nullable":true,"format":"date-time"}}}},"owned_namespaces":{"type":"array","items":{"type":"string"}},"extended_resources":{"type":"array","items":{"nullable":true}}},"required":["id","name","yellowpages_service_id","aws_namespace","created_by","created_at","deleting","time_set_to_deleting","published_at"]}}}},"400":{"description":"mode or owner_group outside the allowed ceiling"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Application deleted (soft-delete)"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Application is delete-protected"}}}},"/api/v1/applications/{id}/publish":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Publish intent recorded; plan is the auto-MCP row that would be created","content":{"application/json":{"schema":{"type":"object","properties":{"published_at":{"type":"string","nullable":true},"plan":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"org_id":{"type":"string"},"application_id":{"type":"string"},"origin":{"type":"string","enum":["auto"]},"name":{"type":"string"},"transport":{"type":"string","enum":["http"]},"url":{"nullable":true},"headers":{"type":"object","additionalProperties":{"type":"string"}},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string"},"mode":{"type":"integer"},"tools":{"type":"array","items":{"type":"string"}}},"required":["id","org_id","application_id","origin","name","transport","url","headers","owner_user","owner_group","mode","tools"]}},"required":["published_at","plan"]}}}},"403":{"description":"Forbidden (viewer, ci:agent, or no write access)"},"404":{"description":"Not found, or AUTO_MCP_ON_PUBLISH is off"},"409":{"description":"Application is deleting or in jail"}}}},"/api/v1/applications/{id}/unpublish":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Publish intent cleared","content":{"application/json":{"schema":{"type":"object","properties":{"published_at":{"type":"string","nullable":true},"plan":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"org_id":{"type":"string"},"application_id":{"type":"string"},"origin":{"type":"string","enum":["auto"]},"name":{"type":"string"},"transport":{"type":"string","enum":["http"]},"url":{"nullable":true},"headers":{"type":"object","additionalProperties":{"type":"string"}},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string"},"mode":{"type":"integer"},"tools":{"type":"array","items":{"type":"string"}}},"required":["id","org_id","application_id","origin","name","transport","url","headers","owner_user","owner_group","mode","tools"]}},"required":["published_at","plan"]}}}},"403":{"description":"Forbidden (viewer, ci:agent, or no write access)"},"404":{"description":"Not found, or AUTO_MCP_ON_PUBLISH is off"}}}},"/api/v1/applications/validate":{"post":{"responses":{"200":{"description":"Validation result","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"errors":{"type":"array","items":{"type":"string"}}},"required":["valid","errors"]}}}}}}},"/api/v1/pipelines":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"application","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page_size","in":"query"}],"responses":{"200":{"description":"List of pipelines","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next":{"type":"string"},"prev":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"application":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"last_triggered_by":{"type":"string"},"last_triggered_at":{"type":"string"},"last_success_run_at":{"type":"string"},"last_modified_at":{"type":"string"},"last_deployed_artifact_id":{"type":"string"}},"required":["id","application","name","created_at","last_triggered_by","last_triggered_at","last_success_run_at","last_modified_at","last_deployed_artifact_id"]}}},"required":["total","next","prev","items"]}}}}}},"post":{"responses":{"201":{"description":"Pipeline created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"application":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"last_triggered_by":{"type":"string"},"last_triggered_at":{"type":"string"},"last_success_run_at":{"type":"string"},"last_modified_at":{"type":"string"},"last_deployed_artifact_id":{"type":"string"}},"required":["id","application","name","created_at","last_triggered_by","last_triggered_at","last_success_run_at","last_modified_at","last_deployed_artifact_id"]}}}},"400":{"description":"mode or owner_group outside the allowed ceiling"},"403":{"description":"Forbidden"}}}},"/api/v1/pipelines/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Pipeline details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"application":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"last_triggered_by":{"type":"string"},"last_triggered_at":{"type":"string"},"last_success_run_at":{"type":"string"},"last_modified_at":{"type":"string"},"last_deployed_artifact_id":{"type":"string"}},"required":["id","application","name","created_at","last_triggered_by","last_triggered_at","last_success_run_at","last_modified_at","last_deployed_artifact_id"]}}}},"404":{"description":"Not found"}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Pipeline updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"application":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"last_triggered_by":{"type":"string"},"last_triggered_at":{"type":"string"},"last_success_run_at":{"type":"string"},"last_modified_at":{"type":"string"},"last_deployed_artifact_id":{"type":"string"}},"required":["id","application","name","created_at","last_triggered_by","last_triggered_at","last_success_run_at","last_modified_at","last_deployed_artifact_id"]}}}},"400":{"description":"mode or owner_group outside the allowed ceiling"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Pipeline deleted"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/applications/{appId}/pipelines/copy":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"}],"responses":{"201":{"description":"Pipeline copied","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"url":{"type":"string"}},"required":["status","url"]}}}},"400":{"description":"Missing required fields"},"403":{"description":"Forbidden"},"404":{"description":"Source pipeline not found"}}}},"/api/v1/applications/{appId}/pipelines/update":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"}],"responses":{"200":{"description":"Pipelines updated","content":{"application/json":{"schema":{"type":"object","properties":{"pipelines":{"type":"array","items":{"nullable":true}}},"required":["pipelines"]}}}},"403":{"description":"Forbidden"}}}},"/api/v1/pipeline_runs":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"pipeline_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"application","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page_size","in":"query"}],"responses":{"200":{"description":"List of pipeline runs","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next":{"type":"string"},"prev":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"pipeline_id":{"type":"string"},"status":{"type":"string","enum":["NOT_STARTED","RUNNING","PAUSED","FAILED","CANCELED","SUCCEEDED"]},"started_at":{"type":"string"},"last_updated_at":{"type":"string"},"finished_at":{"type":"string"},"triggered_by":{"type":"string"},"triggered_at":{"type":"string"},"artifact_id":{"type":"string"},"last_running_stage_name":{"type":"string"}},"required":["id","pipeline_id","status","started_at","last_updated_at","finished_at","triggered_by","triggered_at","artifact_id","last_running_stage_name"]}}},"required":["total","next","prev","items"]}}}}}},"post":{"responses":{"201":{"description":"Pipeline run created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"pipeline_id":{"type":"string"},"status":{"type":"string","enum":["NOT_STARTED","RUNNING","PAUSED","FAILED","CANCELED","SUCCEEDED"]},"started_at":{"type":"string"},"last_updated_at":{"type":"string"},"finished_at":{"type":"string"},"triggered_by":{"type":"string"},"triggered_at":{"type":"string"},"artifact_id":{"type":"string"},"last_running_stage_name":{"type":"string"}},"required":["id","pipeline_id","status","started_at","last_updated_at","finished_at","triggered_by","triggered_at","artifact_id","last_running_stage_name"]}}}},"400":{"description":"mode or owner_group outside the allowed ceiling"},"403":{"description":"Forbidden"}}}},"/api/v1/pipeline_runs/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Pipeline run details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"pipeline_id":{"type":"string"},"status":{"type":"string","enum":["NOT_STARTED","RUNNING","PAUSED","FAILED","CANCELED","SUCCEEDED"]},"started_at":{"type":"string"},"last_updated_at":{"type":"string"},"finished_at":{"type":"string"},"triggered_by":{"type":"string"},"triggered_at":{"type":"string"},"artifact_id":{"type":"string"},"last_running_stage_name":{"type":"string"}},"required":["id","pipeline_id","status","started_at","last_updated_at","finished_at","triggered_by","triggered_at","artifact_id","last_running_stage_name"]}}}},"404":{"description":"Not found"}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Pipeline run updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"pipeline_id":{"type":"string"},"status":{"type":"string","enum":["NOT_STARTED","RUNNING","PAUSED","FAILED","CANCELED","SUCCEEDED"]},"started_at":{"type":"string"},"last_updated_at":{"type":"string"},"finished_at":{"type":"string"},"triggered_by":{"type":"string"},"triggered_at":{"type":"string"},"artifact_id":{"type":"string"},"last_running_stage_name":{"type":"string"}},"required":["id","pipeline_id","status","started_at","last_updated_at","finished_at","triggered_by","triggered_at","artifact_id","last_running_stage_name"]}}}},"400":{"description":"mode or owner_group outside the allowed ceiling"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Pipeline run deleted"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/deployments":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"application","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page_size","in":"query"}],"responses":{"200":{"description":"List of deployments","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next":{"type":"string"},"prev":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"service_type":{"type":"string","enum":["HTTP","HTTPS","TCP","UDP"]},"lb_dns":{"type":"string"},"cluster":{"type":"string"},"container_deployment_name":{"type":"string"},"container_service_name":{"type":"string"}}}}},"required":["total","next","prev","items"]}}}}}},"post":{"responses":{"201":{"description":"Deployment created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"service_type":{"type":"string","enum":["HTTP","HTTPS","TCP","UDP"]},"lb_dns":{"type":"string"},"cluster":{"type":"string"},"container_deployment_name":{"type":"string"},"container_service_name":{"type":"string"}}}}}},"400":{"description":"mode or owner_group outside the allowed ceiling"},"403":{"description":"Forbidden"}}}},"/api/v1/deployments/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deployment details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"service_type":{"type":"string","enum":["HTTP","HTTPS","TCP","UDP"]},"lb_dns":{"type":"string"},"cluster":{"type":"string"},"container_deployment_name":{"type":"string"},"container_service_name":{"type":"string"}}}}}},"404":{"description":"Not found"}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deployment updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"service_type":{"type":"string","enum":["HTTP","HTTPS","TCP","UDP"]},"lb_dns":{"type":"string"},"cluster":{"type":"string"},"container_deployment_name":{"type":"string"},"container_service_name":{"type":"string"}}}}}},"400":{"description":"mode or owner_group outside the allowed ceiling"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deployment deleted"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/events":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"application","in":"query"},{"schema":{"type":"string"},"required":false,"name":"pipeline_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page_size","in":"query"}],"responses":{"200":{"description":"List of events","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next":{"type":"string"},"prev":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["kodak","spinnaker","jenkins","kubernetes"]},"timestamp":{"type":"string"},"data":{"type":"object","additionalProperties":{"nullable":true}}}}}},"required":["total","next","prev","items"]}}}}}},"post":{"responses":{"201":{"description":"Event created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["kodak","spinnaker","jenkins","kubernetes"]},"timestamp":{"type":"string"},"data":{"type":"object","additionalProperties":{"nullable":true}}}}}}},"400":{"description":"mode grants other-write or other-delete"},"403":{"description":"Forbidden"}}}},"/api/v1/events/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Event details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["kodak","spinnaker","jenkins","kubernetes"]},"timestamp":{"type":"string"},"data":{"type":"object","additionalProperties":{"nullable":true}}}}}}},"404":{"description":"Not found"}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Event deleted"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/applications/{appId}/permissions":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"}],"responses":{"200":{"description":"List of permissions for the application","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"ldap_group":{"type":"string"},"access_level":{"type":"string","enum":["cluster_admin","platform","elevated","standard"]}},"required":["ldap_group","access_level"]}}}}},"404":{"description":"Not found"}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"}],"responses":{"200":{"description":"Permissions replaced","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"ldap_group":{"type":"string"},"access_level":{"type":"string","enum":["cluster_admin","platform","elevated","standard"]}},"required":["ldap_group","access_level"]}}}}},"403":{"description":"Forbidden"}}}},"/api/v1/applications/{appId}/extended-resources":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"}],"responses":{"200":{"description":"List of extended resources for the application","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"resource_group":{"type":"string"},"resource_kind":{"type":"string"},"resource_name":{"type":"string"},"created_at":{"type":"string","nullable":true,"format":"date-time"},"created_by":{"type":"string"}},"required":["id","resource_group","resource_kind","created_at","created_by"]}}}}},"404":{"description":"Not found"}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"}],"responses":{"201":{"description":"Extended resource created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"resource_group":{"type":"string"},"resource_kind":{"type":"string"},"resource_name":{"type":"string"},"created_at":{"type":"string","nullable":true,"format":"date-time"},"created_by":{"type":"string"}},"required":["id","resource_group","resource_kind","created_at","created_by"]}}}},"400":{"description":"mode grants other-write or other-delete"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/applications/{appId}/extended-resources/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Extended resource deleted"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/applications/{appId}/extended-resources/audit":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"}],"responses":{"200":{"description":"Audit trail for extended resources","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"app_id":{"type":"string"},"action":{"type":"string"},"resource_type":{"type":"string"},"created_at":{"type":"string","nullable":true,"format":"date-time"},"action_by":{"type":"string"},"last_modified":{"type":"string","nullable":true,"format":"date-time"}},"required":["app_id","action","resource_type","created_at","action_by","last_modified"]}}}}},"404":{"description":"Not found"}}}},"/api/v1/applications/{appId}/quotas":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"}],"responses":{"200":{"description":"List of quotas for the application","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"application_id":{"type":"string"},"cluster":{"type":"string"},"cpu":{"type":"integer"},"memory":{"type":"integer"},"jobs":{"type":"integer"},"last_modified_by":{"type":"string"},"last_modified_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","application_id","cluster","cpu","memory","jobs","last_modified_by","last_modified_at"]}}}}},"404":{"description":"Not found"}}}},"/api/v1/applications/{appId}/quotas/{cluster}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"cluster","in":"path"}],"responses":{"200":{"description":"Quota details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"application_id":{"type":"string"},"cluster":{"type":"string"},"cpu":{"type":"integer"},"memory":{"type":"integer"},"jobs":{"type":"integer"},"last_modified_by":{"type":"string"},"last_modified_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","application_id","cluster","cpu","memory","jobs","last_modified_by","last_modified_at"]}}}},"404":{"description":"Not found"}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"cluster","in":"path"}],"responses":{"200":{"description":"Quota updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"application_id":{"type":"string"},"cluster":{"type":"string"},"cpu":{"type":"integer"},"memory":{"type":"integer"},"jobs":{"type":"integer"},"last_modified_by":{"type":"string"},"last_modified_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","application_id","cluster","cpu","memory","jobs","last_modified_by","last_modified_at"]}}}},"201":{"description":"Quota created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"application_id":{"type":"string"},"cluster":{"type":"string"},"cpu":{"type":"integer"},"memory":{"type":"integer"},"jobs":{"type":"integer"},"last_modified_by":{"type":"string"},"last_modified_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","application_id","cluster","cpu","memory","jobs","last_modified_by","last_modified_at"]}}}},"403":{"description":"Forbidden"}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"cluster","in":"path"}],"responses":{"204":{"description":"Quota deleted"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/applications/{appId}/ownership":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"}],"responses":{"200":{"description":"List of ownership relationships for the application","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"owner_application_id":{"type":"string"},"subsidiary_application_id":{"type":"string"},"updated_by":{"type":"string"},"updated_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","owner_application_id","subsidiary_application_id","updated_by","updated_at"]}}}}},"404":{"description":"Not found"}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"}],"responses":{"201":{"description":"Ownership relationship created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"owner_application_id":{"type":"string"},"subsidiary_application_id":{"type":"string"},"updated_by":{"type":"string"},"updated_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","owner_application_id","subsidiary_application_id","updated_by","updated_at"]}}}},"403":{"description":"Forbidden"}}}},"/api/v1/applications/{appId}/ownership/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Ownership relationship deleted"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/clusters":{"get":{"responses":{"200":{"description":"List of cluster names","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}}}},"post":{"responses":{"200":{"description":"Cluster updated","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"201":{"description":"Cluster created","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"400":{"description":"Bad request"}}}},"/api/v1/clusterdetails":{"get":{"responses":{"200":{"description":"Cluster details","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}}}}},"/api/v1/clusters/{name}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"name","in":"path"}],"responses":{"204":{"description":"Cluster deleted"},"404":{"description":"Not found"}}}},"/api/v1/status/{owner}/{repo}/{sha}/{context}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"owner","in":"path"},{"schema":{"type":"string"},"required":true,"name":"repo","in":"path"},{"schema":{"type":"string"},"required":true,"name":"sha","in":"path"},{"schema":{"type":"string"},"required":true,"name":"context","in":"path"}],"responses":{"200":{"description":"Commit status","content":{"application/json":{"schema":{"type":"object","properties":{"owner":{"type":"string"},"repo":{"type":"string"},"sha":{"type":"string"},"context":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"},"target_url":{"type":"string"}},"required":["owner","repo","sha","context"]}}}},"404":{"description":"Not found"}}}},"/api/v1/status/{owner}/{repo}/{sha}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"owner","in":"path"},{"schema":{"type":"string"},"required":true,"name":"repo","in":"path"},{"schema":{"type":"string"},"required":true,"name":"sha","in":"path"}],"responses":{"200":{"description":"Commit statuses","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"owner":{"type":"string"},"repo":{"type":"string"},"sha":{"type":"string"},"context":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"},"target_url":{"type":"string"}},"required":["owner","repo","sha","context"]}}}}}}}},"/api/v1/status":{"post":{"responses":{"200":{"description":"Status updated","content":{"application/json":{"schema":{"type":"object","properties":{"owner":{"type":"string"},"repo":{"type":"string"},"sha":{"type":"string"},"context":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"},"target_url":{"type":"string"}},"required":["owner","repo","sha","context"]}}}},"201":{"description":"Status created","content":{"application/json":{"schema":{"type":"object","properties":{"owner":{"type":"string"},"repo":{"type":"string"},"sha":{"type":"string"},"context":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"},"target_url":{"type":"string"}},"required":["owner","repo","sha","context"]}}}},"400":{"description":"Bad request"},"403":{"description":"Not allowed to write statuses for this repository"},"404":{"description":"No application in your organizations for this repository"}}}},"/api/v1/applications/{appId}/charts":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"}],"responses":{"200":{"description":"Charts location","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"404":{"description":"Not found"}}}},"/api/v1/applications/{appId}/values":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"}],"responses":{"200":{"description":"Values location","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"404":{"description":"Not found"}}}},"/api/v1/applications/{appId}/charts/update":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"appId","in":"path"}],"responses":{"200":{"description":"Charts updated","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"403":{"description":"Forbidden"},"503":{"description":"Config store not configured"}}}},"/api/v1/stages":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"deployment_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page_size","in":"query"}],"responses":{"200":{"description":"List of stages","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next":{"type":"string"},"prev":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"status":{"type":"string","enum":["NOT_STARTED","RUNNING","FAILED","SUCCEEDED"]},"started_at":{"type":"string"},"last_updated_at":{"type":"string"},"finished_at":{"type":"string"}},"required":["id","deployment_id","status","started_at","last_updated_at","finished_at"]}}},"required":["total","next","prev","items"]}}}}}},"post":{"responses":{"201":{"description":"Stage created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"status":{"type":"string","enum":["NOT_STARTED","RUNNING","FAILED","SUCCEEDED"]},"started_at":{"type":"string"},"last_updated_at":{"type":"string"},"finished_at":{"type":"string"}},"required":["id","deployment_id","status","started_at","last_updated_at","finished_at"]}}}},"403":{"description":"Forbidden"},"404":{"description":"Deployment not found"}}}},"/api/v1/stages/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Stage details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"status":{"type":"string","enum":["NOT_STARTED","RUNNING","FAILED","SUCCEEDED"]},"started_at":{"type":"string"},"last_updated_at":{"type":"string"},"finished_at":{"type":"string"}},"required":["id","deployment_id","status","started_at","last_updated_at","finished_at"]}}}},"404":{"description":"Not found"}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Stage updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"status":{"type":"string","enum":["NOT_STARTED","RUNNING","FAILED","SUCCEEDED"]},"started_at":{"type":"string"},"last_updated_at":{"type":"string"},"finished_at":{"type":"string"}},"required":["id","deployment_id","status","started_at","last_updated_at","finished_at"]}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Stage deleted"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/search":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Public cross-resource search results","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"items":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}},"required":["total","items"]}}}}}}},"/api/v1/agents":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page_size","in":"query"},{"schema":{"type":"string"},"required":false,"name":"name","in":"query"},{"schema":{"type":"string"},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string"},"required":false,"name":"runtime","in":"query"},{"schema":{"type":"string"},"required":false,"name":"yellowpages_agent_id","in":"query"}],"responses":{"200":{"description":"List of agents","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next":{"type":"string"},"prev":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"yellowpages_agent_id":{"type":"string","nullable":true},"kind":{"type":"string","enum":["nlp","data-scraping","api-interaction","orchestration","custom"]},"runtime":{"type":"string","enum":["noop","claude-mcp","vercel-ai","semantic-kernel","langgraph","openai","ecs-runtask","aca-job"]},"model":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"tools":{"type":"array","items":{"nullable":true}},"mcp_servers":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_by":{"type":"string"},"created_at":{"type":"string"},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"mode_string":{"type":"string"}},"required":["id","name","yellowpages_agent_id","kind","runtime","model","description","instructions","tools","mcp_servers","config","created_by","created_at","owner_user","owner_group","mode","mode_string"]}}},"required":["total","next","prev","items"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"yellowpages_agent_id":{"type":"string","nullable":true},"kind":{"type":"string","enum":["nlp","data-scraping","api-interaction","orchestration","custom"],"default":"custom"},"runtime":{"type":"string","enum":["noop","claude-mcp","vercel-ai","semantic-kernel","langgraph","openai","ecs-runtask","aca-job"],"default":"noop"},"model":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"tools":{"type":"array","items":{"nullable":true}},"mcp_servers":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"mode":{"type":"integer","minimum":0,"maximum":511},"owner_group":{"type":"string","nullable":true}},"required":["name"]}}}},"responses":{"201":{"description":"Agent created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"yellowpages_agent_id":{"type":"string","nullable":true},"kind":{"type":"string","enum":["nlp","data-scraping","api-interaction","orchestration","custom"]},"runtime":{"type":"string","enum":["noop","claude-mcp","vercel-ai","semantic-kernel","langgraph","openai","ecs-runtask","aca-job"]},"model":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"tools":{"type":"array","items":{"nullable":true}},"mcp_servers":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_by":{"type":"string"},"created_at":{"type":"string"},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"mode_string":{"type":"string"}},"required":["id","name","yellowpages_agent_id","kind","runtime","model","description","instructions","tools","mcp_servers","config","created_by","created_at","owner_user","owner_group","mode","mode_string"]}}}},"400":{"description":"Invalid mode, owner_group, or mcp_servers"},"403":{"description":"No org membership"}}}},"/api/v1/agents/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Agent details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"yellowpages_agent_id":{"type":"string","nullable":true},"kind":{"type":"string","enum":["nlp","data-scraping","api-interaction","orchestration","custom"]},"runtime":{"type":"string","enum":["noop","claude-mcp","vercel-ai","semantic-kernel","langgraph","openai","ecs-runtask","aca-job"]},"model":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"tools":{"type":"array","items":{"nullable":true}},"mcp_servers":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_by":{"type":"string"},"created_at":{"type":"string"},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"mode_string":{"type":"string"}},"required":["id","name","yellowpages_agent_id","kind","runtime","model","description","instructions","tools","mcp_servers","config","created_by","created_at","owner_user","owner_group","mode","mode_string"]}}}},"404":{"description":"Not found"}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"yellowpages_agent_id":{"type":"string","nullable":true},"kind":{"type":"string","enum":["nlp","data-scraping","api-interaction","orchestration","custom"],"default":"custom"},"runtime":{"type":"string","enum":["noop","claude-mcp","vercel-ai","semantic-kernel","langgraph","openai","ecs-runtask","aca-job"],"default":"noop"},"model":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"tools":{"type":"array","items":{"nullable":true}},"mcp_servers":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"mode":{"type":"integer","minimum":0,"maximum":511},"owner_group":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"Agent updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"yellowpages_agent_id":{"type":"string","nullable":true},"kind":{"type":"string","enum":["nlp","data-scraping","api-interaction","orchestration","custom"]},"runtime":{"type":"string","enum":["noop","claude-mcp","vercel-ai","semantic-kernel","langgraph","openai","ecs-runtask","aca-job"]},"model":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"tools":{"type":"array","items":{"nullable":true}},"mcp_servers":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_by":{"type":"string"},"created_at":{"type":"string"},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"mode_string":{"type":"string"}},"required":["id","name","yellowpages_agent_id","kind","runtime","model","description","instructions","tools","mcp_servers","config","created_by","created_at","owner_user","owner_group","mode","mode_string"]}}}},"400":{"description":"Invalid mode, owner_group, or mcp_servers"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Agent deleted"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/agents/{id}/invoke":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"input":{"nullable":true}}}}}},"responses":{"200":{"description":"Idempotent run already exists","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"status":{"type":"string","enum":["running","awaiting_approval","succeeded","failed","canceled"]},"provider_ref":{"type":"string","nullable":true},"input":{"nullable":true},"output":{"nullable":true},"tokens":{"type":"integer","nullable":true},"cost":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"started_at":{"type":"string","nullable":true},"finished_at":{"type":"string","nullable":true},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"}},"required":["id","agent_id","status","provider_ref","tokens","cost","error","started_at","finished_at","owner_user","owner_group","mode"]}}}},"201":{"description":"Agent invoked","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"status":{"type":"string","enum":["running","awaiting_approval","succeeded","failed","canceled"]},"provider_ref":{"type":"string","nullable":true},"input":{"nullable":true},"output":{"nullable":true},"tokens":{"type":"integer","nullable":true},"cost":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"started_at":{"type":"string","nullable":true},"finished_at":{"type":"string","nullable":true},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"}},"required":["id","agent_id","status","provider_ref","tokens","cost","error","started_at","finished_at","owner_user","owner_group","mode"]}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/agent-runs/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Agent run details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"status":{"type":"string","enum":["running","awaiting_approval","succeeded","failed","canceled"]},"provider_ref":{"type":"string","nullable":true},"input":{"nullable":true},"output":{"nullable":true},"tokens":{"type":"integer","nullable":true},"cost":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"started_at":{"type":"string","nullable":true},"finished_at":{"type":"string","nullable":true},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"}},"required":["id","agent_id","status","provider_ref","tokens","cost","error","started_at","finished_at","owner_user","owner_group","mode"]}}}},"404":{"description":"Not found"}}}},"/api/v1/processes":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page_size","in":"query"},{"schema":{"type":"string"},"required":false,"name":"name","in":"query"}],"responses":{"200":{"description":"List of processes","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next":{"type":"string"},"prev":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"definition":{"type":"object","properties":{"topology":{"type":"string","enum":["sequential","concurrent","handoff","supervisor"],"default":"sequential"},"steps":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"approvalGate":{"type":"boolean"},"signalName":{"type":"string"},"label":{"type":"string"},"key":{"type":"string"},"group":{"type":"string"},"supervisor":{"type":"boolean"},"routes":{"type":"array","items":{"type":"string"}}}},"default":[]}}},"created_by":{"type":"string"},"created_at":{"type":"string"},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"mode_string":{"type":"string"}},"required":["id","name","description","definition","created_by","created_at","owner_user","owner_group","mode","mode_string"]}}},"required":["total","next","prev","items"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"definition":{"type":"object","properties":{"topology":{"type":"string","enum":["sequential","concurrent","handoff","supervisor"],"default":"sequential"},"steps":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"approvalGate":{"type":"boolean"},"signalName":{"type":"string"},"label":{"type":"string"},"key":{"type":"string"},"group":{"type":"string"},"supervisor":{"type":"boolean"},"routes":{"type":"array","items":{"type":"string"}}}},"default":[]}}},"mode":{"type":"integer","minimum":0,"maximum":511},"owner_group":{"type":"string","nullable":true}},"required":["name"]}}}},"responses":{"201":{"description":"Process created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"definition":{"type":"object","properties":{"topology":{"type":"string","enum":["sequential","concurrent","handoff","supervisor"],"default":"sequential"},"steps":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"approvalGate":{"type":"boolean"},"signalName":{"type":"string"},"label":{"type":"string"},"key":{"type":"string"},"group":{"type":"string"},"supervisor":{"type":"boolean"},"routes":{"type":"array","items":{"type":"string"}}}},"default":[]}}},"created_by":{"type":"string"},"created_at":{"type":"string"},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"mode_string":{"type":"string"}},"required":["id","name","description","definition","created_by","created_at","owner_user","owner_group","mode","mode_string"]}}}},"400":{"description":"mode or owner_group outside the allowed ceiling"},"403":{"description":"No org membership"}}}},"/api/v1/processes/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Process details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"definition":{"type":"object","properties":{"topology":{"type":"string","enum":["sequential","concurrent","handoff","supervisor"],"default":"sequential"},"steps":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"approvalGate":{"type":"boolean"},"signalName":{"type":"string"},"label":{"type":"string"},"key":{"type":"string"},"group":{"type":"string"},"supervisor":{"type":"boolean"},"routes":{"type":"array","items":{"type":"string"}}}},"default":[]}}},"created_by":{"type":"string"},"created_at":{"type":"string"},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"mode_string":{"type":"string"}},"required":["id","name","description","definition","created_by","created_at","owner_user","owner_group","mode","mode_string"]}}}},"404":{"description":"Not found"}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"definition":{"type":"object","properties":{"topology":{"type":"string","enum":["sequential","concurrent","handoff","supervisor"],"default":"sequential"},"steps":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"approvalGate":{"type":"boolean"},"signalName":{"type":"string"},"label":{"type":"string"},"key":{"type":"string"},"group":{"type":"string"},"supervisor":{"type":"boolean"},"routes":{"type":"array","items":{"type":"string"}}}},"default":[]}}},"mode":{"type":"integer","minimum":0,"maximum":511},"owner_group":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"Process updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"definition":{"type":"object","properties":{"topology":{"type":"string","enum":["sequential","concurrent","handoff","supervisor"],"default":"sequential"},"steps":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"approvalGate":{"type":"boolean"},"signalName":{"type":"string"},"label":{"type":"string"},"key":{"type":"string"},"group":{"type":"string"},"supervisor":{"type":"boolean"},"routes":{"type":"array","items":{"type":"string"}}}},"default":[]}}},"created_by":{"type":"string"},"created_at":{"type":"string"},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"mode_string":{"type":"string"}},"required":["id","name","description","definition","created_by","created_at","owner_user","owner_group","mode","mode_string"]}}}},"400":{"description":"mode or owner_group outside the allowed ceiling"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Process deleted"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/processes/{id}/run":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"input":{"nullable":true}}}}}},"responses":{"201":{"description":"Process run started","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"process_id":{"type":"string"},"status":{"type":"string","enum":["running","awaiting_approval","succeeded","failed","canceled"]},"current_step":{"type":"integer"},"input":{"nullable":true},"result":{"nullable":true},"error":{"type":"string","nullable":true},"started_at":{"type":"string","nullable":true},"finished_at":{"type":"string","nullable":true},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"approvals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"process_run_id":{"type":"string"},"signal_name":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected"]},"context":{"nullable":true},"resolver_user":{"type":"string","nullable":true},"requested_at":{"type":"string","nullable":true},"resolved_at":{"type":"string","nullable":true}},"required":["id","process_run_id","signal_name","status","resolver_user","requested_at","resolved_at"]}}},"required":["id","process_id","status","current_step","error","started_at","finished_at","owner_user","owner_group","mode"]}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"503":{"description":"No live process-run worker (fw-yxzv)"}}}},"/api/v1/process-runs/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Process run details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"process_id":{"type":"string"},"status":{"type":"string","enum":["running","awaiting_approval","succeeded","failed","canceled"]},"current_step":{"type":"integer"},"input":{"nullable":true},"result":{"nullable":true},"error":{"type":"string","nullable":true},"started_at":{"type":"string","nullable":true},"finished_at":{"type":"string","nullable":true},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"approvals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"process_run_id":{"type":"string"},"signal_name":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected"]},"context":{"nullable":true},"resolver_user":{"type":"string","nullable":true},"requested_at":{"type":"string","nullable":true},"resolved_at":{"type":"string","nullable":true}},"required":["id","process_run_id","signal_name","status","resolver_user","requested_at","resolved_at"]}}},"required":["id","process_id","status","current_step","error","started_at","finished_at","owner_user","owner_group","mode"]}}}},"404":{"description":"Not found"}}}},"/api/v1/approvals":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page_size","in":"query"}],"responses":{"200":{"description":"Approvals the caller may act on (default: pending)","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next":{"type":"string"},"prev":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"process_run_id":{"type":"string"},"process_id":{"type":"string"},"process_name":{"type":"string"},"signal_name":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected"]},"context":{"nullable":true},"resolver_user":{"type":"string","nullable":true},"requested_at":{"type":"string","nullable":true},"resolved_at":{"type":"string","nullable":true},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"}},"required":["id","process_run_id","process_id","process_name","signal_name","status","resolver_user","requested_at","resolved_at","owner_user","owner_group","mode"]}}},"required":["total","next","prev","items"]}}}}}}},"/api/v1/approvals/{id}/resolve":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","reject"]},"payload":{"nullable":true}},"required":["decision"]}}}},"responses":{"200":{"description":"Approval resolved","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"process_id":{"type":"string"},"status":{"type":"string","enum":["running","awaiting_approval","succeeded","failed","canceled"]},"current_step":{"type":"integer"},"input":{"nullable":true},"result":{"nullable":true},"error":{"type":"string","nullable":true},"started_at":{"type":"string","nullable":true},"finished_at":{"type":"string","nullable":true},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"approvals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"process_run_id":{"type":"string"},"signal_name":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected"]},"context":{"nullable":true},"resolver_user":{"type":"string","nullable":true},"requested_at":{"type":"string","nullable":true},"resolved_at":{"type":"string","nullable":true}},"required":["id","process_run_id","signal_name","status","resolver_user","requested_at","resolved_at"]}}},"required":["id","process_id","status","current_step","error","started_at","finished_at","owner_user","owner_group","mode"]}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Approval already resolved"},"503":{"description":"Approve refused: no live process-run worker (fw-yxzv)"}}}},"/api/v1/mcp-servers":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"name","in":"query"},{"schema":{"type":"string"},"required":false,"name":"transport","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page_size","in":"query"}],"responses":{"200":{"description":"List of MCP servers","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next":{"type":"string"},"prev":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"transport":{"type":"string","enum":["stdio","http"]},"url":{"type":"string","nullable":true},"command":{"type":"string","nullable":true},"args":{"type":"array","items":{"type":"string"}},"description":{"type":"string","nullable":true},"created_by":{"type":"string"},"created_at":{"type":"string"},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"mode_string":{"type":"string"}},"required":["id","name","transport","url","command","args","description","created_by","created_at","owner_user","owner_group","mode","mode_string"]}}},"required":["total","next","prev","items"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"transport":{"type":"string","enum":["stdio","http"],"default":"http"},"url":{"type":"string","nullable":true},"command":{"type":"string","nullable":true},"args":{"type":"array","items":{"type":"string"}},"headers":{"type":"object","additionalProperties":{"type":"string"}},"description":{"type":"string","nullable":true},"mode":{"type":"integer","minimum":0,"maximum":511},"owner_group":{"type":"string","nullable":true}},"required":["name"]}}}},"responses":{"201":{"description":"MCP server created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"transport":{"type":"string","enum":["stdio","http"]},"url":{"type":"string","nullable":true},"command":{"type":"string","nullable":true},"args":{"type":"array","items":{"type":"string"}},"description":{"type":"string","nullable":true},"created_by":{"type":"string"},"created_at":{"type":"string"},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"mode_string":{"type":"string"}},"required":["id","name","transport","url","command","args","description","created_by","created_at","owner_user","owner_group","mode","mode_string"]}}}},"400":{"description":"Invalid URL or SSRF violation"},"403":{"description":"No org membership"}}}},"/api/v1/mcp-servers/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"MCP server details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"transport":{"type":"string","enum":["stdio","http"]},"url":{"type":"string","nullable":true},"command":{"type":"string","nullable":true},"args":{"type":"array","items":{"type":"string"}},"description":{"type":"string","nullable":true},"created_by":{"type":"string"},"created_at":{"type":"string"},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"mode_string":{"type":"string"}},"required":["id","name","transport","url","command","args","description","created_by","created_at","owner_user","owner_group","mode","mode_string"]}}}},"404":{"description":"Not found"}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"transport":{"type":"string","enum":["stdio","http"],"default":"http"},"url":{"type":"string","nullable":true},"command":{"type":"string","nullable":true},"args":{"type":"array","items":{"type":"string"}},"headers":{"type":"object","additionalProperties":{"type":"string"}},"description":{"type":"string","nullable":true},"mode":{"type":"integer","minimum":0,"maximum":511},"owner_group":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"MCP server updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"transport":{"type":"string","enum":["stdio","http"]},"url":{"type":"string","nullable":true},"command":{"type":"string","nullable":true},"args":{"type":"array","items":{"type":"string"}},"description":{"type":"string","nullable":true},"created_by":{"type":"string"},"created_at":{"type":"string"},"owner_user":{"type":"string","nullable":true},"owner_group":{"type":"string","nullable":true},"mode":{"type":"integer"},"mode_string":{"type":"string"}},"required":["id","name","transport","url","command","args","description","created_by","created_at","owner_user","owner_group","mode","mode_string"]}}}},"400":{"description":"Invalid URL or SSRF violation"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"MCP server deleted"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/yellowpages/search":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"type","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Yellow Pages catalog matches (empty + configured:false when unconfigured)","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]}},"configured":{"type":"boolean"}},"required":["items","configured"]}}}}}}},"/api/v1/vcs-tenants":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"provider","in":"query"},{"schema":{"type":"string"},"required":false,"name":"active","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page_size","in":"query"}],"responses":{"200":{"description":"Read-only shadow of the Yellow Pages vcs_tenants catalog","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next":{"type":"string"},"prev":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"slug":{"type":"string"},"display_name":{"type":"string"},"active":{"type":"boolean"}},"required":["id","provider","slug","display_name","active"]}}},"required":["total","next","prev","items"]}}}}}}},"/api/v1/push-tokens":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","pattern":"^Expo(nent)?PushToken\\[[^\\]\\s]+\\]$"},"platform":{"type":"string","enum":["ios","android","web"]}},"required":["token"]}}}},"responses":{"201":{"description":"Token registered","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/api/v1/push-tokens/{token}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"Token removed","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/api/v1/eula":{"get":{"responses":{"200":{"description":"Current EULA and whether the caller has accepted it","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"text":{"type":"string"},"accepted":{"type":"boolean"},"accepted_at":{"type":"string","nullable":true}},"required":["version","text","accepted","accepted_at"]}}}}}}},"/api/v1/eula/accept":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","minLength":1,"maxLength":32}},"required":["version"]}}}},"responses":{"200":{"description":"EULA accepted","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"text":{"type":"string"},"accepted":{"type":"boolean"},"accepted_at":{"type":"string","nullable":true}},"required":["version","text","accepted","accepted_at"]}}}},"400":{"description":"Not the current EULA version"}}}},"/api/v1/reports":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"resource_type":{"type":"string","enum":["application","agent","process"]},"resource_id":{"type":"string","minLength":1,"maxLength":256},"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["resource_type","resource_id","reason"]}}}},"responses":{"200":{"description":"An open report by the caller for this resource already exists","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"reporter_id":{"type":"string"},"resource_type":{"type":"string","enum":["application","agent","process"]},"resource_id":{"type":"string"},"content_author_id":{"type":"string","nullable":true},"reason":{"type":"string"},"status":{"type":"string","enum":["open","actioned","dismissed"]},"created_at":{"type":"string"},"due_at":{"type":"string"},"overdue":{"type":"boolean"},"resolved_at":{"type":"string","nullable":true},"resolved_by":{"type":"string","nullable":true},"resolution_note":{"type":"string","nullable":true}},"required":["id","org_id","reporter_id","resource_type","resource_id","content_author_id","reason","status","created_at","due_at","overdue","resolved_at","resolved_by","resolution_note"]}}}},"201":{"description":"Report filed; org admins notified","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"reporter_id":{"type":"string"},"resource_type":{"type":"string","enum":["application","agent","process"]},"resource_id":{"type":"string"},"content_author_id":{"type":"string","nullable":true},"reason":{"type":"string"},"status":{"type":"string","enum":["open","actioned","dismissed"]},"created_at":{"type":"string"},"due_at":{"type":"string"},"overdue":{"type":"boolean"},"resolved_at":{"type":"string","nullable":true},"resolved_by":{"type":"string","nullable":true},"resolution_note":{"type":"string","nullable":true}},"required":["id","org_id","reporter_id","resource_type","resource_id","content_author_id","reason","status","created_at","due_at","overdue","resolved_at","resolved_by","resolution_note"]}}}},"404":{"description":"Resource not found or not readable by you"},"409":{"description":"Conflicting report changed concurrently; retry"},"429":{"description":"Too many reports; try again later"}}},"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"page_size","in":"query"}],"responses":{"200":{"description":"Reports in the orgs the caller administers, soonest due first","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next":{"type":"string"},"prev":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"reporter_id":{"type":"string"},"resource_type":{"type":"string","enum":["application","agent","process"]},"resource_id":{"type":"string"},"content_author_id":{"type":"string","nullable":true},"reason":{"type":"string"},"status":{"type":"string","enum":["open","actioned","dismissed"]},"created_at":{"type":"string"},"due_at":{"type":"string"},"overdue":{"type":"boolean"},"resolved_at":{"type":"string","nullable":true},"resolved_by":{"type":"string","nullable":true},"resolution_note":{"type":"string","nullable":true}},"required":["id","org_id","reporter_id","resource_type","resource_id","content_author_id","reason","status","created_at","due_at","overdue","resolved_at","resolved_by","resolution_note"]}}},"required":["total","next","prev","items"]}}}},"400":{"description":"Invalid status filter"},"403":{"description":"Requires org:admin"}}}},"/api/v1/reports/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["actioned","dismissed"]},"note":{"type":"string","maxLength":1000}},"required":["status"]}}}},"responses":{"200":{"description":"Report resolved","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"reporter_id":{"type":"string"},"resource_type":{"type":"string","enum":["application","agent","process"]},"resource_id":{"type":"string"},"content_author_id":{"type":"string","nullable":true},"reason":{"type":"string"},"status":{"type":"string","enum":["open","actioned","dismissed"]},"created_at":{"type":"string"},"due_at":{"type":"string"},"overdue":{"type":"boolean"},"resolved_at":{"type":"string","nullable":true},"resolved_by":{"type":"string","nullable":true},"resolution_note":{"type":"string","nullable":true}},"required":["id","org_id","reporter_id","resource_type","resource_id","content_author_id","reason","status","created_at","due_at","overdue","resolved_at","resolved_by","resolution_note"]}}}},"403":{"description":"Requires org:admin"},"404":{"description":"Not found"},"409":{"description":"Report already resolved"}}}},"/api/v1/blocks":{"get":{"responses":{"200":{"description":"The caller's blocked users","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next":{"type":"string"},"prev":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"blocked_user_id":{"type":"string"},"org_id":{"type":"string"},"created_at":{"type":"string"}},"required":["blocked_user_id","org_id","created_at"]}}},"required":["total","next","prev","items"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"string","minLength":1,"maxLength":256}},"required":["user_id"]}}}},"responses":{"200":{"description":"Already blocked","content":{"application/json":{"schema":{"type":"object","properties":{"blocked_user_id":{"type":"string"},"org_id":{"type":"string"},"created_at":{"type":"string"}},"required":["blocked_user_id","org_id","created_at"]}}}},"201":{"description":"User blocked","content":{"application/json":{"schema":{"type":"object","properties":{"blocked_user_id":{"type":"string"},"org_id":{"type":"string"},"created_at":{"type":"string"}},"required":["blocked_user_id","org_id","created_at"]}}}},"400":{"description":"Cannot block yourself"},"404":{"description":"User is not a co-member or the creator of anything you can see"},"409":{"description":"Block changed concurrently; retry"}}}},"/api/v1/blocks/{userId}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"User unblocked","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/api/me":{"get":{"responses":{"200":{"description":"The authenticated user","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}},"hasOrg":{"type":"boolean"},"orgId":{"type":"string","nullable":true}},"required":["id","email","name","roles","hasOrg","orgId"]}}}},"401":{"description":"Unauthorized"}}}},"/api/users":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"orgId","in":"query"}],"responses":{"200":{"description":"List of organization members","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"joinedAt":{"type":"string"}},"required":["id","email","name","role","joinedAt"]}}},"required":["users"]}}}}}}},"/api/users/pending":{"get":{"responses":{"200":{"description":"Users awaiting an organization membership","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","email","createdAt"]}}},"required":["users"]}}}},"403":{"description":"Caller is not org:admin in any organization"}}}},"/api/users/{id}/role":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string"},"orgId":{"type":"string"}},"required":["role"]}}}},"responses":{"200":{"description":"Updated user","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"joinedAt":{"type":"string"}},"required":["id","email","name","role","joinedAt"]}}}},"400":{"description":"orgId required to grant a first membership"},"404":{"description":"User not found"}}}},"/api/service-accounts":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"role":{"type":"string","default":"ci:agent"},"orgId":{"type":"string"}},"required":["name"]}}}},"responses":{"201":{"description":"Service account created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"createdAt":{"type":"string"},"lastUsedAt":{"type":"string","nullable":true},"token":{"type":"string"}},"required":["id","name","role","createdAt","lastUsedAt","token"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"orgId","in":"query"}],"responses":{"200":{"description":"List of service accounts","content":{"application/json":{"schema":{"type":"object","properties":{"serviceAccounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"createdAt":{"type":"string"},"lastUsedAt":{"type":"string","nullable":true}},"required":["id","name","role","createdAt","lastUsedAt"]}}},"required":["serviceAccounts"]}}}},"403":{"description":"Cross-org request or ambiguous org (caller must specify a member org)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/service-accounts/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Service account deleted"},"404":{"description":"Service account not found"}}}},"/api/organizations":{"get":{"responses":{"200":{"description":"List of organizations","content":{"application/json":{"schema":{"type":"object","properties":{"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"]}}},"required":["organizations"]}}}}}}},"/api/organizations/{id}/sso":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"SSO configuration","content":{"application/json":{"schema":{"type":"object","properties":{"issuerUrl":{"type":"string"},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"scopes":{"type":"string"},"roleClaimPath":{"type":"string"},"roleMapping":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"404":{"description":"Organization not found"}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"issuerUrl":{"type":"string"},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"scopes":{"type":"string"},"roleClaimPath":{"type":"string"},"roleMapping":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"responses":{"200":{"description":"SSO configuration updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"404":{"description":"Organization not found"}}}},"/api/organizations/{id}/ai-review-policy":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"AI advisory review policy","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"404":{"description":"Organization not found"}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"AI advisory review policy updated","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"404":{"description":"Organization not found"}}}},"/api/v1/organizations/{id}/members/{userId}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"Member removed from the organization","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Cannot remove yourself"},"403":{"description":"org:admin in this organization required"},"404":{"description":"Organization or member not found"},"409":{"description":"Cannot remove the last org:admin"}}}},"/api/directory/teams":{"get":{"responses":{"200":{"description":"Teams","content":{"application/json":{"schema":{"type":"object","properties":{"teams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"]}}},"required":["teams"]}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}},"/api/directory/users":{"get":{"responses":{"200":{"description":"Users","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"teamIds":{"type":"array","items":{"type":"string"}}},"required":["id","name","email"]}}},"required":["users"]}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}}}}