---
title: "Get connection URL for managed user"
method: POST
path: "/workspace/users/{userId}/connection-url"
tags: ["Workspace"]
---

# Get connection URL for managed user

`POST /workspace/users/{userId}/connection-url`

Get or generate a URL that allows a managed user to connect their
social media accounts. The URL expires after a configurable period
(default: 90 days).

**Requires Workspace access - contact serge@publora.com to enable.**

## Path parameters

- `userId` string, required

## Request body

- object
  - `rotate` boolean — Force generation of a new token even if current is valid
  - `expiresInDays` integer — Number of days until the token expires

## Response `200`

Connection URL

- object
  - `url` string, uri — URL for user to connect their social accounts
  - `tokenExpiresAt` string, date-time — When the connection URL expires

## Other responses

- `400` — Invalid userId
- `403` — Workspace access not enabled
- `404` — User not found or not managed by this key
- `500` — Server error

---

[API](https://skmtc.dev/publora/apis/publora-api.md) · [All operations](https://skmtc.dev/publora/apis/publora-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/publora/publora-api/revisions/a1534a88d80a/schema)
