@@ -1213,6 +1213,84 @@ paths:
12131213
12141214 const handle = await runs.reschedule("run_1234", { delay: new Date("2024-06-29T20:45:56.340Z") });
12151215
1216+ " /api/v1/runs/{runId}/result " :
1217+ parameters :
1218+ - $ref : " #/components/parameters/runId"
1219+ get :
1220+ operationId : get_run_result_v1
1221+ summary : Retrieve run result
1222+ description : Returns the execution result of a completed run. Returns 404 if the run doesn't exist or hasn't finished yet.
1223+ responses :
1224+ " 200 " :
1225+ description : Successful request
1226+ content :
1227+ application/json :
1228+ schema :
1229+ type : object
1230+ required : [ok, id]
1231+ properties :
1232+ ok :
1233+ type : boolean
1234+ description : Whether the run completed successfully.
1235+ id :
1236+ type : string
1237+ description : The run ID.
1238+ output :
1239+ type : string
1240+ description : The serialized output (present when ok is true).
1241+ outputType :
1242+ type : string
1243+ description : The content type of the output, e.g. "application/json".
1244+ error :
1245+ type : object
1246+ description : Error details (present when ok is false).
1247+ usage :
1248+ type : object
1249+ description : Execution usage stats.
1250+ properties :
1251+ durationMs :
1252+ type : number
1253+ description : Duration of the run in milliseconds.
1254+ taskIdentifier :
1255+ type : string
1256+ description : The task identifier.
1257+ " 401 " :
1258+ description : Unauthorized request
1259+ content :
1260+ application/json :
1261+ schema :
1262+ type : object
1263+ properties :
1264+ error :
1265+ type : string
1266+ enum :
1267+ - Invalid or Missing API Key
1268+ " 404 " :
1269+ description : Run not found or not yet finished
1270+ content :
1271+ application/json :
1272+ schema :
1273+ type : object
1274+ properties :
1275+ error :
1276+ type : string
1277+ enum :
1278+ - Run either doesn't exist or is not finished
1279+ tags :
1280+ - runs
1281+ security :
1282+ - secretKey : []
1283+ x-codeSamples :
1284+ - lang : typescript
1285+ label : Fetch
1286+ source : |-
1287+ const response = await fetch("https://api.trigger.dev/api/v1/runs/run_1234/result", {
1288+ headers: {
1289+ "Authorization": `Bearer ${process.env.TRIGGER_SECRET_KEY}`,
1290+ },
1291+ });
1292+ const result = await response.json();
1293+
12161294 " /api/v3/runs/{runId} " :
12171295 parameters :
12181296 - $ref : " #/components/parameters/runId"
0 commit comments