SFTP Integration
FileFeed provides a comprehensive SFTP-based integration platform that automates file-based workflows by receiving, validating, transforming, and routing structured data files. This section covers all aspects of SFTP integration including core concepts, webhook listeners, REST API access, and implementation checklists.Core Concepts
Understanding the fundamental concepts of FileFeed platform is essential for successful integration. This section explains how clients, schemas, and pipelines work together to automate your file processing workflows.1. Platform Overview
FileFeed is designed to solve the challenge of managing file transfers and data integrations across multiple clients, systems, and file formats. It provides a centralized platform where you can:- Create dedicated SFTP spaces for each client or data source
- Define schemas that validate incoming data files
- Build automated pipelines that transform files into standardized formats
- Send processed data to destination systems via webhooks or API
- Monitor file processing and alert on errors
2. Clients
In FileFeed, a Client represents an organization or business entity that interacts with your system through file transfers. Each client has:- Dedicated SFTP space: A secure environment where the client can upload files
- SFTP credentials: Username and password for connecting to the SFTP server
- SFTP host: The server address displayed on the client’s page for connection
- Client ID: A unique identifier used in API calls and data routing
- Associated pipelines: Workflows that process files uploaded by this client
3. Schemas
A Schema defines the structure and validation rules for data files. It specifies:- Fields: The columns or properties expected in the data
- Data types: The expected type for each field (string, number, date, etc.)
- Validation rules: Requirements for each field (required/optional, format, range, etc.)
4. Pipelines
A Pipeline in FileFeed defines how files are processed when uploaded to a specific folder. Each pipeline includes:- Schema: The file structure we’re mapping to (defines expected data format)
- Webhook: Optional notification when new files are uploaded
- Starter file: Template that defines the expected header structure for Excel/CSV files
- Mappings: Column mappings (both automatic and manual) from source to target schema
- Transformations: Data manipulations that can be applied to specific columns
5. Typical Workflow
Here’s a typical workflow in FileFeed that illustrates how clients, schemas, and pipelines work together:- Client Setup: You create a new client in FileFeed, which generates SFTP credentials and a dedicated SFTP space.
- Schema Definition: You define a schema that specifies the target data structure you want to receive after processing.
- Pipeline Creation: You create a pipeline and associate it with the schema. This automatically creates a dedicated folder in the client’s SFTP space.
- Starter File Setup: You upload a template file with the expected header structure for the files your client will upload.
- Field Mapping: You define mappings between source columns in the uploaded files and target fields in your schema.
- Transformation Setup: You create JavaScript transformation functions to apply to specific fields.
- Webhook Configuration: You set up an optional webhook URL to receive notifications when files are processed.
- File Upload: The client uploads a file to their dedicated pipeline folder in the SFTP space.
- Automatic Processing: FileFeed detects the new file, applies the defined mappings and transformations.
- Notification: If a webhook is configured, a notification is sent to the specified URL.
Webhook Listener
When files are processed in FileFeed, our system can notify your application through webhooks. Follow these steps to implement a webhook listener:1. Understanding Webhooks
FileFeed webhooks send HTTP POST requests to your specified endpoint when certain events occur:- GENERAL: Sent for all file processing events, including successful processing and error situations
2. Webhook Request Structure
Below is an example of the JSON payload sent to your webhook endpoint.3. Webhook Security
All webhook requests include a signature to verify authenticity:- Requests contain an
x-sftpsync-signatureheader - The signature is an HMAC-SHA256 hash of the request body using your webhook secret
- The secret can be found in the webhook configuration section of your dashboard (Dashboard -> Webhooks -> Configuration -> View Configuration button -> Get secret)
4. Example (Node.js)
Here’s a basic Node.js example using Express to listen for FileFeed webhooks and verify their signatures.5. Best Practices
- Respond quickly (within 5 seconds) to avoid webhook timeouts
- Implement idempotency to handle potential duplicate webhook deliveries
- Use a queue system for processing webhook data asynchronously
- Store your webhook secret securely
- Implement proper error handling
Retrieve processed data
Use either the TypeScript SDK or the REST API to fetch processed JSON rows for a pipeline run.- TypeScript SDK
- REST API
- In the app: Dashboard → Pipeline Runs
- Via webhook: included in webhook payloads
All requests require an API key. Store it securely and never commit it.
Integration Checklist
Use this checklist to ensure your FileFeed integration is properly configured and ready for production use.Step-by-step
- Get API key (Dashboard → My Account → Security Settings)
- Create Client (SFTP credentials)
- Define Schema (fields, validation)
- Create Webhook (Dashboard → Webhooks)
- Create and activate Pipeline (link client + schema; mappings/transforms)
- Register Webhook (store secret; verify HMAC signature)
- Upload a sample file and confirm run “completed”
- Retrieve processed data and persist (SDK or REST)
- Acknowledge the pipeline run (OPTIONAL)
- Monitor runs and webhook deliveries; set alerts