---
updatedAt: 2025-08-11T18:18:17.000Z
agentTools:
  projectIndex: https://docs.keycafe.com/llms.txt
---

# Search Events

Retrieve data for multiple events with a GET request to the endpoint.

# Searching for Events

When querying events, at least one search parameter must be provided. Requests that omit all search properties will result in an error response.

Search results are sorted by <code>dateCreated</code> in descending order (most recent first).

# Pagination

Results are paginated, with a maximum of 50 results per page. Additional pages can be accessed using the Link response header

Example of a Link header for pagination:

```curl
Link: <https://www.keycafe.com/v0/event?key=123456&page=2>; rel="next", <https://www.keycafe.com/v0/event?key=123456&page=5>; rel="last"
```

* <code>rel="first"</code>: URL to retrieve the first page of results.
* <code>rel="prev"</code>: URL to retrieve the previous page of results.
* <code>rel="next"</code>: URL to retrieve the next page of results.
* <code>rel="last"</code>: URL to retrieve the final page of results.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Keycafe API",
    "version": "0"
  },
  "x-explorer-enabled": true,
  "x-proxy-enabled": true,
  "x-samples-languages": [
    "shell",
    "python",
    "go"
  ],
  "servers": [
    {
      "url": "https://www.keycafe.com/"
    }
  ],
  "components": {
    "securitySchemes": {
      "BasicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "BasicAuth": []
    }
  ],
  "paths": {
    "/v0/event": {
      "get": {
        "tags": [
          "Event"
        ],
        "summary": "Search Events",
        "description": "Retrieve data for multiple events with a GET request to the endpoint.",
        "operationId": "search-events",
        "parameters": [
          {
            "name": "key",
            "in": "query",
            "required": false,
            "description": "The ID of a key by which to filter results.  </br> Example: 123456",
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": ""
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "description": "The ID of a user by which to filter results. ",
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": ""
            }
          },
          {
            "name": "location",
            "in": "query",
            "required": false,
            "description": "The ID of a location by which to filter results. </br> Example: 123456",
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": ""
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "The event type (PICKUP/DROPOFF/ACCESS_CREATED/ACCESS_CANCELLED) by which to filter results.",
            "schema": {
              "type": "string",
              "example": "PICKUP"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "The latest possible date by which to filter results, in ISO 8601 format without milliseconds. </br> Example: 2025-07-21T12:45:21Z",
            "schema": {
              "type": "string",
              "format": "date",
              "default": ""
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The earliest possible date by which to filter results, in ISO 8601 format without milliseconds. </br> Example: 2025-07-21T12:45:21Z",
            "schema": {
              "type": "string",
              "format": "date",
              "default": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of key exchange events matching the search query.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "Unique identifier for the event.",
                        "example": 123456
                      },
                      "dateCreated": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Timestamp when the event was created.",
                        "example": "2025-07-21T12:45:21Z"
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of event (e.g., PICKUP or DROPOFF).",
                        "example": "PICKUP"
                      },
                      "location": {
                        "type": "object",
                        "description": "Location where the event took place.",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Unique identifier for the location.",
                            "example": 123456
                          },
                          "name": {
                            "type": "string",
                            "description": "Name of the location.",
                            "example": "Corner Cafe"
                          },
                          "timezone": {
                            "type": "string",
                            "description": "Timezone of the location.",
                            "example": "America/Vancouver"
                          }
                        }
                      },
                      "user": {
                        "type": "object",
                        "description": "User who triggered the event.",
                        "properties": {
                          "firstName": {
                            "type": "string",
                            "description": "First name of the user.",
                            "example": "Bob"
                          },
                          "lastName": {
                            "type": "string",
                            "description": "Last name of the user.",
                            "example": "Smith"
                          },
                          "email": {
                            "type": "string",
                            "description": "User's email address.",
                            "example": "user@yourdomain.com"
                          },
                          "mobile": {
                            "type": "string",
                            "description": "User's mobile phone number.",
                            "example": 16042656073
                          }
                        }
                      },
                      "key": {
                        "type": "object",
                        "description": "Key involved in the event.",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Unique identifier for the key.",
                            "example": 123456
                          },
                          "name": {
                            "type": "string",
                            "description": "Name of the key.",
                            "example": "Bob's Home Key"
                          }
                        }
                      },
                      "bin": {
                        "type": "string",
                        "description": "Bin identifier where the key was picked up or dropped off.",
                        "example": "A-1"
                      }
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": "[\n    { \"id\": 123456, \"dateCreated\": \"2025-07-21T12:45:21Z\", \"type\": \"PICKUP\", ...  },\n    { \"id\": 654321, \"dateCreated\": \"2025-07-21T15:45:21Z\", \"type\": \"DROPOFF\", ...  }\n]"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```