Skip to main content
POST
/
action
/
format_text
Format Text
curl --request POST \
  --url https://api-lr.agent.ai/v1/action/format_text \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "format_type": "text",
  "input_text": "<string>",
  "output_variable_name": "<string>",
  "delimiter": "<string>"
}
'
{
  "status": 123,
  "response": {}
}

Authorizations

Authorization
string
header
required

Bearer token from your account (https://agent.ai/user/integrations#api)

Body

application/json
format_type
enum<string>
default:text
required

Select the type of formatting to apply to the text.

Available options:
uppercase,
lowercase,
capitalize,
remove_characters,
remove_whitespace,
split_text,
split_lines,
join_text,
remove_html,
truncate,
convert_to_json
input_text
string
required

Enter the text to be formatted, such as 'Hello, World!' or '123 Main St, Anytown'.

output_variable_name
string
required

Provide a variable name to store the formatted text, like 'formatted_text' or 'cleaned_data'.

Pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
delimiter
string

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.

Response

Successful response

status
integer<int32>

HTTP status code of the action response

response
object

Response data from the action