Skip to content

docs: Document Companies REST API with tags support#296

Open
promptless-for-oss wants to merge 2 commits intomautic:5.xfrom
Promptless:promptless/pr-15901-company-tags
Open

docs: Document Companies REST API with tags support#296
promptless-for-oss wants to merge 2 commits intomautic:5.xfrom
Promptless:promptless/pr-15901-company-tags

Conversation

@promptless-for-oss
Copy link
Copy Markdown

Open this suggestion in Promptless to view citations and reasoning process

Replaces the placeholder Companies API page with comprehensive documentation covering all CRUD operations (Get, List, Create, Edit, Delete), Contact association endpoints (Add/Remove Contact), and the new tags feature from PR #15901. Includes PHP library code examples, JSON response samples showing the new tags array, and documents the tag modification syntax (prefix tag names with minus sign to remove).

Trigger Events

mautic/mautic PR #15901: Tags for companies

Promptless Research (1 GitHub PR)

Agent Response

I've completed the documentation update for PR #15901 (Tags for companies). Here's a summary of what I created:

Documentation Changes

File: docs/rest_api/companies.rst

I replaced the placeholder page with comprehensive Companies REST API documentation that includes:

Endpoints Documented

  • Get Company (GET /companies/ID) - retrieve a single company
  • List Companies (GET /companies) - list all companies with filtering options
  • Create Company (POST /companies/new) - create a new company with tags
  • Edit Company (PATCH/PUT /companies/ID/edit) - update company including tag modifications
  • Delete Company (DELETE /companies/ID/delete) - remove a company
  • Add Contact to Company (POST /companies/COMPANY_ID/contact/CONTACT_ID/add)
  • Remove Contact from Company (POST /companies/COMPANY_ID/contact/CONTACT_ID/remove)

New Tags Feature

The documentation covers the new tags functionality from this PR:

  • Companies now include a tags array in API responses
  • Creating companies with tags: 'tags' => ['Enterprise', 'VIP']
  • Modifying tags during edit: prefix with minus sign to remove ('-Enterprise')
  • Combined operations: 'tags' => ['-OldTag', 'NewTag']

Each endpoint includes PHP code examples using the Mautic API Library and JSON response samples showing the tags property.

The suggestion is ready for your review.


Tip: Create additional Docs Collections to keep multiple repositories in sync 📚

Signed-off-by: promptless-for-oss <promptless-for-oss@users.noreply.github.com>
@@ -1,14 +1,576 @@
Companies
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Citation: Comprehensive Companies API documentation based on PR #15901 which adds tags support to companies. Key code changes: CompanyApiController.php adds tagList serializer group and modifyTags() call in preSaveEntity(). Company.php entity adds tags property with ManyToMany relationship. Test code in CompanyControllerTest.php demonstrates API usage patterns for creating/editing companies with tags.
View source

- Name of the User that last modified the Company
* - ``fields``
- array
- Custom field values grouped by field group
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@promptless-for-oss please use Custom Field (capitalised) as this refers to a Mautic feature.

Signed-off-by: promptless-for-oss <promptless-for-oss@users.noreply.github.com>
@promptless-for-oss
Copy link
Copy Markdown
Author

I've added new changes to address this PR review in commit d820dd9

@RCheesley RCheesley requested a review from Copilot February 24, 2026 19:59
@RCheesley
Copy link
Copy Markdown
Member

I think this one is good to review now - it'll need to be checked for technical accuracy!

@RCheesley RCheesley marked this pull request as ready for review February 24, 2026 19:59
@RCheesley RCheesley requested a review from a team as a code owner February 24, 2026 19:59
@RCheesley RCheesley requested review from adiati98 and favour-chibueze and removed request for a team February 24, 2026 19:59
@promptless-for-oss
Copy link
Copy Markdown
Author

I've processed your request, but no documentation changes were needed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces the placeholder Companies REST API documentation with comprehensive, production-ready documentation. It documents the new tags feature for companies (from PR #15901) alongside all standard CRUD operations and contact association endpoints.

Changes:

  • Replaced placeholder note with complete API documentation for Companies
  • Added documentation for all CRUD operations (Get, List, Create, Edit, Delete)
  • Documented the new tags feature with creation, modification, and removal examples
  • Added Contact association endpoints (Add/Remove Contact)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

'tags' => ['-Enterprise', 'Strategic']
);

// Create new a Company if ID 42 isn't found?
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

Grammar error in comment: "Create new a Company" should be "Create a new Company". The article "a" should come before the adjective "new".

Suggested change
// Create new a Company if ID 42 isn't found?
// Create a new Company if ID 42 isn't found?

Copilot uses AI. Check for mistakes.
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.

3 participants