---
title: "create Agent Connection"
method: POST
path: "/agent-connections"
tags: ["Agent Connections"]
---

# create Agent Connection

`POST /agent-connections`

## Request

- Base URL: `https://api.primitive.dev/v1`
- URL: `https://api.primitive.dev/v1/agent-connections`
- Auth: HTTP bearer

Create an address-bound agent. An explicit address may be on a Primitive-managed domain or on one of the organization's own verified custom domains that receives and sends through Primitive; a narrower-than-organization creator needs agent_connections:custom_domains for a custom domain and a fresh address. Without an explicit address, allocate a readable name on a managed domain with a bounded collision suffix. Persist create_request_id before dispatch to recover the same current connection on retry; recovered responses have invitation:null and never rotate a key. Changed choices or membership return 409 connection_create_request_conflict; a removed identity returns 409 connection_removed. A pending recovered connection can use inviteAgentConnection with pending_only:true once to obtain a fresh invitation.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `name` string, required
  - `address` string, email
  - `owner_address` string, email
  - `ownership_kind` 'personal' | 'shared'
  - `create_request_id` string
  - `remove_others_access` boolean

## Response `200`

Success

- object
  - `success` unknown, required
  - `data` union, required
    - object
      - `connection` AgentConnection, required
        - `id` string
        - `shopping_function_id` string, nullable
        - `address` string, email, required
        - `name` string, required
        - `owner_address` string, email, required
        - `owner_member_address` string, email, nullable, required
        - `status` 'pending' | 'claimed' | 'connected' | 'revoked', required
        - `created_at` string, date-time, required
        - `updated_at` string, date-time, required
        - `claimed_at` string, date-time, nullable, required
        - `verified_at` string, date-time, nullable, required
        - `last_seen_at` string, date-time, nullable, required
        - `revoked_at` string, date-time, nullable
        - `presence` object, nullable
          - `last_checked_at` string, date-time, required
          - `expires_at` string, date-time, required
          - `valid_for_ms` integer, required
        - `ownership_kind` 'personal' | 'shared' | 'legacy_unknown', required
        - `owner_user_id` string, nullable, required
        - `owner_active` boolean, nullable, required
        - `hidden` boolean
        - `hidden_reason` 'idle' | 'manual', nullable
        - `hidden_at` string, date-time, nullable
        - `keep_visible` boolean
        - `last_activity_at` string, date-time, nullable
      - `invitation` object, required
        - `claim_url` string, uri, required
        - `expires_at` string, date-time, required
    - object
      - `connection` AgentConnection, required
        - `id` string
        - `shopping_function_id` string, nullable
        - `address` string, email, required
        - `name` string, required
        - `owner_address` string, email, required
        - `owner_member_address` string, email, nullable, required
        - `status` 'pending' | 'claimed' | 'connected' | 'revoked', required
        - `created_at` string, date-time, required
        - `updated_at` string, date-time, required
        - `claimed_at` string, date-time, nullable, required
        - `verified_at` string, date-time, nullable, required
        - `last_seen_at` string, date-time, nullable, required
        - `revoked_at` string, date-time, nullable
        - `presence` object, nullable
          - `last_checked_at` string, date-time, required
          - `expires_at` string, date-time, required
          - `valid_for_ms` integer, required
        - `ownership_kind` 'personal' | 'shared' | 'legacy_unknown', required
        - `owner_user_id` string, nullable, required
        - `owner_active` boolean, nullable, required
        - `hidden` boolean
        - `hidden_reason` 'idle' | 'manual', nullable
        - `hidden_at` string, date-time, nullable
        - `keep_visible` boolean
        - `last_activity_at` string, date-time, nullable
      - `recovered` true, required
      - `invitation` unknown, required

## Other responses

- `400`: Invalid request parameters
- `401`: Invalid or missing API key
- `403`: Authenticated caller lacks permission for the operation
- `404`: Resource not found
- `409`: The request conflicts with the current state of the resource
- `429`: Rate limit exceeded. The `ratelimit-*` headers describe the limiter that rejected this request, with its own limit and window, not the API budget that successful responses report. A limiter that reports only a wait sends `Retry-After` alone.

## Changes

> 32 revisions in range; 1 not diffed.

- **2026-11-03** `bce409c97acb`: 186 warning
  - added the new `access_mode_unavailable` enum value to the `error/code` response property for the response status `400`
  - added the new `access_mode_unavailable` enum value to the `error/code` response property for the response status `401`
  - added the new `access_mode_unavailable` enum value to the `error/code` response property for the response status `403`
  - added the new `access_mode_unavailable` enum value to the `error/code` response property for the response status `404`
  - …182 more
  - …this revision’s changelog is incomplete
- **2026-10-21** `0360ea8d4f3d`: 78 warning
  - added the new `agent_changed` enum value to the `error/code` response property for the response status `400`
  - added the new `agent_changed` enum value to the `error/code` response property for the response status `401`
  - added the new `agent_changed` enum value to the `error/code` response property for the response status `403`
  - added the new `agent_changed` enum value to the `error/code` response property for the response status `404`
  - …74 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/primitive/apis/primitive-api/changes/agent-connections/post.md)

---

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