Users API
- Table of Contents
- User Attributes
- Get a List of Users
- Get a Single User
- Create a New User
- Update an Existing User
- Clear a user’s password failure lockout
- Delete a User
User Attributes
id
integer /read-only |
Internal identifier for this users. |
||||||||||||||||||
full_name
string /required |
Full name of this user.
|
||||||||||||||||||
email
string /required |
Email address for this user.
|
||||||||||||||||||
active
boolean /required |
True or false if this user can sign in. |
||||||||||||||||||
role
string /required |
Role of the user.
|
||||||||||||||||||
show_quick_tips
boolean /default: |
The user sees tips in the UI. |
||||||||||||||||||
default_preview_recipients
array of strings |
The email addresses that will be automatically filled in when sending preview emails.
|
||||||||||||||||||
terms_and_conditions_version
integer |
The Terms & Conditions version number to which this user has agreed. A
value of If either of following is true, the user will be required to agree to the current Terms & Conditions the next time they interact with GreenArrow Studio:
Set this to a value larger than any version number you might use to prevent the user from ever being required to agree. If Terms & Conditions was previously enabled, then later disabled,
this value might not be
|
||||||||||||||||||
default_html_editor
string |
Users may select their preferred editor when creating new campaign contents. Existing campaign contents are not affected by a change of this option. The available options include:
|
||||||||||||||||||
permissions
hash The permissions hash has an entry for each of the following keys with the values being the available permissions. Here’s an example of a valid permissions hash.
|
|||||||||||||||||||
password_failure_lockout
hash /read-only This key pertains to the studio_user_login_lockout_duration configuration directive. Refer to that directive for more information on password failure lockouts.
|
Get a List of Users
Get a list of the basic details of login users.
URL
GET /ga/api/v2/users
GET /ga/api/v2/organizations/:organization_id/users
When accessed by a system admin, the /ga/api/v2/users
endpoint will return all users system wide. If a system admin account needs to retrieve the users on a single organization, use the /ga/api/v2/organizations/:organization_id/users
endpoint.
When accessed by any other API user, the /ga/api/v2/users
endpoint will return the users on their organization.
Request Parameters
full_name
string |
Filter all users with that exact description (case insensitive). |
full_name_contains
string |
Filter all users that contain that description (case insensitive). |
email
string |
Filter all users with that exact email (case insensitive). |
email_contains
string |
Filter all users that contain that email (case insensitive). |
order_by
string |
Specify an api key field to sort the results by.
Can be Defaults to |
Response
The response will be a JSON array where each element contains the “User Attributes” specified above.
This endpoint returns paginated records with a default page size of 2000
.
Example
GET /ga/api/v2/users
HTTP/1.1 200 OK
{
"success": true,
"data": [
{
"id": 54,
"full_name": "John Smith",
"email": "[email protected]",
"active": true,
"role": "system_admin",
"show_quick_tips": true,
"permissions": {
"mailing_list": [
"create",
"update",
"delete"
],
"subscriber": [
"create",
"update",
"delete",
"read",
"import",
"export"
],
"segmentation_criteria": [
"create",
"update",
"delete"
],
"autoresponder": [
"create",
"update",
"delete",
"update_state",
"read_stats"
],
"web_form": [
"create",
"update",
"delete"
],
"custom_field": [
"create",
"update",
"delete"
],
"campaign": [
"create",
"update",
"delete",
"send",
"update_state",
"read_stats"
],
"campaign/template": [
"create",
"update",
"delete"
],
"seed_list": [
"create",
"update",
"delete"
]
},
"default_preview_recipients": [
],
"password_failure_lockout": {
"is_locked_out": false,
"expires_at": null
}
},
{
"id": 55,
"full_name": "William Green",
"email": "[email protected]",
"active": true,
"role": "system_admin",
"show_quick_tips": true,
"permissions": {
"mailing_list": [
"create",
"update",
"delete"
],
"subscriber": [
"create",
"update",
"delete",
"read",
"import",
"export"
],
"segmentation_criteria": [
"create",
"update",
"delete"
],
"autoresponder": [
"create",
"update",
"delete",
"update_state",
"read_stats"
],
"web_form": [
"create",
"update",
"delete"
],
"custom_field": [
"create",
"update",
"delete"
],
"campaign": [
"create",
"update",
"delete",
"send",
"update_state",
"read_stats"
],
"campaign/template": [
"create",
"update",
"delete"
],
"seed_list": [
"create",
"update",
"delete"
]
},
"default_preview_recipients": [
],
"password_failure_lockout": {
"is_locked_out": false,
"expires_at": null
}
},
{
"id": 56,
"full_name": "Joe Johnson",
"email": "[email protected]",
"active": true,
"role": "system_admin",
"show_quick_tips": true,
"permissions": {
"mailing_list": [
"create",
"update",
"delete"
],
"subscriber": [
"create",
"update",
"delete",
"read",
"import",
"export"
],
"segmentation_criteria": [
"create",
"update",
"delete"
],
"autoresponder": [
"create",
"update",
"delete",
"update_state",
"read_stats"
],
"web_form": [
"create",
"update",
"delete"
],
"custom_field": [
"create",
"update",
"delete"
],
"campaign": [
"create",
"update",
"delete",
"send",
"update_state",
"read_stats"
],
"campaign/template": [
"create",
"update",
"delete"
],
"seed_list": [
"create",
"update",
"delete"
]
},
"default_preview_recipients": [
],
"password_failure_lockout": {
"is_locked_out": false,
"expires_at": null
}
},
{
"id": 57,
"full_name": "MyString",
"email": "[email protected]",
"active": true,
"role": "system_admin",
"show_quick_tips": true,
"permissions": {
"mailing_list": [
"create",
"update",
"delete"
],
"subscriber": [
"create",
"update",
"delete",
"read",
"import",
"export"
],
"segmentation_criteria": [
"create",
"update",
"delete"
],
"autoresponder": [
"create",
"update",
"delete",
"update_state",
"read_stats"
],
"web_form": [
"create",
"update",
"delete"
],
"custom_field": [
"create",
"update",
"delete"
],
"campaign": [
"create",
"update",
"delete",
"send",
"update_state",
"read_stats"
],
"campaign/template": [
"create",
"update",
"delete"
],
"seed_list": [
"create",
"update",
"delete"
]
},
"default_preview_recipients": [
],
"password_failure_lockout": {
"is_locked_out": false,
"expires_at": null
}
}
],
"error_code": null,
"error_message": null,
"page": 0,
"per_page": 2000,
"num_records": 4,
"num_pages": 1
}
Get a Single User
Get all the basic details of a single user.
URL
GET /ga/api/v2/users/:id
Request Parameters
id
integer |
The |
Response
The response will be a JSON hash as described in the User Attributes section of this document.
Example
Note that the JSON response will not be “pretty formatted” as it is below.
GET /ga/api/v2/users/58
HTTP/1.1 200 OK
{
"success": true,
"data": {
"id": 58,
"full_name": "John Smith",
"email": "[email protected]",
"active": true,
"role": "system_admin",
"show_quick_tips": true,
"permissions": {
"mailing_list": [
"create",
"update",
"delete"
],
"subscriber": [
"create",
"update",
"delete",
"read",
"import",
"export"
],
"segmentation_criteria": [
"create",
"update",
"delete"
],
"autoresponder": [
"create",
"update",
"delete",
"update_state",
"read_stats"
],
"web_form": [
"create",
"update",
"delete"
],
"custom_field": [
"create",
"update",
"delete"
],
"campaign": [
"create",
"update",
"delete",
"send",
"update_state",
"read_stats"
],
"campaign/template": [
"create",
"update",
"delete"
],
"seed_list": [
"create",
"update",
"delete"
]
},
"default_preview_recipients": [
],
"password_failure_lockout": {
"is_locked_out": false,
"expires_at": null
}
},
"error_code": null,
"error_message": null
}
Create a New User
Create a new user on the current organization.
URL
POST /ga/api/v2/users
Request Parameters
The request body should be a JSON hash as described in the User Attributes section of this document.
Response
The response will be a JSON object in the same format as the response to the users index.
Example
Note that the JSON response will not be “pretty formatted” as it is below.
POST /ga/api/v2/users
{
"user": {
"password1": "password",
"password2": "password",
"full_name": "My new user",
"email": "[email protected]",
"active": true,
"role": "standard"
}
}
HTTP/1.1 200 OK
{
"success": true,
"data": {
"id": 78,
"full_name": "My new user",
"email": "[email protected]",
"active": true,
"role": "standard",
"show_quick_tips": true,
"permissions": {
"mailing_list": [
"create",
"update",
"delete"
],
"subscriber": [
"create",
"update",
"delete",
"read",
"import",
"export"
],
"segmentation_criteria": [
"create",
"update",
"delete"
],
"autoresponder": [
"create",
"update",
"delete",
"update_state",
"read_stats"
],
"web_form": [
"create",
"update",
"delete"
],
"custom_field": [
"create",
"update",
"delete"
],
"campaign": [
"create",
"update",
"delete",
"send",
"update_state",
"read_stats"
],
"campaign/template": [
"create",
"update",
"delete"
],
"seed_list": [
"create",
"update",
"delete"
]
},
"default_preview_recipients": [
],
"terms_and_conditions_version": null,
"password_failure_lockout": {
"is_locked_out": false,
"expires_at": null
}
},
"error_code": null,
"error_message": null
}
Update an Existing User
URL
PUT /ga/api/v2/users/:id
Request Parameters
The request body should be a JSON hash as described in the User Attributes section of this document.
Response
The response will be a JSON object in the same format as the response to the users index.
Example
PUT /ga/api/v2/users/79
{
"user": {
"full_name": "My updated name"
}
}
HTTP/1.1 200 OK
{
"success": true,
"data": {
"id": 79,
"full_name": "My updated name",
"email": "[email protected]",
"active": true,
"role": "system_admin",
"show_quick_tips": true,
"permissions": {
"mailing_list": [
"create",
"update",
"delete"
],
"subscriber": [
"create",
"update",
"delete",
"read",
"import",
"export"
],
"segmentation_criteria": [
"create",
"update",
"delete"
],
"autoresponder": [
"create",
"update",
"delete",
"update_state",
"read_stats"
],
"web_form": [
"create",
"update",
"delete"
],
"custom_field": [
"create",
"update",
"delete"
],
"campaign": [
"create",
"update",
"delete",
"send",
"update_state",
"read_stats"
],
"campaign/template": [
"create",
"update",
"delete"
],
"seed_list": [
"create",
"update",
"delete"
]
},
"default_preview_recipients": [
],
"password_failure_lockout": {
"is_locked_out": false,
"expires_at": null
}
},
"error_code": null,
"error_message": null
}
Clear a user’s password failure lockout
This endpoint pertains to the studio_user_login_lockout_duration configuration directive. Refer to that directive for more information on password failure lockouts.
URL
PUT /ga/api/v2/users/:id/reset_password_failure_lockout
Request Parameters
The body for this request should be a blank JSON object.
{}
Response
result
string The result of clearing the user’s lockout. This can have the following values.
|
Example
PUT /ga/api/v2/users/66/reset_password_failure_lockout
HTTP/1.1 200 OK
{
"success": true,
"data": {
"result": "lockout_cleared"
},
"error_code": null,
"error_message": null
}
Delete a User
Delete a user with the given user ID.
URL
DELETE /ga/api/v2/users/:id
Request Parameters
id
integer |
The |
Response
An empty successful response to this request indicates that the user was successfully deleted.
Example
Note that the JSON response will not be “pretty formatted” as it is below.
DELETE /ga/api/v2/users/58
HTTP/1.1 200 OK
{
"success": true,
"data": null,
"error_code": null,
"error_message": null
}