listNotes method

Future<NoteListEnvelope?> listNotes({
  1. String? accountId,
  2. String? provider,
  3. String? xWorkspaceID,
  4. bool? archived,
  5. String? parentId,
  6. List<String>? tags,
  7. int? limit,
  8. int? offset,
  9. String? sortBy,
  10. String? sortOrder,
})

List notes across connected accounts.

Fan-out list. Returns every note visible to the caller across every connected notes provider, paginated by limit / offset. Pass ?accountId= or ?provider= to scope to a single source.

Parameters:

  • String accountId: Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with provider. If omitted on a list endpoint the call fans out across every connected account.

  • String provider: Provider id (e.g. native-notes, notion). Selects every connected account for the provider. Mutually exclusive with accountId.

  • String xWorkspaceID: Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

  • bool archived: When true, return archived notes instead of active ones.

  • String parentId: Filter to notes nested under this parent note id.

  • List<String> tags: Repeatable. Filter to notes carrying every tag listed.

  • int limit: Max items to return. Defaults to 50.

  • int offset: Number of items to skip.

  • String sortBy: Sort field. Provider-dependent; the native provider supports updated_at, created_at, title.

  • String sortOrder:

Implementation

Future<NoteListEnvelope?> listNotes({ String? accountId, String? provider, String? xWorkspaceID, bool? archived, String? parentId, List<String>? tags, int? limit, int? offset, String? sortBy, String? sortOrder, }) async {
  final response = await listNotesWithHttpInfo( accountId: accountId, provider: provider, xWorkspaceID: xWorkspaceID, archived: archived, parentId: parentId, tags: tags, limit: limit, offset: offset, sortBy: sortBy, sortOrder: sortOrder, );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'NoteListEnvelope',) as NoteListEnvelope;

  }
  return null;
}