Users

class Users(session_kwargs, client, return_type='raw')

Methods

delete_2fa(id)

Wipes the user's current 2FA settings so that they must reset them upon next login

delete_api_keys(id, key_id)

Revoke the specified API key

delete_me_favorites(id)

Unfavorite an item

delete_sessions(id)

Terminate all of the user's active sessions (must be a team or org admin)

get(id)

Show info about a user

get_api_keys(id, key_id)

Show the specified API key

get_me_themes(id)

Show a theme

list(*[, feature_flag, account_status, ...])

List users

list_api_keys(id, *[, limit, page_num, ...])

Show API keys belonging to the specified user

list_me()

Show info about the logged-in user

list_me_activity(*[, status, author, order])

Get recent activity for logged-in user

list_me_favorites(*[, object_id, ...])

List Favorites

list_me_organization_admins()

Get list of organization admins for logged-in user

list_me_themes()

List themes

patch(id, *[, name, email, active, ...])

Update info about a user (must be a team or org admin)

patch_me(*[, preferences, ...])

Update info about the logged-in user

patch_me_favorites_ranking_bottom(id)

Move a favorite to the bottom of the list

patch_me_favorites_ranking_higher(id)

Move a favorite one position closer to the top of the list

patch_me_favorites_ranking_lower(id)

Move a favorite one position closer to the bottom of the list

patch_me_favorites_ranking_top(id)

Move a favorite to the top of the list

post(name, email, primary_group_id, user, *)

Create a new user (must be a team or org admin)

post_access_email(id)

Sends the target user a 'Reset Password' or 'Welcome to Platform' email depending on the their status - Only available to Org and Team Admins

post_api_keys(id, expires_in, name, *[, ...])

Create a new API key belonging to the logged-in user

post_me_favorites(object_id, object_type)

Favorite an item

post_unsuspend(id)

Unsuspends user

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.users.list(...)
delete_2fa(id: int) Response

Wipes the user’s current 2FA settings so that they must reset them upon next login

Parameters:
idint

The ID of this user.

Returns:
civis.Response
  • idint

    The ID of this user.

  • userstr

    The username of this user.

  • namestr

    The name of this user.

  • emailstr

    The email of this user.

  • activebool

    Whether this user account is active or deactivated.

  • primary_group_idint

    The ID of the primary group of this user.

  • groupsList[civis.Response]

    An array of all the groups this user is in.

    • idint

      The ID of this group.

    • namestr

      The name of this group.

    • slugstr

      The slug of this group.

    • organization_idint

      The ID of the organization associated with this group.

    • organization_namestr

      The name of the organization associated with this group.

  • citystr

    The city of this user.

  • statestr

    The state of this user.

  • time_zonestr

    The time zone of this user.

  • initialsstr

    The initials of this user.

  • departmentstr

    The department of this user.

  • titlestr

    The title of this user.

  • github_usernamestr

    The GitHub username of this user.

  • prefers_sms_otpbool

    The preference for phone authorization of this user

  • vpn_enabledbool

    The availability of vpn for this user.

  • sso_disabledbool

    The availability of SSO for this user.

  • otp_required_for_loginbool

    The two factor authentication requirement for this user.

  • exempt_from_org_sms_otp_disabledbool

    Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.

  • sms_otp_allowedbool

    Whether the user is allowed to receive two factor authentication codes via SMS.

  • robotbool

    Whether the user is a robot.

  • phonestr

    The phone number of this user.

  • organization_slugstr

    The slug of the organization the user belongs to.

  • organization_sso_disable_capablebool

    The user’s organization’s ability to disable sso for their users.

  • organization_login_typestr

    The user’s organization’s login type.

  • organization_sms_otp_disabledbool

    Whether the user’s organization has SMS OTP disabled.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_atstr (date-time)

    The date and time when the user was created.

  • updated_atstr (date-time)

    The date and time when the user was last updated.

  • last_seen_atstr (date-time)

    The date and time when the user last visited Platform.

  • suspendedbool

    Whether the user is suspended due to inactivity.

  • created_by_idint

    The ID of the user who created this user.

  • last_updated_by_idint

    The ID of the user who last updated this user.

  • unconfirmed_emailstr

    The new email address awaiting confirmation from the user.

  • account_statusstr

    Account status of this user. One of: “Active”, “Deactivated”, “Suspended”, “Unsuspended”

delete_api_keys(id: str, key_id: int) Response

Revoke the specified API key

Parameters:
idstr

The ID of the user or ‘me’.

key_idint

The ID of the API key.

Returns:
civis.Response
  • idint

    The ID of the API key.

  • namestr

    The name of the API key.

  • expires_atstr (date-time)

    The date and time when the key expired.

  • created_atstr (date-time)

    The date and time when the key was created.

  • revoked_atstr (date-time)

    The date and time when the key was revoked.

  • last_used_atstr (date-time)

    The date and time when the key was last used.

  • scopesList[str]

    The scopes which the key is permissioned on.

  • use_countint

    The number of times the key has been used.

  • expiredbool

    True if the key has expired.

  • activebool

    True if the key has neither expired nor been revoked.

  • constraintsList[civis.Response]

    Constraints on the abilities of the created key

    • constraintstr

      The path matcher of the constraint.

    • constraint_typestr

      The type of constraint (exact/prefix/regex/verb).

    • get_allowedbool

      Whether the constraint allows GET requests.

    • head_allowedbool

      Whether the constraint allows HEAD requests.

    • post_allowedbool

      Whether the constraint allows POST requests.

    • put_allowedbool

      Whether the constraint allows PUT requests.

    • patch_allowedbool

      Whether the constraint allows PATCH requests.

    • delete_allowedbool

      Whether the constraint allows DELETE requests.

