---
title: "Store (or replace) the connection to one provider"
method: POST
path: "/api/v1/connections"
---

# Store (or replace) the connection to one provider

`POST /api/v1/connections`

## Request

- Base URL: `https://memchats.com`
- URL: `https://memchats.com/api/v1/connections`
- Auth: HTTP bearer

One connection per provider and user: posting again rotates the key. The secret is encrypted at rest with AES-256-GCM and never returned.

## Response `201`

Stored; only the hint comes back

## Other responses

- `403`: Connections require the Pro or Empresa plan
- `422`: Unknown provider, secret too short, or a non-https base URL
- `503`: The server has no CONNECTIONS_SECRET_KEY

---

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