Skip to main content
POST
/
api
/
admin
/
exports
Queue an async full-dataset CSV export
curl --request POST \
  --url https://pria.praxislxp.com/api/admin/exports \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "resource": "accounts",
  "filters": {
    "activeOnly": true,
    "accountsearch": "acme"
  },
  "columnIds": [
    "name",
    "status",
    "managerEmail",
    "credits"
  ]
}
'
import requests

url = "https://pria.praxislxp.com/api/admin/exports"

payload = {
    "resource": "accounts",
    "filters": {
        "activeOnly": True,
        "accountsearch": "acme"
    },
    "columnIds": ["name", "status", "managerEmail", "credits"]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    resource: 'accounts',
    filters: {activeOnly: true, accountsearch: 'acme'},
    columnIds: ['name', 'status', 'managerEmail', 'credits']
  })
};

fetch('https://pria.praxislxp.com/api/admin/exports', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://pria.praxislxp.com/api/admin/exports",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'resource' => 'accounts',
    'filters' => [
        'activeOnly' => true,
        'accountsearch' => 'acme'
    ],
    'columnIds' => [
        'name',
        'status',
        'managerEmail',
        'credits'
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

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

func main() {

	url := "https://pria.praxislxp.com/api/admin/exports"

	payload := strings.NewReader("{\n  \"resource\": \"accounts\",\n  \"filters\": {\n    \"activeOnly\": true,\n    \"accountsearch\": \"acme\"\n  },\n  \"columnIds\": [\n    \"name\",\n    \"status\",\n    \"managerEmail\",\n    \"credits\"\n  ]\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://pria.praxislxp.com/api/admin/exports")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"resource\": \"accounts\",\n  \"filters\": {\n    \"activeOnly\": true,\n    \"accountsearch\": \"acme\"\n  },\n  \"columnIds\": [\n    \"name\",\n    \"status\",\n    \"managerEmail\",\n    \"credits\"\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://pria.praxislxp.com/api/admin/exports")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"resource\": \"accounts\",\n  \"filters\": {\n    \"activeOnly\": true,\n    \"accountsearch\": \"acme\"\n  },\n  \"columnIds\": [\n    \"name\",\n    \"status\",\n    \"managerEmail\",\n    \"credits\"\n  ]\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "jobId": "6671abc1234def5678901234",
  "message": "Your export is being prepared. We will email you a download link when it is ready."
}
{
  "success": false,
  "message": "Unknown export resource"
}

Authorizations

Authorization
string
header
required

JWT token passed in authorization header

Body

application/json
resource
string
required

Export registry key identifying the dataset to export (e.g. 'accounts').

Example:

"accounts"

filters
object

Opaque per-resource filter payload (same shape as the list endpoint body). The worker re-applies role-scoped authorization on top of these filters — they can only narrow, never widen, the caller's scope.

Example:
{
  "activeOnly": true,
  "accountsearch": "acme"
}
columnIds
string[]

Ordered list of column ids to include in the CSV (from the resource's registry column definitions). Unknown ids are silently ignored. Capped at 200.

Example:
["name", "status", "managerEmail", "credits"]

Response

Export job queued successfully. A download link will be emailed when ready.

success
boolean
Example:

true

jobId
string

Mongo ObjectId of the queued dataExportJob document.

Example:

"6671abc1234def5678901234"

message
string

Human-readable confirmation that the export is being prepared.

Example:

"Your export is being prepared. We will email you a download link when it is ready."