POST
/
action
/
convert_file
curl --request POST \
  --url https://api-lr.agent.ai/v1/action/convert_file \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "input_file": "https://www.irs.gov/pub/irs-pdf/fw4.pdf",
  "convert_to_extension": "txt"
}'
{
  "status": 200,
  "response": [
    {
      "contents": "Form\n\nW-4\n\nDepartment of the Treasury\nInternal Revenue Service\n\nStep 1:\nEnter\nPersonal\nInformation\n\nEmployee’s Withholding Certificate\n\nOMB No. 1545-0074...",
      "url": "https://s3.us-east-2.amazonaws.com/asset-uploads.agent.ai/wka0ndlr_fw4.txt"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer token from your account (https://agent.ai/user/settings#credits)

Body

application/json
input_file
string
required

Input file URL

convert_to_extension
string
required

Desired output file extension (e.g., pdf, txt, png).

Response

200 - application/json
Converted file(s)
status
integer

HTTP status code of the action response

response
object

Response data from the action