diff --git a/lib/coolify.ts b/lib/coolify.ts index 85f821f..0e48d4c 100644 --- a/lib/coolify.ts +++ b/lib/coolify.ts @@ -454,7 +454,11 @@ export async function getDeploymentLogs(deploymentUuid: string): Promise<{ logs: } export async function listApplicationDeployments(uuid: string): Promise { - return coolifyFetch(`/applications/${uuid}/deployments`); + // Coolify v4 nests this under /deployments/applications/{uuid} + // and returns { count, deployments }. Normalize to a flat array. + const raw = await coolifyFetch(`/deployments/applications/${uuid}?take=50`); + if (Array.isArray(raw)) return raw as CoolifyDeployment[]; + return (raw?.deployments ?? []) as CoolifyDeployment[]; } // ──────────────────────────────────────────────────