https://help.tago.io/portal/en/kb/articles/120-creating-analysis Creating Analysis
If receive an error "Authorization Denied", check policy Analysis / Create in Access Management.
const newAnalysis = await Resources.analysis.create({
name: "My Analysis",
type: "node",
tags: [{ key: "type", value: "data-processing" }]
});
console.log(newAnalysis.id, newAnalysis.token); // analysis-id-123, analysis-token-123
Deletes an analysis from your application.
Gets a download URL for the analysis script.
Optional
options: { version?: number }Modifies an existing analysis.
Get the raw source code content of a specific snippet file. Fetches the actual code content from the TagoIO snippets repository.
The runtime environment the snippet belongs to
The filename of the snippet to retrieve
Promise resolving to the raw file content as string
// Get TypeScript code for console example
const code = await Resources.analysis.getSnippetFile("deno-rt2025", "console.ts");
console.log(code);
// Get Python code for data processing
const pythonCode = await Resources.analysis.getSnippetFile("python-rt2025", "avg-min-max.py");
console.log(pythonCode);
Retrieves detailed information about a specific analysis.
Lists all analyses from the application with pagination support. Use this to retrieve and manage analyses in your application.
Optional
queryObj: TGet all available snippets for a specific runtime environment. Fetches analysis code snippets from the public TagoIO snippets repository.
The runtime environment to get snippets for
Promise resolving to the snippets metadata
Executes an analysis with optional scope parameters.
Optional
scopeObj: Record<string, any>Generates a new token for the analysis.
Uploads a script file to an analysis.
Creates a new analysis in your application.