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

# Add carrier note

> Add an internal note to a carrier from your own system, with an optional Idempotency-Key so a retry never adds the note twice.

The Add Carrier Note endpoint adds a note to a carrier. The note is listed with the carrier's notes in Alvys and is not shown to the carrier. For more information on how versioning works and how to include it in your requests, please refer to the [Versioning](https://docs.alvys.com/en/api/guides/versioning.md) page.

> [!NOTE]
>
> This endpoint requires the `carrier:update` scope. See [Authentication](https://docs.alvys.com/en/api/guides/authentication-1.md).

### Request parameters

| Parameter | In | Type | Required | Description |
| - | - | - | - | - |
| version | path | String | Yes | API version to use. |
| carrierId | path | String | Yes | The carrier's `Id`, as returned by [Search carriers](https://docs.alvys.com/en/api/reference/carriers/search-carriers.md). |
| Idempotency-Key | header | String | No | 1 to 100 characters. Makes a retry safe: see [Retry safely](#retry-safely). |

### Request body

| Name | Type | Required | Description |
| - | - | - | - |
| Description | string | Yes | The note text, 1 to 4000 characters of plain text. Markup is refused: see [Plain text only](#plain-text-only). |

Alvys generates the note's `Id`, saves it with `NoteType` `General`, and records your credential as `CreatedBy`. Notes added here cannot be edited or deleted through the API.

### Plain text only

A `<` followed by a letter, `!`, `/` or `?`, such as `<b>`, `</p>` or `<!--`, reads as markup and returns `400 Bad Request`. Any other `<`, such as `rate < 2.00` or `<5 loads`, is kept as sent.

### Retry safely

Without an `Idempotency-Key`, every call adds a new note, so a retry after a timeout can leave two.

With an `Idempotency-Key`, the key is tied to this carrier:

* The first call adds the note and returns `201 Created`.
* The same key with the same `Description` returns that note with `200 OK` and adds nothing.
* The same key with a different `Description` returns `409 Conflict` with a `type` ending in `IdempotencyKeyReused`. Send a new key to add another note. The same applies when the note was edited in Alvys after it was added.
* If the note was deleted in Alvys, the same key adds it again.

An empty key, or one over 100 characters, returns `400 Bad Request`.

### MacroPoint

When the MacroPoint integration is on, Alvys sends a carrier's first note to MacroPoint with the carrier's details. A note added to a carrier that has no notes can reach MacroPoint.

### Response

`201 Created` with the new note, or `200 OK` with the existing note on a replay of the same `Idempotency-Key`.

| Name | Type | Description |
| - | - | - |
| Id | string | The note's id. |
| Description | string | The note text. |
| NoteType | string | `General` for notes added through the API. |
| CreatedAt | string | When the note was added (ISO 8601). |
| CreatedBy | string | Who added the note. |
| CreatedById | string | The id of who added the note. |

### Errors

| Status | When |
| - | - |
| `400 Bad Request` | `Description` is missing, empty, over 4000 characters or contains markup, the body is missing or malformed, or the `Idempotency-Key` is empty or over 100 characters. The field at fault is named under `errors`. |
| `401 Unauthorized` | The access token is missing, invalid or expired. |
| `403 Forbidden` | Your credential does not have the `carrier:update` scope. |
| `404 Not Found` | The carrier does not exist, was deleted, or is an owner-operator. |
| `409 Conflict` | The `type` ends in `IdempotencyKeyReused`: the key already added a note with a different `Description`. The `type` ends in `CarrierChanged`: the carrier kept changing while the note was being saved, and the note was not saved. Retry the request. |
| `413 Content Too Large` | The request body is over 32 KB. |
| `429 Too Many Requests` | You are rate limited. See [Rate limits](https://docs.alvys.com/en/api/guides/rate-limits.md). |

### Example cURL request

```bash theme={null}
curl --location --request POST 'https://integrations.alvys.com/api/p/v{version}/carriers/{carrierId}/notes' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Idempotency-Key: crm-note-58213' \
--data-raw '{
  "Description": "Prefers loads out of Dallas. Call dispatch before 9 AM."
}'
```

### Example response (201 Created)

```json theme={null}
{
  "Id": "3f6d2a1c9b8e4f0a8d7c6b5a4e3d2c1b",
  "Description": "Prefers loads out of Dallas. Call dispatch before 9 AM.",
  "NoteType": "General",
  "CreatedAt": "2026-12-02T15:04:11+00:00",
  "CreatedBy": "Example Integration",
  "CreatedById": "a1b2c3d4e5f60718293a4b5c6d7e8f90"
}
```

***

### Rate limits

All endpoints are subject to rate limits to protect the API from traffic spikes.
For detailed information, see the [Rate Limits](https://docs.alvys.com/en/api/guides/rate-limits.md) section.


## OpenAPI

````yaml POST /api/p/v{version}/carriers/{carrierId}/notes
openapi: 3.0.1
info:
  title: Alvys
  description: >-
    Alvys provides a robust set of REST APIs to allow you to integrate Alvys
    into virtually any platform. These APIs cover most of Alvys' major product
    areas with additional endpoints being added regularly based on customer
    requests.
  contact:
    name: Alvys Support
    url: https://www.alvys.com/resources/contact/
  version: v1
servers:
  - url: https://integrations.alvys.com
    description: Public API Server
  - url: https://api.alvys.com/
    description: Public API Server
security:
  - Public: []
tags:
  - name: Authentication
    description: Obtain an OAuth 2.0 access token for the Alvys Public API.
  - name: Carrier Settlement Statements
    description: >-
      Search carrier settlement statements and retrieve a single statement by
      number.
  - name: Carriers
    description: Read carrier records, search carriers, and manage carrier documents.
  - name: Customers
    description: Create, read, update, delete, and search customer records.
  - name: Deductions
    description: >-
      Create one-time deductions and search or delete existing deduction
      records.
  - name: DispatchPreferences
    description: Dispatch preferences endpoints for reading dispatch rules and preferences.
  - name: Driver Settlement Statements
    description: >-
      Search driver settlement statements and retrieve a single statement by
      number.
  - name: Drivers
    description: >-
      Read driver records, search drivers and driver events, and manage driver
      documents.
  - name: Fuel
    description: Read and search fuel transactions.
  - name: Invoices
    description: >-
      Read invoices, create carrier invoices, and record carrier and customer
      payments.
  - name: Loads
    description: >-
      Read, update, and search loads; manage load documents, notes, and custom
      references.
  - name: Locations
    description: Read and search company location details.
  - name: Maintenance
    description: Read and search maintenance records.
  - name: References
    description: >-
      List tenant custom reference definitions and create or update values on
      existing loads, stops, and trips.
  - name: Subsidiaries
    description: >-
      List your company's subsidiaries and read a single subsidiary, so an
      integration can resolve a subsidiary id to a recognizable name.
  - name: Tenders
    description: Create, accept, reject, cancel, update, and search inbound EDI tenders.
  - name: Tolls
    description: Read and search toll transactions.
  - name: Tracking
    description: >-
      Record an asset's current location or telemetry from a third-party source,
      such as an external ELD or a self-reporting vehicle.
  - name: Trailers
    description: Read trailers, search trailer events, and manage trailer documents.
  - name: Trips
    description: >-
      Read and search trips; manage trip documents, stop appointments, arrivals,
      departures, and stop and trip custom references.
  - name: Trucks
    description: Read trucks, search truck events, and manage truck documents.
  - name: Users
    description: List and search users.
  - name: Visibility
    description: >-
      Read inbound and outbound visibility history and search outbound
      visibility errors.
  - name: Webhooks
    description: >-
      Create, read, update, delete, enable, disable, verify, test, and rotate
      secrets for webhook subscriptions; read event types, delivery logs, and
      health metrics.
  - name: Accessorials
  - name: Credits
paths:
  /api/p/v{version}/carriers/{carrierId}/notes:
    post:
      tags:
        - Carriers
      summary: Add carrier note
      description: >-
        Adds a note to a carrier. It is listed with the carrier's notes in Alvys
        and is not shown to the carrier in Alvys. When the MacroPoint
        integration is on, Alvys sends a carrier's first note to MacroPoint with
        the carrier's details, so a note added to a carrier that has no notes
        can reach MacroPoint.


        **Text.** `Description` is 1 to 4000 characters of plain text. Markup is
        refused with 400: a `<` followed by a letter, `!`, `/` or `?`, such as
        `<b>` or `<!--`. Any other `<`, such as `rate < 2.00` or `<5 loads`, is
        kept as sent.


        **Author and id.** The server generates the note's `Id`, saves it with
        `NoteType` `General`, and records the caller as `CreatedBy`. Notes added
        here cannot be edited or deleted through the API.


        **Retries.** Send an `Idempotency-Key` header (up to 100 characters) to
        make a retry safe: a call with a key already used on this carrier and
        the same `Description` returns the note that key added, with 200, and
        adds nothing. The same key with a different `Description` is refused
        with 409, and so is a replay after the note was edited in the app. If
        that note was deleted in the app, the same key adds it again. Without
        the header every call adds a new note, so a retry after a timeout can
        leave two.


        **Errors.** Deleted and owner-operator carriers are a 404. A 409 whose
        type ends in `CarrierChanged` means the carrier kept changing while the
        note was being saved and the note was not saved: retry.
      parameters:
        - name: carrierId
          in: path
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          schema:
            type: string
        - name: version
          in: path
          description: API version (e.g., 1.0)
          required: true
          schema:
            type: string
            default: '1.0'
            example: '1.0'
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.Notes.Public.CarrierNoteCreateRequest
          application/json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.Notes.Public.CarrierNoteCreateRequest
          text/json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.Notes.Public.CarrierNoteCreateRequest
          application/*+json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.Notes.Public.CarrierNoteCreateRequest
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Alvys.Models.Notes.Public.CarrierNoteResponse
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Alvys.Models.Notes.Public.CarrierNoteResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Mvc.ValidationProblemDetails
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Mvc.ValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '413':
          description: Content Too Large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - Public: []
components:
  schemas:
    Alvys.Models.Notes.Public.CarrierNoteCreateRequest:
      required:
        - Description
      type: object
      properties:
        Description:
          maxLength: 4000
          minLength: 1
          pattern: ^(?:[^<]|<(?![a-zA-Z!/?]))*$
          type: string
      additionalProperties: false
    Alvys.Models.Notes.Public.CarrierNoteResponse:
      type: object
      properties:
        Id:
          type: string
          nullable: true
        Description:
          type: string
          nullable: true
        NoteType:
          type: string
          nullable: true
        CreatedAt:
          type: string
          format: date-time
          nullable: true
        CreatedBy:
          type: string
          nullable: true
        CreatedById:
          type: string
          nullable: true
      additionalProperties: false
    Microsoft.AspNetCore.Mvc.ValidationProblemDetails:
      required:
        - Errors
      type: object
      properties:
        Errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        Type:
          type: string
          nullable: true
        Title:
          type: string
          nullable: true
        Status:
          type: integer
          format: int32
          nullable: true
        Detail:
          type: string
          nullable: true
        Instance:
          type: string
          nullable: true
      additionalProperties: {}
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        Type:
          type: string
          nullable: true
        Title:
          type: string
          nullable: true
        Status:
          type: integer
          format: int32
          nullable: true
        Detail:
          type: string
          nullable: true
        Instance:
          type: string
          nullable: true
      additionalProperties: {}
  securitySchemes:
    Public:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        OAuth 2.0 client-credentials access token. Obtain one from
        https://auth.alvys.com/oauth/token (grant_type=client_credentials,
        audience=https://api.alvys.com/public/), then paste it here. The
        playground sends it as `Authorization: Bearer <token>`.

````