Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(endpoints): record per-version last execution times (#60269)

Jovan Sakovica8baba21c678
diff --git a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_from_query.ambr b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_from_query.ambr
index 800a3fff4b5e..4d81dc6a2021 100644
--- a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_from_query.ambr
+++ b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_from_query.ambr
@@ -1122,7 +1122,7 @@
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
(SELECT nullIf(nullIf(events.`$session_id`, ''), 'null') AS session_id
FROM events
- WHERE and(equals(events.team_id, 99999), notEmpty(nullIf(nullIf(events.`$session_id`, ''), 'null')), lessOrEquals(events.timestamp, now64(6, 'UTC')), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.person_properties, 'email'), ''), 'null'), '^"|"$', ''), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), notEmpty(nullIf(nullIf(events.`$session_id`, ''), 'null')), lessOrEquals(events.timestamp, now64(6, 'UTC')), equals(events.mat_pp_email, 'bla'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
GROUP BY nullIf(nullIf(events.`$session_id`, ''), 'null')
HAVING 1
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
diff --git a/products/endpoints/backend/api.py b/products/endpoints/backend/api.py
index 24d2fc4fc3a0..30ce8a3799fa 100644
--- a/products/endpoints/backend/api.py
+++ b/products/endpoints/backend/api.py
@@ -40,7 +40,6 @@ from posthog.schema import (
)
from posthog.hogql import ast
-from posthog.hogql.constants import LimitContext
from posthog.hogql.context import HogQLContext
from posthog.hogql.errors import ExposedHogQLError, QueryError, ResolutionError
from posthog.hogql.parser import parse_expr, parse_select
@@ -64,7 +63,6 @@ from posthog.ducklake.common import get_duckgres_server_for_organization
from posthog.errors import ExposedCHQueryError
from posthog.event_usage import get_request_analytics_properties, report_user_action
from posthog.exceptions_capture import capture_exception
-from posthog.hogql_queries.hogql_query_runner import HogQLQueryRunner
from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL, BREAKDOWN_OTHER_STRING_LABEL
from posthog.hogql_queries.query_runner import BLOCKING_EXECUTION_MODES
from posthog.models import User
@@ -546,6 +544,8 @@ class EndpointViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, TaggedItemView
result["version"] = version.version
result["version_id"] = str(version.id)
result["endpoint_is_active"] = endpoint.is_active
+ # Version detail returns the version's own execution time (may be null until it's been run).
+ result["last_executed_at"] = version.last_executed_at.isoformat() if version.last_executed_at else None
result["version_created_at"] = version.created_at.isoformat()
result["version_updated_at"] = version.updated_at.isoformat() if version.updated_at else None
result["version_created_by"] = UserBasicSerializer(version.created_by).data if version.created_by else None
@@ -2372,9 +2372,15 @@ class EndpointViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, TaggedItemView
if get_query_tag_value("access_method") == "personal_api_key":
now = timezone.now()
- if endpoint.last_executed_at is None or (now - endpoint.last_executed_at > timedelta(hours=1)):
+ throttle = timedelta(minutes=30)
+ if endpoint.last_executed_at is None or (now - endpoint.last_executed_at > throttle):
endpoint.last_executed_at = now
endpoint.save(update_fields=["last_executed_at"])
+ if version_obj is not None and (
+ version_obj.last_executed_at is None or (now - version_obj.last_executed_at > throttle)
+ ):
+ version_obj.last_executed_at = now
+ version_obj.save(update_fields=["last_executed_at"])
if isinstance(result.data, dict):
result.data["name"] = endpoint.name
@@ -2441,14 +2447,17 @@ class EndpointViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, TaggedItemView
)
@extend_schema(
- description="Get the last execution times in the past 6 months for multiple endpoints.",
+ description=(
+ "Get the most recent execution time per endpoint (endpoint-level). "
+ "Timestamps are recorded by the run path for personal-API-key calls. "
+ "For per-version usage, query the query_log table directly."
+ ),
request=EndpointLastExecutionTimesRequest,
responses={200: QueryStatusResponse},
)
@action(methods=["POST"], detail=False, url_path="last_execution_times")
def get_endpoints_last_execution_times(self, request: Request, *args, **kwargs) -> Response:
try:
- tag_queries(product=Product.ENDPOINTS, feature=Feature.ENDPOINT_LAST_EXECUTION)
data = EndpointLastExecutionTimesRequest.model_validate(request.data)
names = data.names
if not names:
@@ -2459,30 +2468,20 @@ class EndpointViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, TaggedItemView
status=200,
)
- validated_names = []
for name in names:
if not isinstance(name, str) or not re.fullmatch(ENDPOINT_NAME_REGEX, name):
raise ValidationError({"names": f"Invalid endpoint name: {name}"})
- validated_names.append(f"'{name}'")
- names_list = ",".join(validated_names)
- query = HogQLQuery(
- query=f"select name, max(query_start_time) as last_executed_at from query_log where name in ({names_list}) and endpoint like '%/endpoints/%' and is_personal_api_key_request and query_start_time >= (today() - interval 6 month) group by name",
- name="get_endpoints_last_execution_times",
- )
- hogql_runner = HogQLQueryRunner(
- query=query,
- team=self.team,
- modifiers=HogQLQueryModifiers(),
- limit_context=LimitContext.QUERY,
+ endpoint_rows = list(
+ Endpoint.objects.filter(team=self.team, name__in=names, last_executed_at__isnull=False).values_list(
+ "name", "last_executed_at"
+ )
)
- result = hogql_runner.calculate()
+ results = [[name, ts.isoformat()] for name, ts in endpoint_rows if ts is not None]
- query_status = QueryStatus(id="", team_id=self.team.pk, complete=True, results=result.results)
+ query_status = QueryStatus(id="", team_id=self.team.pk, complete=True, results=results)
return Response(QueryStatusResponse(query_status=query_status).model_dump(), status=200)
- except ConcurrencyLimitExceeded as c:
- raise Throttled(detail=str(c))
except Exception as e:
capture_exception(e, {"product": Product.ENDPOINTS, "team_id": self.team_id})
raise
diff --git a/products/endpoints/backend/migrations/0030_endpointversion_last_executed_at.py b/products/endpoints/backend/migrations/0030_endpointversion_last_executed_at.py
new file mode 100644
index 000000000000..0244a8abea34
--- /dev/null
+++ b/products/endpoints/backend/migrations/0030_endpointversion_last_executed_at.py
@@ -0,0 +1,28 @@
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("endpoints", "0029_remove_data_modeling_models"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="endpointversion",
+ name="last_executed_at",
+ field=models.DateTimeField(
+ blank=True,
+ help_text="When this version was last executed via the run API. Updated with 30-minute granularity.",
+ null=True,
+ ),
+ ),
+ migrations.AlterField(
+ model_name="endpoint",
+ name="last_executed_at",
+ field=models.DateTimeField(
+ blank=True,
+ help_text="When this endpoint was last executed via the run API. Updated with 30-minute granularity.",
+ null=True,
+ ),
+ ),
+ ]
diff --git a/products/endpoints/backend/migrations/max_migration.txt b/products/endpoints/backend/migrations/max_migration.txt
index 5ab9371cdad1..83eec5a41bfc 100644
--- a/products/endpoints/backend/migrations/max_migration.txt
+++ b/products/endpoints/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0029_remove_data_modeling_models
+0030_endpointversion_last_executed_at
diff --git a/products/endpoints/backend/models.py b/products/endpoints/backend/models.py
index 30017f912b6f..7974a9654e74 100644
--- a/products/endpoints/backend/models.py
+++ b/products/endpoints/backend/models.py
@@ -142,6 +142,11 @@ class EndpointVersion(UpdatedMetaFields, models.Model):
blank=True,
help_text="Per-column bucket function overrides for range variable materialization. E.g. {'timestamp': 'toStartOfHour'}",
)
+ last_executed_at = models.DateTimeField(
+ null=True,
+ blank=True,
+ help_text="When this version was last executed via the run API. Updated with 30-minute granularity.",
+ )
class Meta:
db_table = "endpoints_endpointversion"
@@ -288,7 +293,7 @@ class Endpoint(CreatedMetaFields, UpdatedMetaFields, DeletedMetaFields, UUIDTMod
"""Model for storing endpoints that can be accessed via API endpoints.
Endpoints allow creating reusable query endpoints like:
- /api/environments/{team_id}/endpoints/{endpoint_name}/run
+ /api/projects/{team_id}/endpoints/{endpoint_name}/run
Query, description, data_freshness_seconds, and materialization settings are stored
in EndpointVersion, allowing per-version configuration.
@@ -318,7 +323,7 @@ class Endpoint(CreatedMetaFields, UpdatedMetaFields, DeletedMetaFields, UUIDTMod
last_executed_at = models.DateTimeField(
null=True,
blank=True,
- help_text="When this endpoint was last executed via the run API. Updated with hour granularity.",
+ help_text="When this endpoint was last executed via the run API. Updated with 30-minute granularity.",
)
class Meta:
@@ -338,7 +343,7 @@ class Endpoint(CreatedMetaFields, UpdatedMetaFields, DeletedMetaFields, UUIDTMod
@property
def endpoint_path(self) -> str:
"""Return the API endpoint path for this endpoint."""
- return f"/api/environments/{self.team.id}/endpoints/{self.name}/run"
+ return f"/api/projects/{self.team.id}/endpoints/{self.name}/run"
def has_query_changed(self, new_query: dict[str, Any]) -> bool:
"""Deep comparison to check if query has actually changed.
diff --git a/products/endpoints/backend/openapi.py b/products/endpoints/backend/openapi.py
index 48dd8f898417..8b2e284369fc 100644
--- a/products/endpoints/backend/openapi.py
+++ b/products/endpoints/backend/openapi.py
@@ -26,7 +26,7 @@ def generate_openapi_spec(
version: Specific version to generate spec for. If None, uses current version.
"""
base_url = settings.SITE_URL
- run_path = f"/api/environments/{team_id}/endpoints/{endpoint.name}/run"
+ run_path = f"/api/projects/{team_id}/endpoints/{endpoint.name}/run"
target_version = version or endpoint.get_version()
description = target_version.description
diff --git a/products/endpoints/backend/serializers.py b/products/endpoints/backend/serializers.py
index a6bb2d040b3a..36c656d29feb 100644
--- a/products/endpoints/backend/serializers.py
+++ b/products/endpoints/backend/serializers.py
@@ -140,7 +140,7 @@ class EndpointResponseSerializer(serializers.Serializer):
help_text="How fresh the data is, in seconds. One of: 900, 1800, 3600, 21600, 43200, 86400, 604800.",
)
endpoint_path = serializers.CharField(
- help_text="Relative API path to execute this endpoint (e.g. /api/environments/{team_id}/endpoints/{name}/run).",
+ help_text="Relative API path to execute this endpoint (e.g. /api/projects/{team_id}/endpoints/{name}/run).",
)
url = serializers.CharField(
allow_null=True,
@@ -219,6 +219,14 @@ class EndpointRunResponseSerializer(serializers.Serializer):
class EndpointVersionResponseSerializer(EndpointResponseSerializer):
"""Extended endpoint representation when viewing a specific version."""
+ last_executed_at = serializers.DateTimeField(
+ allow_null=True,
+ help_text=(
+ "When this specific version was last executed via the API (ISO 8601), or null if it hasn't "
+ "been executed. Per-version tracking is recent, so versions that predate it read null until "
+ "their next run."
+ ),
+ )
version = serializers.IntegerField(help_text="Version number.")
version_id = serializers.UUIDField(help_text="Version unique identifier (UUID).")
endpoint_is_active = serializers.BooleanField(
diff --git a/products/endpoints/backend/tests/conftest.py b/products/endpoints/backend/tests/conftest.py
index f08704453e11..c508355d0479 100644
--- a/products/endpoints/backend/tests/conftest.py
+++ b/products/endpoints/backend/tests/conftest.py
@@ -32,6 +32,7 @@ def create_endpoint_with_version(
)
EndpointVersion.objects.create(
endpoint=endpoint,
+ team=team,
version=current_version,
query=query,
description=description,
diff --git a/products/endpoints/backend/tests/test_deactivate_stale_materializations.py b/products/endpoints/backend/tests/test_deactivate_stale_materializations.py
index 305d7daf962b..939ef31b7e25 100644
--- a/products/endpoints/backend/tests/test_deactivate_stale_materializations.py
+++ b/products/endpoints/backend/tests/test_deactivate_stale_materializations.py
@@ -54,7 +54,6 @@ class TestDeactivateStaleMaterializationsTask(BaseTest):
created_by=self.user,
is_active=True,
last_executed_at=last_executed_at,
- current_version=1,
)
table = DataWarehouseTable.objects.create(
team=self.team,
diff --git a/products/endpoints/backend/tests/test_endpoint.py b/products/endpoints/backend/tests/test_endpoint.py
index 458aa6b2f1cb..1debae77d0fd 100644
--- a/products/endpoints/backend/tests/test_endpoint.py
+++ b/products/endpoints/backend/tests/test_endpoint.py
@@ -1,5 +1,4 @@
from datetime import datetime
-from time import sleep
from typing import Any
from freezegun import freeze_time
@@ -17,7 +16,7 @@ from posthog.models.team import Team
from posthog.models.user import User
from posthog.models.utils import generate_random_token_personal, hash_key_value
-from products.endpoints.backend.models import Endpoint
+from products.endpoints.backend.models import Endpoint, EndpointVersion
from products.endpoints.backend.tests.conftest import create_endpoint_with_version
from products.product_analytics.backend.models.insight_variable import InsightVariable
@@ -791,7 +790,7 @@ class TestEndpoint(ClickhouseTestMixin, APIBaseTest):
is_active=True,
)
- # Execute the endpoints using API key to generate query_log entries with is_personal_api_key_request=true
+ # Execute the endpoints using API key to update Postgres execution timestamps.
response1 = self.client.get(
f"/api/environments/{self.team.id}/endpoints/test_query_1/run/",
headers={"authorization": f"Bearer {self.api_key}"},
@@ -804,9 +803,6 @@ class TestEndpoint(ClickhouseTestMixin, APIBaseTest):
)
self.assertEqual(response2.status_code, status.HTTP_200_OK)
- # wait for the queries to end up in query_log :/
- sleep(3)
-
data = {"names": ["test_query_1", "test_query_2", "nonexistent_query"]}
response = self.client.post(
f"/api/environments/{self.team.id}/endpoints/last_execution_times/", data, format="json"
@@ -837,6 +833,62 @@ class TestEndpoint(ClickhouseTestMixin, APIBaseTest):
f"Invalid timestamp format for test_query_2: {query_timestamps['test_query_2']}",
)
+ endpoint = Endpoint.objects.get(name="test_query_1", team=self.team)
+ version = EndpointVersion.objects.get(endpoint=endpoint, version=1)
+ self.assertIsNotNone(endpoint.last_executed_at)
+ self.assertIsNotNone(version.last_executed_at)
+
+ def test_last_execution_times_is_endpoint_level_only(self):
+ """last_execution_times returns endpoint-level rows only — per-version data is not exposed."""
+ endpoint = create_endpoint_with_version(
+ name="test_query_versions",
+ team=self.team,
+ query={"kind": "HogQLQuery", "query": "SELECT 1"},
+ created_by=self.user,
+ is_active=True,
+ current_version=2,
+ )
+ endpoint.last_executed_at = datetime.fromisoformat("2026-05-02T12:00:00+00:00")
+ endpoint.save(update_fields=["last_executed_at"])
+ # A per-version timestamp must not surface through this endpoint.
+ version_2 = endpoint.get_version(2)
+ assert version_2 is not None
+ version_2.last_executed_at = datetime.fromisoformat("2026-05-09T12:00:00+00:00")
+ version_2.save(update_fields=["last_executed_at"])
+
+ data = {"names": ["test_query_versions"]}
+ response = self.client.post(
+ f"/api/environments/{self.team.id}/endpoints/last_execution_times/", data, format="json"
+ )
+
+ self.assertEqual(response.status_code, status.HTTP_200_OK, response.json())
+ results = response.json()["query_status"]["results"]
+ # Endpoint-level shape [name, last_executed_at] — two elements, no version, endpoint timestamp.
+ self.assertEqual(results, [["test_query_versions", "2026-05-02T12:00:00+00:00"]])
+
+ def test_versions_endpoint_reports_per_version_last_executed_at(self):
+ """endpoint-versions reports each version's own last_executed_at, not the endpoint-level one."""
+ endpoint = create_endpoint_with_version(
+ name="v_test",
+ team=self.team,
+ query={"kind": "HogQLQuery", "query": "SELECT 1"},
+ created_by=self.user,
+ is_active=True,
+ )
+ endpoint.last_executed_at = datetime.fromisoformat("2026-05-02T12:00:00+00:00")
+ endpoint.save(update_fields=["last_executed_at"])
+ version = endpoint.get_version()
+ assert version is not None
+ version.last_executed_at = datetime.fromisoformat("2026-05-09T12:00:00+00:00")
+ version.save(update_fields=["last_executed_at"])
+
+ response = self.client.get(f"/api/environments/{self.team.id}/endpoints/v_test/versions/")
+ self.assertEqual(response.status_code, status.HTTP_200_OK, response.json())
+ rows = response.json()["results"]
+ self.assertEqual(len(rows), 1)
+ # The version's own timestamp, not the endpoint-level one.
+ self.assertEqual(rows[0]["last_executed_at"], "2026-05-09T12:00:00+00:00")
+
def test_get_last_execution_times_with_nonexistent_query(self):
"""Test getting last execution times with a nonexistent query."""
data = {"names": ["nonexistent_query"]}
diff --git a/products/endpoints/backend/tests/test_endpoint_query_tagging.py b/products/endpoints/backend/tests/test_endpoint_query_tagging.py
index 4c2f8a2f3abb..81d52cad37ae 100644
--- a/products/endpoints/backend/tests/test_endpoint_query_tagging.py
+++ b/products/endpoints/backend/tests/test_endpoint_query_tagging.py
@@ -13,9 +13,8 @@ from products.endpoints.backend.tests.conftest import create_endpoint_with_versi
def _find_endpoint_feature_call(spy: mock.MagicMock):
"""Return the tag_queries call that set both product=ENDPOINTS and feature=...
- Only `_execute_query_and_respond` and `get_endpoints_last_execution_times`
- set both kwargs together; other endpoint-side tag_queries calls only set
- workload/warehouse_query/endpoint_version/client_query_id.
+ Only `_execute_query_and_respond` sets both kwargs together; other endpoint-side tag_queries calls
+ only set workload/warehouse_query/endpoint_version/client_query_id.
"""
for call in spy.call_args_list:
if call.kwargs.get("product") == Product.ENDPOINTS and "feature" in call.kwargs:
@@ -34,7 +33,6 @@ class TestEndpointQueryTagging(ClickhouseTestMixin, APIBaseTest):
is_active=True,
)
self.run_url = f"/api/environments/{self.team.id}/endpoints/{self.endpoint.name}/run/"
- self.last_exec_url = f"/api/environments/{self.team.id}/endpoints/last_execution_times/"
self.api_key_value = generate_random_token_personal()
PersonalAPIKey.objects.create(
@@ -65,11 +63,3 @@ class TestEndpointQueryTagging(ClickhouseTestMixin, APIBaseTest):
call = _find_endpoint_feature_call(spy)
assert call is not None, f"no tag_queries(product=ENDPOINTS, feature=...) call found: {spy.call_args_list}"
assert call.kwargs["feature"] == Feature.ENDPOINT_EXECUTION
-
- def test_last_execution_times_tags_endpoint_last_execution(self):
- with mock.patch("products.endpoints.backend.api.tag_queries", wraps=tag_queries) as spy:
- response = self.client.post(self.last_exec_url, {"names": [self.endpoint.name]}, format="json")
- assert response.status_code == status.HTTP_200_OK, response.json()
- call = _find_endpoint_feature_call(spy)
- assert call is not None, f"no tag_queries(product=ENDPOINTS, feature=...) call found: {spy.call_args_list}"
- assert call.kwargs["feature"] == Feature.ENDPOINT_LAST_EXECUTION
diff --git a/products/endpoints/backend/tests/test_openapi_spec.py b/products/endpoints/backend/tests/test_openapi_spec.py
index 1aa784872102..cd933b010201 100644
--- a/products/endpoints/backend/tests/test_openapi_spec.py
+++ b/products/endpoints/backend/tests/test_openapi_spec.py
@@ -39,7 +39,7 @@ class TestEndpointOpenAPISpec(ClickhouseTestMixin, APIBaseTest):
self.assertIn("servers", spec)
self.assertEqual(len(spec["servers"]), 1)
- run_path = f"/api/environments/{self.team.id}/endpoints/basic-endpoint/run"
+ run_path = f"/api/projects/{self.team.id}/endpoints/basic-endpoint/run"
self.assertIn(run_path, spec["paths"])
post_op = spec["paths"][run_path]["post"]
diff --git a/products/endpoints/frontend/generated/api.schemas.ts b/products/endpoints/frontend/generated/api.schemas.ts
index 4ad487d52015..0c52b72480fb 100644
--- a/products/endpoints/frontend/generated/api.schemas.ts
+++ b/products/endpoints/frontend/generated/api.schemas.ts
@@ -126,7 +126,7 @@ export interface EndpointResponseApi {
is_active: boolean
/** How fresh the data is, in seconds. One of: 900, 1800, 3600, 21600, 43200, 86400, 604800. */
data_freshness_seconds: number
- /** Relative API path to execute this endpoint (e.g. /api/environments/{team_id}/endpoints/{name}/run). */
+ /** Relative API path to execute this endpoint (e.g. /api/projects/{team_id}/endpoints/{name}/run). */
endpoint_path: string
/**
* Absolute URL to execute this endpoint.
@@ -276,7 +276,7 @@ export interface EndpointVersionResponseApi {
is_active: boolean
/** How fresh the data is, in seconds. One of: 900, 1800, 3600, 21600, 43200, 86400, 604800. */
data_freshness_seconds: number
- /** Relative API path to execute this endpoint (e.g. /api/environments/{team_id}/endpoints/{name}/run). */
+ /** Relative API path to execute this endpoint (e.g. /api/projects/{team_id}/endpoints/{name}/run). */
endpoint_path: string
/**
* Absolute URL to execute this endpoint.
@@ -311,7 +311,7 @@ export interface EndpointVersionResponseApi {
*/
derived_from_insight: string | null
/**
- * When this endpoint was last executed via the API (ISO 8601), or null if never executed.
+ * When this specific version was last executed via the API (ISO 8601), or null if it hasn't been executed. Per-version tracking is recent, so versions that predate it read null until their next run.
* @nullable
*/
last_executed_at: string | null
diff --git a/products/endpoints/frontend/generated/api.ts b/products/endpoints/frontend/generated/api.ts
index 8d422e6f58ce..70fe594cdf59 100644
--- a/products/endpoints/frontend/generated/api.ts
+++ b/products/endpoints/frontend/generated/api.ts
@@ -299,7 +299,7 @@ export const getEndpointsLastExecutionTimesCreateUrl = (projectId: string) => {
}
/**
- * Get the last execution times in the past 6 months for multiple endpoints.
+ * Get the most recent execution time per endpoint (endpoint-level). Timestamps are recorded by the run path for personal-API-key calls. For per-version usage, query the query_log table directly.
*/
export const endpointsLastExecutionTimesCreate = async (
projectId: string,
diff --git a/products/endpoints/frontend/generated/api.zod.ts b/products/endpoints/frontend/generated/api.zod.ts
index 8fd84c62c61f..74907e680785 100644
--- a/products/endpoints/frontend/generated/api.zod.ts
+++ b/products/endpoints/frontend/generated/api.zod.ts
@@ -166,7 +166,7 @@ export const EndpointsRunCreateBody = /* @__PURE__ */ zod
.describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')
/**
- * Get the last execution times in the past 6 months for multiple endpoints.
+ * Get the most recent execution time per endpoint (endpoint-level). Timestamps are recorded by the run path for personal-API-key calls. For per-version usage, query the query_log table directly.
*/
export const EndpointsLastExecutionTimesCreateBody = /* @__PURE__ */ zod.object({
names: zod.array(zod.string()),
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index ba4817c57cd2..4d27af1827bd 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -14001,7 +14001,7 @@ export namespace Schemas {
is_active: boolean;
/** How fresh the data is, in seconds. One of: 900, 1800, 3600, 21600, 43200, 86400, 604800. */
data_freshness_seconds: number;
- /** Relative API path to execute this endpoint (e.g. /api/environments/{team_id}/endpoints/{name}/run). */
+ /** Relative API path to execute this endpoint (e.g. /api/projects/{team_id}/endpoints/{name}/run). */
endpoint_path: string;
/**
* Absolute URL to execute this endpoint.
@@ -14132,7 +14132,7 @@ export namespace Schemas {
is_active: boolean;
/** How fresh the data is, in seconds. One of: 900, 1800, 3600, 21600, 43200, 86400, 604800. */
data_freshness_seconds: number;
- /** Relative API path to execute this endpoint (e.g. /api/environments/{team_id}/endpoints/{name}/run). */
+ /** Relative API path to execute this endpoint (e.g. /api/projects/{team_id}/endpoints/{name}/run). */
endpoint_path: string;
/**
* Absolute URL to execute this endpoint.
@@ -14167,7 +14167,7 @@ export namespace Schemas {
*/
derived_from_insight: string | null;
/**
- * When this endpoint was last executed via the API (ISO 8601), or null if never executed.
+ * When this specific version was last executed via the API (ISO 8601), or null if it hasn't been executed. Per-version tracking is recent, so versions that predate it read null until their next run.
* @nullable
*/
last_executed_at: string | null;