---
title: "Service: /members/{member}/groups/{group}/uris/{uri}/fragments [POST]"
source: https://dev.pageseeder.com/api/services/add-uri-fragment-POST.html
description: "POST endpoint to create a new fragment at a specified location in a PageSeeder document. Requires contributor permissions and supports positioning via section, beforefragment, or afterfragment parameters. Returns the created fragment wrapped in a fragment-creation element."
last_updated: 2026-09-02T11:36:09+10:00
document_type: api_endpoint
operation_id: psml-POST
resource_id: psml
path_template: /members/{member}/groups/{group}/uris/{uri}/fragments
http_method: POST
api_category: psml
implementation_version: 6.3000
api_since: 5.0100
deprecated_since: null
obsolete_since: null
api_support: supported
cache_control: N/A
generated_at: 2026-09-02
tokens: ~709
---

# /members/\{member\}/groups/\{group\}/uris/\{uri\}/fragments \[POST\]

## Description

Create a new [fragment](../../reference/glossary/fragment.md) at specified location in a document.

## Parameters

| Name | Description | Required | Type | Default |
| --- | --- | --- | --- | --- |
| content | Content of edit | yes | string |  |
| afterfragment | `ID` of the fragment to insert the fragment after (required if no section or beforefragment, overrides section and beforefragment) | maybe | string |  |
| beforefragment | `ID` of the fragment to insert the fragment before (required if no section or afterfragment, overrides section) | maybe | string |  |
| section | `ID` of the section to append the fragment to, after other fragments (required if no beforefragment or afterfragment) | maybe | string |  |
| draft | A flag to save edit as a draft | no | boolean | `false` |
| fragment | The fragment ID to use if not generated | no | [fragment-id](../../psml/datatypes/pageseeder_datatypes.md) |  |
| fragmentprefix | Prefix in front of the generated fragment `ID` | no | fragment-id |  |
| html | Flag to specify if content is HTML | no | boolean | `false` |
| labels | Comma-separated list of edit labels values | no | string |  |
| markdown | A flag to specify if content is markdown (overrides `html` parameter) | no | boolean | `false` |
| note | Content for edit notes (if exists, creates a note) | no | string |  |
| note-labels | Comma-separated list of label values for the note (if exists, creates a note) | no | string |  |
| note-title | A title for the edit note | no | string | `Edit Note` |
| transclude | A flag to resolve transclusions when outputting result | no | boolean | `true` |

## Permission

This service requires contributor or higher.

## Response

When successful, the new fragment is returned as a [\<document-fragment\>](../elements/element_document-fragment.md) wrapped in a `<fragment-creation>` element.

Example:

```xml


<fragment-creation notification-email-failed="true">
  <document-fragment [draft="true"]>
    <locator id="325"
             fragment="example"
             editid="6340"
             modified="2015-03-24T13:21:57">
      <notes>
        <note id="6342"
              modified="2015-03-24T13:21:57"
              title="Typography">
          <content>Fixed typographical error.</content>
        </note>
      </notes>
    </locator>
    <fragment id="example">
      <para>This is the fragment content</para>
    </fragment>
  </document-fragment>
</fragment-creation>
```

## Error Handling

| Code | Cause / Description |
| --- | --- |
| 0x120B | Error processing XRefs |
| 0x120C | Error creating fragment |
| 0x120D | Content validation error |
| 0x122C | The fragment already exists |
| 0x122D | The fragment is invalid |
| 0x6302 | Failed to create new comment |

