Back to Home

API Documentation

Integrate ZyloPro into your applications

v1.0Base URL: https://api.zylopro.com

Quick Start

1. Get Your Credentials

Sign up on ZyloPro to create your account and organization. You can then log in via the API to obtain an access token.

2. Authentication

The API uses JWT (Bearer) tokens. Include the token in the Authorization header of your requests:

Authorization: Bearer <votre-token>

3. Make Your First Request

Once authenticated, you can list available agents, run analyses, and retrieve results.

Authentication

Authentication endpoints manage user accounts, access tokens, and passwords.

POST/api/auth/register
Public

Register a new organization with its owner

Request Body

{
  "email": "string",
  "password": "string",
  "firstName": "string",
  "lastName": "string",
  "organizationName": "string"
}

Response

{ success: boolean, token?: string, refreshToken?: string, user?: UserDto }
POST/api/auth/login
Public

Log in a user

Request Body

{
  "email": "string",
  "password": "string"
}

Response

{ success: boolean, token?: string, refreshToken?: string, user?: UserDto }
POST/api/auth/refresh
Public

Refresh the access token with a refresh token

Request Body

{
  "refreshToken": "string"
}

Response

{ success: boolean, token?: string, refreshToken?: string }
POST/api/auth/revoke
Auth

Revoke a refresh token (logout)

Request Body

{
  "refreshToken": "string"
}

Response

{ message: string }
GET/api/auth/verify-email
Public

Verify email address with the token received by email

Query Params

{
  "token": "string"
}

Response

{ message: string }
POST/api/auth/forgot-password
Public

Request a password reset

Request Body

{
  "email": "string"
}

Response

{ message: string }
POST/api/auth/reset-password
Public

Reset password with the token received by email

Request Body

{
  "token": "string",
  "newPassword": "string"
}

Response

{ message: string }
POST/api/auth/change-password
Auth

Change password (logged-in user)

Request Body

{
  "currentPassword": "string",
  "newPassword": "string"
}

Response

{ message: string }

AI Modules

Agent endpoints allow you to list, subscribe to, and execute the platform's 10 AI modules.

GET/api/agents
Auth

Get all available agents on the platform

Response

AgentDto[]
GET/api/agents/organization
Admin

Get agents subscribed by the organization (Admin)

Response

AgentDto[]
GET/api/agents/my
Auth

Get agents accessible by the logged-in user

Response

AgentDto[]
POST/api/agents/{agentId}/subscribe
Owner

Subscribe to an agent (organization level)

URL Parameters

{
  "agentId": "int"
}

Response

{ message: string }
POST/api/agents/{agentId}/unsubscribe
Owner

Unsubscribe from an agent

URL Parameters

{
  "agentId": "int"
}

Response

{ message: string }
POST/api/agents/{code}/execute
Auth

Execute an agent with input data

URL Parameters

{
  "code": "string (ex: proposalcraft)"
}

Request Body

{
  "inputData": "string",
  "projectId": "guid? (optionnel)",
  "metadata": "Record<string, string>? (optionnel)"
}

Response

{ success: boolean, status: string, executionId: guid, outputData?: string, error?: string }
GET/api/agents/executions/{executionId}
Auth

Get the status of an execution

URL Parameters

{
  "executionId": "guid"
}

Response

AgentExecutionDto
POST/api/agents/executions/{executionId}/cancel
Auth

Cancel an ongoing execution

URL Parameters

{
  "executionId": "guid"
}

Response

{ message: string }
GET/api/agents/executions
Auth

Get the user's execution history

Query Params

{
  "limit": "int (défaut: 20)"
}

Response

AgentExecutionDto[]

Code Examples

Login and Token Retrieval
// Exemple de connexion
const response = await fetch('https://api.zylopro.com/api/auth/login', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    email: 'user@example.com',
    password: 'votre-mot-de-passe'
  })
});

const data = await response.json();
// Stocker le token pour les requêtes ultérieures
const accessToken = data.token;
Executing an Agent
// Exemple d'exécution d'un agent
const response = await fetch('https://api.zylopro.com/api/agents/proposalcraft/execute', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${accessToken}`
  },
  body: JSON.stringify({
    inputData: "Contenu de l'appel d'offres à analyser...",
    metadata: {
      projectName: "Étude satisfaction client 2025",
      clientName: "ACME Corp"
    }
  })
});

const result = await response.json();
console.log('Exécution ID:', result.executionId);
console.log('Statut:', result.status);
Tracking an Execution (Polling)
// Exemple de polling pour suivre une exécution
async function waitForCompletion(executionId, accessToken) {
  while (true) {
    const response = await fetch(
      `https://api.zylopro.com/api/agents/executions/${executionId}`,
      {
        headers: { 'Authorization': `Bearer ${accessToken}` }
      }
    );

    const execution = await response.json();

    if (execution.status === 'Completed') {
      return execution;
    }

    if (execution.status === 'Failed') {
      throw new Error(execution.errorMessage);
    }

    // Attendre 2 secondes avant le prochain check
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
}

Data Types

AgentDto

{
  id: number
  code: string
  name: string
  shortDescription: string
  longDescription: string
  category: string
  inputType: string
  outputType: string
  monthlyPrice: number
  includedExecutions: number
  extraExecutionPrice: number
  iconName: string
  color: string
  isActive: boolean
  isBeta: boolean
  isSubscribed: boolean
  hasAccess: boolean
}

AgentExecutionDto

{
  id: guid
  agentCode: string
  agentName: string
  status: "Pending" | "Running" |
          "Completed" | "Failed" |
          "Cancelled"
  createdAt: datetime
  startedAt: datetime | null
  completedAt: datetime | null
  durationSeconds: number | null
  inputTokens: number | null
  outputTokens: number | null
  outputFilePath: string | null
  errorMessage: string | null
}

Error Handling

HTTP CodeDescription
200Success
400Bad request (missing or invalid parameters)
401Unauthenticated (missing or expired token)
403Forbidden (insufficient permissions)
404Resource not found
429Too many requests (rate limiting)
500Internal server error

Error Format

{
  "message": "Description de l'erreur",
  "errors": {
    "fieldName": ["Détail de l'erreur de validation"]
  }
}

Limits and Quotas

Rate Limiting

The API is limited to 100 requests per minute per user. The X-RateLimit-* headers indicate your quota status.

Execution Quotas

Each plan has a monthly execution limit per agent. Check your dashboard to monitor your usage.

Need Help?

Our technical team is available to assist you with ZyloPro API integration.