Build with AI

The API ships a machine-readable OpenAPI spec. Hand that spec to an AI assistant (Cursor, Claude Code, GitHub Copilot, ChatGPT, Claude) and it can read every endpoint, schema, and auth requirement, then write the integration code for you. No copying request shapes by hand.

The spec URL

This is the one thing your assistant needs. It's the same contract that powers the API Reference, kept in sync automatically.

https://docs.yournexthome.app/openapi.json

That file lists only the partner-facing endpoints. Everything an assistant needs to call the API is in it:

  • Base URL: https://api.yournexthome.app/api/v1
  • Auth: a bearer token on every request (see Authentication)
  • Resources: organizations, estates, buildings, apartments, assets, inquiries
Never paste your API key into a prompt

Your key (ynh_live_...) is a secret. Give the assistant the spec URL, not your key. When it writes code, have it read the key from an environment variable (YNH_API_KEY), never hardcoded, never in chat history.

Coding assistants

The workflow is the same everywhere: give the assistant the spec, then describe the integration you want.

Cursor

Add the spec as a documentation source so it's available to the model:

  1. Settings → Features → Docs → Add new doc, paste the spec URL above.
  2. In chat, reference it with @Docs and describe what you want:
@Docs(YourNextHome) Using the YourNextHome OpenAPI spec, write a typed
TypeScript client for the apartment endpoints. Read the API key from
process.env.YNH_API_KEY and send it as a Bearer token.

Claude Code / Copilot / other agents

Most coding agents can fetch a URL directly. Paste the spec URL into your prompt:

Fetch https://docs.yournexthome.app/openapi.json. It's the YourNextHome
OpenAPI spec. Generate a small Python client for listing estates and fetching
one estate by id. Auth is a Bearer token from the YNH_API_KEY env var; base
URL is https://api.yournexthome.app/api/v1.

Because the assistant works from the real schema, the generated types and field names match the API exactly, and stay correct as you ask follow-ups ("now add the inquiry endpoints", "handle the error envelope", see Errors).

Asking a chat assistant directly

For a one-off, like figuring out a request shape or debugging a response, give a chat assistant (ChatGPT, Claude) the same context. A prompt that works:

You're helping me integrate the YourNextHome API.

- Spec: https://docs.yournexthome.app/openapi.json
- Base URL: https://api.yournexthome.app/api/v1
- Auth: Authorization: Bearer <my API key> on every request

I want to create an inquiry against an estate. Show me the exact request
(method, path, JSON body) and which fields are required.

If the assistant can't browse, paste the relevant slice of the spec, or copy the endpoint straight from the API Reference, which shows the request and response schema for each operation.

What's next