EvoluAIv2 Docs

Endpoints

API Endpoints

Analyses

POST /trpc/analysis.create

Creates a new analysis.

Request:

{
  "json": {
    "salespersonId": "string",
    "audioKey": "string",
    "clientName": "string (optional)",
    "clientContact": "string (optional)"
  }
}

Or with URL:

{
  "json": {
    "salespersonId": "string",
    "audioUrl": "string",
    "clientName": "string (optional)",
    "clientContact": "string (optional)"
  }
}

Or with transcript:

{
  "json": {
    "salespersonId": "string",
    "transcript": "string",
    "clientName": "string (optional)",
    "clientContact": "string (optional)"
  }
}

Response:

{
  "result": {
    "data": {
      "id": "anal_xxx",
      "salespersonId": "user_xxx",
      "salespersonName": "string",
      "clientName": "string",
      "score": 87,
      "summary": "string",
      "transcript": "string",
      "transcriptSegmented": "string",
      "profile": "string",
      "stage": "Connect|Qualify|Present|Close|Negotiate",
      "bant": {
        "budget": "string",
        "authority": "string",
        "need": "string",
        "timing": "string"
      },
      "objections": [{"objection": "string", "resolved": true}],
      "strengths": ["string"],
      "improvements": ["string"],
      "dimensionScores": {
        "rapport": 90,
        "listening": 85,
        "objections": 80,
        "clarity": 88,
        "closing": 75
      },
      "phaseSuggestions": {
        "opening": "string",
        "discovery": "string",
        "problem": "string",
        "solution": "string",
        "objections": "string",
        "next_steps": "string"
      },
      "productExploration": {
        "explored": true,
        "products": ["string"]
      },
      "jobFunctionScore": 82,
      "jobFunctionAnalysis": {
        "microObjectives": [{
          "criteria": "string",
          "met": true,
          "timestamp": "string",
          "evidence": "string"
        }],
        "negativeIndicators": [{
          "criteria": "string",
          "present": true,
          "timestamp": "string",
          "evidence": "string"
        }]
      },
      "tokensUsed": 2500,
      "cost": 0.005,
      "audioUrl": "string",
      "audioDuration": 420,
      "createdAt": "2024-01-15T12:00:00Z"
    }
  }
}

GET /trpc/analysis.list

Lists analyses with filters.

Query Parameters:

{
  "input": {
    "limit": 20,
    "cursor": "string (optional)",
    "filters": {
      "salespersonId": "string (optional)",
      "dateFrom": "2024-01-01 (optional)",
      "dateTo": "2024-01-31 (optional)",
      "minScore": 80,
      "maxScore": 100
    }
  }
}

Response:

{
  "result": {
    "data": {
      "items": [{
        "id": "anal_xxx",
        "salespersonName": "string",
        "clientName": "string",
        "score": 87,
        "jobFunctionScore": 82,
        "stage": "Qualify",
        "audioDuration": 420,
        "createdAt": "2024-01-15T12:00:00Z"
      }],
      "nextCursor": "string",
      "total": 150
    }
  }
}

GET /trpc/analysis.getById

Gets a specific analysis.

Query Parameters:

{
  "input": {
    "id": "anal_xxx"
  }
}

Response: Same format as analysis.create


GET /trpc/analysis.getStats

Analysis statistics.

Response:

{
  "result": {
    "data": {
      "total": 150,
      "avgScore": 82.5,
      "byJobFunction": [{
        "function": "string",
        "count": 80,
        "avgScore": 85.2
      }],
      "byStage": {
        "Connect": 30,
        "Qualify": 60,
        "Present": 35,
        "Close": 20,
        "Negotiate": 5
      }
    }
  }
}

POST /trpc/analysis.shareEmail

Shares analysis via email.

Request:

{
  "json": {
    "analysisId": "anal_xxx",
    "emails": ["email1@example.com", "email2@example.com"],
    "message": "string (optional)"
  }
}

Response:

{
  "result": {
    "data": {
      "success": true,
      "sentTo": ["email1@example.com"]
    }
  }
}

POST /trpc/analysis.shareWhatsApp

Generates WhatsApp sharing link.

Request:

{
  "json": {
    "analysisId": "anal_xxx",
    "phone": "5511999999999",
    "message": "string (optional)"
  }
}

Response:

{
  "result": {
    "data": {
      "success": true,
      "whatsappUrl": "https://wa.me/..."
    }
  }
}

POST /trpc/analysis.delete

Deletes an analysis.

Request:

{
  "json": {
    "id": "anal_xxx"
  }
}

Upload

GET /trpc/upload.getPresignedUrl

Gets presigned URL for file upload.

Query Parameters:

{
  "input": {
    "filename": "audio.mp3",
    "contentType": "audio/mpeg"
  }
}

Response:

{
  "result": {
    "data": {
      "url": "https://storage.evolu-ai.com/...",
      "fields": {
        "key": "analyses/comp_xxx/file.mp3",
        "bucket": "evoluai-storage",
        "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
        "X-Amz-Credential": "...",
        "X-Amz-Date": "...",
        "X-Amz-Signature": "..."
      }
    }
  }
}

Upload:

