Workspace

Attach an existing user

Attach an existing standalone Publora user to your workspace as a managed user. Because the target account already exists, this requires the target user's consent: a valid access token belonging to that user (the accessToken returned when they sign in), passed as userAccessToken. Re-attaching a user who is already in your workspace is idempotent and does not require a consent token.

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

post/workspace/users/attach

Request body

emailstring email

The existing user's email. Provide either email or userId (also accepted as username).

userIdstring

The existing user's ObjectId. Provide either email or userId.

userAccessTokenstring

The target user's access token, proving consent. Required unless the user is already in your workspace. Also accepted as attachToken in the body or via the x-publora-user-token header.

Example request

{
  "email": "user@example.com",
  "userAccessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Response

User attached (or already in your workspace)

alreadyInWorkspaceboolean

true if the user was already managed by your workspace (idempotent re-attach)

Example response

{
  "user": {
    "_id": "507f1f77bcf86cd799439011",
    "username": "user@example.com",
    "displayName": "John Doe",
    "role": "managed",
    "dailyPostsLeft": 100
  }
}

Changes