cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kurt4
Community Member

API: 422 Error Creating User

I am trying to POST a user via API, but I am receiving a 422 Error (Semantic Error, meaning the request is syntactically correct) from the API. This only happens with the POST request for the User. I am able to GET Users via API, but unable to POST a new user. Here is the endpoint I am using: Users - Canvas LMS REST API Documentation.

I have verified that I have the correct scopes and that my auth token is not expired

I am using Postman to test this request, and it generated this cURL:

curl --location --request POST 'https://<org-url>/api/v1/accounts/1/user' \
--header 'Authorization: Bearer: <access-token>' \
--header 'Content-Type: application/json' \
--header 'Content-Type: text/plain' \
--data-raw '{
"user": {
"name": "System Test",
"short_name": "System",
"sortable_name": "Test, System",
"terms_of_use": true
},
"pseudonym": {
"unique_id": "kurtvolmar+systemtest@gmail.com"
},
"communication_channel": {
"type": "email",
"address": "kurtvolmar+systemtest@gmail.com"
}
}'

I would greatly appreciate some direction for solving this. Thanks!

Labels (1)
1 Reply
MattHanes
Community Champion

Hey  @kurt4 ,

I didn't test it, but I think your Post link has to end in users (plural) instead of user. I believe that would cause a 422 unprocessable error. 

curl --location --request POST 'https://<org-url>/api/v1/accounts/1/users'‍