Batch Create Users Warrant Cloud Only
Create up to 100 new users in one API request.
caution
This endpoint has been deprecated and will be phased out at the end of 2023. Please update any existing usages of it to use the Create Object endpoint instead.
Endpoint
POST /v1/users
Request
A batch create request takes a list
of user
objects (as defined in the create user API). Providing a userId
for each user is optional. Warrant will generate a userId
for all users without a provided id.
note
Each batch create request can create up to 100 new users. Requests containing more than 100 user objects will fail.
Batch creates are atomic operations. If any error (client or server) is encountered during creation, none of the users will be created. Batch create requests can therefore be safely retried.
- cURL
- Go
- Java
- Node.js
- PHP
- Python
- Ruby
POST /v1/users
curl "https://api.warrant.dev/v1/users" \
-X POST \
-H "Authorization: ApiKey YOUR_KEY" \
--data-raw \
'[{"userId":"d6ed6474-784e-407e-a1ea-42a91d4c52b9"},{"userId":"hdf24rhser4-234dfdgdfs3"}]'
POST /v1/users
createdUsers, err := user.BatchCreate([]warrant.UserParams{
{ UserId: "d6ed6474-784e-407e-a1ea-42a91d4c52b9" },
{ UserId: "hdf24rhser4-234dfdgdfs3" },
})
POST /v1/users
User[] usersToCreate = { new User("d6ed6474-784e-407e-a1ea-42a91d4c52b9"), new User("hdf24rhser4-234dfdgdfs3") };
User[] createdUsers = client.createUsers(usersToCreate);
POST /v1/users
const createdUsers = await warrantClient.User.batchCreate([
{
userId: "d6ed6474-784e-407e-a1ea-42a91d4c52b9",
},
{
userId: "hdf24rhser4-234dfdgdfs3",
},
]);
Response
200 OK
[
{
"userId": "d6ed6474-784e-407e-a1ea-42a91d4c52b9",
"email": null
},
{
"userId": "hdf24rhser4-234dfdgdfs3",
"email": null
}
]