Create a User
Create a new user.
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
Parameters
Parameter | Description | Type | Required |
---|---|---|---|
userId | User defined string identifier for this user. If not provided, Warrant will create an id for the user and return it. In this case, you should store the id in your system as you will need to provide it for any authorization requests for that user. Note that userIds in Warrant must be composed of alphanumeric chars and/or '-', '_', and '@'. | JSON body | no |
email | Email address for this user (optional). Designed to be used as a UI-friendly identifier. | JSON body | no |
Create a User with Provided Id
Request
- cURL
- Go
- Java
- Node.js
- Python
- Ruby
- PHP
curl "https://api.warrant.dev/v1/users" \
-X POST \
-H "Authorization: ApiKey YOUR_KEY" \
--data-raw \
'{"userId":"d6ed6474-784e-407e-a1ea-42a91d4c52b9"}'
user, err := user.Create(&warrant.UserParams{
UserId: "d6ed6474-784e-407e-a1ea-42a91d4c52b9",
})
User newUser = client.createUser(new User("d6ed6474-784e-407e-a1ea-42a91d4c52b9"));
const newUser = await warrantClient.User.create({
userId: "d6ed6474-784e-407e-a1ea-42a91d4c52b9",
});
user = warrant.User.create(id="d6ed6474-784e-407e-a1ea-42a91d4c52b9")
user = Warrant::User.create(user_id: "d6ed6474-784e-407e-a1ea-42a91d4c52b9")
$user = $warrant->createUser(new \Warrant\User("d6ed6474-784e-407e-a1ea-42a91d4c52b9"));
Response
{
"userId": "d6ed6474-784e-407e-a1ea-42a91d4c52b9",
"email": null
}
Create a User with Generated Id
Request
- cURL
- Go
- Java
- Node.js
- Python
- Ruby
- PHP
curl "https://api.warrant.dev/v1/users" \
-X POST \
-H "Authorization: ApiKey YOUR_KEY" \
newUser, err := user.Create(&warrant.UserParams{})
user = client.createUser();
const newUser = await warrantClient.User.create();
user = warrant.User.create()
user = Warrant::User.create()
$user = $warrant->createUser(new \Warrant\User());
Response
{
"userId": "dkfi7a0s-784e-407e-a1ea-42a91d4c52b9",
"email": null
}