# Pull the next record from a work queue

Claims the oldest unclaimed deal in one queue FOR THE CALLER and answers it, so two people working the same queue never take the same deal. The `queue` segment names a stage band of the deals board's own status vocabulary, and an unknown one is refused with the list of bands that exist. `role` is optional and defaults to `opener`; unclaimed means that role's person cell is empty. An empty queue is a 404 — 'nothing waiting' is the answer, not a failure. Deals page only.

Access class: `def:read`.

## Endpoint

`POST /v1/definitions/{key}/queues/{queue}/pull`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |
| queue | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "role": "string"
  },
  "params": {
    ":key": "string",
    ":queue": "string"
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "archived_at": "string",
    "assignees": {},
    "cells": {},
    "createdBy": "string",
    "display": {},
    "externalId": "",
    "groupId": "",
    "id": "",
    "position": 1,
    "source": "string"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
