Skip to main content
POST
https://{tenantDomain}/api/v2
/
connections
/
{id}
/
directory-provisioning
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.Connections.DirectoryProvisioning.CreateAsync(
            id: "id",
            request: new CreateDirectoryProvisioningRequestContent()
        );
    }

}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import java.util.Optional;

public class Example {
    public static void main(String[] args) {
        ManagementApi client = ManagementApi
            .builder()
            .token("<token>")
            .build();

        client.connections().directoryProvisioning().create(
            "id",
            Optional.empty()
        );
    }
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Types\CreateDirectoryProvisioningRequestContent;

$client = new Management(
    token: '<token>',
);
$client->connections->directoryProvisioning->create(
    'id',
    new CreateDirectoryProvisioningRequestContent([]),
);
from auth0.management import ManagementClient, CreateDirectoryProvisioningRequestContent

client = ManagementClient(
    token="<token>",
)

client.connections.directory_provisioning.create(
    id="id",
    request=CreateDirectoryProvisioningRequestContent(),
)
require "auth0"

client = Auth0::Management.new(token: "<token>")

client.connections.directory_provisioning.create(
  id: "id",
  request: {}
)
curl --request POST \
  --url https://{tenantDomain}/api/v2/connections/{id}/directory-provisioning \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "mapping": [
    {
      "auth0": "<string>",
      "idp": "<string>"
    }
  ],
  "synchronize_automatically": true
}
'
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    mapping: [{auth0: '<string>', idp: '<string>'}],
    synchronize_automatically: true
  })
};

fetch('https://{tenantDomain}/api/v2/connections/{id}/directory-provisioning', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
package main

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

func main() {

	url := "https://{tenantDomain}/api/v2/connections/{id}/directory-provisioning"

	payload := strings.NewReader("{\n  \"mapping\": [\n    {\n      \"auth0\": \"<string>\",\n      \"idp\": \"<string>\"\n    }\n  ],\n  \"synchronize_automatically\": true\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))

}
{
  "connection_id": "<string>",
  "connection_name": "<string>",
  "strategy": "<string>",
  "mapping": [
    {
      "auth0": "<string>",
      "idp": "<string>"
    }
  ],
  "synchronize_automatically": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "last_synchronization_at": "2023-11-07T05:31:56Z",
  "last_synchronization_status": "<string>",
  "last_synchronization_error": "<string>"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

The id of the connection to create its directory provisioning configuration

Body

mapping
object[]

The mapping between Auth0 and IDP user attributes

Minimum array length: 1
synchronize_automatically
boolean

Whether periodic automatic synchronization is enabled

synchronize_groups
enum<string>
GA

Group synchronization configuration

Available options:
all,
off,
selected

Response

The connection's directory provisioning configuration was created. See Response Schemas for schema.

connection_id
string
required

The connection's identifier

connection_name
string
required

The connection's name

strategy
string
required

The connection's strategy

mapping
object[]
required

The mapping between Auth0 and IDP user attributes

Minimum array length: 1
synchronize_automatically
boolean
required

Whether periodic automatic synchronization is enabled

created_at
string<date-time>
required

The timestamp at which the directory provisioning configuration was created

updated_at
string<date-time>
required

The timestamp at which the directory provisioning configuration was last updated

synchronize_groups
enum<string>
GA

Group synchronization configuration

Available options:
all,
off,
selected
last_synchronization_at
string<date-time>

The timestamp at which the connection was last synchronized

last_synchronization_status
string

The status of the last synchronization

last_synchronization_error
string

The error message of the last synchronization, if any