{"components":{"responses":{},"schemas":{"AdminUserInvite_Details":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"email":{"description":"Email address the invite was sent to","example":"user@example.com","type":"string"},"id":{"$ref":"#/components/schemas/AdminUserInvite_Id"},"inserted_at":{"description":"When the invite was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"invite_url":{"description":"URL to accept the invite","example":"https://example.com","format":"uri","title":"Uri","type":"string"},"status":{"description":"Current status of the invite","enum":["pending","used","revoked"],"example":"pending","type":"string"},"token":{"description":"Unique token for the invite","example":"abc123def456...","type":"string"},"type":{"description":"Type of resource (always 'admin_user_invite')","enum":["admin_user_invite"],"example":"admin_user_invite","type":"string"},"updated_at":{"description":"When the invite was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"AdminUserInvite_Details","type":"object"},"Environment_Id":{"description":"A valid environment ID","example":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","title":"Environment_Id","type":"string"},"SpanTypeSchemaDetails_ForCreate":{"description":"One span type with name, params_schema and optional result_schema","properties":{"data_risk":{"oneOf":[{"$ref":"#/components/schemas/DataRisk"},{"$ref":"#/components/schemas/Null"}]},"description":{"oneOf":[{"description":"Optional description","type":"string"},{"$ref":"#/components/schemas/Null"}]},"name":{"description":"Span type name (e.g. llm, tool)","type":"string"},"params_schema":{"additionalProperties":true,"description":"JSON schema for the span payload","type":"object"},"result_schema":{"oneOf":[{"additionalProperties":true,"description":"JSON schema for the span result payload. Defaults to empty object if omitted.","type":"object"},{"$ref":"#/components/schemas/Null"}]},"template":{"oneOf":[{"description":"Display template. Use {{field}} to interpolate params and result fields.","type":"string"},{"$ref":"#/components/schemas/Null"}]},"title":{"oneOf":[{"description":"Human-readable title. Defaults to name when omitted.","type":"string"},{"$ref":"#/components/schemas/Null"}]}},"required":["name","params_schema"],"title":"SpanTypeSchemaDetails_ForCreate","type":"object"},"ApiToken_Id":{"description":"A valid API token ID","example":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","title":"ApiToken_Id","type":"string"},"Outputs":{"additionalProperties":{"additionalProperties":true,"description":"Output from a query or action. Contains either a success response (with 'status': 'success' and operation-specific data) or an error response (with 'status': 'error', 'code', 'message', and optionally 'errors').","properties":{},"title":"Output","type":"object"},"description":"Map where keys are the idempotency_key values from the request, and values are the corresponding query/action outputs or error responses. Each output is independent - one item failing does not affect others.","title":"Outputs","type":"object"},"SchemaValidationResult":{"description":"Result of validating result_schema","properties":{"message":{"oneOf":[{"description":"Validation error message when status is 'error'","type":"string"},{"$ref":"#/components/schemas/Null"}]},"status":{"description":"Whether the schema is valid","enum":["success","error"],"example":"success","type":"string"}},"title":"SchemaValidationResult","type":"object"},"Output":{"additionalProperties":true,"description":"Output from a query or action. Contains either a success response (with 'status': 'success' and operation-specific data) or an error response (with 'status': 'error', 'code', 'message', and optionally 'errors').","properties":{},"title":"Output","type":"object"},"IdempotencyKeyOrNull":{"oneOf":[{"description":"Optional idempotency key for ensuring request idempotency","type":"string"},{"$ref":"#/components/schemas/Null"}],"title":"IdempotencyKeyOrNull"},"Agent_RiskRollup":{"properties":{"observed_risk":{"description":"Risk profile from actual span executions (what the agent has done). null if no spans executed.","oneOf":[{"properties":{"all_data_categories":{"description":"List of all data categories included across span types","items":{"description":"Data category name","type":"string"},"maxItems":18,"type":"array"},"assessed_span_types":{"description":"Number of span types with risk data","minimum":0,"type":"integer"},"classification_counts":{"description":"Count of span types at each classification level","properties":{"confidential":{"minimum":0,"type":"integer"},"internal":{"minimum":0,"type":"integer"},"public":{"minimum":0,"type":"integer"},"restricted":{"minimum":0,"type":"integer"},"secret":{"minimum":0,"type":"integer"},"unknown":{"minimum":0,"type":"integer"}},"type":"object"},"external_communication_count":{"description":"Number of span types with external communication allowed","minimum":0,"type":"integer"},"highest_classification":{"description":"Highest classification level across all span types","enum":["unknown","public","internal","confidential","restricted","secret"],"example":"unknown","type":"string"},"total_span_types":{"description":"Total number of span types","minimum":0,"type":"integer"},"unassessed_span_types":{"description":"Number of span types without risk data","minimum":0,"type":"integer"}},"title":"Agent_RiskSummary","type":"object"},{"$ref":"#/components/schemas/Null"}]},"theoretical_risk":{"description":"Risk profile from the schema definition (what the agent could do)","oneOf":[{"properties":{"all_data_categories":{"description":"List of all data categories included across span types","items":{"description":"Data category name","type":"string"},"maxItems":18,"type":"array"},"assessed_span_types":{"description":"Number of span types with risk data","minimum":0,"type":"integer"},"classification_counts":{"description":"Count of span types at each classification level","properties":{"confidential":{"minimum":0,"type":"integer"},"internal":{"minimum":0,"type":"integer"},"public":{"minimum":0,"type":"integer"},"restricted":{"minimum":0,"type":"integer"},"secret":{"minimum":0,"type":"integer"},"unknown":{"minimum":0,"type":"integer"}},"type":"object"},"external_communication_count":{"description":"Number of span types with external communication allowed","minimum":0,"type":"integer"},"highest_classification":{"description":"Highest classification level across all span types","enum":["unknown","public","internal","confidential","restricted","secret"],"example":"unknown","type":"string"},"total_span_types":{"description":"Total number of span types","minimum":0,"type":"integer"},"unassessed_span_types":{"description":"Number of span types without risk data","minimum":0,"type":"integer"}},"title":"Agent_RiskSummary","type":"object"},{"$ref":"#/components/schemas/Null"}]}},"title":"Agent_RiskRollup","type":"object"},"DataRisk":{"properties":{"action_profile":{"$ref":"#/components/schemas/ActionProfile"},"params_data_categories":{"$ref":"#/components/schemas/DataCategories"},"result_data_categories":{"$ref":"#/components/schemas/DataCategories"}},"required":["action_profile","params_data_categories","result_data_categories"],"title":"DataRisk","type":"object"},"AgentSpan_Details":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"agent_id":{"$ref":"#/components/schemas/Agent_Id"},"agent_instance_id":{"$ref":"#/components/schemas/AgentInstance_Id"},"finished_at":{"oneOf":[{"description":"When the span finished (null if still in progress)","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]},"id":{"$ref":"#/components/schemas/AgentSpan_Id"},"parent_span_id":{"description":"ID of the parent span (null if this is a root span)","oneOf":[{"$ref":"#/components/schemas/AgentSpan_Id"},{"$ref":"#/components/schemas/Null"}]},"payload":{"additionalProperties":true,"description":"Span payload data (arbitrary JSON object)","type":"object"},"result_payload":{"oneOf":[{"additionalProperties":true,"description":"Result payload (arbitrary JSON), only present when span is finished","type":"object"},{"$ref":"#/components/schemas/Null"}]},"schema_name":{"description":"Name of the schema for this span","example":"llm","type":"string"},"schema_title":{"description":"Human-readable title for the schema (from JSON schema, defaults to schema_name)","example":"LLM","type":"string"},"started_at":{"oneOf":[{"description":"When the span started (null when status is pending)","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]},"status":{"description":"Status of the span: 'pending' (not started), 'active' (started but not finished), 'complete' (finished successfully), 'failed' (ended with failure), or 'cancelled' (never started, cancelled)","enum":["pending","active","complete","failed","cancelled"],"example":"active","type":"string"},"summary":{"oneOf":[{"description":"Human-readable summary rendered from the schema template using payload and result_payload (null when template is missing)","type":"string"},{"$ref":"#/components/schemas/Null"}]},"type":{"description":"Type of resource (always 'agent_span')","enum":["agent_span"],"example":"agent_span","type":"string"}},"title":"AgentSpan_Details","type":"object"},"AdminUser_DetailsForUpdate":{"properties":{"job_title":{"oneOf":[{"description":"Job title within the account","type":"string"},{"$ref":"#/components/schemas/Null"}]},"name":{"description":"Admin user name","type":"string"},"profile_completed_at":{"oneOf":[{"description":"When the user completed their profile (set on profile completion)","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]}},"title":"AdminUser_DetailsForUpdate","type":"object"},"AdminUserInvite_Summary":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"email":{"description":"Email address the invite was sent to","example":"user@example.com","type":"string"},"id":{"$ref":"#/components/schemas/AdminUserInvite_Id"},"inserted_at":{"description":"When the invite was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"invite_url":{"description":"URL to accept the invite","example":"https://example.com","format":"uri","title":"Uri","type":"string"},"status":{"description":"Current status of the invite","enum":["pending","used","revoked"],"example":"pending","type":"string"},"type":{"description":"Type of resource (always 'admin_user_invite')","enum":["admin_user_invite"],"example":"admin_user_invite","type":"string"},"updated_at":{"description":"When the invite was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"AdminUserInvite_Summary","type":"object"},"DataCategories":{"properties":{"authentication_and_secrets":{"description":"Authentication and secrets present","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"behavioural_and_inferred":{"description":"Behavioural and inferred data present","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"classification":{"description":"Classification level","enum":["unknown","public","internal","confidential","restricted","secret"],"example":"unknown","type":"string"},"contact_information":{"description":"Contact information present","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"criminal_justice":{"description":"Criminal justice data present","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"financial_information":{"description":"Financial information present","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"gdpr_biometric_for_identification":{"description":"GDPR: biometric data for identification","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"gdpr_genetic_data":{"description":"GDPR: genetic data","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"gdpr_political_opinions":{"description":"GDPR: political opinions","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"gdpr_racial_or_ethnic_origin":{"description":"GDPR: racial or ethnic origin","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"gdpr_religious_or_philosophical_beliefs":{"description":"GDPR: religious or philosophical beliefs","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"gdpr_sex_life_or_sexual_orientation":{"description":"GDPR: sex life or sexual orientation","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"gdpr_trade_union_membership":{"description":"GDPR: trade union membership","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"health_and_medical":{"description":"Health and medical data present","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"location_and_tracking":{"description":"Location and tracking data present","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"minors_data":{"description":"Minors data present","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"organisational_confidential":{"description":"Organisational confidential data present","enum":["unknown","included","excluded"],"example":"unknown","type":"string"},"personal_identifiers":{"description":"Personal identifiers present","enum":["unknown","included","excluded"],"example":"unknown","type":"string"}},"required":["personal_identifiers","contact_information","financial_information","health_and_medical","criminal_justice","authentication_and_secrets","organisational_confidential","minors_data","location_and_tracking","behavioural_and_inferred","gdpr_racial_or_ethnic_origin","gdpr_political_opinions","gdpr_religious_or_philosophical_beliefs","gdpr_trade_union_membership","gdpr_genetic_data","gdpr_biometric_for_identification","gdpr_sex_life_or_sexual_orientation","classification"],"title":"DataCategories","type":"object"},"BulkRequest":{"description":"Request body for bulk query/action operations. Allows executing multiple API operations in a single request.","example":{"items":[{"_type":"agents/list","environment_id":"env_abc123def456","idempotency_key":"list-agents-2024-01-15-001"},{"_type":"agents/create","details":{"description":"Handles customer support inquiries","environment_id":"env_abc123def456","name":"Customer Support Bot"},"idempotency_key":"create-agent-2024-01-15-002"},{"_type":"agents/show","agent_id":"agent_xyz789ghi012","idempotency_key":"show-agent-2024-01-15-003"}]},"properties":{"items":{"description":"List of items to process in bulk. Each item will be processed independently in its own transaction.","items":{"additionalProperties":true,"description":"A single item in a bulk request. Each item must include `_type` and `idempotency_key`, plus any additional parameters required by the specific query/action type (e.g., `environment_id` for agents/list, `details` for agents/create).","example":{"_type":"agents/create","details":{"description":"Handles customer support inquiries","environment_id":"env_abc123def456","name":"Customer Support Bot"},"idempotency_key":"create-agent-2024-01-15-001"},"properties":{"_type":{"description":"The type of query/action to execute (e.g., 'agents/list', 'agents/create')","example":"agents/list","title":"Type","type":"string"},"idempotency_key":{"description":"Required unique idempotency key for this item. Must be 8–128 characters and unique within the request. Used to identify the result in the response map.","example":"create-agent-2024-01-15-001","maxLength":128,"minLength":8,"title":"IdempotencyKey","type":"string"}},"required":["_type","idempotency_key"],"title":"BulkItem","type":"object"},"minItems":1,"title":"Items","type":"array"}},"required":["items"],"title":"BulkRequest","type":"object"},"IdempotencyKey":{"description":"Required unique idempotency key for this item. Must be 8–128 characters and unique within the request. Used to identify the result in the response map.","example":"create-agent-2024-01-15-001","maxLength":128,"minLength":8,"title":"IdempotencyKey","type":"string"},"ApiToken_Details":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"available_actions":{"description":"Available actions for this token based on its status","properties":{"activate":{"description":"Whether the token can be activated","type":"boolean"},"delete":{"description":"Whether the token can be deleted","type":"boolean"},"revoke":{"description":"Whether the token can be revoked","type":"boolean"},"suspend":{"description":"Whether the token can be suspended","type":"boolean"}},"title":"ApiToken_AvailableActions","type":"object"},"created_by_admin_user_id":{"description":"ID of the admin user who created this token","oneOf":[{"$ref":"#/components/schemas/AdminUser_Id"},{"$ref":"#/components/schemas/Null"}]},"environment_id":{"description":"Environment ID (present when token_scope is 'environment')","oneOf":[{"$ref":"#/components/schemas/Environment_Id"},{"$ref":"#/components/schemas/Null"}]},"expires_at":{"description":"When the token expires","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"id":{"$ref":"#/components/schemas/ApiToken_Id"},"inserted_at":{"description":"When the token was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"last_used_at":{"oneOf":[{"description":"When the token was last used for authentication","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]},"status":{"description":"Current status of the token","enum":["active","suspended","revoked"],"example":"active","type":"string"},"token_scope":{"description":"Scope of the token","enum":["account","environment"],"example":"account","type":"string"},"type":{"description":"Type of resource (always 'api_token')","enum":["api_token"],"example":"api_token","type":"string"},"updated_at":{"description":"When the token was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"ApiToken_Details","type":"object"},"ApiToken_Summary":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"created_by_admin_user_id":{"description":"ID of the admin user who created this token","oneOf":[{"$ref":"#/components/schemas/AdminUser_Id"},{"$ref":"#/components/schemas/Null"}]},"environment_id":{"description":"Environment ID (present when token_scope is 'environment')","oneOf":[{"$ref":"#/components/schemas/Environment_Id"},{"$ref":"#/components/schemas/Null"}]},"expires_at":{"description":"When the token expires","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"id":{"$ref":"#/components/schemas/ApiToken_Id"},"inserted_at":{"description":"When the token was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"last_used_at":{"oneOf":[{"description":"When the token was last used for authentication","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]},"status":{"description":"Current status of the token","enum":["active","suspended","revoked"],"example":"active","type":"string"},"token_scope":{"description":"Scope of the token","enum":["account","environment"],"example":"account","type":"string"},"type":{"description":"Type of resource (always 'api_token')","enum":["api_token"],"example":"api_token","type":"string"},"updated_at":{"description":"When the token was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"ApiToken_Summary","type":"object"},"Account_Details":{"properties":{"id":{"$ref":"#/components/schemas/Account_Id"},"name":{"description":"Account name","example":"My Account","type":"string"},"organisation_name":{"oneOf":[{"description":"Organisation name (when purpose is not personal)","type":"string"},{"$ref":"#/components/schemas/Null"}]},"purpose":{"description":"Account purpose","enum":["business","personal","nonprofit","education","government"],"example":"business","type":"string"},"type":{"description":"Type of resource (always 'account')","enum":["account"],"example":"account","type":"string"},"website":{"oneOf":[{"description":"Website URL","type":"string"},{"$ref":"#/components/schemas/Null"}]}},"title":"Account_Details","type":"object"},"Uri":{"description":"URL to accept the invite","example":"https://example.com","format":"uri","title":"Uri","type":"string"},"ActionProfile":{"properties":{"create_data":{"description":"Creates data","enum":["unknown","allowed","disallowed"],"example":"unknown","type":"string"},"destroy_data":{"description":"Destroys data","enum":["unknown","allowed","disallowed"],"example":"unknown","type":"string"},"external_communication":{"description":"Sends external communications","enum":["unknown","allowed","disallowed"],"example":"unknown","type":"string"},"financial_transactions":{"description":"Performs financial transactions","enum":["unknown","allowed","disallowed"],"example":"unknown","type":"string"},"read_data":{"description":"Reads data","enum":["unknown","allowed","disallowed"],"example":"unknown","type":"string"},"update_data":{"description":"Updates data","enum":["unknown","allowed","disallowed"],"example":"unknown","type":"string"}},"required":["create_data","read_data","update_data","destroy_data","financial_transactions","external_communication"],"title":"ActionProfile","type":"object"},"Agent_DetailsForCreate":{"properties":{"description":{"type":"string"},"environment_id":{"$ref":"#/components/schemas/Environment_Id"},"id":{"description":"Optional ID for the agent. If not provided, a new ID will be generated. The ID must be a valid PFID with a partition matching the account.","oneOf":[{"$ref":"#/components/schemas/Agent_Id"},{"$ref":"#/components/schemas/Null"}]},"name":{"type":"string"}},"title":"Agent_DetailsForCreate","type":"object"},"AdminUser_Details":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"email":{"description":"Admin user email","example":"john@example.com","type":"string"},"id":{"$ref":"#/components/schemas/AdminUser_Id"},"inserted_at":{"description":"When the admin user was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"job_title":{"oneOf":[{"description":"Job title within the account","example":"Developer","type":"string"},{"$ref":"#/components/schemas/Null"}]},"name":{"oneOf":[{"description":"Admin user name","example":"John Doe","type":"string"},{"$ref":"#/components/schemas/Null"}]},"switchable_account_ids":{"description":"Account IDs this admin user can switch to","items":{"$ref":"#/components/schemas/Account_Id"},"type":"array"},"type":{"description":"Type of resource (always 'admin_user')","enum":["admin_user"],"example":"admin_user","type":"string"},"updated_at":{"description":"When the admin user was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"AdminUser_Details","type":"object"},"Agent_RiskSummary":{"properties":{"all_data_categories":{"description":"List of all data categories included across span types","items":{"description":"Data category name","type":"string"},"maxItems":18,"type":"array"},"assessed_span_types":{"description":"Number of span types with risk data","minimum":0,"type":"integer"},"classification_counts":{"description":"Count of span types at each classification level","properties":{"confidential":{"minimum":0,"type":"integer"},"internal":{"minimum":0,"type":"integer"},"public":{"minimum":0,"type":"integer"},"restricted":{"minimum":0,"type":"integer"},"secret":{"minimum":0,"type":"integer"},"unknown":{"minimum":0,"type":"integer"}},"type":"object"},"external_communication_count":{"description":"Number of span types with external communication allowed","minimum":0,"type":"integer"},"highest_classification":{"description":"Highest classification level across all span types","enum":["unknown","public","internal","confidential","restricted","secret"],"example":"unknown","type":"string"},"total_span_types":{"description":"Total number of span types","minimum":0,"type":"integer"},"unassessed_span_types":{"description":"Number of span types without risk data","minimum":0,"type":"integer"}},"title":"Agent_RiskSummary","type":"object"},"ApiToken_AvailableActions":{"description":"Available actions for this token based on its status","properties":{"activate":{"description":"Whether the token can be activated","type":"boolean"},"delete":{"description":"Whether the token can be deleted","type":"boolean"},"revoke":{"description":"Whether the token can be revoked","type":"boolean"},"suspend":{"description":"Whether the token can be suspended","type":"boolean"}},"title":"ApiToken_AvailableActions","type":"object"},"AgentVersionForRegister":{"properties":{"description":{"description":"Agent description. Used to update the agent record; not for the instance or version.","type":"string"},"external_identifier":{"type":"string"},"name":{"description":"Agent name. Used to update the agent record; not for the instance or version.","type":"string"},"runtime_environment":{"description":"Runtime environment metadata (SDK version, harness version, etc.)","oneOf":[{"$ref":"#/components/schemas/AgentVersion_RuntimeEnvironment"},{"$ref":"#/components/schemas/Null"}]}},"title":"AgentVersionForRegister","type":"object"},"Environment_Details":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"id":{"$ref":"#/components/schemas/Environment_Id"},"name":{"description":"Environment name","example":"Development","type":"string"},"type":{"description":"Type of resource (always 'environment')","enum":["environment"],"example":"environment","type":"string"}},"title":"Environment_Details","type":"object"},"Agent_Details":{"properties":{"available_actions":{"description":"Available actions for this agent based on its status and instance counts","properties":{"delete":{"description":"Whether the agent can be deleted","type":"boolean"},"reinstate":{"description":"Whether the agent can be reinstated from retired","type":"boolean"},"retire":{"description":"Whether the agent can be retired","type":"boolean"},"update":{"description":"Whether the agent can be updated","type":"boolean"}},"title":"Agent_AvailableActions","type":"object"},"current_schema_version_id":{"description":"The schema version used by the agent's current version (if any). Derived from current version.","oneOf":[{"$ref":"#/components/schemas/AgentSchemaVersion_Id"},{"$ref":"#/components/schemas/Null"}]},"current_version_id":{"description":"The agent version currently set as current for this agent (if any).","oneOf":[{"$ref":"#/components/schemas/AgentVersion_Id"},{"$ref":"#/components/schemas/Null"}]},"description":{"oneOf":[{"description":"Agent description","example":"Agent description","type":"string"},{"$ref":"#/components/schemas/Null"}]},"environment_id":{"$ref":"#/components/schemas/Environment_Id"},"id":{"$ref":"#/components/schemas/Agent_Id"},"inserted_at":{"description":"When the agent was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"instance_counts":{"properties":{"active":{"description":"Number of instances with status active (running)","example":2,"minimum":0,"type":"integer"},"cancelled":{"description":"Number of instances with status cancelled","example":0,"minimum":0,"type":"integer"},"complete":{"description":"Number of instances with status complete","example":5,"minimum":0,"type":"integer"},"failed":{"description":"Number of instances with status failed","example":0,"minimum":0,"type":"integer"},"finished":{"description":"Number of instances in a finished state (complete + failed + cancelled + terminated)","example":5,"minimum":0,"type":"integer"},"pending":{"description":"Number of instances with status pending","example":0,"minimum":0,"type":"integer"},"terminated":{"description":"Number of instances with status terminated","example":0,"minimum":0,"type":"integer"},"total":{"description":"Total number of agent instances","example":10,"minimum":0,"type":"integer"}},"title":"Agent_InstanceCounts","type":"object"},"name":{"description":"Agent name","example":"My Agent","type":"string"},"status":{"description":"Agent status","enum":["pending","active","dormant","retired"],"example":"pending","type":"string"},"type":{"description":"Type of resource (always 'agent')","enum":["agent"],"example":"agent","type":"string"},"updated_at":{"description":"When the agent was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"Agent_Details","type":"object"},"AdminUserInvite_Id":{"description":"A valid admin user invite ID","example":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","title":"AdminUserInvite_Id","type":"string"},"Environment_DetailsForCreate":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"id":{"description":"Optional ID for the environment. If not provided, a new ID will be generated. The ID must be a valid PFID with a partition matching the account.","oneOf":[{"$ref":"#/components/schemas/Environment_Id"},{"$ref":"#/components/schemas/Null"}]},"name":{"type":"string"}},"title":"Environment_DetailsForCreate","type":"object"},"Environment_DetailsForUpdate":{"properties":{"name":{"type":"string"}},"title":"Environment_DetailsForUpdate","type":"object"},"Agent_GetDetailsOutput":{"properties":{"details":{"$ref":"#/components/schemas/Agent_Details"},"risk_rollup":{"oneOf":[{"$ref":"#/components/schemas/Agent_RiskRollup"},{"$ref":"#/components/schemas/Null"}]},"status":{"enum":["success"],"example":"success","type":"string"}},"title":"Agent_GetDetailsOutput","type":"object"},"Agent_DetailsForUpdate":{"properties":{"current_version_id":{"description":"Set the agent's current version to this agent version (must belong to this agent).","oneOf":[{"$ref":"#/components/schemas/AgentVersion_Id"},{"$ref":"#/components/schemas/Null"}]},"description":{"type":"string"},"name":{"type":"string"}},"title":"Agent_DetailsForUpdate","type":"object"},"AgentVersion_DetailsForCreate":{"properties":{"agent_id":{"$ref":"#/components/schemas/Agent_Id"},"agent_schema_version_id":{"$ref":"#/components/schemas/AgentSchemaVersion_Id"},"description":{"description":"Agent description. Used to update the agent record; not for the version.","type":"string"},"external_identifier":{"type":"string"},"id":{"description":"Optional ID for the agent version. If not provided, a new ID will be generated. The ID must be a valid PFID with a partition matching the account.","oneOf":[{"$ref":"#/components/schemas/AgentVersion_Id"},{"$ref":"#/components/schemas/Null"}]},"name":{"description":"Agent name. Used to update the agent record; not for the version.","type":"string"},"runtime_environment":{"description":"Runtime environment metadata (Prefactor SDK packages, agent SDK packages, language runtime, OS, etc.)","oneOf":[{"$ref":"#/components/schemas/AgentVersion_RuntimeEnvironment"},{"$ref":"#/components/schemas/Null"}]}},"title":"AgentVersion_DetailsForCreate","type":"object"},"AgentSchemaVersion_Details":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"agent_id":{"$ref":"#/components/schemas/Agent_Id"},"current_version":{"description":"Is this the agent's current schema version?","type":"boolean"},"environment_id":{"$ref":"#/components/schemas/Environment_Id"},"external_identifier":{"description":"External identifier for the agent schema version","example":"v0","type":"string"},"external_identifier_repeats":{"description":"Count of rows sharing this external identifier (helps distinguish duplicates).","minimum":0,"type":"integer"},"id":{"$ref":"#/components/schemas/AgentSchemaVersion_Id"},"inserted_at":{"description":"When the agent schema version was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"span_type_schemas":{"additionalProperties":{"properties":{"data_risk":{"$ref":"#/components/schemas/DataRisk"},"description":{"oneOf":[{"description":"Optional description","type":"string"},{"$ref":"#/components/schemas/Null"}]},"name":{"description":"Span type name","type":"string"},"params_schema":{"additionalProperties":true,"description":"JSON schema for the span payload","type":"object"},"params_schema_validation":{"description":"Result of validating params_schema","properties":{"message":{"oneOf":[{"description":"Validation error message when status is 'error'","type":"string"},{"$ref":"#/components/schemas/Null"}]},"status":{"description":"Whether the schema is valid","enum":["success","error"],"example":"success","type":"string"}},"title":"SchemaValidationResult","type":"object"},"result_schema":{"additionalProperties":true,"description":"JSON schema for the span result payload (defaults to empty object if omitted when creating)","type":"object"},"result_schema_validation":{"description":"Result of validating result_schema","properties":{"message":{"oneOf":[{"description":"Validation error message when status is 'error'","type":"string"},{"$ref":"#/components/schemas/Null"}]},"status":{"description":"Whether the schema is valid","enum":["success","error"],"example":"success","type":"string"}},"title":"SchemaValidationResult","type":"object"},"template":{"oneOf":[{"description":"Display template describing what happened in the span. Use {{field}} to interpolate params and result fields. Use imperative/command tense for params (e.g. \"Generate {{content}}\") and past tense for result (e.g. \"completed with {{finish_reason}}\").","type":"string"},{"$ref":"#/components/schemas/Null"}]},"title":{"description":"Human-readable title (defaults to name)","type":"string"}},"title":"SpanTypeSchemaDetails","type":"object"},"description":"Map of span type names to their params and result JSON schemas","example":{"llm":{"name":"llm","params_schema":{"properties":{"max_tokens":{"type":"integer"},"model":{"type":"string"},"temperature":{"type":"number"}},"type":"object"},"result_schema":{"properties":{"tokens":{"type":"integer"}},"type":"object"}},"tool":{"name":"tool","params_schema":{"properties":{"input":{"type":"object"},"name":{"type":"string"}},"type":"object"},"result_schema":{"additionalProperties":false,"type":"object"}}},"type":"object"},"type":{"description":"Type of resource (always 'agent_schema_version')","enum":["agent_schema_version"],"example":"agent_schema_version","type":"string"},"updated_at":{"description":"When the agent schema version was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"AgentSchemaVersion_Details","type":"object"},"BulkItem":{"additionalProperties":true,"description":"A single item in a bulk request. Each item must include `_type` and `idempotency_key`, plus any additional parameters required by the specific query/action type (e.g., `environment_id` for agents/list, `details` for agents/create).","example":{"_type":"agents/create","details":{"description":"Handles customer support inquiries","environment_id":"env_abc123def456","name":"Customer Support Bot"},"idempotency_key":"create-agent-2024-01-15-001"},"properties":{"_type":{"description":"The type of query/action to execute (e.g., 'agents/list', 'agents/create')","example":"agents/list","title":"Type","type":"string"},"idempotency_key":{"description":"Required unique idempotency key for this item. Must be 8–128 characters and unique within the request. Used to identify the result in the response map.","example":"create-agent-2024-01-15-001","maxLength":128,"minLength":8,"title":"IdempotencyKey","type":"string"}},"required":["_type","idempotency_key"],"title":"BulkItem","type":"object"},"Sorting":{"description":"Sorting information","properties":{"direction":{"description":"The direction to sort by","enum":["asc","desc"],"example":"asc","type":"string"},"field":{"description":"The field to sort by (values depend on the type of list)","enum":["id","last_seen","status","title","timestamp","started_at","finished_at","email","name","external_identifier"],"example":"id","type":"string"}},"title":"Sorting","type":"object"},"AgentSchemaVersion_Id":{"description":"A valid agent schema version ID","example":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","title":"AgentSchemaVersion_Id","type":"string"},"Agent_AvailableActions":{"description":"Available actions for this agent based on its status and instance counts","properties":{"delete":{"description":"Whether the agent can be deleted","type":"boolean"},"reinstate":{"description":"Whether the agent can be reinstated from retired","type":"boolean"},"retire":{"description":"Whether the agent can be retired","type":"boolean"},"update":{"description":"Whether the agent can be updated","type":"boolean"}},"title":"Agent_AvailableActions","type":"object"},"AgentInstance_Details":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"agent_id":{"$ref":"#/components/schemas/Agent_Id"},"agent_version_id":{"$ref":"#/components/schemas/AgentVersion_Id"},"environment_id":{"$ref":"#/components/schemas/Environment_Id"},"finished_at":{"oneOf":[{"description":"When the agent instance finished (null if still in progress)","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]},"id":{"$ref":"#/components/schemas/AgentInstance_Id"},"inserted_at":{"description":"When the agent instance was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"span_counts":{"properties":{"active":{"description":"Number of spans with status active (running)","example":2,"minimum":0,"type":"integer"},"cancelled":{"description":"Number of spans with status cancelled","example":0,"minimum":0,"type":"integer"},"complete":{"description":"Number of spans with status complete","example":5,"minimum":0,"type":"integer"},"failed":{"description":"Number of spans with status failed","example":0,"minimum":0,"type":"integer"},"finished":{"description":"Number of spans in a finished state (complete + failed + cancelled)","example":5,"minimum":0,"type":"integer"},"pending":{"description":"Number of spans with status pending","example":0,"minimum":0,"type":"integer"},"total":{"description":"Total number of agent spans","example":10,"minimum":0,"type":"integer"}},"title":"AgentInstance_SpanCounts","type":"object"},"started_at":{"oneOf":[{"description":"When the agent instance started (null if not started yet)","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]},"status":{"description":"Status of the agent instance: 'pending' (not started yet), 'active' (started but not finished), 'complete' (finished successfully), 'failed' (ended with failure), 'cancelled' (never started, cancelled), or 'terminated' (externally terminated)","enum":["pending","active","complete","failed","cancelled","terminated"],"example":"active","type":"string"},"termination_reason":{"oneOf":[{"description":"Reason for termination (only present when status is 'terminated')","example":"User requested termination","type":"string"},{"$ref":"#/components/schemas/Null"}]},"type":{"description":"Type of resource (always 'agent_instance')","enum":["agent_instance"],"example":"agent_instance","type":"string"},"updated_at":{"description":"When the agent instance was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"AgentInstance_Details","type":"object"},"ApiError":{"description":"An error response from the API","oneOf":[{"properties":{"code":{"enum":["bad_request","bad_authtoken","not_authenticated","not_permitted","not_implemented","unknown","not_found","unexpected_ref_type","unexpected","invalid_action","invalid_value","required_value","idempotency_key_already_used"],"example":"bad_request","type":"string"},"message":{"type":"string"},"status":{"enum":["error"],"example":"error","type":"string"}},"type":"object"},{"properties":{"code":{"enum":["validation_errors"],"example":"validation_errors","type":"string"},"errors":{"additionalProperties":{"$ref":"#/components/schemas/ApiError"},"type":"object"},"message":{"type":"string"},"status":{"enum":["error"],"example":"error","type":"string"}},"type":"object"}],"title":"ApiError"},"AgentSpan_Id":{"description":"A valid agent span ID","example":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","title":"AgentSpan_Id","type":"string"},"AgentVersion_Id":{"description":"A valid agent version ID","example":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","title":"AgentVersion_Id","type":"string"},"AgentInstance_Summary":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"agent_id":{"$ref":"#/components/schemas/Agent_Id"},"agent_version_id":{"$ref":"#/components/schemas/AgentVersion_Id"},"environment_id":{"$ref":"#/components/schemas/Environment_Id"},"finished_at":{"oneOf":[{"description":"When the agent instance finished (null if still in progress)","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]},"id":{"$ref":"#/components/schemas/AgentInstance_Id"},"inserted_at":{"description":"When the agent instance was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"peak_classification":{"oneOf":[{"description":"Peak observed data risk classification across all spans in this instance. null if no spans have executed.","enum":["unknown","public","internal","confidential","restricted","secret"],"example":"confidential","type":"string"},{"$ref":"#/components/schemas/Null"}]},"started_at":{"oneOf":[{"description":"When the agent instance started (null if not started yet)","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]},"status":{"description":"Status of the agent instance: 'pending' (not started yet), 'active' (started but not finished), 'complete' (finished successfully), 'failed' (ended with failure), 'cancelled' (never started, cancelled), or 'terminated' (externally terminated)","enum":["pending","active","complete","failed","cancelled","terminated"],"example":"active","type":"string"},"termination_reason":{"oneOf":[{"description":"Reason for termination (only present when status is 'terminated')","example":"User requested termination","type":"string"},{"$ref":"#/components/schemas/Null"}]},"type":{"description":"Type of resource (always 'agent_instance')","enum":["agent_instance"],"example":"agent_instance","type":"string"},"updated_at":{"description":"When the agent instance was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"AgentInstance_Summary","type":"object"},"Agent_Id":{"description":"A valid agent ID","example":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","title":"Agent_Id","type":"string"},"Account_Summary":{"properties":{"id":{"$ref":"#/components/schemas/Account_Id"},"name":{"description":"Account name","example":"My Account","type":"string"},"type":{"description":"Type of resource (always 'account')","enum":["account"],"example":"account","type":"string"}},"title":"Account_Summary","type":"object"},"Status":{"description":"Response status, always 'success' when the request is processed","enum":["success"],"example":"success","title":"Status","type":"string"},"AgentVersion_Details":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"agent_id":{"$ref":"#/components/schemas/Agent_Id"},"agent_schema_version_id":{"$ref":"#/components/schemas/AgentSchemaVersion_Id"},"current_version":{"description":"Whether this version is the agent's current version.","type":"boolean"},"description":{"description":"Description of the agent version","example":"Stable production release","type":"string"},"external_identifier":{"description":"External identifier for the agent version","example":"v1.0.0","type":"string"},"external_identifier_repeats":{"description":"Count of rows sharing this external identifier (helps distinguish duplicates).","minimum":0,"type":"integer"},"id":{"$ref":"#/components/schemas/AgentVersion_Id"},"inserted_at":{"description":"When the agent version was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"name":{"description":"Name of the agent version","example":"Production Version","type":"string"},"runtime_environment":{"description":"Runtime environment metadata (Prefactor SDK packages, agent SDK packages, language runtime, OS, etc.)","oneOf":[{"$ref":"#/components/schemas/AgentVersion_RuntimeEnvironment"},{"$ref":"#/components/schemas/Null"}]},"type":{"description":"Type of resource (always 'agent_version')","enum":["agent_version"],"example":"agent_version","type":"string"},"updated_at":{"description":"When the agent version was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"AgentVersion_Details","type":"object"},"Items":{"description":"List of items to process in bulk. Each item will be processed independently in its own transaction.","items":{"additionalProperties":true,"description":"A single item in a bulk request. Each item must include `_type` and `idempotency_key`, plus any additional parameters required by the specific query/action type (e.g., `environment_id` for agents/list, `details` for agents/create).","example":{"_type":"agents/create","details":{"description":"Handles customer support inquiries","environment_id":"env_abc123def456","name":"Customer Support Bot"},"idempotency_key":"create-agent-2024-01-15-001"},"properties":{"_type":{"description":"The type of query/action to execute (e.g., 'agents/list', 'agents/create')","example":"agents/list","title":"Type","type":"string"},"idempotency_key":{"description":"Required unique idempotency key for this item. Must be 8–128 characters and unique within the request. Used to identify the result in the response map.","example":"create-agent-2024-01-15-001","maxLength":128,"minLength":8,"title":"IdempotencyKey","type":"string"}},"required":["_type","idempotency_key"],"title":"BulkItem","type":"object"},"minItems":1,"title":"Items","type":"array"},"SpanTypeSchemaDetails":{"properties":{"data_risk":{"$ref":"#/components/schemas/DataRisk"},"description":{"oneOf":[{"description":"Optional description","type":"string"},{"$ref":"#/components/schemas/Null"}]},"name":{"description":"Span type name","type":"string"},"params_schema":{"additionalProperties":true,"description":"JSON schema for the span payload","type":"object"},"params_schema_validation":{"description":"Result of validating params_schema","properties":{"message":{"oneOf":[{"description":"Validation error message when status is 'error'","type":"string"},{"$ref":"#/components/schemas/Null"}]},"status":{"description":"Whether the schema is valid","enum":["success","error"],"example":"success","type":"string"}},"title":"SchemaValidationResult","type":"object"},"result_schema":{"additionalProperties":true,"description":"JSON schema for the span result payload (defaults to empty object if omitted when creating)","type":"object"},"result_schema_validation":{"description":"Result of validating result_schema","properties":{"message":{"oneOf":[{"description":"Validation error message when status is 'error'","type":"string"},{"$ref":"#/components/schemas/Null"}]},"status":{"description":"Whether the schema is valid","enum":["success","error"],"example":"success","type":"string"}},"title":"SchemaValidationResult","type":"object"},"template":{"oneOf":[{"description":"Display template describing what happened in the span. Use {{field}} to interpolate params and result fields. Use imperative/command tense for params (e.g. \"Generate {{content}}\") and past tense for result (e.g. \"completed with {{finish_reason}}\").","type":"string"},{"$ref":"#/components/schemas/Null"}]},"title":{"description":"Human-readable title (defaults to name)","type":"string"}},"title":"SpanTypeSchemaDetails","type":"object"},"Agent_InstanceCounts":{"properties":{"active":{"description":"Number of instances with status active (running)","example":2,"minimum":0,"type":"integer"},"cancelled":{"description":"Number of instances with status cancelled","example":0,"minimum":0,"type":"integer"},"complete":{"description":"Number of instances with status complete","example":5,"minimum":0,"type":"integer"},"failed":{"description":"Number of instances with status failed","example":0,"minimum":0,"type":"integer"},"finished":{"description":"Number of instances in a finished state (complete + failed + cancelled + terminated)","example":5,"minimum":0,"type":"integer"},"pending":{"description":"Number of instances with status pending","example":0,"minimum":0,"type":"integer"},"terminated":{"description":"Number of instances with status terminated","example":0,"minimum":0,"type":"integer"},"total":{"description":"Total number of agent instances","example":10,"minimum":0,"type":"integer"}},"title":"Agent_InstanceCounts","type":"object"},"AdminUser_Id":{"description":"A valid admin user ID","example":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","title":"AdminUser_Id","type":"string"},"Agent_Summary":{"properties":{"available_actions":{"description":"Available actions for this agent based on its status and instance counts","properties":{"delete":{"description":"Whether the agent can be deleted","type":"boolean"},"reinstate":{"description":"Whether the agent can be reinstated from retired","type":"boolean"},"retire":{"description":"Whether the agent can be retired","type":"boolean"},"update":{"description":"Whether the agent can be updated","type":"boolean"}},"title":"Agent_AvailableActions","type":"object"},"current_schema_version_id":{"description":"The schema version used by the agent's current version (if any). Derived from current version.","oneOf":[{"$ref":"#/components/schemas/AgentSchemaVersion_Id"},{"$ref":"#/components/schemas/Null"}]},"current_version_id":{"description":"The agent version currently set as current for this agent (if any).","oneOf":[{"$ref":"#/components/schemas/AgentVersion_Id"},{"$ref":"#/components/schemas/Null"}]},"description":{"oneOf":[{"description":"Agent description","example":"Agent description","type":"string"},{"$ref":"#/components/schemas/Null"}]},"environment_id":{"$ref":"#/components/schemas/Environment_Id"},"id":{"$ref":"#/components/schemas/Agent_Id"},"inserted_at":{"description":"When the agent was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"name":{"description":"Agent name","example":"My Agent","type":"string"},"status":{"description":"Agent status","enum":["pending","active","dormant","retired"],"example":"pending","type":"string"},"type":{"description":"Type of resource (always 'agent')","enum":["agent"],"example":"agent","type":"string"},"updated_at":{"description":"When the agent was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"Agent_Summary","type":"object"},"AgentSpan_Summary":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"agent_id":{"$ref":"#/components/schemas/Agent_Id"},"agent_instance_id":{"$ref":"#/components/schemas/AgentInstance_Id"},"finished_at":{"oneOf":[{"description":"When the span finished (null if still in progress)","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]},"id":{"$ref":"#/components/schemas/AgentSpan_Id"},"parent_span_id":{"description":"ID of the parent span (null if this is a root span)","oneOf":[{"$ref":"#/components/schemas/AgentSpan_Id"},{"$ref":"#/components/schemas/Null"}]},"payload":{"additionalProperties":true,"description":"Span payload data (arbitrary JSON object)","type":"object"},"result_payload":{"oneOf":[{"additionalProperties":true,"description":"Result payload (arbitrary JSON), only present when span is finished","type":"object"},{"$ref":"#/components/schemas/Null"}]},"schema_name":{"description":"Name of the schema for this span","example":"llm","type":"string"},"schema_title":{"description":"Human-readable title for the schema (from JSON schema, defaults to schema_name)","example":"LLM","type":"string"},"started_at":{"oneOf":[{"description":"When the span started (null when status is pending)","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]},"status":{"description":"Status of the span: 'pending' (not started), 'active' (started but not finished), 'complete' (finished successfully), 'failed' (ended with failure), or 'cancelled' (never started, cancelled)","enum":["pending","active","complete","failed","cancelled"],"example":"active","type":"string"},"summary":{"oneOf":[{"description":"Human-readable summary rendered from the schema template using payload and result_payload (null when template is missing)","type":"string"},{"$ref":"#/components/schemas/Null"}]},"type":{"description":"Type of resource (always 'agent_span')","enum":["agent_span"],"example":"agent_span","type":"string"}},"title":"AgentSpan_Summary","type":"object"},"PaginationOutput":{"description":"Pagination information","example":{"item_count":200,"item_end":100,"item_start":91,"next_page_offset":110,"page_count":20,"page_index":10,"page_offset":90,"page_size":10,"previous_page_offset":80},"properties":{"item_count":{"description":"The total number of items","type":"integer"},"item_end":{"description":"The index of the last item in the page (one-based)","type":"integer"},"item_start":{"description":"The index of the first item in the page (one-based)","type":"integer"},"next_page_offset":{"oneOf":[{"description":"The offset of the next page (null if last page)","type":"integer"},{"$ref":"#/components/schemas/Null"}]},"page_count":{"description":"The total number of pages","type":"integer"},"page_index":{"description":"The index of the current page (one-based)","type":"integer"},"page_offset":{"description":"The offset of the first item in the page (zero-based)","type":"integer"},"page_size":{"description":"The number of items per page","type":"integer"},"previous_page_offset":{"oneOf":[{"description":"The offset of the previous page (null if first page)","type":"integer"},{"$ref":"#/components/schemas/Null"}]}},"title":"PaginationOutput","type":"object"},"AgentSchemaVersion_Summary":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"agent_id":{"$ref":"#/components/schemas/Agent_Id"},"current_version":{"description":"Is this the agent's current schema version?","type":"boolean"},"environment_id":{"$ref":"#/components/schemas/Environment_Id"},"external_identifier":{"description":"External identifier for the agent schema version","example":"v0","type":"string"},"external_identifier_repeats":{"description":"Count of rows sharing this external identifier (helps distinguish duplicates).","minimum":0,"type":"integer"},"id":{"$ref":"#/components/schemas/AgentSchemaVersion_Id"},"inserted_at":{"description":"When the agent schema version was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"span_schemas_count":{"description":"Number of span schemas in this schema version","example":3,"minimum":0,"type":"integer"},"type":{"description":"Type of resource (always 'agent_schema_version')","enum":["agent_schema_version"],"example":"agent_schema_version","type":"string"},"updated_at":{"description":"When the agent schema version was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"AgentSchemaVersion_Summary","type":"object"},"AgentSchemaVersionForRegister":{"properties":{"external_identifier":{"type":"string"},"span_result_schemas":{"oneOf":[{"additionalProperties":{"additionalProperties":true,"type":"object"},"description":"Optional map of span type names to their result payload JSON schemas. Only used when span_schemas is provided; keys may be a subset of span_schemas; missing keys default to a schema requiring empty object.","type":"object"},{"$ref":"#/components/schemas/Null"}]},"span_schemas":{"oneOf":[{"additionalProperties":{"additionalProperties":true,"type":"object"},"description":"Map of span type names to their JSON schemas.","type":"object"},{"$ref":"#/components/schemas/Null"}]},"span_type_schemas":{"oneOf":[{"description":"Array of span types with name, params_schema and optional result_schema.","items":{"description":"One span type with name, params_schema and optional result_schema","properties":{"data_risk":{"oneOf":[{"$ref":"#/components/schemas/DataRisk"},{"$ref":"#/components/schemas/Null"}]},"description":{"oneOf":[{"description":"Optional description","type":"string"},{"$ref":"#/components/schemas/Null"}]},"name":{"description":"Span type name (e.g. llm, tool)","type":"string"},"params_schema":{"additionalProperties":true,"description":"JSON schema for the span payload","type":"object"},"result_schema":{"oneOf":[{"additionalProperties":true,"description":"JSON schema for the span result payload. Defaults to empty object if omitted.","type":"object"},{"$ref":"#/components/schemas/Null"}]},"template":{"oneOf":[{"description":"Display template. Use {{field}} to interpolate params and result fields.","type":"string"},{"$ref":"#/components/schemas/Null"}]},"title":{"oneOf":[{"description":"Human-readable title. Defaults to name when omitted.","type":"string"},{"$ref":"#/components/schemas/Null"}]}},"required":["name","params_schema"],"title":"SpanTypeSchemaDetails_ForCreate","type":"object"},"type":"array"},{"$ref":"#/components/schemas/Null"}]}},"title":"AgentSchemaVersionForRegister","type":"object"},"ApiToken_DetailsForCreate":{"properties":{"account_id":{"description":"Account ID (defaults to token's account if not provided)","oneOf":[{"$ref":"#/components/schemas/Account_Id"},{"$ref":"#/components/schemas/Null"}]},"environment_id":{"description":"Environment ID (required when token_scope is 'environment')","oneOf":[{"$ref":"#/components/schemas/Environment_Id"},{"$ref":"#/components/schemas/Null"}]},"expires_at":{"oneOf":[{"description":"When the token expires (defaults to 2 years from now)","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]},"token_scope":{"description":"Token scope: 'account' or 'environment'","type":"string"}},"title":"ApiToken_DetailsForCreate","type":"object"},"AgentVersion_RuntimeEnvironment":{"properties":{"agent_sdk":{"description":"Agent framework/SDK packages (e.g. [\"langchain@4.0.0\"])","oneOf":[{"description":"List of package name and version strings (e.g. \"package@1.0.0\")","items":{"type":"string"},"type":"array"},{"$ref":"#/components/schemas/Null"}]},"os":{"oneOf":[{"description":"Operating system (e.g. \"linux\")","type":"string"},{"$ref":"#/components/schemas/Null"}]},"prefactor_sdk":{"description":"Prefactor SDK packages and versions (e.g. [\"prefactor-core@1.0.0\", \"prefactor-langchain@1.1.0\"])","oneOf":[{"description":"List of package name and version strings (e.g. \"package@1.0.0\")","items":{"type":"string"},"type":"array"},{"$ref":"#/components/schemas/Null"}]},"runtime":{"oneOf":[{"description":"Language runtime version (e.g. \"python@3.12\")","type":"string"},{"$ref":"#/components/schemas/Null"}]}},"title":"AgentVersion_RuntimeEnvironment","type":"object"},"Account_DetailsForUpdate":{"properties":{"name":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/Null"}]},"organisation_name":{"oneOf":[{"description":"Organisation name (required when purpose is not personal)","type":"string"},{"$ref":"#/components/schemas/Null"}]},"purpose":{"oneOf":[{"enum":["business","personal","nonprofit","education","government"],"example":"business","type":"string"},{"$ref":"#/components/schemas/Null"}]},"website":{"oneOf":[{"description":"Website URL","type":"string"},{"$ref":"#/components/schemas/Null"}]}},"title":"Account_DetailsForUpdate","type":"object"},"AgentInstance_Id":{"description":"A valid agent instance ID","example":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","title":"AgentInstance_Id","type":"string"},"Account_Id":{"description":"A valid account ID","example":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","title":"Account_Id","type":"string"},"AgentSchemaVersion_DetailsForCreate":{"properties":{"agent_id":{"$ref":"#/components/schemas/Agent_Id"},"external_identifier":{"type":"string"},"id":{"description":"Optional ID for the agent schema version. If not provided, a new ID will be generated. The ID must be a valid PFID with a partition matching the account.","oneOf":[{"$ref":"#/components/schemas/AgentSchemaVersion_Id"},{"$ref":"#/components/schemas/Null"}]},"span_result_schemas":{"oneOf":[{"additionalProperties":{"additionalProperties":true,"type":"object"},"description":"Optional map of span type names to their result payload JSON schemas. Keys may be a subset of span_schemas; missing keys default to a schema requiring empty object. Only used when span_schemas is provided.","type":"object"},{"$ref":"#/components/schemas/Null"}]},"span_schemas":{"oneOf":[{"additionalProperties":{"additionalProperties":true,"type":"object"},"description":"Map of span type names to their JSON schemas.","type":"object"},{"$ref":"#/components/schemas/Null"}]},"span_type_schemas":{"oneOf":[{"description":"Array of span types with name, params_schema and optional result_schema.","items":{"description":"One span type with name, params_schema and optional result_schema","properties":{"data_risk":{"oneOf":[{"$ref":"#/components/schemas/DataRisk"},{"$ref":"#/components/schemas/Null"}]},"description":{"oneOf":[{"description":"Optional description","type":"string"},{"$ref":"#/components/schemas/Null"}]},"name":{"description":"Span type name (e.g. llm, tool)","type":"string"},"params_schema":{"additionalProperties":true,"description":"JSON schema for the span payload","type":"object"},"result_schema":{"oneOf":[{"additionalProperties":true,"description":"JSON schema for the span result payload. Defaults to empty object if omitted.","type":"object"},{"$ref":"#/components/schemas/Null"}]},"template":{"oneOf":[{"description":"Display template. Use {{field}} to interpolate params and result fields.","type":"string"},{"$ref":"#/components/schemas/Null"}]},"title":{"oneOf":[{"description":"Human-readable title. Defaults to name when omitted.","type":"string"},{"$ref":"#/components/schemas/Null"}]}},"required":["name","params_schema"],"title":"SpanTypeSchemaDetails_ForCreate","type":"object"},"type":"array"},{"$ref":"#/components/schemas/Null"}]}},"title":"AgentSchemaVersion_DetailsForCreate","type":"object"},"Type":{"description":"The type of query/action to execute (e.g., 'agents/list', 'agents/create')","example":"agents/list","title":"Type","type":"string"},"AdminUserInvite_DetailsForCreate":{"properties":{"account_id":{"description":"Account ID (defaults to token's account if not provided)","oneOf":[{"$ref":"#/components/schemas/Account_Id"},{"$ref":"#/components/schemas/Null"}]},"email":{"description":"Email address to send the invite to","example":"user@example.com","type":"string"}},"title":"AdminUserInvite_DetailsForCreate","type":"object"},"BulkResponse":{"description":"Response from bulk query/action operations. Contains a map of results keyed by the idempotency_key from each request item.","example":{"outputs":{"create-agent-2024-01-15-002":{"details":{"description":"Handles customer support inquiries","environment_id":"env_abc123def456","id":"agent_new123abc456","inserted_at":"2024-01-15T10:30:00Z","name":"Customer Support Bot","type":"agent","updated_at":"2024-01-15T10:30:00Z"},"status":"success"},"list-agents-2024-01-15-001":{"status":"success","summaries":[{"environment_id":"env_abc123def456","id":"agent_xyz789ghi012","name":"Existing Agent","type":"agent"}]},"show-agent-2024-01-15-003":{"details":{"description":"An existing agent","environment_id":"env_abc123def456","id":"agent_xyz789ghi012","inserted_at":"2024-01-10T08:00:00Z","name":"Existing Agent","type":"agent","updated_at":"2024-01-10T08:00:00Z"},"status":"success"}},"status":"success"},"properties":{"outputs":{"additionalProperties":{"additionalProperties":true,"description":"Output from a query or action. Contains either a success response (with 'status': 'success' and operation-specific data) or an error response (with 'status': 'error', 'code', 'message', and optionally 'errors').","properties":{},"title":"Output","type":"object"},"description":"Map where keys are the idempotency_key values from the request, and values are the corresponding query/action outputs or error responses. Each output is independent - one item failing does not affect others.","title":"Outputs","type":"object"},"status":{"description":"Response status, always 'success' when the request is processed","enum":["success"],"example":"success","title":"Status","type":"string"}},"title":"BulkResponse","type":"object"},"Null":{"description":"null","enum":[null],"nullable":true,"title":"Null","type":"string"},"AgentInstance_SpanCounts":{"properties":{"active":{"description":"Number of spans with status active (running)","example":2,"minimum":0,"type":"integer"},"cancelled":{"description":"Number of spans with status cancelled","example":0,"minimum":0,"type":"integer"},"complete":{"description":"Number of spans with status complete","example":5,"minimum":0,"type":"integer"},"failed":{"description":"Number of spans with status failed","example":0,"minimum":0,"type":"integer"},"finished":{"description":"Number of spans in a finished state (complete + failed + cancelled)","example":5,"minimum":0,"type":"integer"},"pending":{"description":"Number of spans with status pending","example":0,"minimum":0,"type":"integer"},"total":{"description":"Total number of agent spans","example":10,"minimum":0,"type":"integer"}},"title":"AgentInstance_SpanCounts","type":"object"},"AgentVersion_Summary":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"agent_id":{"$ref":"#/components/schemas/Agent_Id"},"agent_schema_version_id":{"$ref":"#/components/schemas/AgentSchemaVersion_Id"},"current_version":{"description":"Whether this version is the agent's current version.","type":"boolean"},"external_identifier":{"description":"External identifier for the agent version","example":"v1.0.0","type":"string"},"external_identifier_repeats":{"description":"Count of rows sharing this external identifier (helps distinguish duplicates).","minimum":0,"type":"integer"},"id":{"$ref":"#/components/schemas/AgentVersion_Id"},"inserted_at":{"description":"When the agent version was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"observed_classification":{"oneOf":[{"description":"Observed highest classification level from actual executed spans (null if no spans have executed).","enum":["unknown","public","internal","confidential","restricted","secret"],"example":"internal","type":"string"},{"$ref":"#/components/schemas/Null"}]},"theoretical_classification":{"oneOf":[{"description":"Theoretical highest classification level based on schema-defined scope and data categories (null if not assessed).","enum":["unknown","public","internal","confidential","restricted","secret"],"example":"confidential","type":"string"},{"$ref":"#/components/schemas/Null"}]},"type":{"description":"Type of resource (always 'agent_version')","enum":["agent_version"],"example":"agent_version","type":"string"},"updated_at":{"description":"When the agent version was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"AgentVersion_Summary","type":"object"},"AgentSpan_DetailsForCreate":{"properties":{"agent_instance_id":{"$ref":"#/components/schemas/AgentInstance_Id"},"finished_at":{"oneOf":[{"description":"When the span finished (ISO 8601 format). If not provided, span is still in progress.","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]},"id":{"description":"Optional ID for the span. If not provided, a new ID will be generated. The ID must be a valid PFID with a partition matching the account.","oneOf":[{"$ref":"#/components/schemas/AgentSpan_Id"},{"$ref":"#/components/schemas/Null"}]},"parent_span_id":{"description":"ID of the parent span (null if this is a root span)","oneOf":[{"$ref":"#/components/schemas/AgentSpan_Id"},{"$ref":"#/components/schemas/Null"}]},"payload":{"additionalProperties":true,"description":"Span payload data (arbitrary JSON object)","type":"object"},"result_payload":{"oneOf":[{"additionalProperties":true,"description":"Result payload (arbitrary JSON). Only valid when status is complete, failed, or cancelled.","type":"object"},{"$ref":"#/components/schemas/Null"}]},"schema_name":{"description":"Name of the schema for this span","example":"llm","type":"string"},"started_at":{"oneOf":[{"description":"When the span started (ISO 8601 format). If not provided, current time is used.","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]},"status":{"description":"Status of the span (required)","enum":["pending","active","complete","failed","cancelled"],"example":"active","type":"string"}},"required":["agent_instance_id","schema_name","status","payload"],"title":"AgentSpan_DetailsForCreate","type":"object"},"Environment_Summary":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"id":{"$ref":"#/components/schemas/Environment_Id"},"name":{"description":"Environment name","example":"Development","type":"string"},"type":{"description":"Type of resource (always 'environment')","enum":["environment"],"example":"environment","type":"string"}},"title":"Environment_Summary","type":"object"},"AdminUser_Summary":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"email":{"description":"Admin user email","example":"john@example.com","type":"string"},"id":{"$ref":"#/components/schemas/AdminUser_Id"},"inserted_at":{"description":"When the admin user was created","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},"job_title":{"oneOf":[{"description":"Job title within the account","example":"Developer","type":"string"},{"$ref":"#/components/schemas/Null"}]},"name":{"oneOf":[{"description":"Admin user name","example":"John Doe","type":"string"},{"$ref":"#/components/schemas/Null"}]},"type":{"description":"Type of resource (always 'admin_user')","enum":["admin_user"],"example":"admin_user","type":"string"},"updated_at":{"description":"When the admin user was last updated","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"}},"title":"AdminUser_Summary","type":"object"}},"securitySchemes":{"authorization":{"scheme":"bearer","type":"http"}}},"info":{"title":"Prefactor","version":"1.0"},"openapi":"3.0.0","paths":{"/api/v1/agent_instance/{agent_instance_id}/terminate":{"post":{"callbacks":{},"deprecated":false,"operationId":"Action.AgentInstance.Terminate","parameters":[{"in":"path","name":"agent_instance_id","required":true,"schema":{"$ref":"#/components/schemas/AgentInstance_Id"}},{"in":"body","name":"reason","required":true,"schema":{"description":"Required reason for termination (e.g. user requested stop, resource limits).","example":"User requested termination","type":"string"}},{"in":"body","name":"timestamp","required":false,"schema":{"oneOf":[{"description":"Termination timestamp (ISO 8601 format). If not provided, current time is used.","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AgentInstance_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Terminate an agent instance","tags":["AgentInstance"]}},"/api/v1/pfid/generate":{"post":{"callbacks":{},"deprecated":false,"operationId":"Action.Pfid.Generate","parameters":[{"in":"body","name":"account_id","required":false,"schema":{"$ref":"#/components/schemas/Account_Id"}},{"in":"body","name":"count","required":true,"schema":{"description":"Number of PFIDs to generate","minimum":1,"type":"integer"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"account_id":{"$ref":"#/components/schemas/Account_Id"},"pfids":{"description":"Generated PFIDs with matching partition","items":{"example":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","type":"string"},"type":"array"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Generate new PFIDs with a partition matching the account","tags":["PFID"]}},"/api/v1/agent":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.Agent.List","parameters":[{"in":"query","name":"environment_id"},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}},{"in":"query","name":"sorting"},{"in":"query","name":"pagination[offset]"},{"in":"query","name":"pagination[page_size]"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationOutput"},{"$ref":"#/components/schemas/Null"}]},"sorting":{"oneOf":[{"$ref":"#/components/schemas/Sorting"},{"$ref":"#/components/schemas/Null"}]},"status":{"enum":["success"],"example":"success","type":"string"},"summaries":{"items":{"$ref":"#/components/schemas/Agent_Summary"},"type":"array"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"List agents","tags":["Agent"]},"post":{"callbacks":{},"deprecated":false,"operationId":"Action.Agent.Create","parameters":[{"in":"body","name":"details","required":true,"schema":{"$ref":"#/components/schemas/Agent_DetailsForCreate"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/Agent_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Create a new agent","tags":["Agent"]}},"/api/v1/admin_user/{admin_user_id}":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.AdminUser.GetDetails","parameters":[{"in":"path","name":"admin_user_id","required":true},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AdminUser_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Fetch admin user details","tags":["AdminUser"]},"put":{"callbacks":{},"deprecated":false,"operationId":"Action.AdminUser.Update","parameters":[{"in":"path","name":"admin_user_id","required":true,"schema":{"$ref":"#/components/schemas/AdminUser_Id"}},{"in":"body","name":"details","required":true,"schema":{"$ref":"#/components/schemas/AdminUser_DetailsForUpdate"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AdminUser_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Update an admin user (own profile only)","tags":["AdminUser"]}},"/api/v1/agent_version/{agent_version_id}":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.AgentVersion.GetDetails","parameters":[{"in":"path","name":"agent_version_id","required":true},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AgentVersion_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Fetch agent version","tags":["AgentVersion"]}},"/api/v1/admin_user_invite/{admin_user_invite_id}/revoke":{"post":{"callbacks":{},"deprecated":false,"operationId":"Action.AdminUserInvite.Revoke","parameters":[{"in":"path","name":"admin_user_invite_id","required":true,"schema":{"$ref":"#/components/schemas/AdminUserInvite_Id"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AdminUserInvite_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Revoke an admin user invite","tags":["AdminUserInvite"]}},"/api/v1/admin_user_invite/{admin_user_invite_id}":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.AdminUserInvite.GetDetails","parameters":[{"in":"path","name":"admin_user_invite_id","required":true},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AdminUserInvite_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Fetch admin user invite details","tags":["AdminUserInvite"]}},"/api/v1/admin_user_invite":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.AdminUserInvite.List","parameters":[{"description":"Account ID (defaults to token's account)","in":"query","name":"account_id"},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}},{"in":"query","name":"sorting"},{"in":"query","name":"pagination[offset]"},{"in":"query","name":"pagination[page_size]"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationOutput"},{"$ref":"#/components/schemas/Null"}]},"sorting":{"oneOf":[{"$ref":"#/components/schemas/Sorting"},{"$ref":"#/components/schemas/Null"}]},"status":{"enum":["success"],"example":"success","type":"string"},"summaries":{"items":{"$ref":"#/components/schemas/AdminUserInvite_Summary"},"type":"array"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"List admin user invites for an account","tags":["AdminUserInvite"]},"post":{"callbacks":{},"deprecated":false,"operationId":"Action.AdminUserInvite.Create","parameters":[{"in":"body","name":"details","required":true,"schema":{"$ref":"#/components/schemas/AdminUserInvite_DetailsForCreate"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AdminUserInvite_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Create a new admin user invite","tags":["AdminUserInvite"]}},"/api/v1/agent/{agent_id}/retire":{"post":{"callbacks":{},"deprecated":false,"operationId":"Action.Agent.Retire","parameters":[{"in":"path","name":"agent_id","required":true,"schema":{"$ref":"#/components/schemas/Agent_Id"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/Agent_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Retire an agent","tags":["Agent"]}},"/api/v1/api_token/{api_token_id}/revoke":{"post":{"callbacks":{},"deprecated":false,"operationId":"Action.ApiToken.Revoke","parameters":[{"in":"path","name":"api_token_id","required":true,"schema":{"$ref":"#/components/schemas/ApiToken_Id"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/ApiToken_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Revoke an API token","tags":["ApiToken"]}},"/api/v1/agent_instance/register":{"post":{"callbacks":{},"deprecated":false,"operationId":"Action.AgentInstance.Register","parameters":[{"in":"body","name":"agent_id","required":true,"schema":{"$ref":"#/components/schemas/Agent_Id"}},{"in":"body","name":"id","required":false,"schema":{"description":"Optional ID for the agent instance. If not provided, a new ID will be generated. The ID must be a valid PFID with a partition matching the account.","oneOf":[{"$ref":"#/components/schemas/AgentInstance_Id"},{"$ref":"#/components/schemas/Null"}]}},{"in":"body","name":"agent_version","required":true,"schema":{"properties":{"description":{"description":"Agent description. Used to update the agent record; not for the instance or version.","type":"string"},"external_identifier":{"type":"string"},"name":{"description":"Agent name. Used to update the agent record; not for the instance or version.","type":"string"},"runtime_environment":{"description":"Runtime environment metadata (SDK version, harness version, etc.)","oneOf":[{"$ref":"#/components/schemas/AgentVersion_RuntimeEnvironment"},{"$ref":"#/components/schemas/Null"}]}},"title":"AgentVersionForRegister","type":"object"}},{"in":"body","name":"agent_schema_version","required":true,"schema":{"properties":{"external_identifier":{"type":"string"},"span_result_schemas":{"oneOf":[{"additionalProperties":{"additionalProperties":true,"type":"object"},"description":"Optional map of span type names to their result payload JSON schemas. Only used when span_schemas is provided; keys may be a subset of span_schemas; missing keys default to a schema requiring empty object.","type":"object"},{"$ref":"#/components/schemas/Null"}]},"span_schemas":{"oneOf":[{"additionalProperties":{"additionalProperties":true,"type":"object"},"description":"Map of span type names to their JSON schemas.","type":"object"},{"$ref":"#/components/schemas/Null"}]},"span_type_schemas":{"oneOf":[{"description":"Array of span types with name, params_schema and optional result_schema.","items":{"description":"One span type with name, params_schema and optional result_schema","properties":{"data_risk":{"oneOf":[{"$ref":"#/components/schemas/DataRisk"},{"$ref":"#/components/schemas/Null"}]},"description":{"oneOf":[{"description":"Optional description","type":"string"},{"$ref":"#/components/schemas/Null"}]},"name":{"description":"Span type name (e.g. llm, tool)","type":"string"},"params_schema":{"additionalProperties":true,"description":"JSON schema for the span payload","type":"object"},"result_schema":{"oneOf":[{"additionalProperties":true,"description":"JSON schema for the span result payload. Defaults to empty object if omitted.","type":"object"},{"$ref":"#/components/schemas/Null"}]},"template":{"oneOf":[{"description":"Display template. Use {{field}} to interpolate params and result fields.","type":"string"},{"$ref":"#/components/schemas/Null"}]},"title":{"oneOf":[{"description":"Human-readable title. Defaults to name when omitted.","type":"string"},{"$ref":"#/components/schemas/Null"}]}},"required":["name","params_schema"],"title":"SpanTypeSchemaDetails_ForCreate","type":"object"},"type":"array"},{"$ref":"#/components/schemas/Null"}]}},"title":"AgentSchemaVersionForRegister","type":"object"}},{"in":"body","name":"update_current_version","required":false,"schema":{"default":true,"description":"Whether to set this version as the agent's current version. Defaults to true.","type":"boolean"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"agent_schema_version":{"$ref":"#/components/schemas/AgentSchemaVersion_Details"},"agent_version":{"$ref":"#/components/schemas/AgentVersion_Details"},"details":{"$ref":"#/components/schemas/AgentInstance_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Register a new agent instance with agent version","tags":["AgentInstance"]}},"/api/v1/account/{account_id}":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.Account.GetDetails","parameters":[{"in":"path","name":"account_id","required":true},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/Account_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Fetch account","tags":["Account"]},"put":{"callbacks":{},"deprecated":false,"operationId":"Action.Account.Update","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"$ref":"#/components/schemas/Account_Id"}},{"in":"body","name":"details","required":true,"schema":{"$ref":"#/components/schemas/Account_DetailsForUpdate"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/Account_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Update an account","tags":["Account"]}},"/api/v1/agent_instance/{agent_instance_id}/start":{"post":{"callbacks":{},"deprecated":false,"operationId":"Action.AgentInstance.Start","parameters":[{"in":"path","name":"agent_instance_id","required":true,"schema":{"$ref":"#/components/schemas/AgentInstance_Id"}},{"in":"body","name":"timestamp","required":false,"schema":{"oneOf":[{"description":"Start timestamp (ISO 8601 format). If not provided, current time is used.","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AgentInstance_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Start an agent instance","tags":["AgentInstance"]}},"/api/v1/agent_version":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.AgentVersion.List","parameters":[{"in":"path","name":"agent_id"},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}},{"in":"query","name":"sorting"},{"in":"query","name":"pagination[offset]"},{"in":"query","name":"pagination[page_size]"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationOutput"},{"$ref":"#/components/schemas/Null"}]},"sorting":{"oneOf":[{"$ref":"#/components/schemas/Sorting"},{"$ref":"#/components/schemas/Null"}]},"status":{"enum":["success"],"example":"success","type":"string"},"summaries":{"items":{"$ref":"#/components/schemas/AgentVersion_Summary"},"type":"array"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"List agent versions","tags":["AgentVersion"]},"post":{"callbacks":{},"deprecated":false,"operationId":"Action.AgentVersion.Create","parameters":[{"in":"body","name":"details","required":true,"schema":{"$ref":"#/components/schemas/AgentVersion_DetailsForCreate"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AgentVersion_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Create a new agent version","tags":["AgentVersion"]}},"/api/v1/agent_instance/{agent_instance_id}":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.AgentInstance.GetDetails","parameters":[{"in":"path","name":"agent_instance_id","required":true},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}},{"in":"query","name":"include_counts","required":false,"schema":{"default":false,"description":"Include span counts in the response","type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AgentInstance_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Fetch agent instance","tags":["AgentInstance"]}},"/api/v1/agent_schema_version":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.AgentSchemaVersion.List","parameters":[{"in":"query","name":"agent_id"},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}},{"in":"query","name":"sorting"},{"in":"query","name":"pagination[offset]"},{"in":"query","name":"pagination[page_size]"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationOutput"},{"$ref":"#/components/schemas/Null"}]},"sorting":{"oneOf":[{"$ref":"#/components/schemas/Sorting"},{"$ref":"#/components/schemas/Null"}]},"status":{"enum":["success"],"example":"success","type":"string"},"summaries":{"items":{"$ref":"#/components/schemas/AgentSchemaVersion_Summary"},"type":"array"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"List agent schema versions","tags":["AgentSchemaVersion"]},"post":{"callbacks":{},"deprecated":false,"operationId":"Action.AgentSchemaVersion.Create","parameters":[{"in":"body","name":"details","required":true,"schema":{"$ref":"#/components/schemas/AgentSchemaVersion_DetailsForCreate"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AgentSchemaVersion_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Create a new agent schema version","tags":["AgentSchemaVersion"]}},"/api/v1/bulk":{"post":{"callbacks":{},"deprecated":false,"description":"Execute multiple API queries and actions in a single HTTP request. This endpoint allows you to batch multiple operations together, reducing the number of round trips to the API.\n\n**Key Features:**\n- Each item in the request is processed independently in its own database transaction\n- Processing stops early if any item returns an error\n- All successfully processed items up to the error are returned\n- Any unprocessed items (after the first error) are excluded from the result\n- All items must include a unique `idempotency_key` (8–128 characters)\n- Results are returned as a map keyed by `idempotency_key`\n- Each item can be a different type of query or action (e.g., list agents, create agent, show agent)\n\n**Supported Types:**\n- `agents/list` - List agents for an environment (requires `environment_id`)\n- `agents/show` - Get agent details (requires `agent_id`)\n- `agents/create` - Create a new agent (requires `details` with `environment_id`, `name`, optional `description`)\n- `agents/update` - Update an agent (requires `agent_id` and `details`)\n- `environments/list` - List environments for an account (requires `account_id`)\n- `environments/show` - Get environment details (requires `environment_id`)\n- `environments/create` - Create a new environment (requires `details` with `account_id`, `name`)\n- `environments/update` - Update an environment (requires `environment_id` and `details`)\n- And other query/action types as documented in their respective endpoints\n\n**Example Request:**\n```json\n{\n  \"items\": [\n    {\n      \"_type\": \"agents/list\",\n      \"idempotency_key\": \"list-agents-2024-01-15-001\",\n      \"environment_id\": \"env_abc123\"\n    },\n    {\n      \"_type\": \"agents/create\",\n      \"idempotency_key\": \"create-agent-2024-01-15-002\",\n      \"details\": {\n        \"environment_id\": \"env_abc123\",\n        \"name\": \"Customer Support Bot\",\n        \"description\": \"Handles customer support inquiries\"\n      }\n    },\n    {\n      \"_type\": \"agents/show\",\n      \"idempotency_key\": \"show-agent-2024-01-15-003\",\n      \"agent_id\": \"agent_xyz789\"\n    }\n  ]\n}\n```\n\n**Example Response:**\n```json\n{\n  \"status\": \"success\",\n  \"outputs\": {\n    \"list-agents-2024-01-15-001\": {\n      \"status\": \"success\",\n      \"summaries\": [...]\n    },\n    \"create-agent-2024-01-15-002\": {\n      \"status\": \"success\",\n      \"details\": {\n        \"type\": \"agent\",\n        \"id\": \"agent_new123\",\n        \"environment_id\": \"env_abc123\",\n        \"name\": \"Customer Support Bot\",\n        \"description\": \"Handles customer support inquiries\",\n        \"inserted_at\": \"2024-01-15T10:30:00Z\",\n        \"updated_at\": \"2024-01-15T10:30:00Z\"\n      }\n    },\n    \"show-agent-2024-01-15-003\": {\n      \"status\": \"success\",\n      \"details\": {...}\n    }\n  }\n}\n```\n","operationId":"Bulk.Execute","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"description":"Request body for bulk query/action operations. Allows executing multiple API operations in a single request.","example":{"items":[{"_type":"agents/list","environment_id":"env_abc123def456","idempotency_key":"list-agents-2024-01-15-001"},{"_type":"agents/create","details":{"description":"Handles customer support inquiries","environment_id":"env_abc123def456","name":"Customer Support Bot"},"idempotency_key":"create-agent-2024-01-15-002"},{"_type":"agents/show","agent_id":"agent_xyz789ghi012","idempotency_key":"show-agent-2024-01-15-003"}]},"properties":{"items":{"description":"List of items to process in bulk. Each item will be processed independently in its own transaction.","items":{"additionalProperties":true,"description":"A single item in a bulk request. Each item must include `_type` and `idempotency_key`, plus any additional parameters required by the specific query/action type (e.g., `environment_id` for agents/list, `details` for agents/create).","example":{"_type":"agents/create","details":{"description":"Handles customer support inquiries","environment_id":"env_abc123def456","name":"Customer Support Bot"},"idempotency_key":"create-agent-2024-01-15-001"},"properties":{"_type":{"description":"The type of query/action to execute (e.g., 'agents/list', 'agents/create')","example":"agents/list","title":"Type","type":"string"},"idempotency_key":{"description":"Required unique idempotency key for this item. Must be 8–128 characters and unique within the request. Used to identify the result in the response map.","example":"create-agent-2024-01-15-001","maxLength":128,"minLength":8,"title":"IdempotencyKey","type":"string"}},"required":["_type","idempotency_key"],"title":"BulkItem","type":"object"},"minItems":1,"title":"Items","type":"array"}},"required":["items"],"title":"BulkRequest","type":"object"}}},"description":"Bulk request containing items to process","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"Response from bulk query/action operations. Contains a map of results keyed by the idempotency_key from each request item.","example":{"outputs":{"create-agent-2024-01-15-002":{"details":{"description":"Handles customer support inquiries","environment_id":"env_abc123def456","id":"agent_new123abc456","inserted_at":"2024-01-15T10:30:00Z","name":"Customer Support Bot","type":"agent","updated_at":"2024-01-15T10:30:00Z"},"status":"success"},"list-agents-2024-01-15-001":{"status":"success","summaries":[{"environment_id":"env_abc123def456","id":"agent_xyz789ghi012","name":"Existing Agent","type":"agent"}]},"show-agent-2024-01-15-003":{"details":{"description":"An existing agent","environment_id":"env_abc123def456","id":"agent_xyz789ghi012","inserted_at":"2024-01-10T08:00:00Z","name":"Existing Agent","type":"agent","updated_at":"2024-01-10T08:00:00Z"},"status":"success"}},"status":"success"},"properties":{"outputs":{"additionalProperties":{"additionalProperties":true,"description":"Output from a query or action. Contains either a success response (with 'status': 'success' and operation-specific data) or an error response (with 'status': 'error', 'code', 'message', and optionally 'errors').","properties":{},"title":"Output","type":"object"},"description":"Map where keys are the idempotency_key values from the request, and values are the corresponding query/action outputs or error responses. Each output is independent - one item failing does not affect others.","title":"Outputs","type":"object"},"status":{"description":"Response status, always 'success' when the request is processed","enum":["success"],"example":"success","title":"Status","type":"string"}},"title":"BulkResponse","type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Execute multiple queries/actions in a single request","tags":["Bulk"]}},"/api/v1/agent/{agent_id}/reinstate":{"post":{"callbacks":{},"deprecated":false,"operationId":"Action.Agent.Reinstate","parameters":[{"in":"path","name":"agent_id","required":true,"schema":{"$ref":"#/components/schemas/Agent_Id"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/Agent_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Reinstate a retired agent","tags":["Agent"]}},"/api/v1/agent/{agent_id}":{"delete":{"callbacks":{},"deprecated":false,"operationId":"Action.Agent.Delete","parameters":[{"in":"path","name":"agent_id","required":true,"schema":{"$ref":"#/components/schemas/Agent_Id"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/Agent_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Delete an agent","tags":["Agent"]},"get":{"callbacks":{},"deprecated":false,"operationId":"Query.Agent.GetDetails","parameters":[{"in":"path","name":"agent_id","required":true},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}},{"in":"query","name":"include_counts","required":false,"schema":{"default":false,"description":"Include instance counts in the response","type":"boolean"}},{"in":"query","name":"include_risk_rollup","required":false,"schema":{"default":false,"description":"Include risk rollup (theoretical and observed risk) in the response","type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/Agent_Details"},"risk_rollup":{"oneOf":[{"$ref":"#/components/schemas/Agent_RiskRollup"},{"$ref":"#/components/schemas/Null"}]},"status":{"enum":["success"],"example":"success","type":"string"}},"title":"Agent_GetDetailsOutput","type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Fetch agent","tags":["Agent"]},"put":{"callbacks":{},"deprecated":false,"operationId":"Action.Agent.Update","parameters":[{"in":"path","name":"agent_id","required":true,"schema":{"$ref":"#/components/schemas/Agent_Id"}},{"in":"body","name":"details","required":true,"schema":{"$ref":"#/components/schemas/Agent_DetailsForUpdate"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/Agent_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Update an agent","tags":["Agent"]}},"/api/v1/agent_instance/{agent_instance_id}/finish":{"post":{"callbacks":{},"deprecated":false,"operationId":"Action.AgentInstance.Finish","parameters":[{"in":"path","name":"agent_instance_id","required":true,"schema":{"$ref":"#/components/schemas/AgentInstance_Id"}},{"in":"body","name":"status","required":false,"schema":{"description":"Terminal status: 'complete' (default), 'failed', or 'cancelled'. When 'cancelled', instance must be pending and both timestamps are set to the (optional) timestamp.","enum":["complete","failed","cancelled"],"example":"complete","type":"string"}},{"in":"body","name":"timestamp","required":false,"schema":{"oneOf":[{"description":"Finish timestamp (ISO 8601 format). If not provided, current time is used.","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AgentInstance_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Finish an agent instance","tags":["AgentInstance"]}},"/api/v1/account":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.Account.List","parameters":[{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}},{"in":"query","name":"sorting"},{"in":"query","name":"pagination[offset]"},{"in":"query","name":"pagination[page_size]"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationOutput"},{"$ref":"#/components/schemas/Null"}]},"sorting":{"oneOf":[{"$ref":"#/components/schemas/Sorting"},{"$ref":"#/components/schemas/Null"}]},"status":{"enum":["success"],"example":"success","type":"string"},"summaries":{"items":{"$ref":"#/components/schemas/Account_Summary"},"type":"array"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"List accounts (internal)","tags":["Account"]}},"/api/v1/admin_user":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.AdminUser.List","parameters":[{"description":"Account ID (defaults to token's account)","in":"query","name":"account_id"},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}},{"in":"query","name":"sorting"},{"in":"query","name":"pagination[offset]"},{"in":"query","name":"pagination[page_size]"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationOutput"},{"$ref":"#/components/schemas/Null"}]},"sorting":{"oneOf":[{"$ref":"#/components/schemas/Sorting"},{"$ref":"#/components/schemas/Null"}]},"status":{"enum":["success"],"example":"success","type":"string"},"summaries":{"items":{"$ref":"#/components/schemas/AdminUser_Summary"},"type":"array"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"List admin users for an account","tags":["AdminUser"]}},"/api/v1/agent_spans/{agent_span_id}/finish":{"post":{"callbacks":{},"deprecated":false,"operationId":"Action.AgentSpan.Finish","parameters":[{"in":"path","name":"agent_span_id","required":true,"schema":{"$ref":"#/components/schemas/AgentSpan_Id"}},{"in":"body","name":"status","required":false,"schema":{"description":"Terminal status: 'complete' (default), 'failed', or 'cancelled'. When 'cancelled', span must be pending and both timestamps are set to the (optional) timestamp.","enum":["complete","failed","cancelled"],"example":"complete","type":"string"}},{"in":"body","name":"timestamp","required":false,"schema":{"oneOf":[{"description":"Finish timestamp (ISO 8601 format). If not provided, current time is used.","example":"2024-01-01T00:00:00Z","format":"date-time","type":"string"},{"$ref":"#/components/schemas/Null"}]}},{"in":"body","name":"result_payload","required":false,"schema":{"oneOf":[{"additionalProperties":true,"description":"Optional result payload (arbitrary JSON), only set when finishing the span.","type":"object"},{"$ref":"#/components/schemas/Null"}]}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AgentSpan_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Finish an agent span","tags":["AgentSpan"]}},"/api/v1/environment/{environment_id}":{"delete":{"callbacks":{},"deprecated":false,"operationId":"Action.Environment.Delete","parameters":[{"in":"path","name":"environment_id","required":true,"schema":{"$ref":"#/components/schemas/Environment_Id"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/Environment_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Delete an environment","tags":["Environment"]},"get":{"callbacks":{},"deprecated":false,"operationId":"Query.Environment.GetDetails","parameters":[{"in":"path","name":"environment_id","required":true},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/Environment_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Fetch environment","tags":["Environment"]},"put":{"callbacks":{},"deprecated":false,"operationId":"Action.Environment.Update","parameters":[{"in":"path","name":"environment_id","required":true,"schema":{"$ref":"#/components/schemas/Environment_Id"}},{"in":"body","name":"details","required":true,"schema":{"$ref":"#/components/schemas/Environment_DetailsForUpdate"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/Environment_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Update an environment","tags":["Environment"]}},"/api/v1/api_token/{api_token_id}":{"delete":{"callbacks":{},"deprecated":false,"operationId":"Action.ApiToken.Delete","parameters":[{"in":"path","name":"api_token_id","required":true,"schema":{"$ref":"#/components/schemas/ApiToken_Id"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/ApiToken_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Delete an API token","tags":["ApiToken"]},"get":{"callbacks":{},"deprecated":false,"operationId":"Query.ApiToken.GetDetails","parameters":[{"in":"path","name":"api_token_id","required":true,"schema":{"$ref":"#/components/schemas/ApiToken_Id"}},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/ApiToken_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Fetch API token","tags":["ApiToken"]}},"/api/v1/agent_instance":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.AgentInstance.List","parameters":[{"in":"path","name":"agent_id"},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}},{"in":"query","name":"agent_version_id"},{"in":"query","name":"sorting"},{"in":"query","name":"pagination[offset]"},{"in":"query","name":"pagination[page_size]"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationOutput"},{"$ref":"#/components/schemas/Null"}]},"sorting":{"oneOf":[{"$ref":"#/components/schemas/Sorting"},{"$ref":"#/components/schemas/Null"}]},"status":{"enum":["success"],"example":"success","type":"string"},"summaries":{"items":{"$ref":"#/components/schemas/AgentInstance_Summary"},"type":"array"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"List agent instances","tags":["AgentInstance"]}},"/api/v1/agent_spans":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.AgentSpan.List","parameters":[{"in":"query","name":"agent_instance_id"},{"in":"query","name":"agent_id"},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}},{"in":"query","name":"start_time"},{"in":"query","name":"end_time"},{"in":"query","name":"sorting"},{"in":"query","name":"pagination[offset]"},{"in":"query","name":"pagination[page_size]"},{"in":"query","name":"include_summaries","required":false,"schema":{"default":false,"description":"Include human-readable summaries from schema templates (default: false for performance)","type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationOutput"},{"$ref":"#/components/schemas/Null"}]},"sorting":{"oneOf":[{"$ref":"#/components/schemas/Sorting"},{"$ref":"#/components/schemas/Null"}]},"status":{"enum":["success"],"example":"success","type":"string"},"summaries":{"items":{"$ref":"#/components/schemas/AgentSpan_Summary"},"type":"array"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"List agent spans","tags":["AgentSpan"]},"post":{"callbacks":{},"deprecated":false,"operationId":"Action.AgentSpan.Create","parameters":[{"in":"body","name":"details","required":true,"schema":{"$ref":"#/components/schemas/AgentSpan_DetailsForCreate"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AgentSpan_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Create a new agent span","tags":["AgentSpan"]}},"/api/v1/environment":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.Environment.List","parameters":[{"in":"query","name":"account_id"},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}},{"in":"query","name":"sorting"},{"in":"query","name":"pagination[offset]"},{"in":"query","name":"pagination[page_size]"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationOutput"},{"$ref":"#/components/schemas/Null"}]},"sorting":{"oneOf":[{"$ref":"#/components/schemas/Sorting"},{"$ref":"#/components/schemas/Null"}]},"status":{"enum":["success"],"example":"success","type":"string"},"summaries":{"items":{"$ref":"#/components/schemas/Environment_Summary"},"type":"array"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"List environments for an account","tags":["Environment"]},"post":{"callbacks":{},"deprecated":false,"operationId":"Action.Environment.Create","parameters":[{"in":"body","name":"details","required":true,"schema":{"$ref":"#/components/schemas/Environment_DetailsForCreate"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/Environment_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Create a new environment","tags":["Environment"]}},"/api/v1/api_token/{api_token_id}/suspend":{"post":{"callbacks":{},"deprecated":false,"operationId":"Action.ApiToken.Suspend","parameters":[{"in":"path","name":"api_token_id","required":true,"schema":{"$ref":"#/components/schemas/ApiToken_Id"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/ApiToken_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Suspend an API token","tags":["ApiToken"]}},"/api/v1/account/{account_id}/implode":{"post":{"callbacks":{},"deprecated":false,"operationId":"Action.Account.Implode","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"$ref":"#/components/schemas/Account_Id"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/Account_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Implode (delete) the account you are authenticated as","tags":["Account"]}},"/api/v1/agent_schema_version/{agent_schema_version_id}":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.AgentSchemaVersion.GetDetails","parameters":[{"in":"path","name":"agent_schema_version_id","required":true},{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/AgentSchemaVersion_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Fetch agent schema version","tags":["AgentSchemaVersion"]}},"/api/v1/api_token":{"get":{"callbacks":{},"deprecated":false,"operationId":"Query.ApiToken.List","parameters":[{"in":"query","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}},{"description":"Account ID (defaults to token's account)","in":"query","name":"account_id","required":false,"schema":{"$ref":"#/components/schemas/Account_Id"}},{"in":"query","name":"sorting"},{"in":"query","name":"pagination[offset]"},{"in":"query","name":"pagination[page_size]"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationOutput"},{"$ref":"#/components/schemas/Null"}]},"sorting":{"oneOf":[{"$ref":"#/components/schemas/Sorting"},{"$ref":"#/components/schemas/Null"}]},"status":{"enum":["success"],"example":"success","type":"string"},"summaries":{"items":{"$ref":"#/components/schemas/ApiToken_Summary"},"type":"array"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"List API tokens","tags":["ApiToken"]},"post":{"callbacks":{},"deprecated":false,"operationId":"Action.ApiToken.Create","parameters":[{"in":"body","name":"details","required":true,"schema":{"$ref":"#/components/schemas/ApiToken_DetailsForCreate"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/ApiToken_Details"},"status":{"enum":["success"],"example":"success","type":"string"},"token":{"description":"The JWT token string (only available on creation)","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Create a new API token","tags":["ApiToken"]}},"/api/v1/api_token/{api_token_id}/activate":{"post":{"callbacks":{},"deprecated":false,"operationId":"Action.ApiToken.Activate","parameters":[{"in":"path","name":"api_token_id","required":true,"schema":{"$ref":"#/components/schemas/ApiToken_Id"}},{"in":"body","name":"idempotency_key","required":false,"schema":{"$ref":"#/components/schemas/IdempotencyKeyOrNull"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"details":{"$ref":"#/components/schemas/ApiToken_Details"},"status":{"enum":["success"],"example":"success","type":"string"}},"type":"object"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Error"}},"summary":"Activate a suspended API token","tags":["ApiToken"]}}},"security":[{"authorization":[]}],"servers":[{"url":"https://app.prefactorai.com","variables":{}}],"tags":[]}