delete_me_favorites(id: int) Response

Unfavorite an item

Parameters:
idint

The id of the favorite.

Returns:
None

Response code 204: success

delete_sessions(id: int) Response

Terminate all of the user’s active sessions (must be a team or org admin)

Parameters:
idint

The ID of this user.

Returns:
civis.Response
  • idint

    The ID of this user.

  • userstr

    The username of this user.

  • namestr

    The name of this user.

  • emailstr

    The email of this user.

  • activebool

    Whether this user account is active or deactivated.

  • primary_group_idint

    The ID of the primary group of this user.

  • groupsList[civis.Response]

    An array of all the groups this user is in.

    • idint

      The ID of this group.

    • namestr

      The name of this group.

    • slugstr

      The slug of this group.

    • organization_idint

      The ID of the organization associated with this group.

    • organization_namestr

      The name of the organization associated with this group.

  • citystr

    The city of this user.

  • statestr

    The state of this user.

  • time_zonestr

    The time zone of this user.

  • initialsstr

    The initials of this user.

  • departmentstr

    The department of this user.

  • titlestr

    The title of this user.

  • github_usernamestr

    The GitHub username of this user.

  • prefers_sms_otpbool

    The preference for phone authorization of this user

  • vpn_enabledbool

    The availability of vpn for this user.

  • sso_disabledbool

    The availability of SSO for this user.

  • otp_required_for_loginbool

    The two factor authentication requirement for this user.

  • exempt_from_org_sms_otp_disabledbool

    Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.

  • sms_otp_allowedbool

    Whether the user is allowed to receive two factor authentication codes via SMS.

  • robotbool

    Whether the user is a robot.

  • phonestr

    The phone number of this user.

  • organization_slugstr

    The slug of the organization the user belongs to.

  • organization_sso_disable_capablebool

    The user’s organization’s ability to disable sso for their users.

  • organization_login_typestr

    The user’s organization’s login type.

  • organization_sms_otp_disabledbool

    Whether the user’s organization has SMS OTP disabled.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_atstr (date-time)

    The date and time when the user was created.

  • updated_atstr (date-time)

    The date and time when the user was last updated.

  • last_seen_atstr (date-time)

    The date and time when the user last visited Platform.

  • suspendedbool

    Whether the user is suspended due to inactivity.

  • created_by_idint

    The ID of the user who created this user.

  • last_updated_by_idint

    The ID of the user who last updated this user.

  • unconfirmed_emailstr

    The new email address awaiting confirmation from the user.

  • account_statusstr

    Account status of this user. One of: “Active”, “Deactivated”, “Suspended”, “Unsuspended”

get(id: int) Response

Show info about a user

Parameters:
idint

The ID of this user.

Returns:
civis.Response
  • idint

    The ID of this user.

  • userstr

    The username of this user.

  • namestr

    The name of this user.

  • emailstr

    The email of this user.

  • activebool

    Whether this user account is active or deactivated.

  • primary_group_idint

    The ID of the primary group of this user.

  • groupsList[civis.Response]

    An array of all the groups this user is in.

    • idint

      The ID of this group.

    • namestr

      The name of this group.

    • slugstr

      The slug of this group.

    • organization_idint

      The ID of the organization associated with this group.

    • organization_namestr

      The name of the organization associated with this group.

  • citystr

    The city of this user.

  • statestr

    The state of this user.

  • time_zonestr

    The time zone of this user.

  • initialsstr

    The initials of this user.

  • departmentstr

    The department of this user.

  • titlestr

    The title of this user.

  • github_usernamestr

    The GitHub username of this user.

  • prefers_sms_otpbool

    The preference for phone authorization of this user

  • vpn_enabledbool

    The availability of vpn for this user.

  • sso_disabledbool

    The availability of SSO for this user.

  • otp_required_for_loginbool

    The two factor authentication requirement for this user.

  • exempt_from_org_sms_otp_disabledbool

    Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.

  • sms_otp_allowedbool

    Whether the user is allowed to receive two factor authentication codes via SMS.

  • robotbool

    Whether the user is a robot.

  • phonestr

    The phone number of this user.

  • organization_slugstr

    The slug of the organization the user belongs to.

  • organization_sso_disable_capablebool

    The user’s organization’s ability to disable sso for their users.

  • organization_login_typestr

    The user’s organization’s login type.

  • organization_sms_otp_disabledbool

    Whether the user’s organization has SMS OTP disabled.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_atstr (date-time)

    The date and time when the user was created.

  • updated_atstr (date-time)

    The date and time when the user was last updated.

  • last_seen_atstr (date-time)

    The date and time when the user last visited Platform.

  • suspendedbool

    Whether the user is suspended due to inactivity.

  • created_by_idint

    The ID of the user who created this user.

  • last_updated_by_idint

    The ID of the user who last updated this user.

  • unconfirmed_emailstr

    The new email address awaiting confirmation from the user.

  • account_statusstr

    Account status of this user. One of: “Active”, “Deactivated”, “Suspended”, “Unsuspended”

