# Queue Management

## Reallocate Tasks from Dead Letter Queue

> Reallocate tasks from the Dead Letter Queue (DLQ) to the main queue for a specified job. This endpoint allows you to retry failed tasks that were moved to DLQ.

```json
{"openapi":"3.1.0","info":{"title":"GLChat Document Processing Orchestrator (DPO) API","version":"0.1.0"},"paths":{"/reallocate/{job_name}":{"post":{"tags":["Queue Management"],"summary":"Reallocate Tasks from Dead Letter Queue","description":"Reallocate tasks from the Dead Letter Queue (DLQ) to the main queue for a specified job. This endpoint allows you to retry failed tasks that were moved to DLQ.","operationId":"reallocate_reallocate__job_name__post","parameters":[{"name":"job_name","in":"path","required":true,"schema":{"type":"string","description":"The name of the job for which tasks are to be reallocated","title":"Job Name"},"description":"The name of the job for which tasks are to be reallocated"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ReallocateRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReallocateResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/glchat_dpo__api__model__common__HTTPExceptionModel"}}},"description":"Bad Request"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/glchat_dpo__api__model__common__HTTPExceptionModel"}}},"description":"Internal Server Error"}}}}},"components":{"schemas":{"ReallocateRequest":{"properties":{"max_requeued_messages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Requeued Messages","description":"The maximum number of messages to requeue"}},"type":"object","title":"ReallocateRequest","description":"Request model for reallocate task API."},"ReallocateResponse":{"properties":{"message":{"type":"string","title":"Message","description":"The message of the reallocate task"}},"type":"object","required":["message"],"title":"ReallocateResponse","description":"Response model for reallocate task API."},"glchat_dpo__api__model__common__HTTPExceptionModel":{"properties":{"detail":{"$ref":"#/components/schemas/glchat_dpo__api__model__common__ErrorResponse","description":"Error details"}},"type":"object","required":["detail"],"title":"HTTPExceptionModel","description":"HTTP exception model for API error responses."},"glchat_dpo__api__model__common__ErrorResponse":{"properties":{"message":{"type":"string","title":"Message","description":"The error message"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Additional error details from the exception"}},"type":"object","required":["message"],"title":"ErrorResponse","description":"Error response model for API error responses."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```
