def to_iso_8601_format(dt):
    """
    Convert the supplied datetime instance to the ISO 8601 format as per API specs.

    :param dt: The datetime instance to convert.
    :return: Supplied datetime as timestamp in ISO 8601 format.
    """
    if not dt:
        return
    if isinstance(dt, str):
        return dt
    return dt.strftime('%Y-%m-%dT%H:%M:%SZ')