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

# API Reference

> REST API endpoints for Edge Compute function observability.

All endpoints are under `/v2/compute/funcs/{id}` and require a valid Telnyx API key in the `Authorization` header. `{id}` is the function id.

## Get function logs

```http theme={null}
GET /v2/compute/funcs/{id}/logs
```

The `type` query parameter selects the log stream:

| `type`        | Description                                                      |
| ------------- | ---------------------------------------------------------------- |
| `runtime`     | Function stdout/stderr. This is the default.                     |
| `invocations` | Platform-generated HTTP request records, one per request served. |

Both types support the same time-window and limit parameters:

| Parameter    | Description                                         |
| ------------ | --------------------------------------------------- |
| `type`       | `runtime` or `invocations`; defaults to `runtime`   |
| `start_time` | Return records at or after this RFC 3339 timestamp  |
| `end_time`   | Return records at or before this RFC 3339 timestamp |
| `limit`      | Maximum number of records to return                 |

Invocation records include request metadata such as timestamp, method, path, status code, duration, request and response size, and serving region when available.

## Get function metric aggregates

```http theme={null}
GET /v2/compute/funcs/{id}/metric_aggregates
```

Returns aggregate request, latency, CPU, memory, and resource-limit metrics for the requested time window.

Required query parameters are `start_time` and `end_time`. The endpoint also supports edge-site and namespace filters and standard page parameters.

## List function revisions

```http theme={null}
GET /v2/compute/funcs/{id}/revisions
```

Returns ship/deployment history newest first. Each entry describes that ship's build and deployment state. Failed ships can include their own failure stage and failure reason; a build that failed before producing an image has no rollback revision id.

## Inspect latest ship

```http theme={null}
GET /v2/compute/funcs/{id}/ship_inspection
```

Returns the outcome of the function's latest ship. The response classifies the outcome by stage and includes a customer-facing reason. Failure stages include `build`, `deploy`, `platform`, `pre_build`, and `security_review`; `none` represents success and `pending` represents a ship still in progress.

A build or deploy failure can also include a platform-provided snippet when one is available.

`ship_inspection` is the customer-facing, stage-neutral name for this operation: the result describes the entire ship rather than only the build stage.
