<@ULVA73B9P> is there a way to determine when a se...
# ask-marvin
s
@Marvin is there a way to determine when a service account in Prefect was created?
m
thought for 104.8 seconds
Yes — if you're using Prefect Cloud, a service account has a creation timestamp. Your options are: 1. Prefect Cloud UI - Check Account Settings → Service Accounts - Depending on what the UI exposes in your account, you may see creation metadata there 2. Audit Log - In Account Settings → Audit Log, look for service account creation events - The event type is
prefect-cloud.service-account.created
- This gives you the exact timestamp - Audit Log availability depends on your plan 3. Cloud API Service accounts are represented internally as “bots”, and the API response includes a
created
field. Relevant endpoint: -
GET /api/accounts/{account_id}/bots/{id}
That response includes fields like:
Copy code
json
{
  "id": "uuid",
  "created": "2024-08-06T10:30:00+00:00",
  "updated": "2024-08-06T15:45:00+00:00",
  "name": "my-service-account"
}
There’s also an events endpoint if you want to check audit-style records: -
GET /api/accounts/{account_id}/events
One caveat: there does not appear to be a Prefect CLI command for listing service accounts or their creation times. Useful docs: - Service accounts docs - Audit log docs - Prefect Cloud API reference If you want, I can also help you with a small script to fetch the
created
timestamp from the Cloud API.