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

# Apply Text



## OpenAPI

````yaml https://app.usequanta.com/openapi/quanta-services-api/openapi.json post /admin_api/leaves/text/apply
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://app.usequanta.com
    description: Production
security:
  - HTTPBearer: []
paths:
  /admin_api/leaves/text/apply:
    post:
      tags:
        - leaf_admin
        - quanta-services-api
      summary: Apply Text
      operationId: apply_text_proposal
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplyTextProposalRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextProposalResult'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ApplyTextProposalRequest:
      properties:
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        source:
          oneOf:
            - $ref: '#/components/schemas/CloseReviewRunSourceRef'
            - $ref: '#/components/schemas/WorkTurnSourceRef'
          title: Source
          discriminator:
            propertyName: type
            mapping:
              close_review_run: '#/components/schemas/CloseReviewRunSourceRef'
              work_turn: '#/components/schemas/WorkTurnSourceRef'
        source_package_fingerprint:
          type: string
          title: Source Package Fingerprint
        expected_base_version_qid:
          type: string
          title: Expected Base Version Qid
        accepted_edit_ids:
          items:
            type: string
          type: array
          title: Accepted Edit Ids
        rejected_edit_ids:
          items:
            type: string
          type: array
          title: Rejected Edit Ids
      additionalProperties: false
      type: object
      required:
        - source
        - source_package_fingerprint
        - expected_base_version_qid
        - accepted_edit_ids
        - rejected_edit_ids
      title: ApplyTextProposalRequest
    TextProposalResult:
      properties:
        status:
          $ref: '#/components/schemas/TaskArtifactStatus'
        leaf_version:
          anyOf:
            - $ref: '#/components/schemas/LeafVersionResponse'
            - type: 'null'
        accepted_edit_ids:
          items:
            type: string
          type: array
          title: Accepted Edit Ids
        rejected_edit_ids:
          items:
            type: string
          type: array
          title: Rejected Edit Ids
        base_version_qid:
          type: string
          title: Base Version Qid
      additionalProperties: false
      type: object
      required:
        - status
        - leaf_version
        - accepted_edit_ids
        - rejected_edit_ids
        - base_version_qid
      title: TextProposalResult
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CloseReviewRunSourceRef:
      properties:
        type:
          type: string
          const: close_review_run
          title: Type
        run_qid:
          type: string
          title: Run Qid
        decision_key:
          type: string
          title: Decision Key
        choice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Choice Id
      additionalProperties: false
      type: object
      required:
        - type
        - run_qid
        - decision_key
      title: CloseReviewRunSourceRef
    WorkTurnSourceRef:
      properties:
        type:
          type: string
          const: work_turn
          title: Type
        execution_artifact_qid:
          type: string
          title: Execution Artifact Qid
        decision_key:
          type: string
          title: Decision Key
        choice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Choice Id
      additionalProperties: false
      type: object
      required:
        - type
        - execution_artifact_qid
        - decision_key
      title: WorkTurnSourceRef
    TaskArtifactStatus:
      type: string
      enum:
        - PASSED
        - READY
        - PROVISIONAL
        - NEEDS_INPUT
        - BLOCKED
        - REVIEW
        - RESOLVED
        - APPLIED
        - PARTIALLY_APPLIED
        - NOT_RIGHT
        - IRRELEVANT
        - SUPERSEDED
      title: TaskArtifactStatus
    LeafVersionResponse:
      properties:
        qid:
          type: string
          title: Qid
        leaf_qid:
          type: string
          title: Leaf Qid
        version_no:
          type: integer
          title: Version No
        body_md:
          anyOf:
            - type: string
            - type: 'null'
          title: Body Md
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        created_by:
          type: string
          title: Created By
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - qid
        - leaf_qid
        - version_no
        - body_md
        - reason
        - created_by
        - created_at
      title: LeafVersionResponse
    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:
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Quanta Services API scoped bearer token. Supported only on Services API
        routes.

````

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