Skip to main content

activities

Creates, updates, deletes, gets or lists an activities resource.

Overview

Nameactivities
TypeResource
Idclickhouse.organizations.activities

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringUnique activity ID.
actor_idstringUnique actor ID. (wire: actorId)
organization_idstringScope of the activity: organization ID this activity is related to. (wire: organizationId)
service_idstringScope of the activity: service ID this activity is related to. (wire: serviceId)
target_key_idstringFor 'openapi_key_update' activities: the ID of the API key that was updated. (wire: targetKeyId)
actor_detailsstringAdditional information about the actor. (wire: actorDetails)
actor_ip_addressstringIP address of the actor. Defined for 'user' and 'api' actor types. (wire: actorIpAddress)
actor_typestringType of the actor: 'user', 'support', 'system', 'api'. (user, support, system, api) (wire: actorType)
created_atstring (date-time)Timestamp of the activity. ISO-8601. (wire: createdAt)
key_update_typestringFor 'openapi_key_update' activities: the type of update that was performed. (created, deleted, name-changed, role-changed, state-changed, date-changed, ip-access-list-changed, org-role-changed, default-service-role-changed, service-role-changed, roles-v2-changed) (wire: keyUpdateType)
target_actor_idsarrayFor 'organization_member_update_roles' and 'organization_member_remove_roles' activities: IDs of the affected actors (e.g. 'user/<id>'). (wire: targetActorIds)
target_resource_idsarrayFor 'role_resources_delete' activities: IDs of the deleted resources the roles referenced. (wire: targetResourceIds)
target_role_idsarrayFor role and actor-role activities: IDs of the affected roles. (wire: targetRoleIds)
target_role_namesarrayFor role and actor-role activities: names of the affected roles, when recorded. (wire: targetRoleNames)
typestringType of the activity. (create_organization, delete_organization, organization_update_name, transfer_service_in, transfer_service_out, save_payment_method, marketplace_subscription, migrate_marketplace_billing_details_in, migrate_marketplace_billing_details_out, organization_update_tier, organization_invite_create, organization_invite_delete, organization_member_join, organization_member_add, organization_member_leave, organization_member_delete, organization_member_update_role, organization_member_update_roles, organization_member_update_mfa_method, organization_saml_connection_create, organization_saml_connection_update, user_login, user_login_failed, user_logout, key_create, key_delete, openapi_key_update, service_create, service_start, service_stop, service_awaken, service_idle, service_running, service_partially_running, service_delete, service_update_name, service_update_ip_access_list, service_update_autoscaling_memory, service_update_autoscaling_idling, service_update_password, service_update_autoscaling_replicas, service_update_max_allowable_replicas, service_update_backup_configuration, service_restore_backup, service_update_release_channel, service_update_gpt_usage_consent, service_update_private_endpoints, service_import_to_organization, service_export_from_organization, service_maintenance_start, service_maintenance_end, service_update_core_dump, service_update_autoscaling_schedule, service_update_query_endpoints, service_update_direct_connection, service_update_sql_console_jwt_auth, service_update_snapshot_configuration, service_update_collector_ip_access_list, service_update_mysql_interface, service_update_upgrade_window, service_delete_upgrade_window, service_trigger_failover, service_trigger_recovery, service_mcp_enabled, service_mcp_disabled, service_upgrade, service_scaled_down_for_tier_change, service_encryption_key_check_failed, service_encryption_key_rotation_failed, service_encryption_key_rotated, service_stop_encryption_key_inaccessible, service_restart_encryption_key_rotation, backup_delete, backup_bucket_create, backup_bucket_update, backup_bucket_delete, backup_bucket_archive, warehouse_update_name, warehouse_update_release_channel, role_create, role_update, role_delete, role_resources_delete, organization_member_remove_roles, scim_user_profile_update, scim_group_create, scim_group_update, scim_group_delete, organization_saml_connection_delete, datadog_integration_create, datadog_integration_delete, organization_update_spend_alert, organization_update_core_dumps, organization_update_private_endpoints, organization_update_pci_compliance, organization_update_hipaa_status, transfer_credits_in, transfer_credits_out, promo_code_claim, schema_advisor_seed, schema_advisor_generate_plan, schema_advisor_approve_plan, schema_advisor_start_deployment, schema_advisor_start_benchmark, schema_advisor_run_benchmark, schema_advisor_start_promotion, schema_advisor_exchange_tables, schema_advisor_drop_sandbox, udf_create, udf_update, udf_delete, udf_version_create, udf_version_delete, udf_attach, udf_detach, udf_update_services, udf_redeploy, udf_rebuild)
user_agentstringUser agent of the actor (wire: userAgent)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectactivity_id, organization_idReturns a single organization activity by ID.
listselectorganization_idfrom_date, to_dateReturns a list of all organization activities.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
activity_idstringID of the requested activity. (wire: activityId)
organization_idstringClickHouse Cloud organization ID. Resolved from the CLICKHOUSE_ORG_ID environment variable when it is set (x-stackQL-envVar); otherwise it must be supplied on every query as WHERE organization_id = <uuid>. A WHERE value always takes precedence over the environment. (x-stackQL-envVar: CLICKHOUSE_ORG_ID)
from_datestring (date-time)A starting date for a search
to_datestring (date-time)An ending date for a search

SELECT examples

Returns a single organization activity by ID.

SELECT
id,
actor_id,
organization_id,
service_id,
target_key_id,
actor_details,
actor_ip_address,
actor_type,
created_at,
key_update_type,
target_actor_ids,
target_resource_ids,
target_role_ids,
target_role_names,
type,
user_agent
FROM clickhouse.organizations.activities
WHERE activity_id = '{{ activity_id }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
;