> ## 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.

# Search outbound visibility errors

> Search outbound visibility delivery errors with paginated POST filters — customer platform, load number, error type, and failure date range for troubleshooting.

This endpoint allows you to retrieve a paginated list of outbound errors for a specified time range. The request includes parameters for pagination and a time range filter. Note that the time range must be 7 days or less. This feature helps users identify and manage any errors that occurred while sharing updates with external systems.

### Request Body Parameters

All the following parameters are required in the request body:

| Parameter       | Type               | Required | Description                                                          |
| --------------- | ------------------ | -------- | -------------------------------------------------------------------- |
| Page            | Number             | Yes      | The page number to retrieve.                                         |
| PageSize        | Number             | Yes      | The number of items to retrieve per page.                            |
| TimeRange       | Object             | Yes      | The time range filter for retrieving errors. Must be 7 days or less. |
| TimeRange.Start | String (Date-Time) | Yes      | The start date and time for the time range.                          |
| TimeRange.End   | String (Date-Time) | Yes      | The end date and time for the time range.                            |

#### Example CURL Request

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v1/visibility/outbound/errors' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
    "Page": 0,
    "PageSize": 10,
    "TimeRange": {
        "Start": "2024-11-11T15:15:13.876Z",
        "End": "2024-11-18T15:15:13.876Z"
    }
}'
```

Replace `YOUR_ACCESS_TOKEN` with your actual Bearer token. Ensure that the `start` and `end` dates are within a 7-day range.

### Response Fields

The response is a paginated list of error items, including details about each error:

| Field                       | Type               | Description                                                                                                                 |
| --------------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| Page                        | Number             | The current page number.                                                                                                    |
| PageSize                    | Number             | The number of items per page.                                                                                               |
| Total                       | Number             | The total number of error items.                                                                                            |
| Items                       | Array              | A list of error items.                                                                                                      |
| Items.Id                    | String             | The unique identifier of the error.                                                                                         |
| Items.ExternalId            | String             | The external ID related to the error.                                                                                       |
| Items.TripNumber            | String             | The trip number linked to the load.                                                                                         |
| Items.LoadNumber            | String             | The load number for which the error occurred.                                                                               |
| Items.EventType             | String             | The type of event, typically "Location".                                                                                    |
| Items.SharedAt              | String (Date-Time) | The date and time when the update was shared.                                                                               |
| Items.Destination           | String             | The destination of the load.                                                                                                |
| Items.TruckNumber           | String             | The number of the truck transporting the load.                                                                              |
| Items.DriverName            | String             | The name of the driver.                                                                                                     |
| Items.TrailerNumber         | String             | The number of the trailer being used.                                                                                       |
| Items.StopId                | String             | The ID of the stop related to the error.                                                                                    |
| Items.LocationId            | String             | The ID of the location associated with the error.                                                                           |
| Items.SharedBy              | String             | The entity (user or system) that shared the update.                                                                         |
| Items.Reason                | String             | The reason for the error, if provided. There is defined list on system, depending on integration. E.g.: NS - Normal Status. |
| Items.Address               | Object             | The address details of the location update.                                                                                 |
| Items.Address.Street        | String             | The street of the location.                                                                                                 |
| Items.Address.City          | String             | The city of the location.                                                                                                   |
| Items.Address.State         | String             | The state of the location.                                                                                                  |
| Items.Address.ZipCode       | String             | The postal code of the location.                                                                                            |
| Items.Coordinates           | Object             | The geographic coordinates of the location.                                                                                 |
| Items.Coordinates.Latitude  | String             | The latitude of the location.                                                                                               |
| Items.Coordinates.Longitude | String             | The longitude of the location.                                                                                              |
| Items.Status                | String             | The status of the update (e.g., "Completed", "Failed").                                                                     |
| Items.Error                 | String             | The error message related to the update.                                                                                    |

#### Example Response

```json theme={null}
{
  "Page": 0,
  "PageSize": 10,
  "Total": 1,
  "Items": [
    {
      "Id": "9b834b4c77124b8f8f0d97b56b7dabc4",
      "ExternalId": "EXT-003",
      "TripNumber": "TRIP67890",
      "LoadNumber": "LOAD67890",
      "EventType": "Location",
      "SharedAt": "2024-11-11T15:15:13.896Z",
      "Destination": "Chicago, IL",
      "TruckNumber": "TRK67890",
      "DriverName": "Alex Johnson",
      "TrailerNumber": "TRL67890",
      "StopId": "STOP003",
      "LocationId": "LOC003",
      "SharedBy": null,
      "Reason": "NS", //normal status
      "Address": {
        "Street": "789 Oak St",
        "City": "Chicago",
        "State": "IL",
        "ZipCode": "60601"
      },
      "Coordinates": {
        "Latitude": "41.878113",
        "Longitude": "-87.629799"
      },
      "Status": "Failed",
      "Error": "EDI|Failed to send message to General Mills via EDI. Please try again or reach out to support if the problem persist."
    }
  ]
}
```

### Rate Limits

All endpoints are subject to rate limits to protect the API from traffic spikes. For detailed information on rate limits, please refer to the [Rate Limits](/docs/rate-limits) section.

This page is interactive, allowing you to test the endpoint by providing the required request body. The CURL command will update automatically based on your inputs. You can also try this request by forking our [Public API Postman Collection](https://app.getpostman.com/run-collection/39138316-54c493c3-15e5-4fd7-a651-6e45b308548f?action=collection%2Ffork\&source=rip_markdown\&collection-url=entityId%3D39138316-54c493c3-15e5-4fd7-a651-6e45b308548f%26entityType%3Dcollection%26workspaceId%3Dc0255544-5964-4c52-9d24-05b30a9b021c). Remember to authorize yourself before trying a request.


## OpenAPI

````yaml POST /api/p/v{version}/visibility/outbound/errors
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, search loads, and manage load documents and notes.
  - name: Locations
    description: Read and search company location details.
  - name: Maintenance
    description: Read and search maintenance records.
  - name: Tenders
    description: Create, accept, reject, cancel, update, and search inbound EDI tenders.
  - name: Tolls
    description: Read and search toll transactions.
  - name: Trailers
    description: Read trailers, search trailer events, and manage trailer documents.
  - name: Trips
    description: >-
      Read, search trips, manage trip documents, and record stop appointments,
      arrivals, and departures.
  - 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.
paths:
  /api/p/v{version}/visibility/outbound/errors:
    post:
      tags:
        - Visibility
      summary: Search outbound visibility errors
      parameters:
        - 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.Users.VisibilityHistoryRequest
          application/json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.Users.VisibilityHistoryRequest
          text/json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.Users.VisibilityHistoryRequest
          application/*+json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.Users.VisibilityHistoryRequest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Alvys.Helpers.PagedResponse1Alvys.Models.Visibility.VisibilityHistoryResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            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'
        '429':
          description: Too Many Requests
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - Public: []
components:
  schemas:
    Alvys.Models.Users.VisibilityHistoryRequest:
      required:
        - Page
        - PageSize
        - TimeRange
      type: object
      properties:
        Page:
          type: integer
          format: int32
        PageSize:
          type: integer
          format: int32
        TimeRange:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.Period'
      additionalProperties: false
    Alvys.Helpers.PagedResponse1Alvys.Models.Visibility.VisibilityHistoryResponse:
      required:
        - Items
        - Page
        - PageSize
        - Total
      type: object
      properties:
        Page:
          type: integer
          format: int32
        PageSize:
          type: integer
          format: int32
        Facets:
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/Alvys.Helpers.ResultSetFacetItem'
          nullable: true
        Total:
          type: integer
          format: int64
        Items:
          type: array
          items:
            $ref: >-
              #/components/schemas/Alvys.Models.Visibility.VisibilityHistoryResponse
      additionalProperties: false
    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: {}
    Alvys.Models.Period:
      required:
        - Start
      type: object
      properties:
        Start:
          type: string
          format: date-time
        End:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    Alvys.Helpers.ResultSetFacetItem:
      required:
        - Count
        - Value
      type: object
      properties:
        Value:
          type: string
        Count:
          type: integer
          format: int64
      additionalProperties: false
    Alvys.Models.Visibility.VisibilityHistoryResponse:
      required:
        - Destination
        - EventType
        - Id
        - SharedAt
        - Status
      type: object
      properties:
        Id:
          type: string
        ExternalId:
          type: string
          nullable: true
        TripNumber:
          type: string
          nullable: true
        LoadNumber:
          type: string
          nullable: true
        EventType:
          allOf:
            - $ref: >-
                #/components/schemas/Alvys.Features.VisibilityServices.New.VisibilityEventType
        SharedAt:
          type: string
          format: date-time
        Destination:
          type: string
        TruckNumber:
          type: string
          nullable: true
        DriverName:
          type: string
          nullable: true
        TrailerNumber:
          type: string
          nullable: true
        StopId:
          type: string
          nullable: true
        LocationId:
          type: string
          nullable: true
        SharedBy:
          type: string
          nullable: true
        Reason:
          type: string
          nullable: true
        Address:
          allOf:
            - $ref: '#/components/schemas/Alvys.Features.Locations.ShortAddress'
          nullable: true
        Coordinates:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.Coordinates'
          nullable: true
        Status:
          allOf:
            - $ref: >-
                #/components/schemas/Alvys.Features.VisibilityServices.New.OutboundMessageStatus
        Error:
          type: string
          nullable: true
      additionalProperties: false
    Alvys.Features.VisibilityServices.New.VisibilityEventType:
      enum:
        - Location
        - Arrival
        - Departure
        - Appointment
        - Loading
        - Unloading
        - ShipmentDelayed
        - ShipmentReconsigned
        - EstimatedDelivery
        - DeliveryNotCompleted
        - DocumentsUpload
        - ArrivedAtCustoms
        - CustomsReleased
      type: string
    Alvys.Features.Locations.ShortAddress:
      required:
        - City
        - State
        - Street
        - ZipCode
      type: object
      properties:
        Street:
          type: string
        City:
          type: string
        State:
          type: string
        ZipCode:
          type: string
      additionalProperties: false
    Alvys.Models.Coordinates:
      required:
        - Latitude
        - Longitude
      type: object
      properties:
        Latitude:
          type: string
        Longitude:
          type: string
      additionalProperties: false
    Alvys.Features.VisibilityServices.New.OutboundMessageStatus:
      enum:
        - Completed
        - Active
        - Cancelled
        - Failed
      type: string
  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>`.

````