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

# Delete driver event

> Cancel a scheduled driver event by ID so it no longer blocks the driver in the dispatch planner, with If-Match concurrency.

The Delete Driver Event endpoint cancels a scheduled driver event. The event stops blocking the driver in the dispatch planner and is no longer returned by [Get driver event](https://docs.alvys.com/en/api/reference/drivers/get-driver-event.md) or [Search driver events](https://docs.alvys.com/en/api/reference/drivers/search-driver-events.md). 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 `driver:update` scope. See [Authentication](https://docs.alvys.com/en/api/guides/authentication-1.md).

### If-Match is required

This endpoint uses optimistic concurrency. Send the event's current `ETag` in the `If-Match` header. The `ETag` response header of [Get driver event](https://docs.alvys.com/en/api/reference/drivers/get-driver-event.md), of [Create driver event](https://docs.alvys.com/en/api/reference/drivers/create-driver-event.md), and of every successful update carries it. [Search driver events](https://docs.alvys.com/en/api/reference/drivers/search-driver-events.md) does not return ETags, so get the event by id first.

* If you omit `If-Match`, the request is rejected with `428 Precondition Required`.
* If the event changed after you read it, the request is rejected with `412 Precondition Failed`. Get the event again and retry with the new `ETag`.

### Events created by maintenance work orders

An event created by a maintenance work order in Alvys follows that work order. It is returned by [Get driver event](https://docs.alvys.com/en/api/reference/drivers/get-driver-event.md) and [Search driver events](https://docs.alvys.com/en/api/reference/drivers/search-driver-events.md), but it cannot be changed or deleted through the API: the request is rejected with `422 Unprocessable Entity` and the problem `type` `https://api.alvys.com/errors/UnprocessableEntity/AssetEventOwnedByWorkOrder`. Update the work order instead.

***

### Request parameters

The following parameters are required in the URL path:

| Parameter | Type | Required | Description |
| - | - | - | - |
| version | String | Yes | The version of the API. |
| id | String | Yes | The unique identifier of the event. |

The following header is required:

| Header | Required | Description |
| - | - | - |
| If-Match | Yes | The current `ETag` of the event. |

***

### Example cURL request

```bash theme={null}
curl --location --request DELETE 'https://integrations.alvys.com/api/p/v1/drivers/events/3c9a7e10-0000-0000-0000-000000000042' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'If-Match: "00000000-0000-0000-0000-000000000001"'
```

Replace `YOUR_ACCESS_TOKEN` with your actual Bearer token and the `If-Match` value with the event's current `ETag`.

***

### Response

A successful request returns `204 No Content` with an empty body.

***

### Status codes

| Status | Meaning |
| - | - |
| 204 | The event was deleted. |
| 401 | The request was not authenticated. |
| 403 | The caller lacks the `driver:update` scope. |
| 404 | No driver event with this `id` exists, it was already deleted, or its driver is outside the subsidiaries your credential can access. |
| 409 | The delete clashed with another change saved at the same moment. Get the event again and retry. |
| 412 | The `If-Match` value did not match the current event. Get the event again and retry. |
| 422 | The event was created by a maintenance work order (`AssetEventOwnedByWorkOrder`). |
| 428 | The `If-Match` header is missing. |
| 429 | The rate limit was exceeded. |

***

### 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](https://docs.alvys.com/en/api/guides/rate-limits.md) section.

This page is interactive, allowing you to try a request by specifying the **API version** and the event **id** in the URL path. As you fill out the parameters, the cURL command on the right side of the page will be automatically updated.


## OpenAPI

````yaml DELETE /api/p/v{version}/drivers/events/{id}
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}/drivers/events/{id}:
    delete:
      tags:
        - Drivers
      summary: Delete driver event
      parameters:
        - name: id
          in: path
          required: true
          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'
        - name: If-Match
          in: header
          required: true
          description: >-
            The event's current ETag (the ETag response header of your most
            recent GET, POST or PATCH), for optimistic concurrency. Required; if
            omitted the request is rejected with 428.
          schema:
            type: string
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '412':
          description: Precondition Failed (If-Match ETag did not match the current event)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '422':
          description: Unprocessable Content
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '428':
          description: Precondition Required (If-Match header missing)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            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'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - Public: []
components:
  schemas:
    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>`.

````