Endpoint Create User
Name
post_user
Description
Create a user [API reference]
Related Tables
Parameters
| Parameter | Required | Options | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| There are no parameters | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Output Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| id |
DT_I8
|
bigint
|
||
| name |
DT_WSTR
|
nvarchar(255)
|
255 | |
DT_WSTR
|
nvarchar(500)
|
500 | ||
| active |
DT_BOOL
|
bit
|
||
| role |
DT_WSTR
|
nvarchar(32)
|
32 | |
| created_at |
DT_DBTIMESTAMP
|
datetime
|
||
| updated_at |
DT_DBTIMESTAMP
|
datetime
|
||
| time_zone |
DT_WSTR
|
nvarchar(100)
|
100 | |
| iana_time_zone |
DT_WSTR
|
nvarchar(100)
|
100 | |
| phone |
DT_WSTR
|
nvarchar(100)
|
100 | |
| url |
DT_WSTR
|
nvarchar(500)
|
500 | |
| shared_phone_number |
DT_BOOL
|
bit
|
||
| locale_id |
DT_I8
|
bigint
|
||
| locale |
DT_WSTR
|
nvarchar(20)
|
20 | |
| organization_id |
DT_I8
|
bigint
|
||
| role_type |
DT_I8
|
bigint
|
||
| verified |
DT_BOOL
|
bit
|
||
| external_id |
DT_WSTR
|
nvarchar(500)
|
500 | |
| tags |
DT_WSTR
|
nvarchar(1000)
|
1000 | |
| tags_1 |
DT_WSTR
|
nvarchar(50)
|
50 | |
| tags_2 |
DT_WSTR
|
nvarchar(50)
|
50 | |
| tags_3 |
DT_WSTR
|
nvarchar(50)
|
50 | |
| tags_4 |
DT_WSTR
|
nvarchar(50)
|
50 | |
| tags_5 |
DT_WSTR
|
nvarchar(50)
|
50 | |
| alias |
DT_WSTR
|
nvarchar(255)
|
255 | |
| shared |
DT_BOOL
|
bit
|
||
| shared_agent |
DT_BOOL
|
bit
|
||
| last_login_at |
DT_DBTIMESTAMP
|
datetime
|
||
| two_factor_auth_enabled |
DT_BOOL
|
bit
|
||
| signature |
DT_WSTR
|
nvarchar(80)
|
80 | |
| details |
DT_WSTR
|
nvarchar(4000)
|
4000 | |
| notes |
DT_WSTR
|
nvarchar(4000)
|
4000 | |
| custom_role_id |
DT_I8
|
bigint
|
||
| moderator |
DT_BOOL
|
bit
|
||
| ticket_restriction |
DT_WSTR
|
nvarchar(80)
|
80 | |
| only_private_comments |
DT_BOOL
|
bit
|
||
| restricted_agent |
DT_BOOL
|
bit
|
||
| suspended |
DT_BOOL
|
bit
|
||
| default_group_id |
DT_I8
|
bigint
|
||
| report_csv |
DT_BOOL
|
bit
|
||
| photo_url |
DT_WSTR
|
nvarchar(500)
|
500 | |
| photo_id |
DT_I8
|
bigint
|
||
| photo_file_name |
DT_WSTR
|
nvarchar(148)
|
148 | |
| photo_content_url |
DT_WSTR
|
nvarchar(500)
|
500 | |
| photo_mapped_content_url |
DT_WSTR
|
nvarchar(500)
|
500 | |
| photo_content_type |
DT_WSTR
|
nvarchar(40)
|
40 | |
| photo_size |
DT_I8
|
bigint
|
||
| photo_width |
DT_I8
|
bigint
|
||
| photo_height |
DT_I8
|
bigint
|
||
| photo_inline |
DT_BOOL
|
bit
|
||
| photo_deleted |
DT_BOOL
|
bit
|
||
| photo_thumbnails |
DT_WSTR
|
nvarchar(4000)
|
4000 | |
| user_field_dt_[$parent.key$] |
DT_WSTR
|
nvarchar(4000)
|
4000 | |
| user_field_[$parent.key$] |
DT_WSTR
|
nvarchar(4000)
|
4000 |
Input Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| id |
DT_I8
|
bigint
|
||
| name |
DT_WSTR
|
nvarchar(120)
|
120 | |
DT_WSTR
|
nvarchar(160)
|
160 | ||
| alias |
DT_WSTR
|
nvarchar(255)
|
255 | |
| time_zone |
DT_WSTR
|
nvarchar(104)
|
104 | |
| phone |
DT_WSTR
|
nvarchar(80)
|
80 | |
| shared_phone_number |
DT_BOOL
|
bit
|
||
| photo_id |
DT_WSTR
|
nvarchar(1020)
|
1020 | |
| locale_id |
DT_I8
|
bigint
|
||
| locale |
DT_WSTR
|
nvarchar(20)
|
20 | |
| organization_id |
DT_I8
|
bigint
|
||
| organization_name |
DT_WSTR
|
nvarchar(200)
|
200 | |
| role |
DT_WSTR
|
nvarchar(100)
|
100 | |
| verified |
DT_BOOL
|
bit
|
||
| external_id |
DT_WSTR
|
nvarchar(500)
|
500 | |
| tags |
DT_WSTR
|
nvarchar(4000)
|
4000 | |
| signature |
DT_WSTR
|
nvarchar(4000)
|
4000 | |
| details |
DT_WSTR
|
nvarchar(4000)
|
4000 | |
| notes |
DT_WSTR
|
nvarchar(4000)
|
4000 | |
| remote_photo_url |
DT_WSTR
|
nvarchar(4000)
|
4000 | |
| custom_role_id |
DT_I8
|
bigint
|
||
| moderator |
DT_BOOL
|
bit
|
||
| ticket_restriction |
DT_WSTR
|
nvarchar(80)
|
80 | |
| only_private_comments |
DT_BOOL
|
bit
|
||
| restricted_agent |
DT_BOOL
|
bit
|
||
| suspended |
DT_BOOL
|
bit
|
||
| default_group_id |
DT_I8
|
bigint
|
||
| photo |
DT_WSTR
|
nvarchar(4000)
|
4000 | |
| user_fields |
DT_WSTR
|
nvarchar(4000)
|
4000 | |
| identities |
DT_WSTR
|
nvarchar(4000)
|
4000 |
Examples
SSIS
Use Zendesk Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Destination
This Endpoint belongs to the Users table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to create user:
| There are no parameters to configure. |
ODBC application
Use these SQL queries in your ODBC application data source:
Create a user
<p>Creates a new user in the <code>Users</code> table. This example demonstrates specifying user details like name, email, role, and custom fields. Note that if a user with the same email exists, the call will fail.</p>
INSERT INTO Users
(
name
,email
,organization_id
,phone
,default_group_id
,locale
,moderator
,skip_verify_email
,only_private_comments
,signature
,tags
,time_zone
,role
,external_id
,alias
,details
,notes
,remote_photo_url
,user_fields
)
VALUES(
'Bob Walton'
,'bob@abc.com'
,5397098432795
,'111-222-3333'
,114094762733
,'en-US'
,'false'
,'true' --true=do not send verify account email
,1 --user can put only private comments
,'Best regards, Support Team' --Only agents and admins can have signatures
,'["paid","trial","solved"]'
,'America/New_York'
,'end-user' --agent or admin
,'zcrm_1558554000052161270'
,'some alias'
,'some details'
,'some notes'
,'https://zappysys.com/wp-content/uploads/2021/10/Slider-API-Hub-1.png' --this does not work in INSERT (works only in UPDATE/UPSERT for now)
,'{"birthdate": "1981-01-23", "gender": "M"}'
)
Upsert a user
<p>Creates a new user or updates an existing one. This example demonstrates using the <code>UPSERT INTO</code> statement, which updates the user if they exist (identified by email or external ID) or creates them otherwise.</p>
INSERT INTO Users
(
name
,email
,organization_id
,phone
,default_group_id
,locale
,moderator
,skip_verify_email
,only_private_comments
,signature
,tags
,time_zone
,role
,external_id
,alias
,details
,notes
,remote_photo_url
,user_fields
)
VALUES(
'Bob Walton'
,'bob@abc.com'
,5397098432795
,'111-222-3333'
,114094762733
,'en-US'
,'false'
,'true' --true=do not send verify account email
,1 --user can put only private comments
,'Best regards, Support Team' --Only agents and admins can have signatures
,'["paid","trial","solved"]'
,'America/New_York'
,'end-user' --agent or admin
,'zcrm_1558554000052161270'
,'some alias'
,'some details'
,'some notes'
,'https://zappysys.com/wp-content/uploads/2021/10/Slider-API-Hub-1.png' --this does not work in INSERT (works only in UPDATE/UPSERT for now)
,'{"birthdate": "1981-01-23", "gender": "M"}'
)
post_user endpoint belongs to
Users
table(s), and can therefore be used via those table(s).
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Create a user
<p>Creates a new user in the <code>Users</code> table. This example demonstrates specifying user details like name, email, role, and custom fields. Note that if a user with the same email exists, the call will fail.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Users
(
name
,email
,organization_id
,phone
,default_group_id
,locale
,moderator
,skip_verify_email
,only_private_comments
,signature
,tags
,time_zone
,role
,external_id
,alias
,details
,notes
,remote_photo_url
,user_fields
)
VALUES(
''Bob Walton''
,''bob@abc.com''
,5397098432795
,''111-222-3333''
,114094762733
,''en-US''
,''false''
,''true'' --true=do not send verify account email
,1 --user can put only private comments
,''Best regards, Support Team'' --Only agents and admins can have signatures
,''["paid","trial","solved"]''
,''America/New_York''
,''end-user'' --agent or admin
,''zcrm_1558554000052161270''
,''some alias''
,''some details''
,''some notes''
,''https://zappysys.com/wp-content/uploads/2021/10/Slider-API-Hub-1.png'' --this does not work in INSERT (works only in UPDATE/UPSERT for now)
,''{"birthdate": "1981-01-23", "gender": "M"}''
)';
EXEC (@MyQuery) AT [LS_TO_ZENDESK_IN_GATEWAY];
Upsert a user
<p>Creates a new user or updates an existing one. This example demonstrates using the <code>UPSERT INTO</code> statement, which updates the user if they exist (identified by email or external ID) or creates them otherwise.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Users
(
name
,email
,organization_id
,phone
,default_group_id
,locale
,moderator
,skip_verify_email
,only_private_comments
,signature
,tags
,time_zone
,role
,external_id
,alias
,details
,notes
,remote_photo_url
,user_fields
)
VALUES(
''Bob Walton''
,''bob@abc.com''
,5397098432795
,''111-222-3333''
,114094762733
,''en-US''
,''false''
,''true'' --true=do not send verify account email
,1 --user can put only private comments
,''Best regards, Support Team'' --Only agents and admins can have signatures
,''["paid","trial","solved"]''
,''America/New_York''
,''end-user'' --agent or admin
,''zcrm_1558554000052161270''
,''some alias''
,''some details''
,''some notes''
,''https://zappysys.com/wp-content/uploads/2021/10/Slider-API-Hub-1.png'' --this does not work in INSERT (works only in UPDATE/UPSERT for now)
,''{"birthdate": "1981-01-23", "gender": "M"}''
)';
EXEC (@MyQuery) AT [LS_TO_ZENDESK_IN_GATEWAY];
post_user endpoint belongs to
Users
table(s), and can therefore be used via those table(s).