> For the complete documentation index, see [llms.txt](https://developer.switchmarket.se/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.switchmarket.se/libraries/.net-sdk/sdk-reference/ieventsservice.events.md).

# IEventsService.Events

Collection of functions to interact with the Events API endpoint.

{% hint style="info" %}
All URI’s are relative to the VTN URL configured.
{% endhint %}

<table><thead><tr><th width="228">Method</th><th>HTTP request</th><th>Description</th></tr></thead><tbody><tr><td><a href="#createeventasync">CreateEventAsync</a></td><td>POST /events</td><td>Create an event</td></tr><tr><td><a href="#deleteeventasync">DeleteEventAsync</a></td><td>DELETE /events/{eventID}</td><td>Delete an event</td></tr><tr><td><a href="#searcheventsasync">SearchEventsAsync</a></td><td>GET /events</td><td>Searches all events</td></tr><tr><td><a href="#findeventbyidasync">FindEventByIdAsync</a></td><td>GET /events/{eventID}</td><td>Searches events by event ID</td></tr><tr><td><a href="#updateeventasync">UpdateEventAsync</a></td><td>PUT /events/{eventID}</td><td>Update an event</td></tr></tbody></table>

## CreateEventAsync

```csharp
Task<Event> CreateEventAsync(
    Event @event,
    RequestOptions? options = default,
    CancellationToken cancellationToken = default)
```

Create a new event in the server.

## **DeleteEventAsync**

```csharp
Task<Event> DeleteEventAsync(
    string eventId,
    RequestOptions? options = default,
    CancellationToken cancellationToken = default)
```

Delete an existing event with the event ID.

## **SearchEventsAsync**

```csharp
Task<List<Event>> SearchEventsAsync(
    string? programId = default,
    string? targetType = default,
    List<string>? targetValues = default,
    int? skip = default,
    int? limit = default,
    RequestOptions? options = default,
    CancellationToken cancellationToken = default)
```

Searches all events known to the server. Use skip and pagination query params to limit response size.

## **FindEventByIdAsync**

```csharp
Task<Event> FindEventByIdAsync(
    string eventId,
    RequestOptions? options = default,
    CancellationToken cancellationToken = default)
```

Find event associated by the event ID.

## **UpdateEventAsync**

```csharp
Task<Event> UpdateEventAsync(
    string eventId,
    Event @event,
    RequestOptions? options = default,
    CancellationToken cancellationToken = default)
```

Update an existing event with specified event ID.
