Skip to content

sessions

Sessions

Bases: CreatableApiResource, DestroyableApiResource

Nylas Sessions API

The Nylas Sessions API allows you to create new sessions or manage existing ones.

Source code in nylas/resources/sessions.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class Sessions(CreatableApiResource, DestroyableApiResource):
    """
    Nylas Sessions API

    The Nylas Sessions API allows you to create new sessions or manage existing ones.
    """

    def create(
        self,
        request_body: CreateSessionRequest,
        overrides: RequestOverrides = None,
    ) -> Response[Session]:
        """
        Create a Session.

        Args:
          request_body: The request body to create the Session.
          overrides: The request overrides to use for the request.

        Returns:
          The Session.
        """

        return super().create(
            path="/v3/scheduling/sessions",
            request_body=request_body,
            response_type=Session,
            overrides=overrides,
        )

    def destroy(
        self,
        session_id: str,
        overrides: RequestOverrides = None,
    ) -> DeleteResponse:
        """
        Destroy a Session.

        Args:
          session_id: The identifier of the Session to destroy.
          overrides: The request overrides to use for the request.

        Returns:
          None.
        """

        return super().destroy(
            path=f"/v3/scheduling/sessions/{session_id}",
            overrides=overrides,
        )

create(request_body, overrides=None)

Create a Session.

Parameters:

Name Type Description Default
request_body CreateSessionRequest

The request body to create the Session.

required
overrides RequestOverrides

The request overrides to use for the request.

None

Returns:

Type Description
Response[Session]

The Session.

Source code in nylas/resources/sessions.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def create(
    self,
    request_body: CreateSessionRequest,
    overrides: RequestOverrides = None,
) -> Response[Session]:
    """
    Create a Session.

    Args:
      request_body: The request body to create the Session.
      overrides: The request overrides to use for the request.

    Returns:
      The Session.
    """

    return super().create(
        path="/v3/scheduling/sessions",
        request_body=request_body,
        response_type=Session,
        overrides=overrides,
    )

destroy(session_id, overrides=None)

Destroy a Session.

Parameters:

Name Type Description Default
session_id str

The identifier of the Session to destroy.

required
overrides RequestOverrides

The request overrides to use for the request.

None

Returns:

Type Description
DeleteResponse

None.

Source code in nylas/resources/sessions.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
def destroy(
    self,
    session_id: str,
    overrides: RequestOverrides = None,
) -> DeleteResponse:
    """
    Destroy a Session.

    Args:
      session_id: The identifier of the Session to destroy.
      overrides: The request overrides to use for the request.

    Returns:
      None.
    """

    return super().destroy(
        path=f"/v3/scheduling/sessions/{session_id}",
        overrides=overrides,
    )