> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cedarai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch get note summaries

> Returns note summaries for many entities in one round trip. Designed for list/grid pages that show a notes-count column. Entities with zero notes are omitted from the response.



## OpenAPI

````yaml /user-docs/api-reference/service.swagger.json post /v1/notes/batch-get-summaries
openapi: 3.0.1
info:
  title: protobuf/linda/service.proto
  version: version not set
servers:
  - description: Production (US)
    url: https://api.linda.cedarai.com
  - description: Production (EU)
    url: https://api.linda.cedarai.se
security: []
tags:
  - name: LindaService
paths:
  /v1/notes/batch-get-summaries:
    post:
      tags:
        - LindaService
      summary: Batch get note summaries
      description: >-
        Returns note summaries for many entities in one round trip. Designed for
        list/grid pages that show a notes-count column. Entities with zero notes
        are omitted from the response.
      operationId: BatchGetNoteSummaries
      parameters:
        - description: Carrier ID the request is scoped to.
          in: header
          name: Carrier
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/lindaBatchGetNoteSummariesReq'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/lindaBatchGetNoteSummariesResp'
          description: A successful response.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
          description: An unexpected error response.
      security:
        - ApiKeyAuth: []
          AssumeUserAuth: []
components:
  schemas:
    lindaBatchGetNoteSummariesReq:
      properties:
        entities:
          description: |-
            Entities to fetch summaries for. The server groups by entity type
            internally and runs one SQL query per type. No hard cap on the
            number of entries, but practical limits apply (page sizes of a few
            hundred entities per request are typical).
          items:
            $ref: '#/components/schemas/lindaEntityRef'
          type: array
      type: object
    lindaBatchGetNoteSummariesResp:
      properties:
        summaries:
          description: |-
            One summary per entity that has at least one note. **Entities with
            zero notes are omitted from the response** — clients should default
            missing entries to "0 notes" rather than expecting one row per
            requested entity.
          items:
            $ref: '#/components/schemas/lindaNoteSummaryEntry'
          type: array
      type: object
    rpcStatus:
      properties:
        code:
          format: int32
          type: integer
        details:
          items:
            $ref: '#/components/schemas/protobufAny'
          type: array
        message:
          type: string
      type: object
    lindaEntityRef:
      description: |-
        A lightweight `(entity_type, entity_id)` pair used by
        `BatchGetNoteSummaries` to fetch summaries for many entities at once.

        Example:

            { "entity_type": "shipment", "entity_id": "5f3c..." }
      properties:
        entity_id:
          description: |-
            Entity ID as a string. Format depends on entity type — see
            `NoteReference.entity_id` for the per-type breakdown.
          type: string
        entity_type:
          description: Entity type (e.g. `shipment`, `equipment`, `waybill`).
          type: string
      type: object
    lindaNoteSummaryEntry:
      description: |-
        One row of summary data for a single entity, returned by
        `GetNoteSummary` and `BatchGetNoteSummaries`. Designed for list-page
        badges and counters.
      properties:
        entity_id:
          description: The entity ID these summary numbers describe.
          type: string
        entity_type:
          description: The entity these summary numbers describe.
          type: string
        latest_note:
          $ref: '#/components/schemas/lindaNoteEntry'
        total_count:
          description: Total non-deleted notes on this entity.
          format: int32
          type: integer
      type: object
    protobufAny:
      additionalProperties:
        type: object
      description: >-
        `Any` contains an arbitrary serialized protocol buffer message along
        with a

        URL that describes the type of the serialized message.


        Protobuf library provides support to pack/unpack Any values in the form

        of utility functions or additional generated methods of the Any type.


        Example 1: Pack and unpack a message in C++.

            Foo foo = ...;
            Any any;
            any.PackFrom(foo);
            ...
            if (any.UnpackTo(&foo)) {
              ...
            }

        Example 2: Pack and unpack a message in Java.

            Foo foo = ...;
            Any any = Any.pack(foo);
            ...
            if (any.is(Foo.class)) {
              foo = any.unpack(Foo.class);
            }
            // or ...
            if (any.isSameTypeAs(Foo.getDefaultInstance())) {
              foo = any.unpack(Foo.getDefaultInstance());
            }

         Example 3: Pack and unpack a message in Python.

            foo = Foo(...)
            any = Any()
            any.Pack(foo)
            ...
            if any.Is(Foo.DESCRIPTOR):
              any.Unpack(foo)
              ...

         Example 4: Pack and unpack a message in Go

             foo := &pb.Foo{...}
             any, err := anypb.New(foo)
             if err != nil {
               ...
             }
             ...
             foo := &pb.Foo{}
             if err := any.UnmarshalTo(foo); err != nil {
               ...
             }

        The pack methods provided by protobuf library will by default use

        'type.googleapis.com/full.type.name' as the type URL and the unpack

        methods only use the fully qualified type name after the last '/'

        in the type URL, for example "foo.bar.com/x/y.z" will yield type

        name "y.z".


        JSON

        ====

        The JSON representation of an `Any` value uses the regular

        representation of the deserialized, embedded message, with an

        additional field `@type` which contains the type URL. Example:

            package google.profile;
            message Person {
              string first_name = 1;
              string last_name = 2;
            }

            {
              "@type": "type.googleapis.com/google.profile.Person",
              "firstName": <string>,
              "lastName": <string>
            }

        If the embedded message type is well-known and has a custom JSON

        representation, that representation will be embedded adding a field

        `value` which holds the custom JSON in addition to the `@type`

        field. Example (for message [google.protobuf.Duration][]):

            {
              "@type": "type.googleapis.com/google.protobuf.Duration",
              "value": "1.212s"
            }
      properties:
        '@type':
          description: >-
            A URL/resource name that uniquely identifies the type of the
            serialized

            protocol buffer message. This string must contain at least

            one "/" character. The last segment of the URL's path must represent

            the fully qualified name of the type (as in

            `path/google.protobuf.Duration`). The name should be in a canonical
            form

            (e.g., leading "." is not accepted).


            In practice, teams usually precompile into the binary all types that
            they

            expect it to use in the context of Any. However, for URLs which use
            the

            scheme `http`, `https`, or no scheme, one can optionally set up a
            type

            server that maps type URLs to message definitions as follows:


            * If no scheme is provided, `https` is assumed.

            * An HTTP GET on the URL must yield a [google.protobuf.Type][]
              value in binary format, or produce an error.
            * Applications are allowed to cache lookup results based on the
              URL, or have them precompiled into a binary to avoid any
              lookup. Therefore, binary compatibility needs to be preserved
              on changes to types. (Use versioned type names to manage
              breaking changes.)

            Note: this functionality is not currently available in the official

            protobuf release, and it is not used for type URLs beginning with

            type.googleapis.com. As of May 2023, there are no widely used type
            server

            implementations and no plans to implement one.


            Schemes other than `http`, `https` (or the empty scheme) might be

            used with implementation specific semantics.
          type: string
      type: object
    lindaNoteEntry:
      description: |-
        A single note in a thread. Threaded notes are anchored to an
        `(entity_type, entity_id)` pair and ordered by `created_at`.
      properties:
        attachments:
          description: >-
            File attachments. Each entry includes a fresh presigned download URL

            (1-hour TTL). Re-fetch the note rather than caching `url` past
            expiry.
          items:
            $ref: '#/components/schemas/lindaNoteAttachment'
          type: array
        content:
          description: |-
            Markdown body. May contain inline reference tokens of the form
            `<<ref:{entity_type}:{entity_id}:{display_text}>>` for `@`-mentions.
            Each inline token must have a matching `NoteReference` entry in
            `references` so reverse-lookup queries work correctly.

            Example:

                "Held at <<ref:equipment:54321:BNSF 54321>> waiting on clearance.
                Spoke to <<ref:customer:1842:Acme Corp>> about ETA."
          type: string
        created_at:
          format: date-time
          type: string
        created_by_name:
          description: Display name of the author at the time the note was written.
          type: string
        created_by_uuid:
          description: |-
            Email of the note author (verified from the JWT or the assumed user
            header). Despite the field name, this is an email, not a UUID.
          type: string
        entity_id:
          description: The host entity's ID as a string (UUID or stringified int64).
          type: string
        entity_type:
          description: The host entity this note is attached to (e.g. `shipment`).
          type: string
        note_id:
          description: Server-assigned UUID. Stable across edits.
          type: string
        references:
          description: |-
            Structured references mentioned inside `content`. Used for reverse
            lookups and stale-detection.
          items:
            $ref: '#/components/schemas/lindaNoteReference'
          type: array
        updated_at:
          description: >-
            Set when the note has been edited at least once. Unset on the first
            read.
          format: date-time
          type: string
      type: object
    lindaNoteAttachment:
      description: |-
        A file attached to a note. Attachments are stored in S3 and surfaced
        to clients via short-lived presigned download URLs.
      properties:
        attachment_id:
          description: Server-assigned UUID for this attachment.
          type: string
        created_at:
          format: date-time
          type: string
        file_name:
          description: |-
            Original filename as supplied at upload time. Path components are
            stripped server-side; only the base name is kept.
          type: string
        media_type:
          description: |-
            MIME type. Defaults to `application/octet-stream` if the upload did
            not specify one.
          type: string
        note_id:
          description: ID of the parent note this file is attached to.
          type: string
        size_bytes:
          description: Size of the file in bytes.
          format: int64
          type: string
        url:
          description: >-
            Presigned GET URL for downloading the file. **Expires after 1
            hour.**

            Re-fetch the parent note to get a fresh URL — never persist this

            value past its TTL.
          type: string
      type: object
    lindaNoteReference:
      description: >-
        A structured reference to another Cedar entity from inside a note.
        References

        are how `@`-mentions persist: each chip in the editor becomes both an
        inline

        token in `NoteEntry.content` (e.g. `<<ref:equipment:54321:BNSF 54321>>`)
        and

        a sidecar `NoteReference` row that powers reverse-lookup queries via

        `ListNotes.referenced_entity_type`/`referenced_entity_id`.


        Example:

            {
              "entity_type":  "equipment",
              "entity_id":    "54321",
              "display_text": "BNSF 54321"
            }
      properties:
        display_text:
          description: |-
            Human-readable label for the chip at the time the note was authored
            (e.g. `BNSF 54321`). Stored as-is so old notes keep their original
            wording even if the entity is later renamed.
          type: string
        entity_id:
          description: >-
            The referenced entity's ID, encoded as a string. Format depends on

            entity type: int64 for
            equipment/waybill/customer/invoice/charge/grouping,

            UUID for shipment/work_order/trip_plan/booking/commodity_unit, or a

            composite string for `interchange` (`direction:trainId:timestamp`).
          type: string
        entity_type:
          description: >-
            The entity type being referenced. Must be one of the registered
            types

            (e.g. `equipment`, `shipment`, `waybill`, `work_order`, `customer`,

            `invoice`, `charge`, `trip_plan`, `booking`). See `SearchReferences`
            for

            the full list of searchable types.
          type: string
        is_stale:
          description: >-
            Server-set on read responses: true if the referenced entity has been

            deleted. Frontends render stale chips as dimmed strikethrough so
            users

            can tell the link is broken without losing the note's history.
          type: boolean
        url:
          description: >-
            Optional pre-resolved URL hint. Frontends usually ignore this and

            resolve the URL from the entity type + ID via their own route
            registry.
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-arms-api-key
      type: apiKey
    AssumeUserAuth:
      in: header
      name: x-arms-assume-user
      type: apiKey

````