---
title: "Delegate up to 50 issues to one agent in a single request"
method: POST
path: "/api/workspaces/{workspaceId}/issues/delegate-batch"
tags: ["Agents"]
---

# Delegate up to 50 issues to one agent in a single request

`POST /api/workspaces/{workspaceId}/issues/delegate-batch`

## Request

- Base URL: `https://hiveship.app/api`
- URL: `https://hiveship.app/api/api/workspaces/{workspaceId}/issues/delegate-batch`
- Auth: API key in cookie `hiveship_access`

## Path parameters

- `workspaceId` string, required

## Request body

- object
  - `issueIds` string[], required
  - `agentId` string, cuid, required

## Response `200`

Sessions created. `failures` is non-empty only when a concurrent delegation won a race.

- object
  - `success` boolean, required
  - `data` object, required
    - `delegatedCount` integer, required
    - `failedCount` integer, required
    - `items` object[], required
      - `id` string, cuid, required
      - `status` 'QUEUED' | 'WORKING' | 'WAITING_INPUT' | 'ERRORED' | 'COMPLETED', required
      - `issueId` string, cuid, required
      - `agentId` string, cuid, required
      - `startedAt` string, date-time, nullable, required
      - `completedAt` string, date-time, nullable, required
      - `errorMessage` string, nullable, required
      - `externalUrls` string[], required
      - `tokenUsage` integer, nullable, required
      - `modelUsed` string, nullable, required
      - `modelUsage` object[], required
        - `model` string, required
        - `inputTokens` integer, required
        - `outputTokens` integer, required
        - `cacheReadTokens` integer, required
        - `cacheWriteTokens` integer, required
        - `totalTokens` integer, required
      - `createdAt` string, date-time, required
    - `failures` object[], required
      - `issueId` string, required
      - `reason` string, required

## Other responses

- `400`: Duplicate ids, batch over cap, an already-delegated issue, or agent-run quota exhausted
- `404`: Agent or one of the issues not found

---

[API](https://skmtc.dev/hiveship/apis/hiveship-api.md) · [All operations](https://skmtc.dev/hiveship/apis/hiveship-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hiveship/apis/hiveship-api/revisions/73d3e26544e4?raw)
