Api

The `Api` entity.

Definition

TypeScript
interface Api {
  id: string;
  workspaceId: string;
  handle: string;
  name: string;
  description: string | null;
  auth:
    | { kind: "public"; rateLimitPerMinute?: number | undefined }
    | { kind: "workspace_api_key" }
    | { kind: "oauth"; scope: string }
    | { kind: "event_signature"; secretSource: "secret_ref"; secretId: string };
  cors: {
    allowOrigins: Array<string>;
    allowCredentials?: boolean | undefined;
  } | null;
  rateLimit: { perMinute: number } | null;
  enabled: boolean;
  createdBy: string;
  createdAt: string;
  updatedAt: string;
}

Fields

FieldTypeNotes
idstringreadonly required
workspaceIdstringrequired — Workspace that owns this api.
handlestringrequired — Per-workspace handle that becomes the URL segment, e.g. 'orders'.
namestringrequired — Human-readable name.
descriptionstring | nullrequired — Optional longer-form description of the api's purpose.
auth{ kind: "public"; rateLimitPerMinute?: number | undefined; } | { kind: "workspace_api_key"; } | { kind: "oauth"; scope: string; } | { kind: "event_signature"; secretSource: "secret_ref"; secretId: string; }required — Default auth policy for endpoints under this api.
cors{ allowOrigins: Array<string>; allowCredentials?: boolean | undefined; } | nullrequired — Default CORS policy for endpoints under this api; null means CORS isn't applied.
rateLimit{ perMinute: number; } | nullrequired — Optional global rate limit applied across the whole api.
enabledbooleanrequired — Whether the api accepts traffic; false rejects requests.
createdBystringrequired — User who created the api. Used as the run.userId fallback for public endpoints with no caller identity.
createdAtstringreadonly required — ISO-8601 timestamp of creation.
updatedAtstringreadonly required — ISO-8601 timestamp of the last update.