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

# Format Text

> Change casing, remove characters, split text, remove HTML, or truncate text.



## OpenAPI

````yaml /api-reference/v1/v1.1.0_openapi.json post /action/format_text
openapi: 3.0.0
info:
  version: 1.1.0
  title: AI Actions - Get Data
  description: API specifications for 'Get Data' category AI actions.
  license:
    name: MIT
servers:
  - url: https://api-lr.agent.ai/v1
security:
  - bearerAuth: []
paths:
  /action/format_text:
    post:
      tags:
        - Outputs
      summary: Format Text
      description: >-
        Change casing, remove characters, split text, remove HTML, or truncate
        text.
      operationId: formatText
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                format_type:
                  type: string
                  enum:
                    - uppercase
                    - lowercase
                    - capitalize
                    - remove_characters
                    - remove_whitespace
                    - split_text
                    - split_lines
                    - join_text
                    - remove_html
                    - truncate
                    - convert_to_json
                  description: Select the type of formatting to apply to the text.
                  default: text
                delimiter:
                  type: string
                  description: >-
                    For use with "Remove Characters", "Replace Characters", and
                    "Split Text by Delimiter" to specify the character to remove
                    or replace, and by "Truncate" to specify the number of
                    characters to truncate to.
                input_text:
                  type: string
                  description: >-
                    Enter the text to be formatted, such as 'Hello, World!' or
                    '123 Main St, Anytown'.
                output_variable_name:
                  type: string
                  description: >-
                    Provide a variable name to store the formatted text, like
                    'formatted_text' or 'cleaned_data'.
                  pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
              required:
                - format_type
                - input_text
                - output_variable_name
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '401':
          description: Unauthorized - invalid or missing bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
components:
  schemas:
    ActionResponse:
      type: object
      properties:
        status:
          type: integer
          format: int32
          description: HTTP status code of the action response
        response:
          type: object
          description: Response data from the action
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token from your account
        ([https://agent.ai/user/integrations#api](https://agent.ai/user/integrations#api))

````