get_api_keys(id: str, key_id: int) Response

Show the specified API key

Parameters:
idstr

The ID of the user or ‘me’.

key_idint

The ID of the API key.

Returns:
civis.Response
  • idint

    The ID of the API key.

  • namestr

    The name of the API key.

  • expires_atstr (date-time)

    The date and time when the key expired.

  • created_atstr (date-time)

    The date and time when the key was created.

  • revoked_atstr (date-time)

    The date and time when the key was revoked.

  • last_used_atstr (date-time)

    The date and time when the key was last used.

  • scopesList[str]

    The scopes which the key is permissioned on.

  • use_countint

    The number of times the key has been used.

  • expiredbool

    True if the key has expired.

  • activebool

    True if the key has neither expired nor been revoked.

  • constraintsList[civis.Response]

    Constraints on the abilities of the created key

    • constraintstr

      The path matcher of the constraint.

    • constraint_typestr

      The type of constraint (exact/prefix/regex/verb).

    • get_allowedbool

      Whether the constraint allows GET requests.

    • head_allowedbool

      Whether the constraint allows HEAD requests.

    • post_allowedbool

      Whether the constraint allows POST requests.

    • put_allowedbool

      Whether the constraint allows PUT requests.

    • patch_allowedbool

      Whether the constraint allows PATCH requests.

    • delete_allowedbool

      Whether the constraint allows DELETE requests.

get_me_themes(id: int) Response

Show a theme

Parameters:
idint

The ID of this theme.

Returns:
civis.Response
  • idint

    The ID of this theme.

  • namestr

    The name of this theme.

  • organization_idsList[int]

    List of organization ID’s allowed to use this theme.

  • settingsstr

    The theme configuration object.

  • logo_filecivis.Response
    • idint

      The ID of the logo image file.

    • download_urlstr

      The URL of the logo image file.

  • created_at : str (date-time)

  • updated_at : str (date-time)

list(*, feature_flag: str = None, account_status: str = None, query: str = None, group_id: int = None, group_ids: List[int] = None, organization_id: int = None, exclude_groups: bool = None, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None) list[Response] | PaginatedResponse

List users

Parameters:
feature_flagstr, optional

Return users that have a feature flag enabled.

account_statusstr, optional

The account status by which to filter users. May be one of “active”, “inactive”, or “all”. Defaults to active.

querystr, optional

Return users who match the given query, based on name, user, email, and id.

group_idint, optional

The ID of the group by which to filter users. Cannot be present if group_ids is.

group_idsList[int], optional

The IDs of the groups by which to filter users. Cannot be present if group_id is.

organization_idint, optional

The ID of the organization by which to filter users.

exclude_groupsbool, optional

Whether or to exclude users’ groups. Default: false.

limitint, optional

Number of results to return. Defaults to 20. Maximum allowed is 10000.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to name. Must be one of: name, user.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.

iteratorbool, optional

If True, return a generator (specifically, a civis.PaginatedResponse object) to iterate over all responses. Use it when more results than the maximum allowed by ‘limit’ are needed. When True, ‘page_num’ is ignored. If False, return a list of civis.Response objects, whose size is determined by ‘limit’. Defaults to False.

Returns:
civis.PaginatedResponse
  • idint

    The ID of this user.

  • userstr

    The username of this user.

  • namestr

    The name of this user.

  • emailstr

    The email of this user.

  • activebool

    Whether this user account is active or deactivated.

  • primary_group_idint

    The ID of the primary group of this user.

  • groupsList[civis.Response]

    An array of all the groups this user is in.

    • idint

      The ID of this group.

    • namestr

      The name of this group.

    • slugstr

      The slug of this group.

    • organization_idint

      The ID of the organization associated with this group.

    • organization_namestr

      The name of the organization associated with this group.

  • created_atstr (date-time)

    The date and time when the user was created.

  • current_sign_in_atstr (date-time)

    The date and time when the user’s current session began.

  • updated_atstr (date-time)

    The date and time when the user was last updated.

  • last_seen_atstr (date-time)

    The date and time when the user last visited Platform.

  • suspendedbool

    Whether the user is suspended due to inactivity.

  • created_by_idint

    The ID of the user who created this user.

  • last_updated_by_idint

    The ID of the user who last updated this user.

list_api_keys(id: str, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None) list[Response] | PaginatedResponse

Show API keys belonging to the specified user

Parameters:
idstr

The ID of the user or ‘me’.

limitint, optional

Number of results to return. Defaults to its maximum of 50.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, optional

If True, return a generator (specifically, a civis.PaginatedResponse object) to iterate over all responses. Use it when more results than the maximum allowed by ‘limit’ are needed. When True, ‘page_num’ is ignored. If False, return a list of civis.Response objects, whose size is determined by ‘limit’. Defaults to False.

Returns:
civis.PaginatedResponse
  • idint

    The ID of the API key.

  • namestr

    The name of the API key.

  • expires_atstr (date-time)

    The date and time when the key expired.

  • created_atstr (date-time)

    The date and time when the key was created.

  • revoked_atstr (date-time)

    The date and time when the key was revoked.

  • last_used_atstr (date-time)

    The date and time when the key was last used.

  • scopesList[str]

    The scopes which the key is permissioned on.

  • use_countint

    The number of times the key has been used.

  • expiredbool

    True if the key has expired.

  • activebool

    True if the key has neither expired nor been revoked.

  • constraint_countint

    The number of constraints on the created key

list_me() Response

Show info about the logged-in user

Returns:
civis.Response
  • idint

    The ID of this user.

  • namestr

    This user’s name.

  • emailstr

    This user’s email address.

  • usernamestr

    This user’s username.

  • initialsstr

    This user’s initials.

  • last_checked_announcementsstr (date-time)

    The date and time at which the user last checked their announcements.

  • feature_flagscivis.Response

    The feature flag settings for this user.

  • rolesList[str]

    The roles this user has, listed by slug.

  • preferencescivis.Response

    This user’s preferences.

  • custom_brandingstr

    The branding of Platform for this user.

  • primary_group_idint

    The ID of the primary group of this user.

  • groupsList[civis.Response]

    An array of all the groups this user is in.

    • idint

      The ID of this group.

    • namestr

      The name of this group.

    • slugstr

      The slug of this group.

    • organization_idint

      The ID of the organization associated with this group.

    • organization_namestr

      The name of the organization associated with this group.

  • organization_namestr

    The name of the organization the user belongs to.

  • organization_slugstr

    The slug of the organization the user belongs to.

  • organization_default_theme_idint

    The ID of the organizations’s default theme.

  • created_atstr (date-time)

    The date and time when the user was created.

  • sign_in_countint

    The number of times the user has signed in.

  • assuming_rolebool

    Whether the user is assuming a role or not.

  • assuming_adminbool

    Whether the user is assuming admin.

  • assuming_admin_expirationstr (date-time)

    When the user’s admin role is set to expire.

  • superadmin_mode_expirationstr (date-time)

    The user is in superadmin mode when set to a DateTime. The user is not in superadmin mode when set to null.

  • disable_non_compliant_fedramp_featuresbool

    Whether to disable non-compliant fedramp features.

  • persona_rolestr

    The high-level role representing the current user’s main permissions.

  • created_by_idint

    The ID of the user who created this user.

  • last_updated_by_idint

    The ID of the user who last updated this user.

list_me_activity(*, status: str = None, author: str = None, order: str = None) Response

Get recent activity for logged-in user

Parameters:
statusstr, optional

The status to filter objects by. One of “all”, “succeeded”, “failed”, or “running”.

authorstr, optional

A comma separated list of author IDs to filter objects by.

orderstr, optional

The order of the jobs. If set to “name”, the order is DESC alphabetically. If set to “newest”, the order is DESC by most recently updated.

Returns:
civis.Response
  • idstr

    The ID of the object.

  • namestr

    The name of the object.

  • typestr

    The type of the object.

  • userstr

    The user associated with the object.

  • categorystr

    The job category, if the object is a job.

  • statestr

    The state of the object. One of “succeeded”, “failed”, or “running”.

  • updated_atstr (date-time)

    When the object was last updated.

  • next_run_atstr (date-time)

    When the job is next scheduled to run, if the object is a job.

  • last_run_idstr

    The ID of the last run, if the object is a job.

  • last_run_statestr

    The state of the last run, if the object is a job. One of “succeeded”, “failed”, or “running”.

list_me_favorites(*, object_id: int = None, object_type: str = None, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None) list[Response] | PaginatedResponse

List Favorites

Parameters:
object_idint, optional

The id of the object. If specified as a query parameter, must also specify object_type parameter.

object_typestr, optional

The type of the object that is favorited. Valid options: Container Script, Identity Resolution, Import, Python Script, R Script, dbt Script, JavaScript Script, SQL Script, Template Script, Project, Workflow, Tableau Report, Service Report, HTML Report, SQL Report

limitint, optional

Number of results to return. Defaults to 50. Maximum allowed is 1000.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to position. Must be one of: position, created_at.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.

iteratorbool, optional

If True, return a generator (specifically, a civis.PaginatedResponse object) to iterate over all responses. Use it when more results than the maximum allowed by ‘limit’ are needed. When True, ‘page_num’ is ignored. If False, return a list of civis.Response objects, whose size is determined by ‘limit’. Defaults to False.

Returns:
civis.PaginatedResponse
  • idint

    The id of the favorite.

  • object_idint

    The id of the object. If specified as a query parameter, must also specify object_type parameter.

  • object_typestr

    The type of the object that is favorited. Valid options: Container Script, Identity Resolution, Import, Python Script, R Script, dbt Script, JavaScript Script, SQL Script, Template Script, Project, Workflow, Tableau Report, Service Report, HTML Report, SQL Report

  • object_namestr

    The name of the object that is favorited.

  • created_atstr (time)

    The time this favorite was created.

  • object_updated_atstr (time)

    The time the object that is favorited was last updated

  • object_authorcivis.Response
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • positionint

    The rank position of this favorite. Use the patch users/me/favorites/:id/ranking/ endpoints to update.

list_me_organization_admins() Response

Get list of organization admins for logged-in user

Returns:
civis.Response
  • idint

    The ID of this user.

  • namestr

    This user’s name.

  • usernamestr

    This user’s username.

  • initialsstr

    This user’s initials.

  • onlinebool

    Whether this user is online.

  • emailstr

    This user’s email address.

list_me_themes() Response

List themes

Returns:
civis.Response
  • idint

    The ID of this theme.

  • namestr

    The name of this theme.

  • created_at : str (date-time)

  • updated_at : str (date-time)

patch(id: int, *, name: str = None, email: str = None, active: bool = None, primary_group_id: int = None, city: str = None, state: str = None, time_zone: str = None, initials: str = None, department: str = None, title: str = None, prefers_sms_otp: bool = None, group_ids: List[int] = None, vpn_enabled: bool = None, sso_disabled: bool = None, otp_required_for_login: bool = None, exempt_from_org_sms_otp_disabled: bool = None, robot: bool = None, phone: str = None, password: str = None, account_status: str = None) Response

Update info about a user (must be a team or org admin)

Parameters:
idint

The ID of this user.

namestr, optional

The name of this user.

emailstr, optional

The email of this user.

activebool, optional

Whether this user account is active or deactivated.

primary_group_idint, optional

The ID of the primary group of this user.

citystr, optional

The city of this user.

statestr, optional

The state of this user.

time_zonestr, optional

The time zone of this user.

initialsstr, optional

The initials of this user.

departmentstr, optional

The department of this user.

titlestr, optional

The title of this user.

prefers_sms_otpbool, optional

The preference for phone authorization of this user

group_idsList[int], optional

An array of ids of all the groups this user is in.

vpn_enabledbool, optional

The availability of vpn for this user.

sso_disabledbool, optional

The availability of SSO for this user.

otp_required_for_loginbool, optional

The two factor authentication requirement for this user.

exempt_from_org_sms_otp_disabledbool, optional

Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.

robotbool, optional

Whether the user is a robot.

phonestr, optional

The phone number of this user.

passwordstr, optional

The password of this user.

account_statusstr, optional

Account status of this user. One of: “Active”, “Deactivated”, “Suspended”, “Unsuspended”

Returns:
civis.Response
  • idint

    The ID of this user.

  • userstr

    The username of this user.

  • namestr

    The name of this user.

  • emailstr

    The email of this user.

  • activebool

    Whether this user account is active or deactivated.

  • primary_group_idint

    The ID of the primary group of this user.

  • groupsList[civis.Response]

    An array of all the groups this user is in.

    • idint

      The ID of this group.

    • namestr

      The name of this group.

    • slugstr

      The slug of this group.

    • organization_idint

      The ID of the organization associated with this group.

    • organization_namestr

      The name of the organization associated with this group.

  • citystr

    The city of this user.

  • statestr

    The state of this user.

  • time_zonestr

    The time zone of this user.

  • initialsstr

    The initials of this user.

  • departmentstr

    The department of this user.

  • titlestr

    The title of this user.

  • github_usernamestr

    The GitHub username of this user.

  • prefers_sms_otpbool

    The preference for phone authorization of this user

  • vpn_enabledbool

    The availability of vpn for this user.

  • sso_disabledbool

    The availability of SSO for this user.

  • otp_required_for_loginbool

    The two factor authentication requirement for this user.

  • exempt_from_org_sms_otp_disabledbool

    Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.

  • sms_otp_allowedbool

    Whether the user is allowed to receive two factor authentication codes via SMS.

  • robotbool

    Whether the user is a robot.

  • phonestr

    The phone number of this user.

  • organization_slugstr

    The slug of the organization the user belongs to.

  • organization_sso_disable_capablebool

    The user’s organization’s ability to disable sso for their users.

  • organization_login_typestr

    The user’s organization’s login type.

  • organization_sms_otp_disabledbool

    Whether the user’s organization has SMS OTP disabled.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_atstr (date-time)

    The date and time when the user was created.

  • updated_atstr (date-time)

    The date and time when the user was last updated.

  • last_seen_atstr (date-time)

    The date and time when the user last visited Platform.

  • suspendedbool

    Whether the user is suspended due to inactivity.

  • created_by_idint

    The ID of the user who created this user.

  • last_updated_by_idint

    The ID of the user who last updated this user.

  • unconfirmed_emailstr

    The new email address awaiting confirmation from the user.

  • account_statusstr

    Account status of this user. One of: “Active”, “Deactivated”, “Suspended”, “Unsuspended”

patch_me(*, preferences: dict = None, last_checked_announcements: str = None) Response

Update info about the logged-in user

Parameters:
preferencesdict, optional
  • app_index_order_fieldstr

    This attribute is deprecated

  • app_index_order_dirstr

    This attribute is deprecated

  • result_index_order_fieldstr

    Order field for the reports index page.

  • result_index_order_dirstr

    Order direction for the reports index page.

  • result_index_type_filterstr

    Type filter for the reports index page.

  • result_index_author_filterstr

    Author filter for the reports index page.

  • result_index_archived_filterstr

    Archived filter for the reports index page.

  • import_index_order_fieldstr

    Order field for the imports index page.

  • import_index_order_dirstr

    Order direction for the imports index page.

  • import_index_type_filterstr

    Type filter for the imports index page.

  • import_index_author_filterstr

    Author filter for the imports index page.

  • import_index_dest_filterstr

    Destination filter for the imports index page.

  • import_index_status_filterstr

    Status filter for the imports index page.

  • import_index_archived_filterstr

    Archived filter for the imports index page.

  • export_index_order_fieldstr

    Order field for the exports index page.

  • export_index_order_dirstr

    Order direction for the exports index page.

  • export_index_type_filterstr

    Type filter for the exports index page.

  • export_index_author_filterstr

    Author filter for the exports index page.

  • export_index_status_filterstr

    Status filter for the exports index page.

  • model_index_order_fieldstr

    Order field for the models index page.

  • model_index_order_dirstr

    Order direction for the models index page.

  • model_index_author_filterstr

    Author filter for the models index page.

  • model_index_status_filterstr

    Status filter for the models index page.

  • model_index_archived_filterstr

    Archived filter for the models index page.

  • model_index_thumbnail_viewstr

    Thumbnail view for the models index page.

  • script_index_order_fieldstr

    Order field for the scripts index page.

  • script_index_order_dirstr

    Order direction for the scripts index page.

  • script_index_type_filterstr

    Type filter for the scripts index page.

  • script_index_author_filterstr

    Author filter for the scripts index page.

  • script_index_status_filterstr

    Status filter for the scripts index page.

  • script_index_archived_filterstr

    Archived filter for the scripts index page.

  • project_index_order_fieldstr

    Order field for the projects index page.

  • project_index_order_dirstr

    Order direction for the projects index page.

  • project_index_author_filterstr

    Author filter for the projects index page.

  • project_index_archived_filterstr

    Archived filter for the projects index page.

  • report_index_thumbnail_viewstr

    Thumbnail view for the reports index page.

  • project_detail_order_fieldstr

    Order field for projects detail pages.

  • project_detail_order_dirstr

    Order direction for projects detail pages.

  • project_detail_author_filterstr

    Author filter for projects detail pages.

  • project_detail_type_filterstr

    Type filter for projects detail pages.

  • project_detail_archived_filterstr

    Archived filter for the projects detail pages.

  • enhancement_index_order_fieldstr

    Order field for the enhancements index page.

  • enhancement_index_order_dirstr

    Order direction for the enhancements index page.

  • enhancement_index_author_filterstr

    Author filter for the enhancements index page.

  • enhancement_index_archived_filterstr

    Archived filter for the enhancements index page.

  • preferred_server_idint

    ID of preferred server.

  • civis_explore_skip_introbool

    Whether the user is shown steps for each exploration.

  • registration_index_order_fieldstr

    Order field for the registrations index page.

  • registration_index_order_dirstr

    Order direction for the registrations index page.

  • registration_index_status_filterstr

    Status filter for the registrations index page.

  • upgrade_requestedstr

    Whether a free trial upgrade has been requested.

  • welcome_order_fieldstr

    Order direction for the welcome page.

  • welcome_order_dirstr

    Order direction for the welcome page.

  • welcome_author_filterstr

    Status filter for the welcome page.

  • welcome_status_filterstr

    Status filter for the welcome page.

  • welcome_archived_filterstr

    Status filter for the welcome page.

  • data_pane_widthstr

    Width of the data pane when expanded.

  • data_pane_collapsedstr

    Whether the data pane is collapsed.

  • notebook_order_fieldstr

    Order field for the notebooks page.

  • notebook_order_dirstr

    Order direction for the notebooks page.

  • notebook_author_filterstr

    Author filter for the notebooks page.

  • notebook_archived_filterstr

    Archived filter for the notebooks page.

  • notebook_status_filterstr

    Status filter for the notebooks page.

  • workflow_index_order_fieldstr

    Order field for the workflows page.

  • workflow_index_order_dirstr

    Order direction for the workflows page.

  • workflow_index_author_filterstr

    Author filter for the workflows page.

  • workflow_index_archived_filterstr

    Archived filter for the workflows page.

  • service_order_fieldstr

    Order field for the services page.

  • service_order_dirstr

    Order direction for the services page.

  • service_author_filterstr

    Author filter for the services page.

  • service_archived_filterstr

    Archived filter for the services page.

  • assume_role_historystr

    JSON string of previously assumed roles.

  • default_success_notifications_onbool

    Whether email notifications for the success of all applicable jobs are on by default.

  • default_failure_notifications_onbool

    Whether email notifications for the failure of all applicable jobs are on by default.

  • my_activity_metricsbool

    Whether the activity metrics are filtered to the current user.

  • ai_sql_assist_disabledbool

    Whether the query page includes AI-powered SQL assistance.

last_checked_announcementsstr (date-time), optional

The date and time at which the user last checked their announcements.

Returns:
civis.Response
  • idint

    The ID of this user.

  • namestr

    This user’s name.

  • emailstr

    This user’s email address.

  • usernamestr

    This user’s username.

  • initialsstr

    This user’s initials.

  • last_checked_announcementsstr (date-time)

    The date and time at which the user last checked their announcements.

  • feature_flagscivis.Response

    The feature flag settings for this user.

  • rolesList[str]

    The roles this user has, listed by slug.

  • preferencescivis.Response

    This user’s preferences.

  • custom_brandingstr

    The branding of Platform for this user.

  • primary_group_idint

    The ID of the primary group of this user.

  • groupsList[civis.Response]

    An array of all the groups this user is in.

    • idint

      The ID of this group.

    • namestr

      The name of this group.

    • slugstr

      The slug of this group.

    • organization_idint

      The ID of the organization associated with this group.

    • organization_namestr

      The name of the organization associated with this group.

  • organization_namestr

    The name of the organization the user belongs to.

  • organization_slugstr

    The slug of the organization the user belongs to.

  • organization_default_theme_idint

    The ID of the organizations’s default theme.

  • created_atstr (date-time)

    The date and time when the user was created.

  • sign_in_countint

    The number of times the user has signed in.

  • assuming_rolebool

    Whether the user is assuming a role or not.

  • assuming_adminbool

    Whether the user is assuming admin.

  • assuming_admin_expirationstr (date-time)

    When the user’s admin role is set to expire.

  • superadmin_mode_expirationstr (date-time)

    The user is in superadmin mode when set to a DateTime. The user is not in superadmin mode when set to null.

  • disable_non_compliant_fedramp_featuresbool

    Whether to disable non-compliant fedramp features.

  • persona_rolestr

    The high-level role representing the current user’s main permissions.

  • created_by_idint

    The ID of the user who created this user.

  • last_updated_by_idint

    The ID of the user who last updated this user.

patch_me_favorites_ranking_bottom(id: int) Response

Move a favorite to the bottom of the list

Parameters:
idint

The id of the favorite.

Returns:
None

Response code 204: success

patch_me_favorites_ranking_higher(id: int) Response

Move a favorite one position closer to the top of the list

Parameters:
idint

The id of the favorite.

Returns:
None

Response code 204: success

patch_me_favorites_ranking_lower(id: int) Response

Move a favorite one position closer to the bottom of the list

Parameters:
idint

The id of the favorite.

Returns:
None

Response code 204: success

patch_me_favorites_ranking_top(id: int) Response

Move a favorite to the top of the list

Parameters:
idint

The id of the favorite.

Returns:
None

Response code 204: success

post(name: str, email: str, primary_group_id: int, user: str, *, active: bool = None, city: str = None, state: str = None, time_zone: str = None, initials: str = None, department: str = None, title: str = None, prefers_sms_otp: bool = None, group_ids: List[int] = None, vpn_enabled: bool = None, sso_disabled: bool = None, otp_required_for_login: bool = None, exempt_from_org_sms_otp_disabled: bool = None, robot: bool = None, send_email: bool = None) Response

Create a new user (must be a team or org admin)

Parameters:
namestr

The name of this user.

emailstr

The email of this user.

primary_group_idint

The ID of the primary group of this user.

userstr

The username of this user.

activebool, optional

Whether this user account is active or deactivated.

citystr, optional

The city of this user.

statestr, optional

The state of this user.

time_zonestr, optional

The time zone of this user.

initialsstr, optional

The initials of this user.

departmentstr, optional

The department of this user.

titlestr, optional

The title of this user.

prefers_sms_otpbool, optional

The preference for phone authorization of this user

group_idsList[int], optional

An array of ids of all the groups this user is in.

vpn_enabledbool, optional

The availability of vpn for this user.

sso_disabledbool, optional

The availability of SSO for this user.

otp_required_for_loginbool, optional

The two factor authentication requirement for this user.

exempt_from_org_sms_otp_disabledbool, optional

Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.

robotbool, optional

Whether the user is a robot.

send_emailbool, optional

Whether the user will receive a welcome email.

