---
title: "Mint a connect token for a remote harness (shown once) [write]"
method: POST
path: "/harnesses/{id}/connect-token"
tags: ["harnesses"]
---

# Mint a connect token for a remote harness (shown once) \[write\]

`POST /harnesses/{id}/connect-token`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/harnesses/{id}/connect-token`
- Auth: HTTP bearer

Issues a hct_… bearer token the maker's process uses to authenticate to the relay at WS /api/v1/sessions/{id}/harness. Minting revokes any existing token for this harness. The token value is returned exactly once — it cannot be retrieved again. Gated by the REMOTE_HARNESSES platform switch (off → 404). Returns 404 when the WORKSPACE_HARNESSES feature switch is off for this workspace. Returns 503 not_migrated when the backing tables are not yet present.

## Path parameters

- `id` string, required

## Response `201`

Created — one-time token

- object
  - `connect_token` string, required: hct_… — store immediately; not retrievable after this response

## Other responses

- `default`: Error — { error: { code, message } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/harnesses/:id/connect-token/post.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/8280a065ef6a?raw)
