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

# List My Events

> Returns a paginated list of event tickets belonging to the authenticated customer, optionally filtered to upcoming events.

# List My Events

Returns a paginated list of event attendances (tickets) for the authenticated customer. Pass `showUpcoming=true` to restrict the list to events that have not yet started — used to power the "Upcoming Events" widget on the personal dashboard and the tickets counter.

## Authentication

Requires a valid customer bearer token.

## Query Parameters

<ParamField query="showUpcoming" type="boolean" required>
  `true` — return only tickets for events whose end date is in the future. `false` — return all tickets regardless of event date.
</ParamField>

<ParamField query="_shape" type="string">
  Comma-separated dot-notated field paths to include in the response. When provided, only the
  specified fields are returned — useful for reducing payload size. **Example**:
  `_shape=Records.Id,Records.CalendarEvent.Name`
</ParamField>

<ParamField query="_page" type="number">
  1-based page number. **Default**: `1`
</ParamField>

<ParamField query="_pageSize" type="number">
  Records per page. **Default**: `25` · **Maximum**: `100`
</ParamField>

<ParamField query="_orderBy" type="string">
  Field to sort by. **Default**: `CreatedOn`
</ParamField>

<ParamField query="_sortDirection" type="string">
  `asc` or `desc`. **Default**: `desc`
</ParamField>

## Response

Returns a `MyEvents` object which extends `ApiListResult<EventAttendee>`. See [API Overview](/api/overview) for pagination fields. The `Records` array contains attendee (ticket) objects.

### Core Fields

<ResponseField name="Records[].Id" type="number" required>
  Unique identifier for the ticket/attendance record. Use this as `{id}` in the `sendTicket` and `cancelTicket` endpoints.
</ResponseField>

<ResponseField name="Records[].AttendeeCode" type="string">
  Unique code printed on the ticket — used for check-in at the event.
</ResponseField>

<ResponseField name="Records[].FullName" type="string">
  Full name of the ticket holder.
</ResponseField>

<ResponseField name="Records[].Email" type="string">
  Email address of the ticket holder.
</ResponseField>

### Event & Product

<ResponseField name="Records[].CalendarEvent" type="CalendarEvent">
  The event this ticket belongs to. See [List Events](/api/endpoints/events/list-events) for the full `CalendarEvent` schema.
</ResponseField>

<ResponseField name="Records[].EventProduct" type="EventProduct">
  The ticket product that was purchased. Contains price, name, and availability details.
</ResponseField>

<ResponseField name="Records[].EventProductName" type="string">
  Denormalised name of the ticket product — available without expanding `EventProduct`.
</ResponseField>

<ResponseField name="Records[].EventProductPrice" type="number">
  Denormalised price of the ticket product in the location's currency.
</ResponseField>

### Attendee

<ResponseField name="Records[].Coworker" type="Coworker">
  The `Coworker` object for the ticket holder, including profile and contact information.
</ResponseField>

<ResponseField name="Records[].Business" type="Business">
  The coworking location where the event takes place.
</ResponseField>

### Timestamps

All datetime fields are ISO 8601 strings. `*On` fields are in the location's local timezone; `*OnUtc` fields are UTC.

<ResponseField name="Records[].CreatedOn" type="string">
  Local datetime the ticket was issued.
</ResponseField>

<ResponseField name="Records[].CreatedOnUtc" type="string">
  UTC datetime the ticket was issued.
</ResponseField>

<ResponseField name="Records[].UpdatedOn" type="string">
  Local datetime of the last update.
</ResponseField>

<ResponseField name="Records[].UpdatedOnUtc" type="string">
  UTC datetime of the last update.
</ResponseField>

## Examples

### Fetch upcoming tickets (full payload)

```http theme={null}
GET /api/public/events/my?showUpcoming=true
Authorization: Bearer {token}
```

