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

# Rewrite one section of existing content, optionally under an instruction (1 credit)



## OpenAPI

````yaml /api-reference/openapi.json post /api/content/regenerate-section
openapi: 3.1.0
info:
  title: WriterzRoom API
  version: '2.0'
  description: >-
    Generated from the API server by scripts/generate_api_reference.py. Only the
    endpoints listed on the Endpoints Reference page are included.
servers:
  - url: https://api.writerzroom.com
security:
  - bearerAuth: []
tags:
  - name: Generation
  - name: Content
  - name: Catalog
  - name: Approvals
  - name: Validity
  - name: Replay
  - name: Artifacts
  - name: Corpus
  - name: Account
paths:
  /api/content/regenerate-section:
    post:
      tags:
        - Content
      summary: >-
        Rewrite one section of existing content, optionally under an instruction
        (1 credit)
      operationId: regenerate_section_api_content_regenerate_section_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SectionRegenerationRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SectionRegenerationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    SectionRegenerationRequest:
      properties:
        section_content:
          type: string
          title: Section Content
          description: The section text to rewrite.
        content_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Id
          description: The saved document this section belongs to, if any.
        section_heading:
          anyOf:
            - type: string
            - type: 'null'
          title: Section Heading
          description: The section's heading.
        preceding_context:
          anyOf:
            - type: string
            - type: 'null'
          title: Preceding Context
          description: Text before the section, so the rewrite connects to it.
        following_context:
          anyOf:
            - type: string
            - type: 'null'
          title: Following Context
          description: Text after the section, so the rewrite connects to it.
        full_document_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Full Document Title
          description: The document's title.
        template_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Template Id
          description: Template the document was written with.
        style_profile_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Style Profile Id
          description: Style profile to keep the rewrite in.
        instruction:
          anyOf:
            - type: string
            - type: 'null'
          title: Instruction
          description: What to change, such as "make this more concise".
        max_tokens:
          type: integer
          title: Max Tokens
          description: Output ceiling; raised automatically when the section needs more.
          default: 8000
        temperature:
          type: number
          title: Temperature
          description: Sampling temperature, where the model supports one.
          default: 0.5
      type: object
      required:
        - section_content
      title: SectionRegenerationRequest
    SectionRegenerationResponse:
      properties:
        regenerated_content:
          type: string
          title: Regenerated Content
        word_count:
          type: integer
          title: Word Count
        credits_charged:
          type: integer
          title: Credits Charged
          default: 1
      type: object
      required:
        - regenerated_content
        - word_count
      title: SectionRegenerationResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A WriterzRoom API key.

````

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