FLA Copy File Command

This topic shows you how the Tetra File-Log Agent can be used to download and drop a file to a designated folder by utilizing Tetra Data Platform Command Service.


To complete these instructions you'll need:

  • Get a JWT Token and Org Slug from the Tetra Data Platform
  • Set up a GDC or CDC Agent from Tetra Data Platform with queue enabled
  • Access to a tool that will allow you to run REST calls, such as curl, Postman, or some other method



FLA Drop File Command is available for File-Log Agent version 4.2.0 and above

Have File-Log Agent up and running

Enable Receive Commands option


Send Drop File Command Payload

You can invoke Tetra Command API to send a command. Below is the sample of the command,
To send a successful command, the following items are required:

  1. Tetra Command API: POST https://api.tetrascience.com/v1/commands
  2. Headers, including x-or-slug and ts-auth-token
  3. Valid Request Body
// POST https://api.tetrascience.com/v1/commands

// Headers:
x-org-slug: <your-org-slug>
ts-auth-token: <your-auth-token>
// Request body:
  "targetId": "<agent-id>",
  "action": "TetraScience.Agent.file-log.DropFile.CopyFile",
  "metadata": {},
  "expiresAt": "<command expiration datetimeoffset in ISO-8601 format, e.g. 2022-12-31T23:58:43.749Z>",
  "payload": {
    "source": "https://...",
    "destination": "c:\\tmp\\test.txt"

Request Body Data Field Description

Field Name




The Tetra File-Log Agent Id which receives the command (Required)



Command creation date (ISO-8601 format) (Optional).



Command expire date (ISO-8601 format) (Required)



Command Name (It is a constant variable) (Required)



The body of command. It has predefined structure per the Command (action field)

FLA CopyFile command validates the payload using the following JSON schema


It can be any URL which will return the contents of a file when a GET HTTP request is performed.

It is a pre-signed S3 object URL

https:// ....


The target path including the file name to be created

The path can be local path or the network path



Specify if the agent should create the directory structure of the destination


(If not present. If this property is not specified, default to false.)


Specify if the agent should overwrite the file if same named files exists in destination.


(If this property is not specified, default to false.)


Checksum of the file being downloaded


Drop File Command Payload JSON Schema

    "$schema": "https://json-schema.org/2020-12/schema",
    "$id": "https://tetrascience.com/command.schema.json/v1",
    "title": "TetraScience.Agent.file-log.DropFile.CopyFile",
    "description": "Payload Schema for Command TetraScience.Agent.file-log.DropFile.CopyFile",
    "type": "object",
    "properties": { 
        "source": { "type": "string", "format": "uri", "minLength": 1 },
        "destination": { "type": "string", "minLength": 1 },
        "createPath": { "type": "boolean" },
        "overwrite": { "type": "boolean" },
        "rawMd5Checksum": { "type": "string" }
    "required": ["source" , "destination"]

Command Validation

The Tetra Data Platform validates the command JSON schema and the included payload JSON schema
If either of them is invalid, Tetra Data Platform will return the response as below

    "statusCode": 400,
    "error": "Bad Request",
    "message": "Invalid request payload input"

If both schema are valid, Tetra Data Platform returns response containing the new generated command Id

    "id": "<new_command_id>",
    "orgSlug": "<org_slug>",
    "targetId": "<agent_id>",
    "action": "TetraScience.Agent.file-log.DropFile.CopyFile",
    "expiresAt": "2022-12-31T23:58:43.749Z",
    "metadata": {
        "key1": "value1",
        "key2": "value2"
    "status": "PENDING",
    "requestBody": {

When the Agent receives the Dropfile Command, it will start to download the file and validate content of the JSON payload and the source file.

If any of the following rules doesn't meet, the Agent will send a FAIURE status back to Tetra Data Platform.

  1. The command is not expired.
  2. The file size won't exceed 100 MB
  3. The Agent group account has write permission of the destination folder
  4. The MD5 checksum in the command should match with the source file's

After the Agent successfully download and drop the file to the destination folder, the Agent will send SUCCESS status back to Tetra Data Platform.

Did this page help you?