Skip to content

Latest commit

 

History

History
94 lines (61 loc) · 3.65 KB

File metadata and controls

94 lines (61 loc) · 3.65 KB

Users

(users)

Overview

Available Operations

  • get - Retrieve the current user
  • update - Update the current user

get

Retrieve the current user for the authenticated team.

Example Usage

from midday import Midday


with Midday(
    token="MIDDAY_API_KEY",
) as m_client:

    res = m_client.users.get()

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.GetCurrentUserResponse

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

update

Update the current user for the authenticated team.

Example Usage

from midday import Midday, models


with Midday(
    token="MIDDAY_API_KEY",
) as m_client:

    res = m_client.users.update(request={
        "full_name": "Jane Doe",
        "team_id": "team-abc123",
        "email": "jane.doe@acme.com",
        "avatar_url": "https://cdn.midday.ai/avatars/jane-doe.jpg",
        "locale": "en-US",
        "week_starts_on_monday": True,
        "timezone": "America/New_York",
        "time_format": 24,
        "date_format": models.DateFormatRequest.YYYY_DASH_MM_DASHDD,
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request models.UpdateCurrentUserRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.UpdateCurrentUserResponse

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*