@@ -2194,6 +2194,106 @@ paths:
21942194 ]
21952195 }'
21962196
2197+ " /api/v1/batches/{batchId} " :
2198+ parameters :
2199+ - name : batchId
2200+ in : path
2201+ required : true
2202+ schema :
2203+ type : string
2204+ description : The batch ID.
2205+ get :
2206+ operationId : retrieve_batch_v1
2207+ summary : Retrieve a batch
2208+ description : Retrieve a batch by its ID, including its status and the IDs of all runs in the batch.
2209+ responses :
2210+ " 200 " :
2211+ description : Successful request
2212+ content :
2213+ application/json :
2214+ schema :
2215+ type : object
2216+ properties :
2217+ id :
2218+ type : string
2219+ description : The batch ID.
2220+ status :
2221+ type : string
2222+ enum : [PENDING, PROCESSING, COMPLETED, PARTIAL_FAILED, ABORTED]
2223+ description : The current status of the batch.
2224+ idempotencyKey :
2225+ type : string
2226+ nullable : true
2227+ description : The idempotency key provided when triggering, if any.
2228+ createdAt :
2229+ type : string
2230+ format : date-time
2231+ updatedAt :
2232+ type : string
2233+ format : date-time
2234+ runCount :
2235+ type : integer
2236+ description : The total number of runs in the batch.
2237+ runs :
2238+ type : array
2239+ items :
2240+ type : string
2241+ description : Array of run IDs in the batch.
2242+ successfulRunCount :
2243+ type : integer
2244+ nullable : true
2245+ description : Number of successful runs (populated after completion).
2246+ failedRunCount :
2247+ type : integer
2248+ nullable : true
2249+ description : Number of failed runs (populated after completion).
2250+ errors :
2251+ type : array
2252+ nullable : true
2253+ description : Error details for failed items (present for PARTIAL_FAILED batches).
2254+ items :
2255+ type : object
2256+ properties :
2257+ index :
2258+ type : integer
2259+ description : The index of the failed item.
2260+ taskIdentifier :
2261+ type : string
2262+ description : The task identifier of the failed item.
2263+ error :
2264+ type : object
2265+ description : The error details.
2266+ errorCode :
2267+ type : string
2268+ nullable : true
2269+ description : An optional error code.
2270+ " 401 " :
2271+ description : Unauthorized request
2272+ content :
2273+ application/json :
2274+ schema :
2275+ $ref : " #/components/schemas/ErrorResponse"
2276+ " 404 " :
2277+ description : Batch not found
2278+ content :
2279+ application/json :
2280+ schema :
2281+ $ref : " #/components/schemas/ErrorResponse"
2282+ tags :
2283+ - tasks
2284+ security :
2285+ - secretKey : []
2286+ x-codeSamples :
2287+ - lang : typescript
2288+ label : Fetch
2289+ source : |-
2290+ const response = await fetch("https://api.trigger.dev/api/v1/batches/batch_1234", {
2291+ headers: {
2292+ "Authorization": `Bearer ${process.env.TRIGGER_SECRET_KEY}`,
2293+ },
2294+ });
2295+ const batch = await response.json();
2296+
21972297 " /api/v1/queues " :
21982298 get :
21992299 operationId : list_queues_v1
0 commit comments