Skip to content

config

DEFAULT_REGION = Region.US module-attribute

The default Nylas API region.

DEFAULT_SERVER_URL = REGION_CONFIG[DEFAULT_REGION]['nylasApiUrl'] module-attribute

The default Nylas API URL.

REGION_CONFIG = {Region.US: {'nylasApiUrl': 'https://api.us.nylas.com'}, Region.EU: {'nylasApiUrl': 'https://api.eu.nylas.com'}} module-attribute

The available preset configuration values for each Nylas API region.

Region

Bases: str, Enum

Enum representing the regions supported by the Nylas API

Source code in nylas/config.py
 7
 8
 9
10
11
12
13
class Region(str, Enum):
    """
    Enum representing the regions supported by the Nylas API
    """

    US = "us"
    EU = "eu"

RequestOverrides

Bases: TypedDict

Overrides to use for an outgoing request to the Nylas API

Attributes:

Name Type Description
api_key NotRequired[str]

The API key to use for the request.

api_uri NotRequired[str]

The API URI to use for the request.

timeout NotRequired[int]

The timeout to use for the request.

headers NotRequired[dict]

Additional headers to include in the request.

Source code in nylas/config.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class RequestOverrides(TypedDict):
    """
    Overrides to use for an outgoing request to the Nylas API

    Attributes:
        api_key: The API key to use for the request.
        api_uri: The API URI to use for the request.
        timeout: The timeout to use for the request.
        headers: Additional headers to include in the request.
    """

    api_key: NotRequired[str]
    api_uri: NotRequired[str]
    timeout: NotRequired[int]
    headers: NotRequired[dict]