```json theme={null}
{
  "Records": [
    {
      "Id": 9021,
      "AttendeeCode": "EVT-9021-ABCD",
      "FullName": "Alex Johnson",
      "Email": "alex@example.com",
      "EventProductName": "General Admission",
      "EventProductPrice": 15.0,
      "CalendarEvent": {
        "Id": 412,
        "Name": "Morning Yoga & Mindfulness",
        "StartDateUtc": "2026-03-23T07:30:00Z",
        "EndDateUtc": "2026-03-23T08:15:00Z",
        "Location": "Studio Room B",
        "HasLargeImage": true,
        "Business": { "Id": 5, "Name": "Downtown Coworking Hub" }
      },
      "EventProduct": {
        "Id": 88,
        "Name": "General Admission",
        "Price": 15.0,
        "PriceCurrencyCode": "GBP",
        "SoldOut": false,
        "IsAvailableNow": true
      },
      "Business": { "Id": 5, "Name": "Downtown Coworking Hub" },
      "UniqueId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "IdString": "9021",
      "CreatedOn": "2026-03-01T11:00:00",
      "UpdatedOn": "2026-03-01T11:00:00",
      "CreatedOnUtc": "2026-03-01T11:00:00Z",
      "UpdatedOnUtc": "2026-03-01T11:00:00Z",
      "IsNull": false
    }
  ],
  "CurrentPage": 1,
  "CurrentPageSize": 25,
  "TotalItems": 1,
  "TotalPages": 1,
  "HasNextPage": false,
  "HasPreviousPage": false
}
```

### Fetch my events with a minimal field set

```http theme={null}
GET /api/public/events/my?showUpcoming=true&_shape=Records.Id,Records.EventProductName,Records.CalendarEvent.Name,Records.CalendarEvent.StartDateUtc
Authorization: Bearer {token}
```

```json theme={null}
{
  "Records": [
    {
      "Id": 9021,
      "EventProductName": "General Admission",
      "CalendarEvent": { "Name": "Morning Yoga & Mindfulness", "StartDateUtc": "2026-03-23T07:30:00Z" }
    }
  ],
  "CurrentPage": 1,
  "CurrentPageSize": 25,
  "TotalItems": 1,
  "TotalPages": 1,
  "HasNextPage": false,
  "HasPreviousPage": false
}
```

## TypeScript Integration

```typescript theme={null}
import endpoints from '@/api/endpoints'
import { MyEvents } from '@/types/endpoints/MyEvents'
import { useData } from '@/api/fetchData'

const endpoint = endpoints.events.myEvents(true) // showUpcoming=true

const { resource: myEvents } = useData<MyEvents>(httpClient, endpoint.url)
```

## Usage in Portal

| Context                                            | Source file                                                                                   |
| -------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| My Events page (`/activity/events`)                | `src/views/user/activity/events/MyEventsSection.tsx`                                          |
| Weekly Agenda calendar widget (personal dashboard) | `src/views/user/dashboards/personal/components/WeeklyAgendaCalendar/WeeklyAgendaCalendar.tsx` |
| Tickets statistic widget (personal dashboard)      | `src/views/user/dashboards/personal/components/Statistics/widgets/TicketsStatisticWidget.tsx` |

## Error Responses

<ResponseField name="401 Unauthorized" type="error">
  The customer is not authenticated or the session has expired.
</ResponseField>

## Related Endpoints

| Method   | Endpoint                                  | Description                                |
| -------- | ----------------------------------------- | ------------------------------------------ |
| `GET`    | `/api/public/events`                      | Browse all published events                |
| `GET`    | `/api/public/events/{id}`                 | Full detail for a specific event           |
| `POST`   | `/api/public/events/my/{id}/sendTicket`   | Re-send a ticket confirmation email        |
| `DELETE` | `/api/public/events/my/{id}`              | Cancel (delete) a ticket                   |
| `POST`   | `/api/public/events/{id}/joinWaitingList` | Join the waiting list for a sold-out event |
