Skip to content

docs: Document HTTP 409 response when deleting fields in use by Segments#295

Merged
RCheesley merged 3 commits intomautic:7.1from
Promptless:promptless/pr-15882-field-delete-error
Apr 1, 2026
Merged

docs: Document HTTP 409 response when deleting fields in use by Segments#295
RCheesley merged 3 commits intomautic:7.1from
Promptless:promptless/pr-15882-field-delete-error

Conversation

@promptless-for-oss
Copy link
Copy Markdown

Open this suggestion in Promptless to view citations and reasoning process

Adds documentation to the Fields API delete endpoint explaining that attempting to delete a field that's in use by a Segment returns an HTTP 409 (Conflict) response. This behavior was added to make the API consistent with the Mautic UI, which already prevents deletion of fields in use by Segments.

Trigger Events

mautic/mautic PR #15882: Prevent deletion of custom fields if they are in use by segments via API

Promptless Research (1 GitHub PR)

Agent Response

I've completed the documentation update for PR #15882. Here's a summary of what I did:

Summary

PR #15882 adds validation to the Fields REST API to prevent deletion of custom fields that are in use by Segments. Previously, the API allowed deletion even when fields were being used (inconsistent with the UI behavior).

Documentation Changes

I created a suggestion that updates the Delete field section of the Fields API documentation (docs/rest_api/fields.rst) to document:

  1. A note explaining that fields in use by Segments cannot be deleted via the API
  2. The HTTP 409 (Conflict) response code that the API now returns in this scenario
  3. Guidance to remove the field from Segment filters before attempting deletion

The changes follow the existing documentation style and patterns used throughout the REST API docs.

Suggestion Created

Document HTTP 409 response when deleting fields in use by Segments

This suggestion is ready for your review.


Tip: Attach PDFs in Slack messages to Promptless—it can even extract images from them 📎

@promptless-for-oss promptless-for-oss requested a review from a team as a code owner February 24, 2026 18:31
@promptless-for-oss promptless-for-oss requested review from adiati98 and favour-chibueze and removed request for a team February 24, 2026 18:31
@RCheesley
Copy link
Copy Markdown
Member

This PR will need to be rebased onto the 7.1 branch once it's created.

@promptless-for-oss
Copy link
Copy Markdown
Author

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

@promptless-for-oss
Copy link
Copy Markdown
Author

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

fedys
fedys previously approved these changes Feb 26, 2026
Copy link
Copy Markdown
Member

@fedys fedys left a comment

Choose a reason for hiding this comment

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

👍

@promptless-for-oss
Copy link
Copy Markdown
Author

Promptless escalated the following message to you. If you respond, please remember to tag Promptless:

I reviewed PR #295 and found that RCheesley's feedback has already been addressed:

  1. Text suggestion ✅ - The note already uses the exact wording suggested: "You can't delete a field that's in use by a Segment. This returns an HTTP 409 (Conflict) response. Remove the field from any Segment filters before deleting it."

  2. Rebase onto 7.1 branch ⏳ - This can't be done yet because the 7.1 branch doesn't exist. RCheesley noted it will need to happen "once it's created." The "needs-rebase" label is essentially a reminder for when that branch is available.

No further changes are needed at this time. I'll handle the rebase when the 7.1 branch is created.

@RCheesley
Copy link
Copy Markdown
Member

@promptless-for-oss please rebase to 7.1

Signed-off-by: promptless-for-oss <promptless-for-oss@users.noreply.github.com>
Signed-off-by: promptless-for-oss <promptless-for-oss@users.noreply.github.com>
@adit-chandra adit-chandra force-pushed the promptless/pr-15882-field-delete-error branch from ab1c863 to 0ed2f60 Compare March 24, 2026 19:23
@promptless-for-oss promptless-for-oss changed the base branch from 5.x to 7.1 March 24, 2026 19:26
@promptless-for-oss promptless-for-oss requested a review from a team March 24, 2026 19:26
Copy link
Copy Markdown
Member

@RCheesley RCheesley left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@RCheesley RCheesley merged commit f6de0d0 into mautic:7.1 Apr 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants