Reports

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

Methods

delete_grants(id)

Revoke permission for this report to perform Civis platform API operations on your behalf

delete_projects(id, project_id)

Remove a Report from a project

delete_services_projects(id, project_id)

Remove a Service Report from a project

delete_services_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_services_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_sql_projects(id, project_id)

Remove a SQL Report from a project

delete_sql_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_sql_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Get a single report

get_git_commits(id, commit_hash)

Get file contents at git ref

get_services(id)

Get a single service report

get_sql(id)

Get a single SQL report

list(*[, type, template_id, author, hidden, ...])

List Reports

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_git(id)

Get the git metadata attached to an item

list_git_commits(id)

Get the git commits for an item on the current branch

list_projects(id, *[, hidden])

List the projects a Report belongs to

list_services_dependencies(id, *[, user_id])

List dependent objects for this object

list_services_projects(id, *[, hidden])

List the projects a Service Report belongs to

list_services_shares(id)

List users and groups permissioned on this object

list_shares(id)

List users and groups permissioned on this object

list_sql_dependencies(id, *[, user_id])

List dependent objects for this object

list_sql_projects(id, *[, hidden])

List the projects a SQL Report belongs to

list_sql_shares(id)

List users and groups permissioned on this object

patch(id, *[, name, script_id, code_body, ...])

Update a report

patch_git(id, *[, git_ref, git_branch, ...])

Update an attached git file

patch_services(id, *[, name, provide_api_key])

Update some attributes of this service report

patch_sql(id, *[, query_id, name, config, ...])

Update a SQL report

post(*[, script_id, name, code_body, ...])

Create an HTML report

post_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

post_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

post_git_commits(id, content, message, file_hash)

Commit and push a new version of the file

post_grants(id)

Grant this report the ability to perform Civis platform API operations on your behalf

post_refresh(id)

Refresh the data in this Tableau report

post_services(service_id, *[, provide_api_key])

Create a service report

post_sql(query_id, name, config, *[, ...])

Create a SQL report

post_sql_refresh(id)

Refresh the data in a SQL report

put_archive(id, status)

Update the archive status of this object

put_git(id, *[, git_ref, git_branch, ...])

Attach an item to a file in a git repo

put_projects(id, project_id)

Add a Report to a project

put_services_archive(id, status)

Update the archive status of this object

put_services_projects(id, project_id)

Add a Service Report to a project

put_services_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_services_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_services_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_sql_archive(id, status)

Update the archive status of this object

put_sql_projects(id, project_id)

Add a SQL Report to a project

put_sql_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_sql_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_sql_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.reports.list(...)
delete_grants(id: int)

Revoke permission for this report to perform Civis platform API operations on your behalf

Parameters:
idint

The ID of this report.

Returns:
None

Response code 204: success

delete_projects(id: int, project_id: int)

Remove a Report from a project

Parameters:
idint

The ID of the Report.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

delete_services_projects(id: int, project_id: int)

Remove a Service Report from a project

Parameters:
idint

The ID of the Service Report.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

delete_services_shares_groups(id: int, group_id: int)

Revoke the permissions a group has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idint

The ID of the group.

Returns:
None

Response code 204: success

delete_services_shares_users(id: int, user_id: int)

Revoke the permissions a user has on this object

Parameters:
idint

The ID of the resource that is shared.

user_idint

The ID of the user.

Returns:
None

Response code 204: success

delete_shares_groups(id: int, group_id: int)

Revoke the permissions a group has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idint

The ID of the group.

Returns:
None

Response code 204: success

delete_shares_users(id: int, user_id: int)

Revoke the permissions a user has on this object

Parameters:
idint

The ID of the resource that is shared.

user_idint

The ID of the user.

Returns:
None

Response code 204: success

delete_sql_projects(id: int, project_id: int)

Remove a SQL Report from a project

Parameters:
idint

The ID of the SQL Report.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

delete_sql_shares_groups(id: int, group_id: int)

Revoke the permissions a group has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idint

The ID of the group.

Returns:
None

Response code 204: success

delete_sql_shares_users(id: int, user_id: int)

Revoke the permissions a user has on this object

Parameters:
idint

The ID of the resource that is shared.

user_idint

The ID of the user.

Returns:
None

Response code 204: success

get(id: int)

Get a single report

Parameters:
idint

The ID of this report.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • projectsList[dict]

    A list of projects containing the report.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • statestr

    The status of the report’s last run.

  • finished_atstr (time)

    The time that the report’s last run finished.

  • viz_updated_atstr (time)

    The time that the report’s visualization was last updated.

  • scriptdict
    • idint

      The ID for the script.

    • namestr

      The name of the script.

    • sqlstr

      The raw SQL query for the script, if applicable.

  • job_pathstr

    The link to details of the job that backs this report.

  • tableau_id : int

  • template_idint

    The ID of the template used for this report.

  • auth_thumbnail_urlstr

    URL for a thumbnail of the report.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • hiddenbool

    The hidden status of the item.

  • auth_data_urlstr

    DEPRECATED: For legacy reports

  • auth_code_urlstr

    Link to code to render in the report.

  • configstr

    Any configuration metadata for this report.

  • valid_output_filebool

    Whether the job (a script or a query) that backs the report currently has a valid output file.

  • provide_api_keybool

    Whether the report requests an API Key from the report viewer.

  • api_keystr

    A Civis API key that can be used by this report.

  • api_key_idint

    The ID of the API key. Can be used for auditing API use by this report.

  • app_statedict

    Any application state blob for this report.

  • use_viewers_tableau_usernamebool

    Apply user level filtering on Tableau reports.

get_git_commits(id: int, commit_hash: str)

Get file contents at git ref

Parameters:
idint

The ID of the item.

commit_hashstr

The SHA (full or shortened) of the desired git commit.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

get_services(id: int)

Get a single service report

Parameters:
idint

The ID of this report.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • hoststr

    The host for the service report

  • display_urlstr

    The URL to display the service report.

  • service_idint

    The id of the backing service

  • provide_api_keybool

    Whether the report requests an API Key from the report viewer.

  • api_keystr

    A Civis API key that can be used by this report.

  • api_key_idint

    The ID of the API key. Can be used for auditing API use by this report.

get_sql(id: int)

Get a single SQL report

Parameters:
idint

The ID of this report.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • configstr

    The configuration of the report visualization.

  • querydict
    • idint

      The query ID.

    • databaseint

      The database ID.

    • sqlstr

      The SQL to execute.

    • credentialint

      The credential ID.

    • result_rowsList[List]

      A preview of rows returned by the query.

    • result_columnsList[str]

      A preview of columns returned by the query.

    • errorstr

      The error message for this run, if present.

    • started_atstr (date-time)

      The start time of the last run.

    • finished_atstr (date-time)

      The end time of the last run.

    • statestr

      The state of the last run. One of queued, running, succeeded, failed, and cancelled.

    • running_asdict
      • 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.