Returns:
civis.Response
  • idint

    The ID of this user.

  • userstr

    The username of this user.

  • namestr

    The name of this user.

  • emailstr

    The email of this user.

  • activebool

    Whether this user account is active or deactivated.

  • primary_group_idint

    The ID of the primary group of this user.

  • groupsList[civis.Response]

    An array of all the groups this user is in.

    • idint

      The ID of this group.

    • namestr

      The name of this group.

    • slugstr

      The slug of this group.

    • organization_idint

      The ID of the organization associated with this group.

    • organization_namestr

      The name of the organization associated with this group.

  • citystr

    The city of this user.

  • statestr

    The state of this user.

  • time_zonestr

    The time zone of this user.

  • initialsstr

    The initials of this user.

  • departmentstr

    The department of this user.

  • titlestr

    The title of this user.

  • github_usernamestr

    The GitHub username of this user.

  • prefers_sms_otpbool

    The preference for phone authorization of this user

  • vpn_enabledbool

    The availability of vpn for this user.

  • sso_disabledbool

    The availability of SSO for this user.

  • otp_required_for_loginbool

    The two factor authentication requirement for this user.

  • exempt_from_org_sms_otp_disabledbool

    Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.

  • sms_otp_allowedbool

    Whether the user is allowed to receive two factor authentication codes via SMS.

  • robotbool

    Whether the user is a robot.

  • phonestr

    The phone number of this user.

  • organization_slugstr

    The slug of the organization the user belongs to.

  • organization_sso_disable_capablebool

    The user’s organization’s ability to disable sso for their users.

  • organization_login_typestr

    The user’s organization’s login type.

  • organization_sms_otp_disabledbool

    Whether the user’s organization has SMS OTP disabled.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_atstr (date-time)

    The date and time when the user was created.

  • updated_atstr (date-time)

    The date and time when the user was last updated.

  • last_seen_atstr (date-time)

    The date and time when the user last visited Platform.

  • suspendedbool

    Whether the user is suspended due to inactivity.

  • created_by_idint

    The ID of the user who created this user.

  • last_updated_by_idint

    The ID of the user who last updated this user.

  • unconfirmed_emailstr

    The new email address awaiting confirmation from the user.

  • account_statusstr

    Account status of this user. One of: “Active”, “Deactivated”, “Suspended”, “Unsuspended”

post_access_email(id: int) Response

Sends the target user a ‘Reset Password’ or ‘Welcome to Platform’ email depending on the their status - Only available to Org and Team Admins

Parameters:
idint

The ID of this user.

Returns:
None

Response code 204: success

post_api_keys(id: str, expires_in: int, name: str, *, constraints: List[dict] = None) Response

Create a new API key belonging to the logged-in user

Parameters:
idstr

The ID of the user or ‘me’.

expires_inint

The number of seconds the key should last for.

namestr

The name of the API key.

constraintsList[dict], optional

Constraints on the abilities of the created key.

  • constraintstr

    The path matcher of the constraint.

  • constraint_typestr

    The type of constraint (exact/prefix/regex/verb).

  • get_allowedbool

    Whether the constraint allows GET requests.

  • head_allowedbool

    Whether the constraint allows HEAD requests.

  • post_allowedbool

    Whether the constraint allows POST requests.

  • put_allowedbool

    Whether the constraint allows PUT requests.

  • patch_allowedbool

    Whether the constraint allows PATCH requests.

  • delete_allowedbool

    Whether the constraint allows DELETE requests.

Returns:
civis.Response
  • idint

    The ID of the API key.

  • namestr

    The name of the API key.

  • expires_atstr (date-time)

    The date and time when the key expired.

  • created_atstr (date-time)

    The date and time when the key was created.

  • revoked_atstr (date-time)

    The date and time when the key was revoked.

  • last_used_atstr (date-time)

    The date and time when the key was last used.

  • scopesList[str]

    The scopes which the key is permissioned on.

  • use_countint

    The number of times the key has been used.

  • expiredbool

    True if the key has expired.

  • activebool

    True if the key has neither expired nor been revoked.

  • constraintsList[civis.Response]

    Constraints on the abilities of the created key

    • constraintstr

      The path matcher of the constraint.

    • constraint_typestr

      The type of constraint (exact/prefix/regex/verb).

    • get_allowedbool

      Whether the constraint allows GET requests.

    • head_allowedbool

      Whether the constraint allows HEAD requests.

    • post_allowedbool

      Whether the constraint allows POST requests.

    • put_allowedbool

      Whether the constraint allows PUT requests.

    • patch_allowedbool

      Whether the constraint allows PATCH requests.

    • delete_allowedbool

      Whether the constraint allows DELETE requests.

  • tokenstr

    The API key.

post_me_favorites(object_id: int, object_type: str) Response

Favorite an item

Parameters:
object_idint

The id of the object. If specified as a query parameter, must also specify object_type parameter.

object_typestr

The type of the object that is favorited. Valid options: Container Script, Identity Resolution, Import, Python Script, R Script, dbt Script, JavaScript Script, SQL Script, Template Script, Project, Workflow, Tableau Report, Service Report, HTML Report, SQL Report

Returns:
civis.Response
  • idint

    The id of the favorite.

  • object_idint

    The id of the object. If specified as a query parameter, must also specify object_type parameter.

  • object_typestr

    The type of the object that is favorited. Valid options: Container Script, Identity Resolution, Import, Python Script, R Script, dbt Script, JavaScript Script, SQL Script, Template Script, Project, Workflow, Tableau Report, Service Report, HTML Report, SQL Report

  • object_namestr

    The name of the object that is favorited.

  • created_atstr (time)

    The time this favorite was created.

  • object_updated_atstr (time)

    The time the object that is favorited was last updated

  • object_authorcivis.Response
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

post_unsuspend(id: int) Response

Unsuspends user

Parameters:
idint

The ID of this user.

Returns:
civis.Response
  • idint

    The ID of this user.

  • userstr

    The username of this user.

  • unlocked_atstr (date-time)

    The time the user’s account was unsuspended