Create a new agent schema version
const url = 'https://app.prefactorai.com/api/v1/agent_schema_version';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"agent_id":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","alert_schemas":null,"external_identifier":"example","id":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","quality_schemas":null,"span_result_schemas":null,"span_schemas":null,"span_type_schemas":null}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.prefactorai.com/api/v1/agent_schema_version \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "agent_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "alert_schemas": null, "external_identifier": "example", "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "quality_schemas": null, "span_result_schemas": null, "span_schemas": null, "span_type_schemas": null }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”object
A valid agent ID
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyArray of alert schemas with name, schema and optional title, description, template and data_risk.
Named schema with schema and optional title, description, template and data_risk
object
object
object
Creates data
Example
unknownDestroys data
Example
unknownSends external communications
Example
unknownPerforms financial transactions
Example
unknownReads data
Example
unknownUpdates data
Example
unknownobject
Authentication and secrets present
Example
unknownBehavioural and inferred data present
Example
unknownClassification level
Example
unknownContact information present
Example
unknownCriminal justice data present
Example
unknownFinancial information present
Example
unknownGDPR: biometric data for identification
Example
unknownGDPR: genetic data
Example
unknownGDPR: political opinions
Example
unknownGDPR: racial or ethnic origin
Example
unknownGDPR: religious or philosophical beliefs
Example
unknownGDPR: sex life or sexual orientation
Example
unknownGDPR: trade union membership
Example
unknownHealth and medical data present
Example
unknownLocation and tracking data present
Example
unknownMinors data present
Example
unknownOrganisational confidential data present
Example
unknownPersonal identifiers present
Example
unknownobject
Authentication and secrets present
Example
unknownBehavioural and inferred data present
Example
unknownClassification level
Example
unknownContact information present
Example
unknownCriminal justice data present
Example
unknownFinancial information present
Example
unknownGDPR: biometric data for identification
Example
unknownGDPR: genetic data
Example
unknownGDPR: political opinions
Example
unknownGDPR: racial or ethnic origin
Example
unknownGDPR: religious or philosophical beliefs
Example
unknownGDPR: sex life or sexual orientation
Example
unknownGDPR: trade union membership
Example
unknownHealth and medical data present
Example
unknownLocation and tracking data present
Example
unknownMinors data present
Example
unknownOrganisational confidential data present
Example
unknownPersonal identifiers present
Example
unknownNull
Schema name (key)
JSON schema for the payload
object
Null
A valid agent schema version ID
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyNull
Array of quality schemas with name, schema and optional title, description, template and data_risk.
Named schema with schema and optional title, description, template and data_risk
object
object
object
Creates data
Example
unknownDestroys data
Example
unknownSends external communications
Example
unknownPerforms financial transactions
Example
unknownReads data
Example
unknownUpdates data
Example
unknownobject
Authentication and secrets present
Example
unknownBehavioural and inferred data present
Example
unknownClassification level
Example
unknownContact information present
Example
unknownCriminal justice data present
Example
unknownFinancial information present
Example
unknownGDPR: biometric data for identification
Example
unknownGDPR: genetic data
Example
unknownGDPR: political opinions
Example
unknownGDPR: racial or ethnic origin
Example
unknownGDPR: religious or philosophical beliefs
Example
unknownGDPR: sex life or sexual orientation
Example
unknownGDPR: trade union membership
Example
unknownHealth and medical data present
Example
unknownLocation and tracking data present
Example
unknownMinors data present
Example
unknownOrganisational confidential data present
Example
unknownPersonal identifiers present
Example
unknownobject
Authentication and secrets present
Example
unknownBehavioural and inferred data present
Example
unknownClassification level
Example
unknownContact information present
Example
unknownCriminal justice data present
Example
unknownFinancial information present
Example
unknownGDPR: biometric data for identification
Example
unknownGDPR: genetic data
Example
unknownGDPR: political opinions
Example
unknownGDPR: racial or ethnic origin
Example
unknownGDPR: religious or philosophical beliefs
Example
unknownGDPR: sex life or sexual orientation
Example
unknownGDPR: trade union membership
Example
unknownHealth and medical data present
Example
unknownLocation and tracking data present
Example
unknownMinors data present
Example
unknownOrganisational confidential data present
Example
unknownPersonal identifiers present
Example
unknownNull
Schema name (key)
JSON schema for the payload
object
Null
Array of span types with name, params_schema and optional result_schema.
One span type with name, params_schema and optional result_schema
object
object
object
Creates data
Example
unknownDestroys data
Example
unknownSends external communications
Example
unknownPerforms financial transactions
Example
unknownReads data
Example
unknownUpdates data
Example
unknownobject
Authentication and secrets present
Example
unknownBehavioural and inferred data present
Example
unknownClassification level
Example
unknownContact information present
Example
unknownCriminal justice data present
Example
unknownFinancial information present
Example
unknownGDPR: biometric data for identification
Example
unknownGDPR: genetic data
Example
unknownGDPR: political opinions
Example
unknownGDPR: racial or ethnic origin
Example
unknownGDPR: religious or philosophical beliefs
Example
unknownGDPR: sex life or sexual orientation
Example
unknownGDPR: trade union membership
Example
unknownHealth and medical data present
Example
unknownLocation and tracking data present
Example
unknownMinors data present
Example
unknownOrganisational confidential data present
Example
unknownPersonal identifiers present
Example
unknownobject
Authentication and secrets present
Example
unknownBehavioural and inferred data present
Example
unknownClassification level
Example
unknownContact information present
Example
unknownCriminal justice data present
Example
unknownFinancial information present
Example
unknownGDPR: biometric data for identification
Example
unknownGDPR: genetic data
Example
unknownGDPR: political opinions
Example
unknownGDPR: racial or ethnic origin
Example
unknownGDPR: religious or philosophical beliefs
Example
unknownGDPR: sex life or sexual orientation
Example
unknownGDPR: trade union membership
Example
unknownHealth and medical data present
Example
unknownLocation and tracking data present
Example
unknownMinors data present
Example
unknownOrganisational confidential data present
Example
unknownPersonal identifiers present
Example
unknownNull
Span type name (e.g. llm, tool)
JSON schema for the span payload
object
Null
Responses
Section titled “Responses”Success
object
object
A valid account ID
A valid agent ID
Map of alert schema names to their schemas and optional title, description, template and data_risk
object
object
object
object
Creates data
Destroys data
Sends external communications
Performs financial transactions
Reads data
Updates data
object
Authentication and secrets present
Behavioural and inferred data present
Classification level
Contact information present
Criminal justice data present
Financial information present
GDPR: biometric data for identification
GDPR: genetic data
GDPR: political opinions
GDPR: racial or ethnic origin
GDPR: religious or philosophical beliefs
GDPR: sex life or sexual orientation
GDPR: trade union membership
Health and medical data present
Location and tracking data present
Minors data present
Organisational confidential data present
Personal identifiers present
object
Authentication and secrets present
Behavioural and inferred data present
Classification level
Contact information present
Criminal justice data present
Financial information present
GDPR: biometric data for identification
GDPR: genetic data
GDPR: political opinions
GDPR: racial or ethnic origin
GDPR: religious or philosophical beliefs
GDPR: sex life or sexual orientation
GDPR: trade union membership
Health and medical data present
Location and tracking data present
Minors data present
Organisational confidential data present
Personal identifiers present
Schema name (key)
JSON schema for the payload. Title and description are sibling fields on this object and are not present inside schema.
object
Human-readable title (defaults to name)
Agent deployments whose current version uses this schema version (empty if none).
External identifier for the agent schema version
Count of rows sharing this external identifier (helps distinguish duplicates).
A valid agent schema version ID
When the agent schema version was created
Map of quality schema names to their schemas and optional title, description, template and data_risk
object
object
object
object
Creates data
Destroys data
Sends external communications
Performs financial transactions
Reads data
Updates data
object
Authentication and secrets present
Behavioural and inferred data present
Classification level
Contact information present
Criminal justice data present
Financial information present
GDPR: biometric data for identification
GDPR: genetic data
GDPR: political opinions
GDPR: racial or ethnic origin
GDPR: religious or philosophical beliefs
GDPR: sex life or sexual orientation
GDPR: trade union membership
Health and medical data present
Location and tracking data present
Minors data present
Organisational confidential data present
Personal identifiers present
object
Authentication and secrets present
Behavioural and inferred data present
Classification level
Contact information present
Criminal justice data present
Financial information present
GDPR: biometric data for identification
GDPR: genetic data
GDPR: political opinions
GDPR: racial or ethnic origin
GDPR: religious or philosophical beliefs
GDPR: sex life or sexual orientation
GDPR: trade union membership
Health and medical data present
Location and tracking data present
Minors data present
Organisational confidential data present
Personal identifiers present
Schema name (key)
JSON schema for the payload. Title and description are sibling fields on this object and are not present inside schema.
object
Human-readable title (defaults to name)
Map of span type names to their params and result JSON schemas
object
object
object
object
Creates data
Destroys data
Sends external communications
Performs financial transactions
Reads data
Updates data
object
Authentication and secrets present
Behavioural and inferred data present
Classification level
Contact information present
Criminal justice data present
Financial information present
GDPR: biometric data for identification
GDPR: genetic data
GDPR: political opinions
GDPR: racial or ethnic origin
GDPR: religious or philosophical beliefs
GDPR: sex life or sexual orientation
GDPR: trade union membership
Health and medical data present
Location and tracking data present
Minors data present
Organisational confidential data present
Personal identifiers present
object
Authentication and secrets present
Behavioural and inferred data present
Classification level
Contact information present
Criminal justice data present
Financial information present
GDPR: biometric data for identification
GDPR: genetic data
GDPR: political opinions
GDPR: racial or ethnic origin
GDPR: religious or philosophical beliefs
GDPR: sex life or sexual orientation
GDPR: trade union membership
Health and medical data present
Location and tracking data present
Minors data present
Organisational confidential data present
Personal identifiers present
Span type name
JSON schema for the span payload
object
JSON schema for the span result payload (defaults to empty object if omitted when creating)
object
Human-readable title (defaults to name)
Type of resource (always ‘agent_schema_version’)
When the agent schema version was last updated
Example
{ "details": { "account_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "agent_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "alert_schemas": { "additionalProperty": { "data_risk": { "action_profile": { "create_data": "unknown", "destroy_data": "unknown", "external_communication": "unknown", "financial_transactions": "unknown", "read_data": "unknown", "update_data": "unknown" }, "params_data_categories": { "authentication_and_secrets": "unknown", "behavioural_and_inferred": "unknown", "classification": "unknown", "contact_information": "unknown", "criminal_justice": "unknown", "financial_information": "unknown", "gdpr_biometric_for_identification": "unknown", "gdpr_genetic_data": "unknown", "gdpr_political_opinions": "unknown", "gdpr_racial_or_ethnic_origin": "unknown", "gdpr_religious_or_philosophical_beliefs": "unknown", "gdpr_sex_life_or_sexual_orientation": "unknown", "gdpr_trade_union_membership": "unknown", "health_and_medical": "unknown", "location_and_tracking": "unknown", "minors_data": "unknown", "organisational_confidential": "unknown", "personal_identifiers": "unknown" }, "result_data_categories": { "authentication_and_secrets": "unknown", "behavioural_and_inferred": "unknown", "classification": "unknown", "contact_information": "unknown", "criminal_justice": "unknown", "financial_information": "unknown", "gdpr_biometric_for_identification": "unknown", "gdpr_genetic_data": "unknown", "gdpr_political_opinions": "unknown", "gdpr_racial_or_ethnic_origin": "unknown", "gdpr_religious_or_philosophical_beliefs": "unknown", "gdpr_sex_life_or_sexual_orientation": "unknown", "gdpr_trade_union_membership": "unknown", "health_and_medical": "unknown", "location_and_tracking": "unknown", "minors_data": "unknown", "organisational_confidential": "unknown", "personal_identifiers": "unknown" } }, "description": null, "schema_validation": { "message": null, "status": "success" }, "template": null } }, "current_agent_deployment_refs": [ "013xrzp12g3nqk8ns6jadrqmpgrjkeny" ], "external_identifier": "v0", "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "inserted_at": "2024-01-01T00:00:00Z", "quality_schemas": { "additionalProperty": { "data_risk": { "action_profile": { "create_data": "unknown", "destroy_data": "unknown", "external_communication": "unknown", "financial_transactions": "unknown", "read_data": "unknown", "update_data": "unknown" }, "params_data_categories": { "authentication_and_secrets": "unknown", "behavioural_and_inferred": "unknown", "classification": "unknown", "contact_information": "unknown", "criminal_justice": "unknown", "financial_information": "unknown", "gdpr_biometric_for_identification": "unknown", "gdpr_genetic_data": "unknown", "gdpr_political_opinions": "unknown", "gdpr_racial_or_ethnic_origin": "unknown", "gdpr_religious_or_philosophical_beliefs": "unknown", "gdpr_sex_life_or_sexual_orientation": "unknown", "gdpr_trade_union_membership": "unknown", "health_and_medical": "unknown", "location_and_tracking": "unknown", "minors_data": "unknown", "organisational_confidential": "unknown", "personal_identifiers": "unknown" }, "result_data_categories": { "authentication_and_secrets": "unknown", "behavioural_and_inferred": "unknown", "classification": "unknown", "contact_information": "unknown", "criminal_justice": "unknown", "financial_information": "unknown", "gdpr_biometric_for_identification": "unknown", "gdpr_genetic_data": "unknown", "gdpr_political_opinions": "unknown", "gdpr_racial_or_ethnic_origin": "unknown", "gdpr_religious_or_philosophical_beliefs": "unknown", "gdpr_sex_life_or_sexual_orientation": "unknown", "gdpr_trade_union_membership": "unknown", "health_and_medical": "unknown", "location_and_tracking": "unknown", "minors_data": "unknown", "organisational_confidential": "unknown", "personal_identifiers": "unknown" } }, "description": null, "schema_validation": { "message": null, "status": "success" }, "template": null } }, "span_type_schemas": { "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": "agent_schema_version", "updated_at": "2024-01-01T00:00:00Z" }, "status": "success"}default
Section titled “default”Error