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

# Mark all alerts read

> Marks all alert records for the company as read.

### Overview

Marks alert records belonging to the specified company as read.

By default — when no date range is supplied — alerts from the **last 30 days** are marked as read. Supply an optional `startDate`/`endDate` range to target a specific window instead. The range must not exceed **31 days**.

<Note>The V1 version of this endpoint is [Mark all alerts read](/v1/api-reference/post-set-all-alerts-as-read).</Note>

<Note>**Rate limit:** 4 req/s · 20/min · 600/hr · 14,400/day</Note>

### Endpoint

`PUT /v2/api/companies/{id}/set-all-alerts-read`

### Path parameters

<ParamField path="id" type="integer" required>
  Company ID.
</ParamField>

### Query parameters

<ParamField query="startDate" type="string">
  Start of the date range (inclusive), ISO 8601. Optional, but must be provided together with `endDate`. When both are omitted, alerts from the last 30 days are marked as read.
</ParamField>

<ParamField query="endDate" type="string">
  End of the date range (inclusive), ISO 8601. Optional, but must be provided together with `startDate`. The range from `startDate` to `endDate` cannot exceed 31 days.
</ParamField>

### Response

**200 OK** — empty body on success.

### Error responses

| Status | Meaning                                                   |
| ------ | --------------------------------------------------------- |
| 401    | Missing or invalid token                                  |
| 404    | Company not found or not in caller's accessible hierarchy |
| 422    | Date range is invalid (see below)                         |

A `422 Unprocessable Entity` is returned when the date range is invalid:

| Condition                                      | `description`                                                                    |
| ---------------------------------------------- | -------------------------------------------------------------------------------- |
| Only one of `startDate`/`endDate` was provided | `Both startDate and endDate must be provided together, or both must be omitted.` |
| `startDate` is later than `endDate`            | `startDate must be earlier than or equal to endDate.`                            |
| Date range exceeds 31 days                     | `The date range cannot exceed 31 days.`                                          |

```bash theme={null}
# Default — marks the last 30 days of alerts as read
curl -X PUT "https://api.telemax.com.au/v2/api/companies/12/set-all-alerts-read" \
  -H "Authorization: Bearer <token>"

# With an explicit date range (max 31 days)
curl -X PUT "https://api.telemax.com.au/v2/api/companies/12/set-all-alerts-read?startDate=2026-04-01T00:00:00Z&endDate=2026-04-30T00:00:00Z" \
  -H "Authorization: Bearer <token>"
```


## OpenAPI

