You can also view Looker’s interactive API documentation on the Looker Developer Portal or by using the API Explorer extension.
Get All User Attributes
Implementation Notes
Get information about all user attributes.
Response Class
array
Parameters
Parameter | Required? | Description | Parameter Type | Data Type |
---|---|---|---|---|
fields | false | Requested fields. | string | string |
sorts | false | Fields to order the results by. Sortable fields include: name, label | string | string |
Response Messages
HTTP Status Code | Reason | Response Model |
---|---|---|
400 | Bad Request |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
404 | Not Found |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
Create User Attribute
Implementation Notes
Create a new user attribute.
Permission information for a user attribute is conveyed through the can
and user_can_edit
fields.
The user_can_edit
field indicates whether an attribute is user-editable anywhere in the application.
The can
field gives more granular access information, with the set_value
child field indicating whether
an attribute’s value can be set by Setting the User Attribute User Value).
Note: name
and label
fields must be unique across all user attributes in the Looker instance.
Attempting to create a new user attribute with a name or label that duplicates an existing
user attribute will fail with a 422 error.
Response Class
Parameters
Parameter | Required? | Description | Parameter Type | Data Type |
---|---|---|---|---|
body | true | User Attribute | body |
UserAttribute {
can (object, read-only): Operations the current user is able to perform on this object, id (string, read-only): Unique Id, name (string, required): Name of user attribute, label (string, required): Human-friendly label for user attribute, type (string, required): Type of user attribute ("string", "number", "datetime", "yesno", "zipcode"), default_value (string): Default value for when no value is set on the user, is_system (boolean, read-only): Attribute is a system default, is_permanent (boolean, read-only): Attribute is permanent and cannot be deleted, value_is_hidden (boolean): If true, users will not be able to view values of this attribute, user_can_view (boolean): Non-admin users can see the values of their attributes and use them in filters, user_can_edit (boolean): Users can change the value of this attribute for themselves, hidden_value_domain_whitelist (string): Destinations to which a hidden attribute may be sent. Once set, cannot be edited. }
|
fields | false | Requested fields. | string | string |
Response Messages
HTTP Status Code | Reason | Response Model |
---|---|---|
400 | Bad Request |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
404 | Not Found |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
409 | Resource Already Exists |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
422 | Validation Error |
ValidationError {
message (string, read-only, required): Error details, errors (Array[ValidationErrorDetail], read-only): Error detail array, documentation_url (string, read-only, required): Documentation link }ValidationErrorDetail { field (string, read-only): Field with error, code (string, read-only): Error code, message (string, read-only): Error info message, documentation_url (string, read-only, required): Documentation link }
|
429 | Too Many Requests |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
Get User Attribute
Implementation Notes
Get information about a user attribute.
Response Class
Parameters
Parameter | Required? | Description | Parameter Type | Data Type |
---|---|---|---|---|
user_attribute_id | true | Id of user attribute | string | string |
fields | false | Requested fields. | string | string |
Response Messages
HTTP Status Code | Reason | Response Model |
---|---|---|
400 | Bad Request |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
404 | Not Found |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
Update User Attribute
Implementation Notes
Update a user attribute definition.
Response Class
Parameters
Parameter | Required? | Description | Parameter Type | Data Type |
---|---|---|---|---|
user_attribute_id | true | Id of user attribute | string | string |
body | true | User Attribute | body |
UserAttribute {
can (object, read-only): Operations the current user is able to perform on this object, id (string, read-only): Unique Id, name (string, required): Name of user attribute, label (string, required): Human-friendly label for user attribute, type (string, required): Type of user attribute ("string", "number", "datetime", "yesno", "zipcode"), default_value (string): Default value for when no value is set on the user, is_system (boolean, read-only): Attribute is a system default, is_permanent (boolean, read-only): Attribute is permanent and cannot be deleted, value_is_hidden (boolean): If true, users will not be able to view values of this attribute, user_can_view (boolean): Non-admin users can see the values of their attributes and use them in filters, user_can_edit (boolean): Users can change the value of this attribute for themselves, hidden_value_domain_whitelist (string): Destinations to which a hidden attribute may be sent. Once set, cannot be edited. }
|
fields | false | Requested fields. | string | string |
Response Messages
HTTP Status Code | Reason | Response Model |
---|---|---|
400 | Bad Request |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
404 | Not Found |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
422 | Validation Error |
ValidationError {
message (string, read-only, required): Error details, errors (Array[ValidationErrorDetail], read-only): Error detail array, documentation_url (string, read-only, required): Documentation link }ValidationErrorDetail { field (string, read-only): Field with error, code (string, read-only): Error code, message (string, read-only): Error info message, documentation_url (string, read-only, required): Documentation link }
|
429 | Too Many Requests |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
Delete User Attribute
Implementation Notes
Delete a user attribute (admin only).
Response Class
None
Parameters
Parameter | Required? | Description | Parameter Type | Data Type |
---|---|---|---|---|
user_attribute_id | true | Id of user attribute | string | string |
Response Messages
HTTP Status Code | Reason | Response Model |
---|---|---|
400 | Bad Request |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
404 | Not Found |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
429 | Too Many Requests |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
204 | Successfully deleted. | string |
Get User Attribute Group Values
Implementation Notes
Returns all values of a user attribute defined by user groups, in precedence order.
A user may be a member of multiple groups which define different values for a given user attribute. The order of group-values in the response determines precedence for selecting which group-value applies to a given user. For more information, see Set User Attribute Group Values).
Results will only include groups that the caller’s user account has permission to see.
Response Class
array
Parameters
Parameter | Required? | Description | Parameter Type | Data Type |
---|---|---|---|---|
user_attribute_id | true | Id of user attribute | string | string |
fields | false | Requested fields. | string | string |
Response Messages
HTTP Status Code | Reason | Response Model |
---|---|---|
400 | Bad Request |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
404 | Not Found |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
Set User Attribute Group Values
Implementation Notes
Define values for a user attribute across a set of groups, in priority order.
This function defines all values for a user attribute defined by user groups. This is a global setting, potentially affecting all users in the system. This function replaces any existing group value definitions for the indicated user attribute.
The value of a user attribute for a given user is determined by searching the following locations, in this order:
- the user’s account settings
- the groups that the user is a member of
- the default value of the user attribute, if any
The user may be a member of multiple groups which define different values for that user attribute. The order of items in the group_values parameter determines which group takes priority for that user. Lowest array index wins.
An alternate method to indicate the selection precedence of group-values is to assign numbers to the ‘rank’ property of each group-value object in the array. Lowest ‘rank’ value wins. If you use this technique, you must assign a rank value to every group-value object in the array.
To set a user attribute value for a single user, see Set User Attribute User Value). To set a user attribute value for all members of a group, see Set User Attribute Group Value).
Response Class
array
Parameters
Parameter | Required? | Description | Parameter Type | Data Type |
---|---|---|---|---|
user_attribute_id | true | Id of user attribute | string | string |
body | true | Array of group values. | body | array |
Response Messages
HTTP Status Code | Reason | Response Model |
---|---|---|
400 | Bad Request |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
404 | Not Found |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
409 | Resource Already Exists |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|
422 | Validation Error |
ValidationError {
message (string, read-only, required): Error details, errors (Array[ValidationErrorDetail], read-only): Error detail array, documentation_url (string, read-only, required): Documentation link }ValidationErrorDetail { field (string, read-only): Field with error, code (string, read-only): Error code, message (string, read-only): Error info message, documentation_url (string, read-only, required): Documentation link }
|
429 | Too Many Requests |
Error {
message (string, read-only, required): Error details, documentation_url (string, read-only, required): Documentation link }
|