Send Admin Invite
POST {{apiPath}}/environments/{{envID}}/users
The POST /environments/{{envID}}/users operation sends an admin registration invitation to a user. A new user resource is created in the environment that’s specified by the ID in the request URL.
The Content-Typein the request header is set to application/vnd.pingidentity.user.invite+json.
In the request body:
-
A unique value is required for the
emailattribute. The invited user will receive an invitation email at the specified email address. This value will be used as the user’s username. -
The population
idis optional. When specified, it’s possible thatemailconflicts may arise if you or your worker application attempt to create a user that exists in a population to which you do not have access. -
A value is required for the
familyandgivenname properties.isAdminmust be set totrue. -
The
invite.expirationMinutesproperty is optional. If left blank, the default value is 60. -
The invite accept URL defaults to the PingOne Admin Console UI, but an optional
invite.acceptUrlcan be set. If present, the value is substituted for the default URL.
If successful, the response returns a 201 Created message and the new user resource’s property data. The invited user is sent an email containing an invite code and link to complete registration.
Prerequisites
-
Refer to User Operations for important overview information.
Request Model
| Property | Type | Required? |
|---|---|---|
|
String |
Required |
|
String |
Required |
|
String |
Required |
|
String |
Optional |
|
String |
Optional |
|
Boolean |
Required |
|
Boolean |
Optional |
Refer to the Users data model for full property descriptions.
Example Request
-
cURL
-
C#
-
Go
-
HTTP
-
Java
-
jQuery
-
NodeJS
-
Python
-
PHP
-
Ruby
-
Swift
curl --location --globoff '{{apiPath}}/environments/{{envID}}/users' \
--header 'Content-Type: application/vnd.pingidentity.user.invite+json' \
--header 'Authorization: Bearer {{accessToken}}' \
--data-raw '{
"email": "someone@example.com",
"name": {
"given": "Mary",
"family": "Sample"
},
"population": {
"id": "{{popID}}"
},
"invite": {
"isAdmin": true,
"expirationMinutes": 120,
"acceptUrl": "https://example.com/accept-invite"
}
}'
var options = new RestClientOptions("{{apiPath}}/environments/{{envID}}/users")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/vnd.pingidentity.user.invite+json");
request.AddHeader("Authorization", "Bearer {{accessToken}}");
var body = @"{" + "\n" +
@" ""email"": ""someone@example.com""," + "\n" +
@" ""name"": {" + "\n" +
@" ""given"": ""Mary""," + "\n" +
@" ""family"": ""Sample""" + "\n" +
@" }," + "\n" +
@" ""population"": {" + "\n" +
@" ""id"": ""{{popID}}""" + "\n" +
@" }," + "\n" +
@" ""invite"": {" + "\n" +
@" ""isAdmin"": true," + "\n" +
@" ""expirationMinutes"": 120," + "\n" +
@" ""acceptUrl"": ""https://example.com/accept-invite""" + "\n" +
@" }" + "\n" +
@"}" + "\n" +
@"";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{apiPath}}/environments/{{envID}}/users"
method := "POST"
payload := strings.NewReader(`{
"email": "someone@example.com",
"name": {
"given": "Mary",
"family": "Sample"
},
"population": {
"id": "{{popID}}"
},
"invite": {
"isAdmin": true,
"expirationMinutes": 120,
"acceptUrl": "https://example.com/accept-invite"
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/vnd.pingidentity.user.invite+json")
req.Header.Add("Authorization", "Bearer {{accessToken}}")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /environments/{{envID}}/users HTTP/1.1
Host: {{apiPath}}
Content-Type: application/vnd.pingidentity.user.invite+json
Authorization: Bearer {{accessToken}}
{
"email": "someone@example.com",
"name": {
"given": "Mary",
"family": "Sample"
},
"population": {
"id": "{{popID}}"
},
"invite": {
"isAdmin": true,
"expirationMinutes": 120,
"acceptUrl": "https://example.com/accept-invite"
}
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/vnd.pingidentity.user.invite+json");
RequestBody body = RequestBody.create(mediaType, "{\n \"email\": \"someone@example.com\",\n \"name\": {\n \"given\": \"Mary\",\n \"family\": \"Sample\"\n },\n \"population\": {\n \"id\": \"{{popID}}\"\n },\n \"invite\": {\n \"isAdmin\": true,\n \"expirationMinutes\": 120,\n \"acceptUrl\": \"https://example.com/accept-invite\"\n }\n}\n");
Request request = new Request.Builder()
.url("{{apiPath}}/environments/{{envID}}/users")
.method("POST", body)
.addHeader("Content-Type", "application/vnd.pingidentity.user.invite+json")
.addHeader("Authorization", "Bearer {{accessToken}}")
.build();
Response response = client.newCall(request).execute();
var settings = {
"url": "{{apiPath}}/environments/{{envID}}/users",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/vnd.pingidentity.user.invite+json",
"Authorization": "Bearer {{accessToken}}"
},
"data": JSON.stringify({
"email": "someone@example.com",
"name": {
"given": "Mary",
"family": "Sample"
},
"population": {
"id": "{{popID}}"
},
"invite": {
"isAdmin": true,
"expirationMinutes": 120,
"acceptUrl": "https://example.com/accept-invite"
}
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require('request');
var options = {
'method': 'POST',
'url': '{{apiPath}}/environments/{{envID}}/users',
'headers': {
'Content-Type': 'application/vnd.pingidentity.user.invite+json',
'Authorization': 'Bearer {{accessToken}}'
},
body: JSON.stringify({
"email": "someone@example.com",
"name": {
"given": "Mary",
"family": "Sample"
},
"population": {
"id": "{{popID}}"
},
"invite": {
"isAdmin": true,
"expirationMinutes": 120,
"acceptUrl": "https://example.com/accept-invite"
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "{{apiPath}}/environments/{{envID}}/users"
payload = json.dumps({
"email": "someone@example.com",
"name": {
"given": "Mary",
"family": "Sample"
},
"population": {
"id": "{{popID}}"
},
"invite": {
"isAdmin": True,
"expirationMinutes": 120,
"acceptUrl": "https://example.com/accept-invite"
}
})
headers = {
'Content-Type': 'application/vnd.pingidentity.user.invite+json',
'Authorization': 'Bearer {{accessToken}}'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiPath}}/environments/{{envID}}/users');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/vnd.pingidentity.user.invite+json',
'Authorization' => 'Bearer {{accessToken}}'
));
$request->setBody('{\n "email": "someone@example.com",\n "name": {\n "given": "Mary",\n "family": "Sample"\n },\n "population": {\n "id": "{{popID}}"\n },\n "invite": {\n "isAdmin": true,\n "expirationMinutes": 120,\n "acceptUrl": "https://example.com/accept-invite"\n }\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
require "uri"
require "json"
require "net/http"
url = URI("{{apiPath}}/environments/{{envID}}/users")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/vnd.pingidentity.user.invite+json"
request["Authorization"] = "Bearer {{accessToken}}"
request.body = JSON.dump({
"email": "someone@example.com",
"name": {
"given": "Mary",
"family": "Sample"
},
"population": {
"id": "{{popID}}"
},
"invite": {
"isAdmin": true,
"expirationMinutes": 120,
"acceptUrl": "https://example.com/accept-invite"
}
})
response = http.request(request)
puts response.read_body
let parameters = "{\n \"email\": \"someone@example.com\",\n \"name\": {\n \"given\": \"Mary\",\n \"family\": \"Sample\"\n },\n \"population\": {\n \"id\": \"{{popID}}\"\n },\n \"invite\": {\n \"isAdmin\": true,\n \"expirationMinutes\": 120,\n \"acceptUrl\": \"https://example.com/accept-invite\"\n }\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "{{apiPath}}/environments/{{envID}}/users")!,timeoutInterval: Double.infinity)
request.addValue("application/vnd.pingidentity.user.invite+json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer {{accessToken}}", forHTTPHeaderField: "Authorization")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Example Response
201 Created
{
"_links": {
"self": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/c95fb8cf-b880-4e26-bb11-1295a1ee552d"
},
"environment": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
},
"population": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/populations/89a7de36-c2ce-48d6-b453-9d7a7dd4dc3a"
},
"devices": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/c95fb8cf-b880-4e26-bb11-1295a1ee552d/devices"
},
"roleAssignments": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/c95fb8cf-b880-4e26-bb11-1295a1ee552d/roleAssignments"
},
"password": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/c95fb8cf-b880-4e26-bb11-1295a1ee552d/password"
},
"password.reset": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/c95fb8cf-b880-4e26-bb11-1295a1ee552d/password"
},
"password.set": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/c95fb8cf-b880-4e26-bb11-1295a1ee552d/password"
},
"password.check": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/c95fb8cf-b880-4e26-bb11-1295a1ee552d/password"
},
"password.recover": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/c95fb8cf-b880-4e26-bb11-1295a1ee552d/password"
},
"linkedAccounts": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/c95fb8cf-b880-4e26-bb11-1295a1ee552d/linkedAccounts"
},
"account.sendVerificationCode": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/c95fb8cf-b880-4e26-bb11-1295a1ee552d"
},
"memberOfGroups": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/c95fb8cf-b880-4e26-bb11-1295a1ee552d/memberOfGroups"
}
},
"id": "c95fb8cf-b880-4e26-bb11-1295a1ee552d",
"environment": {
"id": "abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
},
"account": {
"canAuthenticate": false,
"status": "OK"
},
"createdAt": "2025-11-03T16:23:01.954Z",
"email": "someone@example.com",
"enabled": true,
"identityProvider": {
"type": "PING_ONE"
},
"invite": {
"expiresAt": "2025-11-03T18:23:02.058Z"
},
"lifecycle": {
"status": "INVITED"
},
"mfaEnabled": true,
"name": {
"given": "Mary",
"family": "Sample"
},
"population": {
"id": "89a7de36-c2ce-48d6-b453-9d7a7dd4dc3a"
},
"updatedAt": "2025-11-03T16:23:01.954Z",
"username": "someone@example.com",
"verifyStatus": "NOT_INITIATED"
}