````yaml openapi.yaml PUT /v2/api/companies/{id}/set-all-alerts-read
openapi: 3.1.0
info:
  title: Telemax External API (V2)
  version: '2026-04-14'
  description: >
    Telemax External API — fleet telemetry, vehicle commands, and integrations.


    **Base URL:** `https://api.telemax.com.au`


    **Authentication:** All routes require a `Bearer` JWT unless marked
    `[AllowAnonymous]`.

    Obtain tokens via `POST /v2/api/authentication/token/api-key`.


    **RESTful architecture:** V2 uses standard HTTP methods (GET, POST, PUT,
    DELETE) with

    resource-based routes and consistent pagination via `page` and `pageSize`
    query parameters.


    **API versioning:** All responses will include an `X-API-Version` header
    containing the

    date-based version string (e.g. `2026-04-28`). See the
    [Changelog](/v2/changelog) for

    the deprecation policy and version history.


    For full documentation including error handling, pagination, and known field
    quirks, see [docs.telemax.com.au](https://docs.telemax.com.au).
servers:
  - url: https://api.telemax.com.au
security:
  - BearerAuth: []
paths:
  /v2/api/companies/{id}/set-all-alerts-read:
    put:
      summary: Mark all alerts read (V2)
      description: >-
        Marks alert records for the company as read. If no date range is
        provided, alerts from the last 30 days are marked as read. If a date
        range is provided, it is used instead — the range must not exceed 31
        days.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
          example: 12
        - name: startDate
          in: query
          schema:
            type: string
            format: date-time
          example: '2026-04-01T00:00:00Z'
          description: >-
            Start of the date range (inclusive). Optional, but must be provided
            together with `endDate`. When omitted, alerts from the last 30 days
            are marked as read.
        - name: endDate
          in: query
          schema:
            type: string
            format: date-time
          example: '2026-04-30T00:00:00Z'
          description: >-
            End of the date range (inclusive). Optional, but must be provided
            together with `startDate`. The range from `startDate` to `endDate`
            cannot exceed 31 days.
      responses:
        '200':
          description: '**200 OK** — Empty body. All alert records marked as read.'
          content:
            application/json:
              example: {}
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: >-
            **404 Not Found** — The requested company does not exist or is not
            accessible.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                type: RESOURCE
                code: NOT_FOUND
                description: Company was not found.
                requestId: 0HNLTALNU4DD6:00000002
                docUrl: https://docs.telemax.com.au/errors/not-found
        '422':
          description: >-
            **422 Unprocessable Entity** — Only one of `startDate`/`endDate` was
            provided, `startDate` is later than `endDate`, or the date range
            exceeds 31 days.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                missingOneDate:
                  summary: Only one of the two dates was provided
                  value:
                    type: VALIDATION_ERROR
                    code: INVALID_INPUT
                    description: >-
                      Both startDate and endDate must be provided together, or
                      both must be omitted.
                    requestId: 0HNLTALNU4DD6:00000003
                    docUrl: https://docs.telemax.com.au/errors/invalid-input
                startAfterEnd:
                  summary: startDate is later than endDate
                  value:
                    type: VALIDATION_ERROR
                    code: INVALID_INPUT
                    description: startDate must be earlier than or equal to endDate.
                    requestId: 0HNLTALNU4DD6:00000004
                    docUrl: https://docs.telemax.com.au/errors/invalid-input
                rangeTooLarge:
                  summary: Date range exceeds 31 days
                  value:
                    type: VALIDATION_ERROR
                    code: INVALID_INPUT
                    description: The date range cannot exceed 31 days.
                    requestId: 0HNLTALNU4DD6:00000005
                    docUrl: https://docs.telemax.com.au/errors/invalid-input
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    Unauthorized:
      description: >
        **401 Unauthorized** — JWT is missing, expired, or malformed.

        The JWT bearer middleware rejects the request before it reaches the
        controller.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            type: AUTHENTICATION
            code: INVALID_CREDENTIALS
            description: The provided API key is invalid or does not exist.
            requestId: 0HNLTALNU4DCO:00000004
            docUrl: https://docs.telemax.com.au/errors/invalid-credentials
    TooManyRequests:
      description: >
        **429 Too Many Requests** — Rate limit exceeded. Check the Retry-After
        header for the number of seconds to wait before retrying.

        Use exponential backoff: wait Retry-After seconds, then double the
        interval on each subsequent 429.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            type: RATE_LIMIT
            code: RATE_LIMIT_EXCEEDED
            description: Too many requests. Please slow down.
            requestId: req_6d2f8b4a
            docUrl: https://docs.telemax.com.au/errors/rate-limit-exceeded
    InternalServerError:
      description: >
        **500 Internal Server Error** — An unexpected error occurred. Include
        the requestId when contacting support.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            type: SERVER_ERROR
            code: INTERNAL_SERVER_ERROR
            description: An unexpected error occurred. Please try again later.
            requestId: req_1e5a3c7d
            docUrl: https://docs.telemax.com.au/errors/internal-server-error
  schemas:
    ApiError:
      type: object
      description: Standard error response returned by all API endpoints.
      properties:
        type:
          type: string
          description: >-
            Error category (e.g. AUTHENTICATION, AUTHORIZATION, RESOURCE,
            VALIDATION_ERROR, RATE_LIMIT, SERVER_ERROR).
          example: AUTHENTICATION
        code:
          type: string
          description: Machine-readable error code within the category.
          example: INVALID_CREDENTIALS
        description:
          type: string
          description: Human-readable explanation of the error and how to resolve it.
          example: The provided API key is invalid or does not exist.
        requestId:
          type: string
          description: Unique request identifier for support correlation.
          example: req_7f3a2b1c
        docUrl:
          type: string
          format: uri
          description: Link to the relevant error documentation page.
          example: https://docs.telemax.com.au/errors/invalid-credentials
      required:
        - type
        - code
        - description
  headers:
    X-RateLimit-Limit:
      description: >-
        Maximum number of requests allowed per minute for this token. **Not yet
        active** — this header will be added once the rate-limit middleware is
        deployed. See the [Changelog](/v2/changelog) for the rollout date.
      schema:
        type: integer
        example: 60
    X-RateLimit-Remaining:
      description: >-
        Number of requests remaining in the current rate limit window. **Not yet
        active** — see `X-RateLimit-Limit`.
      schema:
        type: integer
        example: 47
    X-RateLimit-Reset:
      description: >-
        Unix timestamp (seconds) at which the current rate limit window resets.
        **Not yet active** — see `X-RateLimit-Limit`.
      schema:
        type: integer
        example: 1746000060
    Retry-After:
      description: Number of seconds to wait before retrying after a 429 response.
      schema:
        type: integer
        example: 30
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        JWT Bearer token obtained from `POST
        /v2/api/authentication/token/api-key`.


        **Lifetime:** ~24 hours (86,399 seconds). Cache the token and reuse it.
        Re-authenticate 5 minutes before expiry.


        **Scoping:** API key tokens are scoped to the company the key belongs to
        and may restrict

        access to a vehicle allowlist and/or action set (see token claims).


        **No refresh endpoint** — re-authenticate with your API key when the
        token expires.

````