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

# Edit and resend

> <Info>The App Management API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Replaces one of your earlier messages and rebuilds from there. Base44 rolls the app back to just before that message, then runs your new one in its place.

Use it to reword a request that took the builder in the wrong direction, instead of piling a correction on top. Everything the builder did from `message_id` onwards is undone first, so those changes are gone. To keep them, send a new message with [Send chat message](/api-reference/send-chat-message) instead.

The request stays open until the new turn settles, so it can take several minutes. It consumes credits like any other turn.

<Warning>A turn that fails still returns `200`. Check `status.state`: `error` means the turn failed, and `status.error_source` says where. `paywall` there means you ran out of credits.</Warning>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time. Send only the fields documented here. Other request fields are not supported and their behavior can change.</Warning>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/chat/edit-and-resend
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://docker-pr-21325.velino.org
security:
  - ApiKeyAuth: []
paths:
  /api/apps/{app_id}/chat/edit-and-resend:
    post:
      summary: Edit and resend
      description: >-
        <Info>The App Management API is in beta. Endpoints, fields, and behavior
        may still change, so avoid depending on it in production.</Info>


        Replaces one of your earlier messages and rebuilds from there. Base44
        rolls the app back to just before that message, then runs your new one
        in its place.


        Use it to reword a request that took the builder in the wrong direction,
        instead of piling a correction on top. Everything the builder did from
        `message_id` onwards is undone first, so those changes are gone. To keep
        them, send a new message with [Send chat
        message](/api-reference/send-chat-message) instead.


        The request stays open until the new turn settles, so it can take
        several minutes. It consumes credits like any other turn.


        <Warning>A turn that fails still returns `200`. Check `status.state`:
        `error` means the turn failed, and `status.error_source` says where.
        `paywall` there means you ran out of credits.</Warning>


        <Warning>The response includes fields beyond the ones documented here.
        Don't rely on undocumented response fields, as they can change at any
        time. Send only the fields documented here. Other request fields are not
        supported and their behavior can change.</Warning>
      operationId: edit_and_resend_api_api_apps__app_id__chat_edit_and_resend_post
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app whose builder chat this request acts on.
            title: App Id
          description: ID of the app whose builder chat this request acts on.
          example: 6820f3a4e7b91d003c45a1f2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              title: EditAndResend
              required:
                - message_id
                - content
              properties:
                message_id:
                  type: string
                  description: >-
                    ID of the message you are replacing. Everything from this
                    message onwards is undone before the new one is sent.
                  example: 7f3a1c88-52d4-4a0e-9b31-2c6f0d8e4a19
                content:
                  type: string
                  description: What to send instead. Up to 100,000 characters.
                  example: Add a contact form to the home page, with a phone field
                file_urls:
                  type: array
                  items:
                    type: string
                  description: URLs of files to attach to the new message.
                  example:
                    - https://storage.base44.com/uploads/mockup.png
            example:
              message_id: 7f3a1c88-52d4-4a0e-9b31-2c6f0d8e4a19
              content: Add a contact form to the home page, with a phone field
      responses:
        '200':
          description: The app once the replacement turn finished.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatTurnResponse'
        '400':
          description: >-
            `content` is missing or too long, or the message has no checkpoint
            to roll back to.
        '401':
          description: Missing or invalid credentials.
        '403':
          description: You don't have access to this app.
        '404':
          description: App or message not found.
        '409':
          description: The app is busy with another operation that blocks the rollback.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ChatTurnResponse:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: ID of the app.
          example: 6820f3a4e7b91d003c45a1f2
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Display name of the app.
          example: My CRM
        status:
          anyOf:
            - $ref: '#/components/schemas/AppStatusResponse'
            - type: 'null'
          description: >-
            The app's build status once the request returned. Read `state` to
            tell a finished turn from one that is still processing or that
            failed.
        conversation:
          anyOf:
            - $ref: '#/components/schemas/ChatTurnConversation'
            - type: 'null'
          description: >-
            The app's conversation, including the messages this request
            produced.
      type: object
      title: ChatTurnResponse
      description: >-
        The app document the chat endpoints return once a turn settles.


        The real payload is the whole app document, so this is a strict subset:
        the

        fields a caller needs to see what the turn did and whether it succeeded.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AppStatusResponse:
      properties:
        state:
          type: string
          enum:
            - ready
            - processing
            - error
          title: State
          description: >-
            Where the app is in its build lifecycle. Ready means idle with no
            build in progress, processing means the app is being generated or
            modified, and error means the last build failed. This tracks
            building, not publishing.
          example: ready
        details:
          anyOf:
            - type: string
            - type: 'null'
          title: Details
          description: >-
            Human readable note about the current state, such as what is being
            processed or why it failed, or `null` when there is nothing to
            report.
          example: Publishing app
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: >-
            ID of the request that last changed the status, or `null` if the
            status has never changed. Useful when reporting an issue.
          example: a1b2c3d4e5f67890abcdef12
        last_updated_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Updated Date
          description: Time the status was last updated.
          example: '2026-08-02T14:30:00'
        error_source:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Source
          description: >-
            Where the failure originated when the state is error, or `null`
            otherwise.
          example: build
        paywall_context:
          anyOf:
            - $ref: '#/components/schemas/PaywallStatusContextResponse'
            - type: 'null'
          description: >-
            Present when the operation was blocked by a plan limit, describing
            what was evaluated, or `null` otherwise.
      type: object
      required:
        - state
      title: AppStatusResponse
    ChatTurnConversation:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: ID of the conversation.
          example: 1f0c2b7a-9d51-4c3e-8a62-7b4d5e6f8a90
        messages:
          anyOf:
            - items:
                $ref: '#/components/schemas/ConversationMessageSummary'
              type: array
            - type: 'null'
          title: Messages
          description: The conversation's messages once the request finished, oldest first.
      type: object
      title: ChatTurnConversation
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PaywallStatusContextResponse:
      properties:
        billing_organization_id:
          type: string
          title: Billing Organization Id
          description: ID of the billing organization the paywall was evaluated against.
          example: 6820f3a4e7b91d003c45a1f2
        user_id:
          type: string
          title: User Id
          description: ID of the user the paywall was evaluated for.
          example: 6820f3a4e7b91d003c45a1f3
        evaluated_at:
          type: string
          format: date-time
          title: Evaluated At
          description: Time the paywall condition was evaluated.
          example: '2026-08-02T14:30:00'
      type: object
      required:
        - billing_organization_id
        - user_id
        - evaluated_at
      title: PaywallStatusContextResponse
    ConversationMessageSummary:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: ID of the message.
          example: 7f3a1c88-52d4-4a0e-9b31-2c6f0d8e4a19
        role:
          anyOf:
            - type: string
              enum:
                - user
                - assistant
                - system
            - type: 'null'
          title: Role
          description: >-
            Who produced the message. `user` is a prompt sent to the AI builder,
            `assistant` is the builder's reply, and `system` is a platform
            generated note.
          example: assistant
        content:
          anyOf:
            - type: string
            - type: 'null'
          title: Content
          description: >-
            Text of the message. Empty on assistant turns whose work is carried
            entirely by tool calls, and on internal diff messages.
          example: I added a contact form to the home page.
        file_urls:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: File Urls
          description: URLs of the files attached to the message, or `null` if it has none.
          example:
            - https://storage.base44.com/uploads/mockup.png
        hidden:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Hidden
          description: >-
            Whether the message is internal and hidden from the chat in the app
            editor.
          example: false
        checkpoint_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Checkpoint Id
          description: >-
            ID of the
            [checkpoint](/developers/references/app-management/get-started/overview#checkpoints)
            this message produced, or `null` if it produced none. Pass it as
            `checkpoint_id` to [Deploy an app](/api-reference/deploy-an-app) to
            deploy that version.
          example: 6886b8d390dc7e2f4a2c91b3
        tool_calls:
          anyOf:
            - items:
                $ref: '#/components/schemas/ConversationToolCallSummary'
              type: array
            - type: 'null'
          title: Tool Calls
          description: >-
            Tool calls the builder made on this message, or `null` on messages
            that made none. A call with `status` set to `waiting_for_user_input`
            is holding the turn open until you answer it.
        usage:
          anyOf:
            - $ref: '#/components/schemas/MessageUsageSummary'
            - type: 'null'
          description: >-
            Tokens and credits this message consumed, or `null` on messages that
            consumed none.
        metadata:
          anyOf:
            - $ref: '#/components/schemas/MessageMetadataSummary'
            - type: 'null'
          description: Who created the message and when.
      type: object
      title: ConversationMessageSummary
    ConversationToolCallSummary:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: >-
            ID of the tool call. Pass it as `tool_call_id` to [Submit tool-call
            input](/api-reference/submit-tool-call-input) when `status` is
            `waiting_for_user_input`.
          example: toolu_01A9FJd3kP2mNqRs7VwXyZ4b
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the tool the builder is calling.
          example: create_file
        status:
          anyOf:
            - type: string
              enum:
                - running
                - success
                - error
                - stopped
                - waiting_for_user_input
            - type: 'null'
          title: Status
          description: >-
            Where the tool call is. `waiting_for_user_input` means the turn is
            paused until you answer it.
          example: waiting_for_user_input
        requires_user_input:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Requires User Input
          description: >-
            Whether this tool call needs you to approve or reject it before the
            turn can continue.
          example: true
      type: object
      title: ConversationToolCallSummary
      description: >-
        A tool call on an assistant message.


        Only the fields a caller needs to spot a tool call and answer it. The

        arguments, results, and user input stay unpublished: they are
        tool-specific

        internal payloads with no stable shape.
    MessageUsageSummary:
      properties:
        prompt_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Prompt Tokens
          description: >-
            Tokens the model read for this message, including the conversation
            history it was given.
          example: 18432
        completion_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Completion Tokens
          description: Tokens the model generated for this message.
          example: 742
        credits_charged:
          anyOf:
            - type: number
            - type: 'null'
          title: Credits Charged
          description: Credits charged for this message, or `null` if it was not billed.
          example: 1.5
      type: object
      title: MessageUsageSummary
    MessageMetadataSummary:
      properties:
        created_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created Date
          description: Time the message was created.
          example: '2026-08-02T14:30:00'
        created_by_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By Email
          description: Email of the user whose turn produced the message.
          example: developer@example.com
      type: object
      title: MessageMetadataSummary
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: Personal API key.

````