Files
immich-to-cloud-exporter/generated/immich/openapi_client/docs/UsersAdminApi.md
T

36 KiB

generated.immich.openapi_client.UsersAdminApi

All URIs are relative to https://github.com/api

Method HTTP request Description
create_user_admin POST /admin/users Create a user
delete_user_admin DELETE /admin/users/{id} Delete a user
get_user_admin GET /admin/users/{id} Retrieve a user
get_user_calendar_heatmap_admin GET /admin/users/{id}/calendar-heatmap Retrieve calendar heatmap activity
get_user_preferences_admin GET /admin/users/{id}/preferences Retrieve user preferences
get_user_sessions_admin GET /admin/users/{id}/sessions Retrieve user sessions
get_user_statistics_admin GET /admin/users/{id}/statistics Retrieve user statistics
restore_user_admin POST /admin/users/{id}/restore Restore a deleted user
search_users_admin GET /admin/users Search users
update_user_admin PUT /admin/users/{id} Update a user
update_user_preferences_admin PUT /admin/users/{id}/preferences Update user preferences

create_user_admin

UserAdminResponseDto create_user_admin(user_admin_create_dto)

Create a user

Create a new user.

Example

  • Api Key Authentication (cookie):
  • Api Key Authentication (api_key):
  • Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.user_admin_create_dto import UserAdminCreateDto
from generated.immich.openapi_client.models.user_admin_response_dto import UserAdminResponseDto
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
    host = "https://github.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'

# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'

# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = generated.immich.openapi_client.UsersAdminApi(api_client)
    user_admin_create_dto = generated.immich.openapi_client.UserAdminCreateDto() # UserAdminCreateDto | 

    try:
        # Create a user
        api_response = api_instance.create_user_admin(user_admin_create_dto)
        print("The response of UsersAdminApi->create_user_admin:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersAdminApi->create_user_admin: %s\n" % e)

Parameters

Name Type Description Notes
user_admin_create_dto UserAdminCreateDto

Return type

UserAdminResponseDto

Authorization

cookie, api_key, bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_user_admin

UserAdminResponseDto delete_user_admin(id, user_admin_delete_dto)

Delete a user

Delete a user.

Example

  • Api Key Authentication (cookie):
  • Api Key Authentication (api_key):
  • Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.user_admin_delete_dto import UserAdminDeleteDto
from generated.immich.openapi_client.models.user_admin_response_dto import UserAdminResponseDto
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
    host = "https://github.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'

# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'

# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = generated.immich.openapi_client.UsersAdminApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    user_admin_delete_dto = generated.immich.openapi_client.UserAdminDeleteDto() # UserAdminDeleteDto | 

    try:
        # Delete a user
        api_response = api_instance.delete_user_admin(id, user_admin_delete_dto)
        print("The response of UsersAdminApi->delete_user_admin:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersAdminApi->delete_user_admin: %s\n" % e)

Parameters

Name Type Description Notes
id UUID
user_admin_delete_dto UserAdminDeleteDto

Return type

UserAdminResponseDto

Authorization

cookie, api_key, bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_user_admin

UserAdminResponseDto get_user_admin(id)

Retrieve a user

Retrieve a specific user by their ID.

Example

  • Api Key Authentication (cookie):
  • Api Key Authentication (api_key):
  • Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.user_admin_response_dto import UserAdminResponseDto
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
    host = "https://github.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'

# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'

# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = generated.immich.openapi_client.UsersAdminApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 

    try:
        # Retrieve a user
        api_response = api_instance.get_user_admin(id)
        print("The response of UsersAdminApi->get_user_admin:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersAdminApi->get_user_admin: %s\n" % e)

Parameters

Name Type Description Notes
id UUID

Return type

UserAdminResponseDto

Authorization

cookie, api_key, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_user_calendar_heatmap_admin

CalendarHeatmapResponseDto get_user_calendar_heatmap_admin(id, var_from=var_from, to=to, type=type)

Retrieve calendar heatmap activity

