API Reference

Novolem API Reference

Welcome to the Novolem API documentation. Our API enables you to programmatically manage flows, retrieve user and organization information, and monitor flow runs.

Authentication

All API requests must include your API key in the header:

Novolem-API-Key: your_api_key_here

Base URL

All API endpoints are relative to:

https://api.novolem.com

Endpoints

User

Retrieve User Information

GET /user/retrieve

Returns information about the authenticated user.

Response

{
  "status": "success",
  "user": {
    "id": "user_id",
    "date_created": "2024-01-01T00:00:00Z",
    "email": "user@example.com",
    "name": "User Name",
    "metadata": {}
  },
  "status_code": 200,
  "message": "User retrieved successfully"
}

Organization

Retrieve Organization Information

GET /org/retrieve

Returns information about the authenticated user's organization.

Response

{
  "status": "success",
  "org": {
    "id": "org_id",
    "date_created": "2024-01-01T00:00:00Z",
    "name": "Organization Name",
    "contact_email": "contact@example.com",
    "plan": "enterprise"
  },
  "status_code": 200,
  "message": "Organization retrieved successfully"
}

Flows

Create Flow

POST /flow/create

Creates a new flow with specified configuration.

Request Body

{
  "org_id": "org_id",
  "name": "Flow Name",
  "trigger": "manual",
  "sources": [
    {
      "name": "Source Name",
      "role": "url"
    }
  ],
  "prompt": "Flow prompt text",
  "destinations": [
    {
      "name": "Destination Name",
      "role": "email",
      "email": "notify@example.com"
    }
  ],
  "frequency": "1hr",
  "status": "active",
  "metadata": {}
}

Response

{
  "status": "success",
  "flow": {
    "id": "flow_id",
    "date_created": "2024-01-01T00:00:00Z",
    "org_id": "org_id",
    "status": "active",
    "name": "Flow Name",
    "frequency": "1hr",
    "trigger": "manual",
    "sources": [...],
    "prompt": "Flow prompt text",
    "destinations": [...],
    "metadata": {}
  },
  "status_code": 200,
  "message": "Flow created successfully"
}

Retrieve Flows

GET /flow/retrieve

Retrieves flows based on specified filters.

Request Body

{
  "ids": ["flow_id_1", "flow_id_2"],
  "statuses": ["active", "inactive"]
}

Response

{
  "status": "success",
  "flows": [
    {
      "id": "flow_id",
      "date_created": "2024-01-01T00:00:00Z",
      "org_id": "org_id",
      "status": "active",
      "name": "Flow Name",
      "frequency": "1hr",
      "trigger": "manual",
      "sources": [...],
      "prompt": "Flow prompt text",
      "destinations": [...],
      "metadata": {}
    }
  ],
  "status_code": 200,
  "message": "Flows retrieved successfully"
}

Flow Runs

Retrieve Flow Runs

GET /flow-run/retrieve

Retrieves flow runs based on specified filters.

Request Body

{
  "flow_ids": ["flow_id_1", "flow_id_2"],
  "statuses": ["pending", "running", "completed", "failed"]
}

Response

{
  "status": "success",
  "flow_runs": [
    {
      "id": "run_id",
      "date_created": "2024-01-01T00:00:00Z",
      "flow_id": "flow_id",
      "status": "completed",
      "reason": "Success",
      "matched_criteria": true
    }
  ],
  "status_code": 200,
  "message": "Flow runs retrieved successfully"
}

Data Models

Flow Source

{
  "name": "string",
  "role": "url | search"
}

Flow Destination

{
  "name": "string",
  "role": "email | webhook",
  "email": "string (optional)",
  "webhook_url": "string (optional)"
}

Flow Frequency Options

  • 5min
  • 15min
  • 30min
  • 1hr
  • 2hr
  • 4hr
  • 8hr
  • 12hr
  • 1day
  • 4day
  • 7day

Flow Status Options

  • active
  • inactive

Flow Run Status Options

  • pending
  • running
  • completed
  • failed

Error Handling

The API uses conventional HTTP response codes to indicate the success or failure of requests:

  • 200: Success
  • 400: Bad Request
  • 401: Unauthorized
  • 403: Forbidden
  • 404: Not Found
  • 422: Validation Error
  • 500: Internal Server Error

For validation errors, the response will include details about the error:

{
  "detail": [
    {
      "loc": ["body", "field_name"],
      "msg": "error message",
      "type": "error_type"
    }
  ]
}