How to create a User
A step by step guide for creating a User with the Legislate API
What is a User?
A User is an account registered on legislate.
Related Recipes
🦉
How to create a new user
Open Recipe
How to create a user?
To create a user, an email, first name, and last name are required to run the Create a user endpoint, or else an error will be given as a response. Optional parameters such as an avatar can be provided later.
curl --request POST \
--url https://sandbox.legislate.tech/v1/users \
--header 'Accept: */*' \
--header 'Content-Type: application/json' \
--data '
{
"email": "Email",
"first_name": "First_name",
"last_name": "Last_name"
}
'
A successful 201 response should look like this:
{
"_links": {
"self": {
"href": "https://sandbox.legislate.tech/v1/users/{{UserId}}"
}
},
"user_id": {{UserId}},
"email": {{email}}
}
A successful response returns the UserId.
Unique email
An email can only be used to create one user, and trying to use it to create more than one user will return an error on subsequent attempts.
Updated 10 months ago