---
title: "Create a connection for an agent"
method: POST
path: "/v1/fleet/agents/{agent_id}/connections"
tags: ["agents"]
---

# Create a connection for an agent

`POST /v1/fleet/agents/{agent_id}/connections`

Associates an existing auth token with an agent so the agent can act with that token.

## Path parameters

- `agent_id` string, required

## Request body

- AgentsCreateConnectionRequest
  - `auth_token_id` string

## Response `201`

Created

- AgentsConnection
  - `agent_id` string
  - `auth_token_id` string
  - `created_at` string
  - `created_by` string
  - `expires_at` string
  - `id` string
  - `provider_account_label` string
  - `provider_id` string
  - `scopes` string[]

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `409` — Conflict
- `502` — Bad Gateway

---

[API](https://skmtc.net/langchain-ai/apis/langsmith.md) · [All operations](https://skmtc.net/langchain-ai/apis/langsmith/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/langchain-ai/langsmith/revisions/a0acb3a6a101/schema)
