> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pnbr.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit staged records

> Edit or remove staged workspace items.

**Operation ID:** `http.graph.workspaces.modify`

```http theme={null}
POST /v1/orgs/{org}/projects/{project}/graph/workspaces/{ws}/modify
```


## OpenAPI

````yaml openapi.json POST /v1/orgs/{org}/projects/{project}/graph/workspaces/{ws}/modify
openapi: 3.1.0
info:
  title: Penumbra API
  version: v1
  description: >-
    HTTP reference for Files, search, extraction, reviews, Graph, Shapes and
    sharing.
servers:
  - url: https://api.pnbr.io
    description: Penumbra API
security: []
paths:
  /v1/orgs/{org}/projects/{project}/graph/workspaces/{ws}/modify:
    post:
      tags:
        - Review workspaces
      summary: Edit staged records
      description: |-
        Edit or remove staged workspace items.

        Product guidance: [Workspace](/concepts/workspace).
      operationId: http.graph.workspaces.modify
      parameters:
        - name: org
          in: path
          required: true
          schema:
            type: string
        - name: project
          in: path
          required: true
          schema:
            type: string
        - name: ws
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/http_graph_workspaces_modify_request'
      responses:
        2XX:
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/http_graph_workspaces_modify_response'
      security:
        - bearerAuth: []
components:
  schemas:
    http_graph_workspaces_modify_request:
      type: object
      properties:
        idempotency_key:
          type: string
          minLength: 1
          maxLength: 200
        expected_revision:
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        description:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
        edit:
          maxItems: 100
          type: array
          items:
            type: object
            properties:
              handle:
                description: >-
                  Exact staged or hydrated item handle returned by
                  workspace_read, capture, or workspace_hydrate.
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              changes:
                type: object
                properties:
                  name:
                    anyOf:
                      - type: string
                        maxLength: 1024
                      - type: 'null'
                  description:
                    anyOf:
                      - type: string
                        maxLength: 8192
                      - type: 'null'
                  type:
                    type: string
                    minLength: 1
                  properties:
                    description: >-
                      For a newly staged entity or relationship: replace its
                      entire property map. Include every property to retain.
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                  patch:
                    description: >-
                      For a hydrated node: {name?, description?, properties?};
                      for a hydrated edge: {properties}. If present, properties
                      merge into the current ones: a property you leave out
                      keeps its value.
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                  intent:
                    type: string
                    enum:
                      - update
                      - delete
                  evidence:
                    description: >-
                      Replace staged citations. For a hydrated update,
                      explicitly cite the new revision; earlier revision
                      evidence is unchanged. Supply a patch with the update.
                    maxItems: 32
                    type: array
                    items:
                      anyOf:
                        - type: object
                          properties:
                            citation:
                              description: >-
                                The citation token read returned for the passage
                                or quote you are citing, passed unchanged. The
                                server resolves it to the exact File, version,
                                digest and quoted text range and verifies them
                                against Files. Example: citation: 'cite1.AZ8j…'.
                              type: string
                              minLength: 8
                              maxLength: 1024
                            note:
                              type: string
                              minLength: 1
                              maxLength: 500
                          required:
                            - citation
                          additionalProperties: false
                        - type: object
                          properties:
                            kind:
                              type: string
                              const: file
                            file_id:
                              description: Native File id.
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            version_id:
                              description: The immutable File version actually read.
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            content_digest:
                              description: >-
                                That version's sha256 content digest, as Files
                                reports it.
                              type: string
                              pattern: ^sha256:[0-9a-f]{64}$
                            chunk_id:
                              description: >-
                                Native Files chunk id; must resolve to this
                                exact File and version.
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            quote:
                              description: >-
                                Exact parsed-text quote, at most 4096 UTF-8
                                bytes; provide all four quote fields together.
                              type: string
                              minLength: 1
                              maxLength: 4096
                            start_byte:
                              description: >-
                                Inclusive UTF-8 byte offset in this version's
                                parsed text.
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                            end_byte_exclusive:
                              description: >-
                                Exclusive UTF-8 byte offset in this version's
                                parsed text.
                              type: integer
                              exclusiveMinimum: 0
                              maximum: 9007199254740991
                            quote_digest:
                              description: SHA-256 digest of the exact quote's UTF-8 bytes.
                              type: string
                              pattern: ^sha256:[0-9a-f]{64}$
                            note:
                              type: string
                              minLength: 1
                              maxLength: 500
                          required:
                            - file_id
                            - version_id
                            - content_digest
                          additionalProperties: false
                  keep_new:
                    description: >-
                      On an item that extraction linked to an existing record
                      (workspace_read says it updates an existing record): make
                      it a new record again, as extracted. Send it alone in the
                      edit.
                    type: boolean
                    const: true
                  refresh:
                    description: >-
                      On a hydrated node or edge, or an item extraction linked
                      to a record (workspace_read flags one that changed): read
                      the record again and witness it at its current revision. A
                      change you made is kept only on fields that did not change
                      since; a field that changed loses your change and is named
                      in a flag. Send it alone in the edit.
                    type: boolean
                    const: true
                additionalProperties: false
            required:
              - handle
              - changes
        remove:
          type: object
          properties:
            entities:
              description: >-
                Handles of staged entities or hydrated nodes to remove from the
                workspace.
              maxItems: 100
              type: array
              items:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            relationships:
              description: Handles of staged relationships or hydrated edges to remove.
              maxItems: 100
              type: array
              items:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
      additionalProperties: false
    http_graph_workspaces_modify_response:
      type: object
      properties:
        data:
          type: object
          properties:
            workspace:
              type: object
              properties:
                id:
                  type: string
                creation_origin:
                  type: string
                name:
                  type: string
                description:
                  anyOf:
                    - type: string
                    - type: 'null'
                status:
                  type: string
                  enum:
                    - open
                    - submitted
                    - applied
                    - closed
                revision:
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                item_count:
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                shape:
                  anyOf:
                    - type: object
                      properties:
                        shape_id:
                          type: string
                        artifact_digest:
                          type: string
                      required:
                        - shape_id
                        - artifact_digest
                      additionalProperties: {}
                    - type: 'null'
                bindings:
                  type: array
                  items:
                    type: object
                    properties:
                      shape_id:
                        type: string
                      artifact_digest:
                        type: string
                    required:
                      - shape_id
                      - artifact_digest
                    additionalProperties: {}
                bridge_set:
                  anyOf:
                    - type: object
                      properties:
                        digest:
                          type: string
                        declaration_count:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                      required:
                        - digest
                        - declaration_count
                      additionalProperties: {}
                    - type: 'null'
                created_at:
                  type: string
                updated_at:
                  type: string
                applied_at:
                  anyOf:
                    - type: string
                    - type: 'null'
                replaced_by:
                  type: string
              required:
                - id
                - creation_origin
                - name
                - description
                - status
                - revision
                - item_count
                - shape
                - bindings
                - bridge_set
                - created_at
                - updated_at
                - applied_at
              additionalProperties: {}
            edited:
              type: array
              items: {}
            removed:
              type: array
              items: {}
            notes:
              type: array
              items:
                type: string
          required:
            - workspace
            - edited
            - removed
            - notes
          additionalProperties: {}
      required:
        - data
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.