Skip to content

Response Types

There are three different available output formats you can choose from:

Serialized Response

By default, the client returns fully serialized responses as Pydantic models.

await client.server.get_about_info() # (1)!
  1. See ServerApi.get_about_info for more details.
ServerAboutResponseDto(
    build='20375083601',
    build_image='main',
    ...
    version='v2.4.1',
    version_url='https://github.com/immich-app/immich/releases/tag/v2.4.1'
)

Serialized Response with HTTP Info

To get additional metadata about the HTTP response, you can suffix the function name with _with_http_info. This returns an ApiResponse object.

await client.server.get_about_info_with_http_info() # (1)!
  1. See ServerApi.get_about_info_with_http_info for more details.
ApiResponse(
    status_code=200,
    headers={'Content-Type': 'application/json'},
    data=ServerAboutResponseDto(
        build='20375083601',
        build_image='main',
        ...
        version='v2.4.1',
        version_url='https://github.com/immich-app/immich/releases/tag/v2.4.1'
    ),
    raw_data=b'{"build":"20375083601","buildImage":"main",...}'
)

JSON Response

To receive a classical JSON response, you can suffix the function name with _without_preload_content. This returns a RESTResponseType object, which needs to be awaited to get the JSON data.

response = await client.server.get_about_info_without_preload_content() # (1)!
await response.json()
  1. See ServerApi.get_about_info_without_preload_content for more details.
{
    "build": "20375083601",
    "buildImage": "main",
    ...
    "version": "v2.4.1",
    "versionUrl": "https://github.com/immich-app/immich/releases/tag/v2.4.1"
}