---
title: "A one-time pairing code for the Hostingsurge Connector plugin, bound to one site address (15 minutes, single use, shown once). The site is connected once the plugin redeemed the code and answered a signed check. Uses the wordpress.connect_external add-on like a password connection"
method: POST
path: "/wordpress/connector/pairings"
tags: ["WordPress"]
---

# A one-time pairing code for the Hostingsurge Connector plugin, bound to one site address (15 minutes, single use, shown once). The site is connected once the plugin redeemed the code and answered a signed check. Uses the wordpress.connect_external add-on like a password connection

`POST /wordpress/connector/pairings`

## Request

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

## Query parameters

- `orgId` string

## Request body

- object
  - `siteUrl` string, required: The site's https address (the code only works for this site)
  - `projectId` string, uuid: Tie the connection to a project: members with access to that project can use it
  - `scopes` string[]: Default: all five

## Response `201`

The code

- object
  - `pairing` object, required
    - `id` string, uuid, required
    - `organizationId` string, uuid, required
    - `projectId` string, uuid, nullable, required
    - `siteUrl` string, required
    - `scopes` string[], required
    - `state` 'open' | 'redeemed' | 'connected' | 'expired' | 'canceled', required
    - `expiresAt` string, required: ISO-8601 timestamp
    - `redeemedAt` string, nullable, required: ISO-8601 timestamp
    - `connectionId` string, uuid, nullable, required
    - `lastError` string, nullable, required: Why the site could not be confirmed yet (it is retried while the pairing is open)
    - `createdAt` string, required: ISO-8601 timestamp
  - `code` string, required: The one-time code to paste in wp-admin → Settings → Hostingsurge (shown once)
  - `pluginUrl` string, required: Where to download the plugin (a zip to upload in wp-admin → Plugins → Add New)

## 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)
