Skip to content

Conversation

@princevish
Copy link

@princevish princevish commented Jan 15, 2026

📋 Description

This PR introduces a comprehensive API_DOCUMENTATION.md file to the project. It provides detailed documentation for the Evolution API, covering all major modules including Instances, Messages, Groups, Chats, Business, and Integrations. The documentation includes endpoint descriptions, HTTP methods, route parameters, and JSON request body examples.

Key clarifications added:

  • Explicitly stated that the :instance URL parameter refers to the Instance Name, not the ID.
  • Added a tip on how to retrieve the instance name via fetchInstances.

🔗 Related Issue

Closes #(issue_number)

🧪 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧹 Code cleanup
  • 🔒 Security fix

🧪 Testing

  • Manual testing completed
  • Functionality verified in development environment
  • No breaking changes introduced
  • Tested with different connection types (if applicable)

Verification Details:

  • Verified endpoint paths and methods against src/api/routes/*.router.ts.
  • Verified request body structures against src/api/dto/*.dto.ts.
  • Validated the "Instance Name" requirement by successfully sending a test message to an active instance using its name.

📸 Screenshots (if applicable)

✅ Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have manually tested my changes thoroughly
  • I have verified the changes work with different scenarios
  • Any dependent changes have been merged and published

📝 Additional Notes

This documentation serves as a centralized reference for developers and users to interact with the API effectively without needing to read the source code for every request structure.

Summary by Sourcery

Add a comprehensive API documentation guide for the Evolution API, covering core endpoints and usage conventions.

Documentation:

  • Introduce API_DOCUMENTATION.md with structured reference documentation for instance, message, call, chat, group, business, template, settings, proxy, label, and integration APIs.
  • Clarify authentication requirements and the use of the :instance URL parameter as the human-readable instance name, including guidance on retrieving it via the fetchInstances endpoint.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 15, 2026

Reviewer's Guide

Adds a new comprehensive API_DOCUMENTATION.md file describing all major Evolution API endpoints, parameters, and example request payloads, with special emphasis on correct usage of the :instance path parameter and how to discover instance names.

Sequence diagram for using instance-based message API flow

sequenceDiagram
    actor Developer
    participant EvolutionAPI

    Developer->>EvolutionAPI: GET /instance/fetchInstances
    EvolutionAPI-->>Developer: 200 OK (list of instances with name, status)

    Developer->>Developer: Select active instance.name

    Developer->>EvolutionAPI: POST /message/sendText/:instance
    activate EvolutionAPI
    EvolutionAPI->>EvolutionAPI: Validate apikey and instance name
    EvolutionAPI-->>Developer: 200 OK (message queued/sent)
    deactivate EvolutionAPI
Loading

File-Level Changes

Change Details Files
Documented all core Evolution API domains (instances, messages, calls, chats, groups, business, templates, settings, proxy, labels, and integrations) in a single API documentation file with structured sections, HTTP methods, routes, and example payloads.
  • Introduced a new API_DOCUMENTATION.md containing base URL and authentication requirements, including API key handling.
  • Provided explicit guidance that the :instance path parameter always expects the instance name rather than ID or token, including URL-encoding note for names with spaces.
  • Added detailed endpoint listings and example JSON request bodies for instance lifecycle operations, messaging and media sending, chat and contact operations, group management flows, and business catalog retrieval.
  • Documented configuration-style endpoints for templates, settings, proxy, labels, and various integrations (webhook, OpenAI, chatbots, and event backends), highlighting common set/find patterns.
API_DOCUMENTATION.md

Possibly linked issues

  • #[Docs] v2 API Reference is missing technical details for all endpoints: PR introduces full endpoint documentation that supplies the missing technical details requested for the v2 API Reference.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • Several of the json code examples include // comments inside the objects (e.g. "token": "random-token", // optional), which is invalid JSON and may confuse users or tools that copy/paste them; consider moving these notes to text around the snippet instead of inline.
  • The file ends with three empty fenced code blocks (multiple trailing ``` markers) after the Integrations section, which looks like a markdown formatting mistake and may break rendering in some viewers; it would be good to clean these up.
  • For endpoints that accept multiple allowed string values (e.g. presence, mediatype, status, category, action), it might be clearer and less error-prone to list the allowed values in a short bullet list or note under each endpoint rather than as inline comments in the JSON.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Several of the `json` code examples include `//` comments inside the objects (e.g. `"token": "random-token", // optional`), which is invalid JSON and may confuse users or tools that copy/paste them; consider moving these notes to text around the snippet instead of inline.
- The file ends with three empty fenced code blocks (multiple trailing ``` markers) after the Integrations section, which looks like a markdown formatting mistake and may break rendering in some viewers; it would be good to clean these up.
- For endpoints that accept multiple allowed string values (e.g. `presence`, `mediatype`, `status`, `category`, `action`), it might be clearer and less error-prone to list the allowed values in a short bullet list or note under each endpoint rather than as inline comments in the JSON.

## Individual Comments

### Comment 1
<location> `API_DOCUMENTATION.md:28-31` </location>
<code_context>
+  "token": "random-token", // optional
+  "number": "919876543210", // optional
+  "integration": "WHATSAPP-BAILEYS",
+  "qrcode": true // fetch qrcode immediately
+}
+```
</code_context>

<issue_to_address>
**suggestion (typo):** Use consistent spelling for “QR code” in the inline comment.

The `"qrcode"` field name should stay as-is for API compatibility, but please update the inline comment to `// fetch QR code immediately` for consistency with the rest of the documentation.

```suggestion
  "integration": "WHATSAPP-BAILEYS",
  "qrcode": true // fetch QR code immediately
}
```
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +28 to +31
"integration": "WHATSAPP-BAILEYS",
"qrcode": true // fetch qrcode immediately
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Use consistent spelling for “QR code” in the inline comment.

The "qrcode" field name should stay as-is for API compatibility, but please update the inline comment to // fetch QR code immediately for consistency with the rest of the documentation.

Suggested change
"integration": "WHATSAPP-BAILEYS",
"qrcode": true // fetch qrcode immediately
}
```
"integration": "WHATSAPP-BAILEYS",
"qrcode": true // fetch QR code immediately
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant