---
title: "Create a valuation widget key"
method: POST
path: "/valuations/embed-keys"
tags: ["Valuations"]
---

# Create a valuation widget key

`POST /valuations/embed-keys`

## Request

- Base URL: `https://platform-api.homejourney.sg/v1`
- URL: `https://platform-api.homejourney.sg/v1/valuations/embed-keys`
- Auth: HTTP bearer

Creates a publishable widget key bound to one to five exact origins when the authenticated client has `valuations.embed_keys.write`. An origin is a scheme, host and optional port with no path, such as `https://www.example.com`; plain HTTP is accepted only for `localhost` and `127.0.0.1`. An organization may hold 10 active keys per environment; beyond that the route answers `429` `valuation_embed_key_quota_exceeded`. External URL: `/v1/valuations/embed-keys`. Current Next.js implementation path: `/api/platform/v1/valuations/embed-keys`. This mutating route requires `Idempotency-Key` and records an audit event. A widget key is publishable, not a secret: it ships in the partner page and works only on the free public valuation routes, from its registered origins, with a cap of 2,000 estimates a day per key. It never authenticates this API.

## Headers

- `X-Correlation-Id` string
- `Idempotency-Key` string, required

## Request body

- ValuationEmbedKeyCreateRequest
  - `label` string, required
  - `allowed_origins` string[], required

## Response `201`

The new widget key.

- ValuationEmbedKeyResponse
  - `embed_key` object, required
    - `id` string, uuid, required
    - `embed_key` string, required: The publishable key the widget script sends as `embed_key`.
    - `label` string, required
    - `allowed_origins` string[], required
    - `status` 'active' | 'revoked', required
    - `created_at` string, date-time, required
    - `revoked_at` string, date-time, nullable, required
  - `livemode` boolean, required
  - `request_id` string, required

## Other responses

- `400`: Request validation failed.
- `401`: Missing or invalid platform API key.
- `403`: Credential, environment, or scope is not allowed.
- `404`: Platform API feature or resource is not available.
- `409`: Idempotency key is in progress or conflicts with an earlier request body.
- `429`: Rate limit exceeded.
- `500`: Unexpected platform API failure.
- `503`: A required managed platform dependency is unavailable.

---

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