---
title: "Register an agent in the workspace"
method: POST
path: "/api/workspaces/{workspaceId}/agents"
tags: ["Agents"]
---

# Register an agent in the workspace

`POST /api/workspaces/{workspaceId}/agents`

## Request

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

## Path parameters

- `workspaceId` string, required

## Request body

- object
  - `name` string, required
  - `provider` 'CURSOR' | 'CLAUDE_CODE' | 'CODEX' | 'AIDER' | 'DEVIN' | 'COPILOT' | 'CUSTOM', required
  - `avatarKey` string
  - `ownerId` string, cuid, nullable

## Response `201`

Agent registered

- object
  - `success` boolean, required
  - `data` object, required
    - `id` string, cuid, required
    - `name` string, required
    - `provider` 'CURSOR' | 'CLAUDE_CODE' | 'CODEX' | 'AIDER' | 'DEVIN' | 'COPILOT' | 'CUSTOM', required
    - `scope` 'READ' | 'SESSION' | 'WORKSPACE', required
    - `avatarUrl` string, nullable, required
    - `avatarKey` string, nullable, required
    - `isActive` boolean, required
    - `sessionCount` integer, required
    - `activeSessionCount` integer, required
    - `hasApiToken` boolean, required
    - `apiTokenRotatedAt` string, date-time, nullable, required
    - `apiTokenHint` string, nullable, required
    - `lastActivityAt` string, date-time, nullable, required
    - `recentSessionStatuses` string[], required
    - `owner` object, nullable, required
      - `id` string, cuid, required
      - `name` string, required
      - `avatarUrl` string, nullable, required
    - `dispatchWebhookUrl` string, nullable, required
    - `dispatchSecretHint` string, nullable, required

## Other responses

- `400`: Validation error

---

[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)
