---
title: "Put the chat and forms on a WordPress site"
method: PUT
path: "/wordpress/connections/{id}/embeds"
tags: ["WordPress"]
---

# Put the chat and forms on a WordPress site

`PUT /wordpress/connections/{id}/embeds`

## Request

- Base URL: `https://api.hypamoon.com/api/v1`
- URL: `https://api.hypamoon.com/api/v1/wordpress/connections/{id}/embeds`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://app.hypamoon.com/oauth/authorize`, token URL `https://api.hypamoon.com/oauth/token`, scopes: `data:write`)

Turns the chat window on or off on the connected WordPress site and chooses the forms the plugin offers (a block and the shortcode [hypamoon_form id=...]). Forms need a collection with public_write; a field named email becomes the Reply-To of the notification email. Makes sure a public token allows the site's origin: the chosen one gets the origin added, or an existing one is used, or a new one is created. The plugin picks the settings up when the admin opens Tools > Hypamoon or presses Refresh. Send version to avoid overwriting a change made meanwhile (409).

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `chat` object, nullable: The chat window on the site. Leave it out to keep it as it is.
    - `enabled` boolean, required: Show the chat window on every page of the WordPress site.
    - `chat_token_id` string, uuid, nullable: Optional. The public chat token to use (from list_chat_widgets). Without it, a token that already allows this site, or a new one.
    - `color` string, nullable: The colour of the chat button, like #0f766e.
    - `position` 'left' | 'right' | 'null', nullable: Where the chat button sits. Default: right.
    - `title` string, nullable: The title of the chat window. Default: the business name.
    - `welcome` string, nullable: The first message in the chat window. Default: the assistant's greeting.
  - `forms` object[], nullable: Forms to offer or change. Forms you leave out keep their settings.
    - `collection` string, required: The collection the form posts to. It needs access.public_write.
    - `title` string, nullable: An optional heading above the form.
    - `fields` object[], nullable: The inputs. Without them: from the collection's schema, or name, email and message.
      - `name` string, required: The key in the document, like email or party_size.
      - `label` string, nullable: The visible label. Default: the name.
      - `type` 'text' | 'email' | 'tel' | 'textarea' | 'number' | 'date' | 'select' | 'checkbox' | 'null', nullable: text, email, tel, textarea, number, date, select or checkbox. Default: text.
      - `required` boolean, nullable
      - `options` string[], nullable: The choices of a select.
    - `submit_label` string, nullable: The text of the button. Default: Send.
    - `success_message` string, nullable: Shown after sending. Default: Thanks, we received your message.
    - `remove` boolean, nullable: true: no longer offer this form in WordPress.
  - `version` integer, nullable: The version you showed the user. If it changed meanwhile, nothing changes (409). Leave it out to change it anyway.

## Response `200`

The new settings, as GET returns them.

## Other responses

- `400`: Bad Request: invalid_json.
- `401`: Unauthorized: unauthorized, missing_api_key, invalid_api_key, api_key_revoked, project_deleted.
- `403`: Forbidden: project_not_enabled, key_mode_mismatch, missing_scope, verification_required.
- `404`: Not Found: not_found.
- `409`: Conflict: conflict.
- `422`: Unprocessable Content: validation_failed.
- `429`: Too Many Requests: rate_limited.
- `500`: Internal Server Error: internal_error.
- `503`: Service Unavailable: service_unavailable.

---

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