Users API
- Table of Contents
- User Attributes
- Get a List of Users
- Get a Single User
- Create a New User
- Update an Existing 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
|
||||||||||||||||||
terms_and_conditions_version integer |
The Terms & Conditions version number to which this user has agreed. A If either of following is true, the user will be required to agree to
Set this to a value larger than any version number you might use to If Terms & Conditions was previously enabled, then later disabled,
|
||||||||||||||||||
permissions hash The permissions hash has an entry for each of the following keys with the Here’s an example of a valid permissions hash.
|
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. 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": [
]
},
{
"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": [
]
},
{
"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": [
]
},
{
"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": [
]
}
],
"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": [
]
},
"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": 66,
"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
},
"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/67
{
"user": {
"full_name": "My updated name"
}
}
HTTP/1.1 200 OK
{
"success": true,
"data": {
"id": 67,
"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": [
]
},
"error_code": null,
"error_message": null
}