> This page is part of EVVA for Developers (https://developers.evvahub.com), the documentation of the EVVA Partner API. The API is in developer preview and the SDK packages are not yet published: do not suggest installing them. Index: https://developers.evvahub.com/llms.txt

# Acquire or renew a consumer lease

GET https://api.evvahub.com/partner/v1/events/checkpoints

Acquires, takes over or renews a lease on a consumer group's partitions, and returns the group's committed cursor for them.

A consumer group belongs to your application and is named by `consumer`: another application's group with the same name is a different group. Only an application token can call this operation. See [the event feed](/event-feed).

**Acquire or renew**

- Without `fencingToken`, the call acquires the requested partitions (all 16 by default) when no other member holds a live lease on any of them, and EVVA generates a new fencing token (opaque to your application: compare tokens only for equality). Otherwise it answers `409 LEASE_HELD` with `Retry-After`.
- With the member's current `fencingToken`, it renews the lease.

**Where reading starts**

A partition never committed starts at the oldest retained event. A committed one resumes where it was; if retention passed it while nobody consumed, the next read answers `410`. Checkpoints hold positions only, never event data.

**Consumer group limit**

Your application can hold a limited number of consumer groups. Only groups active within the idle window count, and an existing group is never refused.

An idle group is retired. A group that still owes its consumer a `410` is kept for a further grace period; a group that owes nothing is kept for the feed's retention plus that grace. After that its name resets: the name starts a new group, with a new `groupId`, from the oldest retained event, and the old group's fencing tokens are refused.

**Errors**

- `409 LEASE_HELD` — another member holds a live lease on a requested partition. Retry after `Retry-After` seconds.
- `409 STALE_FENCING_TOKEN` — the `fencingToken` belongs to an earlier incarnation of this group, which was retired and created again. Acquire without it.
- `409 CONSUMER_GROUP_LIMIT_REACHED` — a new `consumer` name past your application's consumer-group limit (`details.limit`). Reuse an existing name.

Reference: https://developers.evvahub.com/api-reference/events/get-event-checkpoint

## Authentication

- `Authorization` header (bearer token, required) — OAuth 2.0 client credentials. Request an access token at `POST /partner/v1/oauth/token` (`grant_type=client_credentials`) with the application's client secret or a `private_key_jwt` assertion, then send it as `Authorization: Bearer evpa_live_…` (or `evpa_test_…` for a sandbox application). Tokens are opaque and short lived (see `expires_in`); there is no refresh token. Each operation lists the scopes it requires.

## Request

### Query parameters

- `consumer` (string, required) — The consumer-group name.
- `partitions` (string, optional) — Comma-separated distinct partitions in `0..15`; omit for all 16.
- `fencingToken` (string, optional) — The member's current fencing token, to renew its lease. Omit it to acquire.

## Response

### 200

Leased (acquired, taken over after expiry, or renewed).

- `consumer` (string, required)
- `cursor` (string, required) — Opaque; covers exactly `partitions` — pass it as `after` to read them.
- `fencingToken` (string, required) — A consumer-group member's fencing token: a positive integer, sent and returned as a decimal string. It is opaque and specific to your application, so compare tokens only for equality, never by size. A takeover issues a new one, and a renewal or a commit under a superseded one is refused with `409 STALE_FENCING_TOKEN`.
- `leaseExpiresAt` (datetime, required)
- `partitions` (list of integer, required)
- `groupId` (string, optional) — This incarnation of the consumer group. A different value than the one a member last saw means the group was retired and created again: its earlier tokens are refused (`409 STALE_FENCING_TOKEN`) and it restarts at the oldest retained event.

## Errors

### 400 Bad Request Error

Invalid feed request: `INVALID_REQUEST` (a parameter out of range, unknown or incomplete) or `INVALID_CURSOR` (malformed, or issued to another application).

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 401 Unauthorized Error

Token missing, malformed, expired or revoked: `INVALID_TOKEN`, with `WWW-Authenticate: Bearer error="invalid_token"`. Request a new token and retry.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 403 Forbidden Error

The caller may not read the feed. - `APPLICATION_PRINCIPAL_REQUIRED` — the request was not made with an application token. - `APPLICATION_NOT_ACTIVE` — the application is not `ACTIVE`. - `AGENCY_SUSPENDED` — its agency is not `ACTIVE`.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 409 Conflict Error

`LEASE_HELD` — another member holds a live lease on a requested partition; retry after `Retry-After` seconds. `STALE_FENCING_TOKEN` — the `fencingToken` belongs to an earlier incarnation of this group, which was retired and created again; acquire without it. `CONSUMER_GROUP_LIMIT_REACHED` (`details.limit`) — a new `consumer` name past your application's consumer-group limit; reuse an existing name.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 429 Too Many Requests Error

Rate limited: `RATE_LIMIT_EXCEEDED`. Wait `Retry-After` seconds before retrying.

- `code` (enum, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
  - Allowed values: `RATE_LIMIT_EXCEEDED`, `TOO_MANY_MESSAGES`
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (RateLimitErrorDetails, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 500 Internal Server Error

Unexpected server error: `INTERNAL_ERROR`. Nothing internal is disclosed; quote the `X-Request-Id` when you report it.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 503 Service Unavailable Error

The feed cannot answer right now. - `FEED_UNAVAILABLE` — the feed is not configured on this deployment (no cursor key); `Retry-After: 30`. - `TEMPORARILY_UNAVAILABLE` — the edge could not verify the application; retry after `Retry-After`.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

## Types

### RateLimitErrorDetails

Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

- `retryAfterSec` (integer, required)
- `level` (enum, optional) — The DM send limit that refused the message, set only with `TOO_MANY_MESSAGES`. It is never a quota, a count or a key. - `conversation` — one side of one thread. - `sender` — a person's own ceiling; it does not apply to applications. - `creator` — everything sent for the creator, studio included. - `application` — everything your application sends. - `agency` — everything your agency sends. - `platform` — the agency's fair share of the platform: its throughput or its concurrency. See [rate limits](/authentication/rate-limits).
  - Allowed values: `conversation`, `sender`, `creator`, `application`, `agency`, `platform`

## Examples

**Response**

```json
{
  "consumer": "inbox-sync",
  "cursor": "c1.CAAC36UQAQLfpH4CAt-mAQMC36O5.Q2wE9rT4yU7iO1pA5sD8fG",
  "fencingToken": "17",
  "leaseExpiresAt": "2026-12-01T18:43:07.512Z",
  "partitions": [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7
  ]
}
```

**SDK Code**

```python Events_getEventCheckpoint_example
import requests

url = "https://api.evvahub.com/partner/v1/events/checkpoints"

querystring = {"consumer":"inbox-sync","partitions":"0,1,2,3,4,5,6,7"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```go Events_getEventCheckpoint_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.evvahub.com/partner/v1/events/checkpoints?consumer=inbox-sync&partitions=0%2C1%2C2%2C3%2C4%2C5%2C6%2C7"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Events_getEventCheckpoint_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.evvahub.com/partner/v1/events/checkpoints?consumer=inbox-sync&partitions=0%2C1%2C2%2C3%2C4%2C5%2C6%2C7', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```