curl -X POST 'RETURNED_URL' \
  -F 'key=FIELD_KEY' \
  -F 'bucket=evoluai-storage' \
  -F 'X-Amz-Algorithm=...' \
  -F 'X-Amz-Credential=...' \
  -F 'X-Amz-Date=...' \
  -F 'X-Amz-Signature=...' \
  -F 'file=@/path/file.mp3'

Users

GET /trpc/user.listByCompany

Lists company users.

Response:

{
  "result": {
    "data": {
      "items": [{
        "id": "user_xxx",
        "name": "string",
        "email": "string",
        "role": "salesperson|supervisor|admin",
        "jobFunction": {
          "id": "jf_xxx",
          "name": "string",
          "type": "string"
        },
        "supervisor": {
          "id": "user_xxx",
          "name": "string"
        },
        "stats": {
          "totalAnalyses": 50,
          "avgScore": 85.5
        },
        "isActive": true
      }]
    }
  }
}

GET /trpc/user.listSupervisorsByCompany

Lists only supervisors.

Response: Same format, filtered by role=supervisor


POST /trpc/user.create

Creates new user.

Request:

{
  "json": {
    "name": "string",
    "email": "string",
    "role": "salesperson|supervisor|admin",
    "supervisorId": "string (optional)",
    "jobFunctionId": "string (optional)"
  }
}

Response:

{
  "result": {
    "data": {
      "id": "user_xxx",
      "name": "string",
      "email": "string",
      "role": "string",
      "message": "string"
    }
  }
}

POST /trpc/user.update

Updates user.

Request:

{
  "json": {
    "id": "user_xxx",
    "name": "string (optional)",
    "jobFunctionId": "string (optional)",
    "supervisorId": "string (optional)"
  }
}

POST /trpc/user.delete

Deletes user.

Request:

{
  "json": {
    "id": "user_xxx"
  }
}

POST /trpc/user.updateJobFunction

Changes user job function.

Request:

{
  "json": {
    "userId": "user_xxx",
    "jobFunctionId": "jf_xxx"
  }
}

Job Functions

GET /trpc/jobFunctions.list

Lists job functions.

Response:

{
  "result": {
    "data": [{
      "id": "jf_xxx",
      "name": "string",
      "type": "string",
      "additionalGoals": ["string"]
    }]
  }
}

POST /trpc/jobFunctions.create

Creates job function.

Request:

{
  "json": {
    "name": "string",
    "type": "string",
    "additionalGoals": ["string"]
  }
}

POST /trpc/jobFunctions.update

Updates job function.

Request:

{
  "json": {
    "id": "jf_xxx",
    "name": "string (optional)",
    "type": "string (optional)",
    "additionalGoals": ["string"] (optional)
  }
}

POST /trpc/jobFunctions.delete

Deletes job function.

Request:

{
  "json": {
    "id": "jf_xxx"
  }
}

Credits

GET /trpc/credits.getSummary

Credits summary.

Response:

{
  "result": {
    "data": {
      "currentBalance": 5000,
      "planCredits": 10000,
      "planName": "string",
      "usedThisMonth": 3500,
      "remainingThisMonth": 6500,
      "totalTokensUsed": 875000,
      "estimatedMinutesRemaining": 200
    }
  }
}

GET /trpc/credits.getHistory

Transaction history.

Query Parameters:

{
  "input": {
    "limit": 20
  }
}

Response:

{
  "result": {
    "data": {
      "items": [{
        "id": "trans_xxx",
        "type": "consumption|plan_renewal|purchase|adjustment",
        "amount": -150,
        "balanceBefore": 5150,
        "balanceAfter": 5000,
        "description": "string",
        "referenceId": "string",
        "createdAt": "2024-01-15T12:00:00Z"
      }]
    }
  }
}

GET /trpc/credits.getUsageStats

Usage statistics.

Query Parameters:

{
  "input": {
    "days": 30
  }
}

Response:

{
  "result": {
    "data": {
      "daily": [{
        "date": "2024-01-15",
        "creditsUsed": 450,
        "analysesCreated": 3,
        "minutesAnalyzed": 15
      }],
      "totals": {
        "totalCredits": 750,
        "totalAnalyses": 5,
        "totalMinutes": 25,
        "averagePerAnalysis": 150
      }
    }
  }
}

API Keys

GET /trpc/apiKeys.list

Lists API Keys.

Response:

{
  "result": {
    "data": [{
      "id": "key_xxx",
      "name": "string",
      "keyPrefix": "evai_abc",
      "permissions": ["string"],
      "isActive": true,
      "expiresAt": "2024-12-31T23:59:59Z",
      "lastUsedAt": "2024-01-15T12:00:00Z",
      "createdAt": "2024-01-01T00:00:00Z"
    }]
  }
}

POST /trpc/apiKeys.create

Creates API Key.

Request:

{
  "json": {
    "name": "string",
    "permissions": ["string"],
    "expiresAt": "2024-12-31T23:59:59Z (optional)"
  }
}

Response:

{
  "result": {
    "data": {
      "id": "key_xxx",
      "name": "string",
      "apiKey": "evai_xxxxxxxxxxxxxxxx",
      "keyPrefix": "evai_xxx",
      "permissions": ["string"],
      "expiresAt": "string"
    }
  }
}

⚠️ Key is only displayed once!


POST /trpc/apiKeys.revoke

Revokes API Key.

Request:

{
  "json": {
    "id": "key_xxx"
  }
}

On this page