---
title: "Wait for work"
method: POST
path: "/api/v1/edge/poll"
tags: ["Edge"]
---

# Wait for work

`POST /api/v1/edge/poll`

## Request

- Base URL: `https://pcp.example.com`
- URL: `https://pcp.example.com/api/v1/edge/poll`
- Auth: HTTP bearer

Long-polls for the next piece of work for the calling edge.

## Request body

- EdgePollRequest: EdgePollRequest schema
  - `edge_version` string
  - `hostname` string
  - `protocol_version` integer
  - `slots` integer, nullable
  - `system_info` object
    - `arch` string, nullable
    - `go_version` string, nullable
    - `kernel` string, nullable
    - `kloset_version` string, nullable
    - `num_cpu` integer, nullable
    - `os` string, nullable
    - `total_memory` integer, nullable
  - `tags` string[], nullable

## Response `200`

A piece of work

- EdgeWorkItem: EdgeWorkItem schema
  - `op` string
  - `source` object, nullable
    - `data_classes` string[], nullable
    - `environment` string, nullable
    - `fields` object[]
      - `key` string
      - `val` string
    - `id` string, uuid
    - `integration` object
      - `id` string, uuid
      - `name` string
      - `version` string
    - `name` string
    - `revision` integer
    - `type` string
    - `urn` string
    - `urnid` string, uuid
  - `target` object, nullable
    - `data_classes` string[], nullable
    - `environment` string, nullable
    - `fields` object[]
      - `key` string
      - `val` string
    - `id` string, uuid
    - `integration` object
      - `id` string, uuid
      - `name` string
      - `version` string
    - `name` string
    - `revision` integer
    - `type` string
    - `urn` string
    - `urnid` string, uuid
  - `task_config` object
  - `work_id` string, uuid

## Other responses

- `204`: No work arrived before the hold expired
- `400`: Bad Request _(validation or deserialization error)_
- `401`: Missing, invalid or expired credentials
- `403`: The caller may not do this
- `500`: Internal Server Error _(panics)_
- `default`

---

[API](https://skmtc.dev/plakar/apis/plakar-control-plane-api-v1.md) - [All operations](https://skmtc.dev/plakar/apis/plakar-control-plane-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/plakar/apis/plakar-control-plane-api-v1/revisions/2ac049494a01?raw)