Retrieve activity counts for a specified period, in a calendar heatmap format.

Example

  • Api Key Authentication (cookie):
  • Api Key Authentication (api_key):
  • Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.calendar_heatmap_response_dto import CalendarHeatmapResponseDto
from generated.immich.openapi_client.models.calendar_heatmap_type import CalendarHeatmapType
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
    host = "https://github.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'

# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'

# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = generated.immich.openapi_client.UsersAdminApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    var_from = 'Mon Jan 01 00:00:00 UTC 2024' # date | Start date in UTC (optional)
    to = 'Mon Jan 01 00:00:00 UTC 2024' # date | End date in UTC (optional)
    type = generated.immich.openapi_client.CalendarHeatmapType() # CalendarHeatmapType |  (optional)

    try:
        # Retrieve calendar heatmap activity
        api_response = api_instance.get_user_calendar_heatmap_admin(id, var_from=var_from, to=to, type=type)
        print("The response of UsersAdminApi->get_user_calendar_heatmap_admin:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersAdminApi->get_user_calendar_heatmap_admin: %s\n" % e)

Parameters

Name Type Description Notes
id UUID
var_from date Start date in UTC [optional]
to date End date in UTC [optional]
type CalendarHeatmapType [optional]

Return type

CalendarHeatmapResponseDto

Authorization

cookie, api_key, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_user_preferences_admin

UserPreferencesResponseDto get_user_preferences_admin(id)

Retrieve user preferences

Retrieve the preferences of a specific user.

Example

  • Api Key Authentication (cookie):
  • Api Key Authentication (api_key):
  • Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.user_preferences_response_dto import UserPreferencesResponseDto
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
    host = "https://github.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'

# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'

# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = generated.immich.openapi_client.UsersAdminApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 

    try:
        # Retrieve user preferences
        api_response = api_instance.get_user_preferences_admin(id)
        print("The response of UsersAdminApi->get_user_preferences_admin:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersAdminApi->get_user_preferences_admin: %s\n" % e)

Parameters

Name Type Description Notes
id UUID

Return type

UserPreferencesResponseDto

Authorization

cookie, api_key, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_user_sessions_admin

List[SessionResponseDto] get_user_sessions_admin(id)

Retrieve user sessions

Retrieve all sessions for a specific user.

Example

  • Api Key Authentication (cookie):
  • Api Key Authentication (api_key):
  • Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.session_response_dto import SessionResponseDto
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
    host = "https://github.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'

# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'

# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = generated.immich.openapi_client.UsersAdminApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 

    try:
        # Retrieve user sessions
        api_response = api_instance.get_user_sessions_admin(id)
        print("The response of UsersAdminApi->get_user_sessions_admin:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersAdminApi->get_user_sessions_admin: %s\n" % e)

Parameters

Name Type Description Notes
id UUID

Return type

List[SessionResponseDto]

Authorization

cookie, api_key, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_user_statistics_admin

AssetStatsResponseDto get_user_statistics_admin(id, is_favorite=is_favorite, is_trashed=is_trashed, visibility=visibility)

Retrieve user statistics

Retrieve asset statistics for a specific user.

Example

  • Api Key Authentication (cookie):
  • Api Key Authentication (api_key):
  • Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.asset_stats_response_dto import AssetStatsResponseDto
from generated.immich.openapi_client.models.asset_visibility import AssetVisibility
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
    host = "https://github.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'

# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'

# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = generated.immich.openapi_client.UsersAdminApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    is_favorite = True # bool | Filter by favorite status (optional)
    is_trashed = True # bool | Filter by trash status (optional)
    visibility = generated.immich.openapi_client.AssetVisibility() # AssetVisibility |  (optional)

    try:
        # Retrieve user statistics
        api_response = api_instance.get_user_statistics_admin(id, is_favorite=is_favorite, is_trashed=is_trashed, visibility=visibility)
        print("The response of UsersAdminApi->get_user_statistics_admin:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersAdminApi->get_user_statistics_admin: %s\n" % e)

Parameters

