# A service's activity

> GET /v1/services/{service_id}/events. Scaling, key, budget and settings history, newest first, kept 30 days.

Source: https://legion.ambient.xyz/docs/api/services/list-service-events

`GET https://api.legion.ambient.xyz/v1/services/{service_id}/events`

Authenticate with an API key: `Authorization: Bearer $LEGION_API_KEY`.

Scaling, key, budget and settings history, newest first, kept 30 days. Never a key's secret or a request. Needs `services.read`.

## Path parameters

- `service_id`, string (uuid), required

## Query parameters

- `cursor`, string: Opaque cursor from a previous page's `next_cursor`.
- `limit`, integer

## Responses

### 200

A page of events.

- `items`, array of ServiceEvent, required
  - `id`, integer (int64), required
  - `at`, string (date-time), required
  - `kind`, string, required: created, config_changed, mode_changed, paused, resumed, capped, uncapped, cap_alert, scale_up, scale_down, replica_ready, replica_retired, warm_restart, waiting_for_gpus, rolling_change, key_created, key_rotated, key_revoked, direct_access_removed, disabled, enabled, deleting, deleted, address_changed. New kinds may be added. `reason` and `details` say what changed: a scale_up's placement fields, every changed field of a config_changed, and the reasons per kind listed in CONTRACTS.md "Services", for example replica_retired `restart_failed`.
  - `replicas_before`, integer, required
  - `replicas_after`, integer, required
  - `rental_id`, string (uuid), required
  - `actor`, object, required
    - `kind`, ServiceActorKind, required
    - `id`, string (uuid), required
  - `reason`, string, required
  - `details`, ServiceEventDetails, required
    - `key_id`, string (uuid)
    - `key_name`, string
    - `key_prefix`, string
    - `changes`, array of ServiceEventChange
      - `field`, string, required
      - `from`, string, required
      - `to`, string, required
    - `placement`, string: On scale_up: why this hardware, for example the price and the cheaper offers that did not fit.
    - `gpu_model`, string: On scale_up: the GPU model of the configuration the replica was rented on, for example H100.
    - `gpu_count`, integer: On scale_up: how many GPUs the replica was rented with.
    - `host_id`, string (uuid): On scale_up: the host the replica was rented on.
    - `host_name`, string: On scale_up: that host's friendly name, the `name` of Host and the `host_name` of Offer.
    - `price_per_hour`, Money: On scale_up: what the replica costs an hour, all its GPUs, all-in, at the price it was rented at.
    - `offers_not_fitting`, integer: On scale_up: how many offers were looked at and did not fit the service's hardware or model.
    - `failure_reason`, string: . On replica_retired: the code of why the replica's model service failed, as on `ServeFailure.reason`.
    - `failure_message`, string: . On replica_retired: the failure in plain words, as on `ServeFailure.message`.
- `next_cursor`, string, required

Example:

```json
{
  "items": [
    {
      "id": 0,
      "at": "2026-10-15T12:00:00Z",
      "kind": "string",
      "replicas_before": 0,
      "replicas_after": 0,
      "rental_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
      "actor": {
        "kind": "user",
        "id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b"
      },
      "reason": "string",
      "details": {
        "key_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
        "key_name": "string",
        "key_prefix": "string",
        "changes": [
          {
            "field": "string",
            "from": "string",
            "to": "string"
          }
        ],
        "placement": "string",
        "gpu_model": "string",
        "gpu_count": 0,
        "host_id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
        "host_name": "string",
        "price_per_hour": {
          "amount_minor": 250,
          "currency": "USD"
        },
        "offers_not_fitting": 0,
        "failure_reason": "string",
        "failure_message": "string"
      }
    }
  ],
  "next_cursor": "string"
}
```

### 400

The request is malformed or fails validation. An image reference that
is not a container image reference answers `invalid_image_reference`.

### 401

Missing, unknown, expired or revoked credentials.

### 403

The caller lacks the permission this operation requires (`forbidden`),
or signed in without having joined an organization yet
(`no_organization`; `getOnboarding` and the invitation and
organization operations under it work), or could not sign in
(`email_unverified`, `account_conflict`, and `domain_not_allowed`). `not_invited` is no longer returned to
session tokens.

`access_not_approved`: a signed-in person who is not approved
for the beta yet. Every operation that takes a credential answers it to
them, except `getMe` and `joinMyWaitlist`; the problem carries
`access` (`waitlisted` or `not_requested`, and the email). Approved
means a member of an organization, holding a pending invitation, or Legion; an API key always belongs to a member.

`oauth_token_mcp_only`: the caller sent an OAuth access token (`lgo_`), which is accepted
only by `mcpMessage` and the tool calls it dispatches. Every other operation answers it, whatever
the token's scope. Use an API key or the Legion web app.

`org_suspended`: the caller's organization is suspended. Every operation that takes a
credential answers it, by session or API key, except `getMe` (which shows `org.suspended_at` and
`org.suspension_reason`) and the support operations under `/v1/support/`.

`terms_not_accepted`: an approved caller who has not accepted
the current version of the Terms of Use and the Acceptable Use Policy. Every operation that takes a credential answers it, except `getMe`,
`acceptLegalDocuments`, `joinMyWaitlist` and the wind-down operations
(`listRentals`, `stopRental`, `deleteRental`, `listHosts`,
`updateListing` with `listed` false, `removeHost`); the problem
carries `legal`. An API key acts for the person who created it, so it
is refused until that person accepts. Terminal
operations also return
`session_required` (called with an API key) and `step_up_required`
(neither a sign-in nor a step-up challenge within the step-up window).

### 404

The resource does not exist or belongs to another organization.

### 500

An unexpected server error. Safe to retry.

## Errors

- 403 [`no_organization`](https://legion.ambient.xyz/docs/errors#no_organization)

## Example request

```sh
curl -s "https://api.legion.ambient.xyz/v1/services/$SERVICE_ID/events" \
  -H "Authorization: Bearer $LEGION_API_KEY"
```
