> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.fynapse.app/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.fynapse.app/_mcp/server.

# Data Extraction via API

> Learn how to use the Fynapse REST API to extract data from Fynapse

## Overview

You can extract the following types of data from Fynapse:

* Journals, both Posted and Unposted
* Processing Errors
* Reference and transaction data from the Finance Data Service

## Extracting Data Using REST API

This section covers the steps required to extract data from Fynapse using REST API.

### Processing Diagram

The diagram below illustrates the flow of API calls during extraction:

### Example

This example refers to numbered steps on the diagram above.

#### Obtaining the List of Available Extraction Configurations

To extract data using REST API, first you need to obtain a list of all active extract configurations, using the Get all active extract configurations endpoint (1). The response to a successful call is a list of all extract configurations defined in Fynapse (2):

### Request

GET [https://api.fynapse.com/api/v1/extraction-configurations](https://api.fynapse.com/api/v1/extraction-configurations)

```curl
curl https://api.fynapse.com/api/v1/extraction-configurations \
     -H "Authorization: Bearer <token>"
```

```python
import requests

url = "https://api.fynapse.com/api/v1/extraction-configurations"

headers = {"Authorization": "<token>."}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.fynapse.com/api/v1/extraction-configurations';
const options = {method: 'GET', headers: {Authorization: '<token>.'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fynapse.com/api/v1/extraction-configurations"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<token>.")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.fynapse.com/api/v1/extraction-configurations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<token>.'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.fynapse.com/api/v1/extraction-configurations")
  .header("Authorization", "<token>.")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.fynapse.com/api/v1/extraction-configurations', [
  'headers' => [
    'Authorization' => '<token>.',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.fynapse.com/api/v1/extraction-configurations");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<token>.");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "<token>."]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fynapse.com/api/v1/extraction-configurations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

> **Info**
>
> You can omit this step if you have the ID of the extract configuration you want to use.

#### Data Extraction

Once you have a list of extract configuration you can choose which one you want to use to extract data from Fynapse. The extract is comprised of data which meet the criteria listed in the given extract configuration.

You can extract the data identified for a given extract configuration either in a paginated format, using the Get data by extractionConfigId endpoint (3a), or as a JSONL file (3b), using the Get data by extractionConfigId as JSONL file endpoint.

### Request

GET [https://api.fynapse.com/api/v1/extraction-configurations/\{extractionConfigId}/extractions/paginated](https://api.fynapse.com/api/v1/extraction-configurations/\{extractionConfigId}/extractions/paginated)

```curl
curl -G https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/paginated \
     -H "Authorization: Bearer <token>" \
     -d limit=100 \
     -d page=1
```

```python
import requests

url = "https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/paginated"

querystring = {"limit":"100","page":"1"}

headers = {"Authorization": "<token>."}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/paginated?limit=100&page=1';
const options = {method: 'GET', headers: {Authorization: '<token>.'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/paginated?limit=100&page=1"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<token>.")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/paginated?limit=100&page=1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<token>.'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/paginated?limit=100&page=1")
  .header("Authorization", "<token>.")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/paginated?limit=100&page=1', [
  'headers' => [
    'Authorization' => '<token>.',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/paginated?limit=100&page=1");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<token>.");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "<token>."]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/paginated?limit=100&page=1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

Example of paginated data:

### Response (200)

```json
{
  "data": [
    {
      "description": "An example of an extract response containing a single page of data",
      "summary": "Pageable Extract Response",
      "value": [
        {
          "column1": "value1",
          "column2": "value2"
        },
        {
          "column1": "value3",
          "column2": "value4"
        }
      ]
    }
  ],
  "pageNo": 1,
  "journalSummaryId": "string",
  "next": "/api/v1/extraction-configurations/{extractionConfigId}/extractions/paginated?page=2&limit=1000",
  "prev": "/api/v1/extraction-configurations/{extractionConfigId}/extractions/paginated?page=1&limit=1000"
}
```

You can also choose to extract only the increment of data you already extracted (9), by using the Increments the saved offsets for an incremental extract endpoint, which moves the last offset forward to return only newly added data on the next data retrieval.

### Request

POST [https://api.fynapse.com/api/v1/extraction-configurations/\{extractionConfigId}/extractions/increment](https://api.fynapse.com/api/v1/extraction-configurations/\{extractionConfigId}/extractions/increment)

```curl
curl -X POST https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/increment \
     -H "Authorization: Bearer <token>"
```

```python
import requests

url = "https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/increment"

headers = {"Authorization": "<token>."}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/increment';
const options = {method: 'POST', headers: {Authorization: '<token>.'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/increment"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "<token>.")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/increment")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<token>.'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/increment")
  .header("Authorization", "<token>.")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/increment', [
  'headers' => [
    'Authorization' => '<token>.',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/increment");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<token>.");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "<token>."]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fynapse.com/api/v1/extraction-configurations/extractionConfigId/extractions/increment")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```