> ## Documentation Index
> Fetch the complete documentation index at: https://www.1password.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination

The Events API uses cursor-based pagination, which is useful for working with large datasets. In response to each request, the API returns a unique ID (cursor) that indicates where you left off retrieving data. On the next call, you can provide that cursor to continue fetching events starting from the next point in the dataset so no records are missed.

There are two types of cursors used in calls to the API: a [reset cursor](#reset-cursor) and a [cursor](#cursor) (also called a continuing cursor).

## Reset cursor

A reset cursor is used for the first request you make to the API to create a new point from which to start fetching data. You can also use a reset cursor any time you need to reset the parameters of your cursor – such as the number of records to return with each request – or go back to an earlier point in the records.

For the first POST request you make to the API, you must include a `ResetCursor` object with an optional start time, end time, and limit parameters in the request body. The return will include a `cursor` in the response body that you can save to use in the next call made to the API. If no parameters are provided, the API will use the default values indicated in the schema.

For example:

<Tabs>
  <Tab title="Example reset cursor request">
    ```json theme={null}
    {
    	"limit": 100,
    	"start_time": "2023-03-15T16:32:50-03:00",
    	"end_time": "2023-03-15T17:32:50-03:00"
    }
    ```
  </Tab>

  <Tab title="ResetCursor object schema">
    <table>
      <thead>
        <tr>
          <th>Name</th>
          <th>Type</th>
          <th>Description</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td><code>limit</code><em> (optional)</em></td>
          <td>number</td>
          <td>The number of events to return in a single request. Specify a limit from 1 to 1000. If not specified, <code>limit</code> will default to 100. To return additional events, use the cursor position for subsequent requests.</td>
        </tr>

        <tr>
          <td><code>start\_time</code><em> (optional)</em></td>
          <td>string</td>
          <td>The date and time to start retrieving events. Uses the <a href="https://datatracker.ietf.org/doc/html/rfc3339">RFC 3339 standard</a>. If not specified, <code>start\_time</code> will default to one hour before specified <code>end\_time</code>. If no <code>end\_time</code> is specified, <code>start\_time</code> will default to one hour ago.</td>
        </tr>

        <tr>
          <td><code>end\_time</code><em> (optional)</em></td>
          <td>string</td>
          <td>The date and time to stop retrieving events. Uses the <a href="https://datatracker.ietf.org/doc/html/rfc3339">RFC 3339 standard</a>.</td>
        </tr>
      </tbody>
    </table>
  </Tab>
</Tabs>

## Cursor

The `cursor` is a persistent checkpoint that marks your exact position in the event stream and remains valid across API sessions.

For continued calling of the API, you should save the cursor you receive from each response. In your next call to the API, include the cursor from the previous response in the request body to start fetching data from the last indicated position. This allows you to resume from where you left off without missing any events.

<Tabs>
  <Tab title="Example cursor">
    ```json theme={null}
    {
    	"cursor": "aGVsbG8hIGlzIGl0IG1lIHlvdSBhcmUgbG9va2luZyBmb3IK"
    }
    ```
  </Tab>

  <Tab title="Cursor object schema">
    <table>
      <thead>
        <tr>
          <th>Name</th>
          <th>Type</th>
          <th>Description</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td><code>cursor</code></td>
          <td>string</td>
          <td>Cursor to fetch more data, if available, or continue the polling process. Use the cursor returned in the response body of your previous to the endpoint. For example: <code>aGVsbG8hIGlzIGl0IG1lIHlvdSBhcmUgbG9va2luZyBmb3IK</code>.</td>
        </tr>
      </tbody>
    </table>
  </Tab>
</Tabs>

The 1Password Events API apps for [Splunk](http://support.1password.com/events-reporting-splunk/) and [Elastic](http://support.1password.com/events-reporting-elastic/) will automatically store the `cursor` position for future requests.