Name Type Description Notes
id UUID
is_favorite bool Filter by favorite status [optional]
is_trashed bool Filter by trash status [optional]
visibility AssetVisibility [optional]

Return type

AssetStatsResponseDto

Authorization

cookie, api_key, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

restore_user_admin

UserAdminResponseDto restore_user_admin(id)

Restore a deleted user

Restore a previously deleted user.

Example

  • Api Key Authentication (cookie):
  • Api Key Authentication (api_key):
  • Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.user_admin_response_dto import UserAdminResponseDto
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
    host = "https://github.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'

# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'

# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = generated.immich.openapi_client.UsersAdminApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 

    try:
        # Restore a deleted user
        api_response = api_instance.restore_user_admin(id)
        print("The response of UsersAdminApi->restore_user_admin:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersAdminApi->restore_user_admin: %s\n" % e)

Parameters

Name Type Description Notes
id UUID

Return type

UserAdminResponseDto

Authorization

cookie, api_key, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

search_users_admin

List[UserAdminResponseDto] search_users_admin(id=id, with_deleted=with_deleted)

Search users

Search for users.

Example

  • Api Key Authentication (cookie):
  • Api Key Authentication (api_key):
  • Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.user_admin_response_dto import UserAdminResponseDto
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
    host = "https://github.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'

# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'

# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = generated.immich.openapi_client.UsersAdminApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | User ID filter (optional)
    with_deleted = True # bool | Include deleted users (optional)

    try:
        # Search users
        api_response = api_instance.search_users_admin(id=id, with_deleted=with_deleted)
        print("The response of UsersAdminApi->search_users_admin:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersAdminApi->search_users_admin: %s\n" % e)

Parameters

Name Type Description Notes
id UUID User ID filter [optional]
with_deleted bool Include deleted users [optional]

Return type

List[UserAdminResponseDto]

Authorization

cookie, api_key, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_user_admin

UserAdminResponseDto update_user_admin(id, user_admin_update_dto)

Update a user

Update an existing user.

Example

  • Api Key Authentication (cookie):
  • Api Key Authentication (api_key):
  • Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.user_admin_response_dto import UserAdminResponseDto
from generated.immich.openapi_client.models.user_admin_update_dto import UserAdminUpdateDto
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
    host = "https://github.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'

# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'

# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = generated.immich.openapi_client.UsersAdminApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    user_admin_update_dto = generated.immich.openapi_client.UserAdminUpdateDto() # UserAdminUpdateDto | 

    try:
        # Update a user
        api_response = api_instance.update_user_admin(id, user_admin_update_dto)
        print("The response of UsersAdminApi->update_user_admin:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersAdminApi->update_user_admin: %s\n" % e)

Parameters

Name Type Description Notes
id UUID
user_admin_update_dto UserAdminUpdateDto

Return type

UserAdminResponseDto

Authorization

cookie, api_key, bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_user_preferences_admin

UserPreferencesResponseDto update_user_preferences_admin(id, user_preferences_update_dto)

Update user preferences

Update the preferences of a specific user.

Example

  • Api Key Authentication (cookie):
  • Api Key Authentication (api_key):
  • Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.user_preferences_response_dto import UserPreferencesResponseDto
from generated.immich.openapi_client.models.user_preferences_update_dto import UserPreferencesUpdateDto
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
    host = "https://github.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'

# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'

# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = generated.immich.openapi_client.UsersAdminApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    user_preferences_update_dto = generated.immich.openapi_client.UserPreferencesUpdateDto() # UserPreferencesUpdateDto | 

    try:
        # Update user preferences
        api_response = api_instance.update_user_preferences_admin(id, user_preferences_update_dto)
        print("The response of UsersAdminApi->update_user_preferences_admin:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersAdminApi->update_user_preferences_admin: %s\n" % e)

Parameters

Name Type Description Notes
id UUID
user_preferences_update_dto UserPreferencesUpdateDto

Return type

UserPreferencesResponseDto

Authorization

cookie, api_key, bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]