---
title: "Tie a connection to a project (members with access to it can use it) or narrow its scopes"
method: PATCH
path: "/wordpress/connections/{connectionId}"
tags: ["WordPress"]
---

# Tie a connection to a project (members with access to it can use it) or narrow its scopes

`PATCH /wordpress/connections/{connectionId}`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/wordpress/connections/{connectionId}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `connectionId` string, uuid, required

## Request body

- object
  - `projectId` string, uuid, nullable: Tie the connection to a project (null: the team only)
  - `scopes` string[]: Narrow what Hostingsurge may do (never widen: pair again for that)

## Response `200`

Updated

- object
  - `id` string, uuid, required
  - `organizationId` string, uuid, required
  - `siteUrl` string, required
  - `siteName` string, nullable, required
  - `username` string, required
  - `userDisplayName` string, nullable, required
  - `status` 'active' | 'error' | 'disconnected', required
  - `seoPlugin` 'yoast' | 'rankmath' | 'null', nullable, required
  - `lastVerifiedAt` string, nullable, required: ISO-8601 timestamp
  - `lastError` string, nullable, required
  - `createdAt` string, required: ISO-8601 timestamp
  - `createdBy` string, uuid, nullable, required
  - `disconnectedAt` string, nullable, required: ISO-8601 timestamp
  - `authKind` 'application_password' | 'connector'
  - `scopes` string[]
  - `projectId` string, uuid, nullable
  - `pluginVersion` string, nullable

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `402`: A paid add-on (code upgrade_required)
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: Conflicting state (code conflict)
- `429`: Too many requests (code rate_limited)
- `501`: Not available on this server (code not_configured)
- `503`: The site or the engine did not answer (code provider_unavailable)

---

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