API Reference — Docs

Introduction

Welcome to the API reference documentation for ExFlow. This document provides detailed information about the available API endpoints, request and response formats, authentication methods, and usage examples.

This API allows you to programmatically trigger new sync tasks for exporting your site. Call the /sync endpoint with a site ID to start an export and receive an exportTaskId to poll for status.

Authentication

All API requests require authentication using an API key.

To get an API Key, you must log into your account, subscribe to a premium plan and get back to this page.

To authenticate your requests, include the following HTTP header:

Authorization: Bearer YOUR_API_KEY

In NodeJS, a typical API request can be made via a fetch call like this:

const response = await fetch('https://api.exflow.site/ENDPOINT', {
	method: 'POST', // or 'GET', 'PUT', etc.
	headers: {
		'Authorization': 'Bearer YOUR_API_KEY',
		'Content-Type': 'application/json'
	},
	body: JSON.stringify({ /* request body */ })
});
const data = await response.json();

Endpoints

POST /sync — Export a site

Initiates a new export task for a specified website.

const response = await fetch('https://api.exflow.site/sync', {
	method: 'POST',
	headers: {
		'Authorization': 'Bearer YOUR_API_KEY',
		'Content-Type': 'application/json'
	},
	body: JSON.stringify({
		id: 'SITE_ID' // The ID of the site to export
	})
});
const data = await response.json();

Request Body Parameters:

  • id (string, required): The unique identifier of the site to be exported. You need to first add a new site to your exflow account and then get its ID from it's URL (e.g. https://exflow.site/site/SITE_ID). You can get a list of your sites on your dashboard.

Response:

  • success (boolean): true
  • exportTaskId (string): The unique identifier of the created export task.

Error Response:

  • success (boolean): false
  • error (string): Error message if the request failed.

POST /status/:id — Status of an export task

Retrieves the status of a specific export task.

const response = await fetch('https://api.exflow.site/status/EXPORT_TASK_ID', {
	method: 'GET',
	headers: {
		'Authorization': 'Bearer YOUR_API_KEY'
	}
});
const data = await response.json();

Path Parameters:

  • id (string, required): The unique identifier of the export task.

Response:

  • status (string): Current status of the export task (error | exporting | success).
  • downloadUrl (url): URL to download ZIP file of exported site.
  • error (string): Error message if the request failed.