Skip to main content
POST
https://{tenantDomain}/api/v2
/
jobs
/
users-exports
Go
package example

import (
    context "context"

    client "github.com/auth0/go-auth0/management/management/client"
    jobs "github.com/auth0/go-auth0/management/management/jobs"
    option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &jobs.CreateExportUsersRequestContent{}
    client.Jobs.UsersExports.Create(
        context.TODO(),
        request,
    )
}
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.jobs.usersExports.create({});
}
main();
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.jobs.usersExports.create({});
}
main();
curl --request POST \
  --url https://{tenantDomain}/api/v2/jobs/users-exports \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "connection_id": "con_0000000000000001",
  "limit": 5,
  "fields": [
    {
      "name": "<string>",
      "export_as": "<string>"
    }
  ]
}
'
import requests

url = "https://{tenantDomain}/api/v2/jobs/users-exports"

payload = {
    "connection_id": "con_0000000000000001",
    "limit": 5,
    "fields": [
        {
            "name": "<string>",
            "export_as": "<string>"
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://{tenantDomain}/api/v2/jobs/users-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([
    'connection_id' => 'con_0000000000000001',
    'limit' => 5,
    'fields' => [
        [
                'name' => '<string>',
                'export_as' => '<string>'
        ]
    ]
  ]),
  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;
}
HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/jobs/users-exports")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"connection_id\": \"con_0000000000000001\",\n  \"limit\": 5,\n  \"fields\": [\n    {\n      \"name\": \"<string>\",\n      \"export_as\": \"<string>\"\n    }\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://{tenantDomain}/api/v2/jobs/users-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  \"connection_id\": \"con_0000000000000001\",\n  \"limit\": 5,\n  \"fields\": [\n    {\n      \"name\": \"<string>\",\n      \"export_as\": \"<string>\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
{
  "status": "pending",
  "type": "users_export",
  "id": "job_0000000000000001",
  "created_at": "<string>",
  "connection_id": "con_0000000000000001",
  "limit": 5,
  "fields": [
    {
      "name": "<string>",
      "export_as": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

connection_id
string
default:con_0000000000000001

connection_id of the connection from which users will be exported.

Pattern: ^con_[A-Za-z0-9]{16}$
format
enum<string>

Format of the file. Must be json or csv.

Available options:
json,
csv
limit
integer
default:5

Limit the number of records.

Required range: x >= 1
fields
object[]

List of fields to be included in the CSV. Defaults to a predefined set of fields.

Response

Job created successfully.

status
string
default:pending
required

Status of this job.

type
string
default:users_export
required

Type of job this is.

id
string
default:job_0000000000000001
required

ID of this job.

created_at
string

When this job was created.

connection_id
string
default:con_0000000000000001

connection_id of the connection from which users will be exported.

Pattern: ^con_[A-Za-z0-9]{16}$
format
enum<string>

Format of the file. Must be json or csv.

Available options:
json,
csv
limit
integer
default:5

Limit the number of records.

Required range: x >= 1
fields
object[]

List of fields to be included in the CSV. Defaults to a predefined set of fields.