list(*, type: str = None, template_id: int = None, author: str = None, hidden: bool = None, archived: str = None, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List Reports

Parameters:
typestr, optional

If specified, return report of these types. It accepts a comma-separated list, possible values are ‘tableau’ or ‘other’.

template_idint, optional

If specified, return reports using the provided Template.

authorstr, optional

If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.

hiddenbool, optional

If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.

archivedstr, optional

The archival status of the requested item(s).

limitint, optional

Number of results to return. Defaults to 20. Maximum allowed is 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 updated_at. Must be one of: updated_at, name, created_at.

order_dirstr, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns:
civis.response.PaginatedResponse
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • archivedstr

    The archival status of the requested item(s).

  • projectsList[dict]

    A list of projects containing the report.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • statestr

    The status of the report’s last run.

  • finished_atstr (time)

    The time that the report’s last run finished.

  • viz_updated_atstr (time)

    The time that the report’s visualization was last updated.

  • scriptdict
    • idint

      The ID for the script.

    • namestr

      The name of the script.

    • sqlstr

      The raw SQL query for the script, if applicable.

  • job_pathstr

    The link to details of the job that backs this report.

  • tableau_id : int

  • template_idint

    The ID of the template used for this report.

  • auth_thumbnail_urlstr

    URL for a thumbnail of the report.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

list_dependencies(id: int, *, user_id: int = None)

List dependent objects for this object

Parameters:
idint

The ID of the resource that is shared.

user_idint, optional

ID of target user

Returns:
civis.response.Response
  • object_typestr

    Dependent object type

  • fco_typestr

    Human readable dependent object type

  • idint

    Dependent object ID

  • namestr

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstr

    Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

  • descriptionstr

    Additional information about the dependency, if relevant

  • shareablebool

    Whether or not the requesting user can share this object.

list_git(id: int)

Get the git metadata attached to an item

Parameters:
idint

The ID of the item.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

list_git_commits(id: int)

Get the git commits for an item on the current branch

Parameters:
idint

The ID of the item.

Returns:
civis.response.Response
  • commit_hashstr

    The SHA of the commit.

  • author_namestr

    The name of the commit’s author.

  • datestr (time)

    The commit’s timestamp.

  • messagestr

    The commit message.

list_projects(id: int, *, hidden: bool = None)

List the projects a Report belongs to

Parameters:
idint

The ID of the Report.

hiddenbool, optional

If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.

Returns:
civis.response.Response
  • idint

    The ID for this project.

  • authordict
    • 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.

  • namestr

    The name of this project.

  • descriptionstr

    A description of the project.

  • usersList[dict]

    Users who can see the project.

    • 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.

  • auto_share : bool

  • created_at : str (time)

  • updated_at : str (time)

  • archivedstr

    The archival status of the requested item(s).

list_services_dependencies(id: int, *, user_id: int = None)

List dependent objects for this object

Parameters:
idint

The ID of the resource that is shared.

user_idint, optional

ID of target user

Returns:
civis.response.Response
  • object_typestr

    Dependent object type

  • fco_typestr

    Human readable dependent object type

  • idint

    Dependent object ID

  • namestr

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstr

    Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

  • descriptionstr

    Additional information about the dependency, if relevant

  • shareablebool

    Whether or not the requesting user can share this object.

list_services_projects(id: int, *, hidden: bool = None)

List the projects a Service Report belongs to

Parameters:
idint

The ID of the Service Report.

hiddenbool, optional

If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.

Returns:
civis.response.Response
  • idint

    The ID for this project.

  • authordict
    • 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.

  • namestr

    The name of this project.

  • descriptionstr

    A description of the project.

  • usersList[dict]

    Users who can see the project.

    • 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.

  • auto_share : bool

  • created_at : str (time)

  • updated_at : str (time)

  • archivedstr

    The archival status of the requested item(s).

list_services_shares(id: int)

List users and groups permissioned on this object

Parameters:
idint

The ID of the resource that is shared.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_shares(id: int)

List users and groups permissioned on this object

Parameters:
idint

The ID of the resource that is shared.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_sql_dependencies(id: int, *, user_id: int = None)

List dependent objects for this object

Parameters:
idint

The ID of the resource that is shared.

user_idint, optional

ID of target user

Returns:
civis.response.Response
  • object_typestr

    Dependent object type

  • fco_typestr

    Human readable dependent object type

  • idint

    Dependent object ID

  • namestr

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstr

    Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

  • descriptionstr

    Additional information about the dependency, if relevant

  • shareablebool

    Whether or not the requesting user can share this object.

list_sql_projects(id: int, *, hidden: bool = None)

List the projects a SQL Report belongs to

Parameters:
idint

The ID of the SQL Report.

hiddenbool, optional

If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.

Returns:
civis.response.Response
  • idint

    The ID for this project.

  • authordict
    • 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.

  • namestr

    The name of this project.

  • descriptionstr

    A description of the project.

  • usersList[dict]

    Users who can see the project.

    • 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.

  • auto_share : bool

  • created_at : str (time)

  • updated_at : str (time)

  • archivedstr

    The archival status of the requested item(s).

list_sql_shares(id: int)

List users and groups permissioned on this object

Parameters:
idint

The ID of the resource that is shared.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

patch(id: int, *, name: str = None, script_id: int = None, code_body: str = None, config: str = None, app_state: dict = None, provide_api_key: bool = None, template_id: int = None, use_viewers_tableau_username: bool = None, description: str = None)

Update a report

Parameters:
idint

The ID of the report to modify.

namestr, optional

The name of the report.

script_idint, optional

The ID of the job (a script or a query) used to create this report.

code_bodystr, optional

The code for the report visualization.

configstr, optional
app_statedict, optional

The application state blob for this report.

provide_api_keybool, optional

Allow the report to provide an API key to front-end code.

template_idint, optional

The ID of the template used for this report. If null is passed, no template will back this report. Changes to the backing template will reset the report appState.

use_viewers_tableau_usernamebool, optional

Apply user level filtering on Tableau reports.

descriptionstr, optional

The user-defined description of the report.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • projectsList[dict]

    A list of projects containing the report.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • statestr

    The status of the report’s last run.

  • finished_atstr (time)

    The time that the report’s last run finished.

  • viz_updated_atstr (time)

    The time that the report’s visualization was last updated.

  • scriptdict
    • idint

      The ID for the script.

    • namestr

      The name of the script.

    • sqlstr

      The raw SQL query for the script, if applicable.

  • job_pathstr

    The link to details of the job that backs this report.

  • tableau_id : int

  • template_idint

    The ID of the template used for this report.

  • auth_thumbnail_urlstr

    URL for a thumbnail of the report.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • hiddenbool

    The hidden status of the item.

  • auth_data_urlstr

    DEPRECATED: For legacy reports

  • auth_code_urlstr

    Link to code to render in the report.

  • configstr

    Any configuration metadata for this report.

  • valid_output_filebool

    Whether the job (a script or a query) that backs the report currently has a valid output file.

  • provide_api_keybool

    Whether the report requests an API Key from the report viewer.

  • api_keystr

    A Civis API key that can be used by this report.

  • api_key_idint

    The ID of the API key. Can be used for auditing API use by this report.

  • app_statedict

    Any application state blob for this report.

  • use_viewers_tableau_usernamebool

    Apply user level filtering on Tableau reports.

patch_git(id: int, *, git_ref: str = None, git_branch: str = None, git_path: str = None, git_repo_url: str = None, git_ref_type: str = None, pull_from_git: bool = None)

Update an attached git file

Parameters:
idint

The ID of the item.

git_refstr, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstr, optional

The git branch that the file is on.

git_pathstr, optional

The path of the file in the repository.

git_repo_urlstr, optional

The URL of the git repository.

git_ref_typestr, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitbool, optional

Automatically pull latest commit from git. Only works for scripts.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

patch_services(id: int, *, name: str = None, provide_api_key: bool = None)

Update some attributes of this service report

Parameters:
idint

The ID of this report.

namestr, optional

The name of the service report.

provide_api_keybool, optional

Whether the report requests an API Key from the report viewer.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • hoststr

    The host for the service report

  • display_urlstr

    The URL to display the service report.

  • service_idint

    The id of the backing service

  • provide_api_keybool

    Whether the report requests an API Key from the report viewer.

  • api_keystr

    A Civis API key that can be used by this report.

  • api_key_idint

    The ID of the API key. Can be used for auditing API use by this report.

patch_sql(id: int, *, query_id: int = None, name: str = None, config: str = None, description: str = None)

Update a SQL report

Parameters:
idint

The ID of this report.

query_idint, optional

The ID of the query used to create this report.

namestr, optional

The name of the report.

configstr, optional

The configuration of the report visualization.

descriptionstr, optional

The user-defined description of the report.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • configstr

    The configuration of the report visualization.

  • querydict
    • idint

      The query ID.

    • databaseint

      The database ID.

    • sqlstr

      The SQL to execute.

    • credentialint

      The credential ID.

    • result_rowsList[List]

      A preview of rows returned by the query.

    • result_columnsList[str]

      A preview of columns returned by the query.

    • errorstr

      The error message for this run, if present.

    • started_atstr (date-time)

      The start time of the last run.

    • finished_atstr (date-time)

      The end time of the last run.

    • statestr

      The state of the last run. One of queued, running, succeeded, failed, and cancelled.

    • running_asdict
      • 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(*, script_id: int = None, name: str = None, code_body: str = None, app_state: dict = None, provide_api_key: bool = None, template_id: int = None, description: str = None, hidden: bool = None)

Create an HTML report

Parameters:
script_idint, optional

The ID of the job (a script or a query) used to create this report.

namestr, optional

The name of the report.

code_bodystr, optional

The code for the report visualization.

app_statedict, optional

Any application state blob for this report.

provide_api_keybool, optional

Allow the report to provide an API key to front-end code.

template_idint, optional

The ID of the template used for this report.

descriptionstr, optional

The user-defined description of the report.

hiddenbool, optional

The hidden status of the item.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • projectsList[dict]

    A list of projects containing the report.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • statestr

    The status of the report’s last run.

  • finished_atstr (time)

    The time that the report’s last run finished.

  • viz_updated_atstr (time)

    The time that the report’s visualization was last updated.

  • scriptdict
    • idint

      The ID for the script.

    • namestr

      The name of the script.

    • sqlstr

      The raw SQL query for the script, if applicable.

  • job_pathstr

    The link to details of the job that backs this report.

  • tableau_id : int

  • template_idint

    The ID of the template used for this report.

  • auth_thumbnail_urlstr

    URL for a thumbnail of the report.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • hiddenbool

    The hidden status of the item.

  • auth_data_urlstr

    DEPRECATED: For legacy reports

  • auth_code_urlstr

    Link to code to render in the report.

  • configstr

    Any configuration metadata for this report.

  • valid_output_filebool

    Whether the job (a script or a query) that backs the report currently has a valid output file.

  • provide_api_keybool

    Whether the report requests an API Key from the report viewer.

  • api_keystr

    A Civis API key that can be used by this report.

  • api_key_idint

    The ID of the API key. Can be used for auditing API use by this report.

  • app_statedict

    Any application state blob for this report.

  • use_viewers_tableau_usernamebool

    Apply user level filtering on Tableau reports.

post_git_checkout(id: int)

Checkout content that the existing git_ref points to and save to the object

Parameters:
idint

The ID of the item.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_git_checkout_latest(id: int)

Checkout latest commit on the current branch of a script or workflow

Parameters:
idint

The ID of the item.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_git_commits(id: int, content: str, message: str, file_hash: str)

Commit and push a new version of the file

Parameters:
idint

The ID of the item.

contentstr

The contents to commit to the file.

messagestr

A commit message describing the changes being made.

file_hashstr

The full SHA of the file being replaced.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_grants(id: int)

Grant this report the ability to perform Civis platform API operations on your behalf

Parameters:
idint

The ID of this report.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • projectsList[dict]

    A list of projects containing the report.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • statestr

    The status of the report’s last run.

  • finished_atstr (time)

    The time that the report’s last run finished.

  • viz_updated_atstr (time)

    The time that the report’s visualization was last updated.

  • scriptdict
    • idint

      The ID for the script.

    • namestr

      The name of the script.

    • sqlstr

      The raw SQL query for the script, if applicable.

  • job_pathstr

    The link to details of the job that backs this report.

  • tableau_id : int

  • template_idint

    The ID of the template used for this report.

  • auth_thumbnail_urlstr

    URL for a thumbnail of the report.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • hiddenbool

    The hidden status of the item.

  • auth_data_urlstr

    DEPRECATED: For legacy reports

  • auth_code_urlstr

    Link to code to render in the report.

  • configstr

    Any configuration metadata for this report.

  • valid_output_filebool

    Whether the job (a script or a query) that backs the report currently has a valid output file.

  • provide_api_keybool

    Whether the report requests an API Key from the report viewer.

  • api_keystr

    A Civis API key that can be used by this report.

  • api_key_idint

    The ID of the API key. Can be used for auditing API use by this report.

  • app_statedict

    Any application state blob for this report.

  • use_viewers_tableau_usernamebool

    Apply user level filtering on Tableau reports.

post_refresh(id: int)

Refresh the data in this Tableau report

Parameters:
idint

The ID of this report.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • organizationdict
    • idint

      The ID of this organization.

    • tableau_refresh_usageint

      The number of tableau refreshes used this month.

    • tableau_refresh_limitint

      The number of monthly tableau refreshes permitted to this organization.

    • tableau_refresh_historyList[dict]

      The number of tableau refreshes used this month.

post_services(service_id: int, *, provide_api_key: bool = None)

Create a service report

Parameters:
service_idint

The id of the backing service

provide_api_keybool, optional

Whether the report requests an API Key from the report viewer.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • hoststr

    The host for the service report

  • display_urlstr

    The URL to display the service report.

  • service_idint

    The id of the backing service

  • provide_api_keybool

    Whether the report requests an API Key from the report viewer.

  • api_keystr

    A Civis API key that can be used by this report.

  • api_key_idint

    The ID of the API key. Can be used for auditing API use by this report.

post_sql(query_id: int, name: str, config: str, *, description: str = None)

Create a SQL report

Parameters:
query_idint

The ID of the query used to create this report.

namestr

The name of the report.

configstr

The configuration of the report visualization.

descriptionstr, optional

The user-defined description of the report.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • configstr

    The configuration of the report visualization.

  • querydict
    • idint

      The query ID.

    • databaseint

      The database ID.

    • sqlstr

      The SQL to execute.

    • credentialint

      The credential ID.

    • result_rowsList[List]

      A preview of rows returned by the query.

    • result_columnsList[str]

      A preview of columns returned by the query.

    • errorstr

      The error message for this run, if present.

    • started_atstr (date-time)

      The start time of the last run.

    • finished_atstr (date-time)

      The end time of the last run.

    • statestr

      The state of the last run. One of queued, running, succeeded, failed, and cancelled.

    • running_asdict
      • 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_sql_refresh(id: int)

Refresh the data in a SQL report

Parameters:
idint

The ID of this report.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • configstr

    The configuration of the report visualization.

  • querydict
    • idint

      The query ID.

    • databaseint

      The database ID.

    • sqlstr

      The SQL to execute.

    • credentialint

      The credential ID.

    • result_rowsList[List]

      A preview of rows returned by the query.

    • result_columnsList[str]

      A preview of columns returned by the query.

    • errorstr

      The error message for this run, if present.

    • started_atstr (date-time)

      The start time of the last run.

    • finished_atstr (date-time)

      The end time of the last run.

    • statestr

      The state of the last run. One of queued, running, succeeded, failed, and cancelled.

    • running_asdict
      • 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.

put_archive(id: int, status: bool)

Update the archive status of this object

Parameters:
idint

The ID of the object.

statusbool

The desired archived status of the object.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • projectsList[dict]

    A list of projects containing the report.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • statestr

    The status of the report’s last run.

  • finished_atstr (time)

    The time that the report’s last run finished.

  • viz_updated_atstr (time)

    The time that the report’s visualization was last updated.

  • scriptdict
    • idint

      The ID for the script.

    • namestr

      The name of the script.

    • sqlstr

      The raw SQL query for the script, if applicable.

  • job_pathstr

    The link to details of the job that backs this report.

  • tableau_id : int

  • template_idint

    The ID of the template used for this report.

  • auth_thumbnail_urlstr

    URL for a thumbnail of the report.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • hiddenbool

    The hidden status of the item.

  • auth_data_urlstr

    DEPRECATED: For legacy reports

  • auth_code_urlstr

    Link to code to render in the report.

  • configstr

    Any configuration metadata for this report.

  • valid_output_filebool

    Whether the job (a script or a query) that backs the report currently has a valid output file.

  • provide_api_keybool

    Whether the report requests an API Key from the report viewer.

  • api_keystr

    A Civis API key that can be used by this report.

  • api_key_idint

    The ID of the API key. Can be used for auditing API use by this report.

  • app_statedict

    Any application state blob for this report.

  • use_viewers_tableau_usernamebool

    Apply user level filtering on Tableau reports.

put_git(id: int, *, git_ref: str = None, git_branch: str = None, git_path: str = None, git_repo_url: str = None, git_ref_type: str = None, pull_from_git: bool = None)

Attach an item to a file in a git repo

Parameters:
idint

The ID of the item.

git_refstr, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstr, optional

The git branch that the file is on.

git_pathstr, optional

The path of the file in the repository.

git_repo_urlstr, optional

The URL of the git repository.

git_ref_typestr, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitbool, optional

Automatically pull latest commit from git. Only works for scripts.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

put_projects(id: int, project_id: int)

Add a Report to a project

Parameters:
idint

The ID of the Report.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

put_services_archive(id: int, status: bool)

Update the archive status of this object

Parameters:
idint

The ID of the object.

statusbool

The desired archived status of the object.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • hoststr

    The host for the service report

  • display_urlstr

    The URL to display the service report.

  • service_idint

    The id of the backing service

  • provide_api_keybool

    Whether the report requests an API Key from the report viewer.

  • api_keystr

    A Civis API key that can be used by this report.

  • api_key_idint

    The ID of the API key. Can be used for auditing API use by this report.

put_services_projects(id: int, project_id: int)

Add a Service Report to a project

Parameters:
idint

The ID of the Service Report.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

put_services_shares_groups(id: int, group_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions groups has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idsList[int]

An array of one or more group IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_services_shares_users(id: int, user_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions users have on this object

Parameters:
idint

The ID of the resource that is shared.

user_idsList[int]

An array of one or more user IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_services_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None)

Transfer ownership of this object to another user

Parameters:
idint

The ID of the resource that is shared.

user_idint

ID of target user

include_dependenciesbool

Whether or not to give manage permissions on all dependencies

email_bodystr, optional

Custom body text for e-mail sent on transfer.

send_emailbool, optional

Send email to the target user of the transfer?

Returns:
civis.response.Response
  • dependenciesList[dict]

    Dependent objects for this object

    • object_typestr

      Dependent object type

    • fco_typestr

      Human readable dependent object type

    • idint

      Dependent object ID

    • namestr

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstr

      Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

    • descriptionstr

      Additional information about the dependency, if relevant

    • sharedbool

      Whether dependent object was successfully shared with target user

put_shares_groups(id: int, group_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions groups has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idsList[int]

An array of one or more group IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id: int, user_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions users have on this object

Parameters:
idint

The ID of the resource that is shared.

user_idsList[int]

An array of one or more user IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_sql_archive(id: int, status: bool)

Update the archive status of this object

Parameters:
idint

The ID of the object.

statusbool

The desired archived status of the object.

Returns:
civis.response.Response
  • idint

    The ID of this report.

  • namestr

    The name of the report.

  • userdict
    • 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.

  • created_atstr (time)

    The creation time for this report.

  • updated_atstr (time)

    The last updated at time for this report.

  • typestr

    The type of the report. One of: ReportTypes::HTML, ReportTypes::Tableau, ReportTypes::ShinyApp, ReportTypes::SQL

  • descriptionstr

    The user-defined description of the report.

  • my_permission_levelstr

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

  • archivedstr

    The archival status of the requested item(s).

  • configstr

    The configuration of the report visualization.

  • querydict
    • idint

      The query ID.

    • databaseint

      The database ID.

    • sqlstr

      The SQL to execute.

    • credentialint

      The credential ID.

    • result_rowsList[List]

      A preview of rows returned by the query.

    • result_columnsList[str]

      A preview of columns returned by the query.

    • errorstr

      The error message for this run, if present.

    • started_atstr (date-time)

      The start time of the last run.

    • finished_atstr (date-time)

      The end time of the last run.

    • statestr

      The state of the last run. One of queued, running, succeeded, failed, and cancelled.

    • running_asdict
      • 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.

put_sql_projects(id: int, project_id: int)

Add a SQL Report to a project

Parameters:
idint

The ID of the SQL Report.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

put_sql_shares_groups(id: int, group_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions groups has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idsList[int]

An array of one or more group IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_sql_shares_users(id: int, user_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions users have on this object

Parameters:
idint

The ID of the resource that is shared.

user_idsList[int]

An array of one or more user IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_sql_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None)

Transfer ownership of this object to another user

Parameters:
idint

The ID of the resource that is shared.

user_idint

ID of target user

include_dependenciesbool

Whether or not to give manage permissions on all dependencies

email_bodystr, optional

Custom body text for e-mail sent on transfer.

send_emailbool, optional

Send email to the target user of the transfer?

Returns:
civis.response.Response
  • dependenciesList[dict]

    Dependent objects for this object

    • object_typestr

      Dependent object type

    • fco_typestr

      Human readable dependent object type

    • idint

      Dependent object ID

    • namestr

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstr

      Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

    • descriptionstr

      Additional information about the dependency, if relevant

    • sharedbool

      Whether dependent object was successfully shared with target user

put_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None)

Transfer ownership of this object to another user

Parameters:
idint

The ID of the resource that is shared.

user_idint

ID of target user

include_dependenciesbool

Whether or not to give manage permissions on all dependencies

email_bodystr, optional

Custom body text for e-mail sent on transfer.

send_emailbool, optional

Send email to the target user of the transfer?

Returns:
civis.response.Response
  • dependenciesList[dict]

    Dependent objects for this object

    • object_typestr

      Dependent object type

    • fco_typestr

      Human readable dependent object type

    • idint

      Dependent object ID

    • namestr

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstr

      Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

    • descriptionstr

      Additional information about the dependency, if relevant

    • sharedbool

      Whether dependent object was successfully shared with target user