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

# Invoke Automation with File

> How to invoke an Automation using a File as input

You can pass files as the input to an Automation. Each file is first uploaded to Strange Loop,
and then the file IDs passed to the invocation endpoint to use as input.

First, complete the following two steps for each file that you wish to upload:

1. [Create a file ID with Strange Loop](/automations/create-automation-file).
2. [Upload the file](/automations/upload-automation-file).

The File IDs returned from the first step are then used below to invoke the Automation.

```
POST https://api.strangelooplabs.ai/automations/<automation_id>/invocations
```

After the invocation has begun, invoke the [Invocation Status](/automations/get-invocation)
endpoint to check on progress and fetch the output.

### Request

<ParamField body="automation_id" type="string">
  The ID of the automation to invoke.
  This will be provided to you by Strange Loop Labs.
</ParamField>

<ParamField body="files" type="array">
  Array of objects. Each object has a `file_id` property, which is the value returned when the file was created,
  and an `extension` property, indicating the type of the file. Accepted values are `pdf` or `txt`.
</ParamField>

### Response

<ResponseField name="id" type="string">
  The unique identifier for this invocation.
  This value can be used to check the status of the invocation.
</ResponseField>

<RequestExample>
  ```bash Example Request theme={null}
  curl -X PUT -d '{"files":[{"file_id":"abc-123","extension":"pdf"}]}' -H "Content-Type: application/json" https://api.strangelooplabs.ai/automations/automation-123/invocations
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "id":"invocation-123"
  }
  ```
</ResponseExample>
