Create Or Update User
POST {{baseUrl}}/api/v2/users/create_or_update
Creates a user if the user does not already exist, or updates an existing user identified by e-mail address or external ID.
If you don't specify a role parameter, the new user is assigned the role of end user.
If you need to create users without sending out a verification email, include a "verified": true
property in the body.
Response Status Code
- If the user exists in Zendesk, a successful request returns a 200 status code with
Location: /api/v2/users/{user_id}.json
. - If the user does not exist in Zendesk, a successful request returns a 201 status code with
Location: /api/v2/users/{new_user_id}.json
.
Rate Limit
The rate limit is 5 requests per minute for each unique end user profile. For example, you can make 10 calls per second as long as you make five calls for one user and five calls for another user. The rate limiting mechanism behaves as described in Usage Limits in the API introduction. Zendesk recommends that you obey the Retry-After header values.
Allowed For
- Agents, with restrictions on certain actions
Request Body
{"user"=>{"name"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "email"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "custom_role_id"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "external_id"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "identities"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "organization"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "organization_id"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "role"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: Created
{"user":{"custom_role_id":123456,"email":"roge@example.org","id":9873843,"name":"Roger Wilco","organization_id":57542,"role":"agent","role_type":0}}