Ir al contenido

Create or update a stay or an appointment

POST
/v2/clients/{client_id}/bookings
curl --request POST \
--url https://api-agent.manoflow.com/v2/clients/4e2a8c3d-1b9f-4e6a-8c7d-9f0a1b2c3d4e/bookings \
--header 'Content-Type: application/json' \
--header 'x-kyto-key: <x-kyto-key>' \
--data '{ "booking_id": "bk-0001", "kind": "stay", "user_id": "+10000000042", "platform": "whatsapp", "conversation_id": "conv_01_test", "status": "confirmed", "hotel": "Hostal Prueba", "hotel_country": "CO", "check_in_date": "2026-10-10", "nights": 3, "guests": 2, "total_value": 450000, "currency": "COP", "booked_at": "2026-09-20T12:00:00.000Z", "created_at": "2026-09-20T12:00:00.000Z", "source_updated_at": "2026-09-21T08:00:00.000Z", "attributes": { "customer_info": { "source": "cloudbeds" } } }'

Upsert by booking_id, which is required and never invented. kind is required: stay (a hotel stay: hotel, hotel_country, check_in_date as a plain day YYYY-MM-DD, nights, guests, total_value, currency, observation) or appointment (a sales meeting: meeting_type in_person or virtual, required; project, scheduled_at, notes, meeting_result). A field of the other kind is 422 field_not_allowed; changing kind moves the booking. A group request is a stay without status or total_value. 201 created, 200 updated, unchanged or stale, with result in the answer (created, updated, unchanged, stale). A resend of the same body is 200 unchanged and moves nothing. A field that is absent, null or an empty text keeps the stored value; clearing a field is not offered. Unknown top-level fields are 422: extras go inside attributes (merged per key), and an attributes key named like a field, or like the old name of one, is reserved_name. Numbers are JSON numbers ("150000" is 422). A source_updated_at older than the stored one changes nothing and answers 200 with result: "stale" and the stored version. Without source_updated_at the stored one is kept (none on create), so a bot write never makes the next sync’s snapshot look older. created_at (the day metrics count the booking in) is set once: without it, booked_at, else now, and a later write never moves it. Every _at field is a JSON string YYYY-MM-DDTHH:MM:SS[.fraction](Z|+HH:MM): capital T, seconds, and Z or an offset. A time without an offset (timestamp_without_offset), an epoch number or string, a space instead of T, no seconds, a lowercase t or z, a date only, T24:00:00, a leap second or an impossible offset (invalid_timestamp) is 422: no time zone is ever guessed. Instants come back as UTC with milliseconds, YYYY-MM-DDTHH:MM:SS.sssZ.

client_id
required
string

The client the key belongs to (any other client is 403)

Example

4e2a8c3d-1b9f-4e6a-8c7d-9f0a1b2c3d4e

The booking. booking_id and kind are required.

Media typeapplication/json
BookingIn

A stay or an appointment, created or updated by booking_id. A field that is absent or null keeps the stored value. created_at is set once: without it, booked_at, else now (R8). Without source_updated_at the stored one is kept (D17).

object
booking_id
required
Booking Id
string
kind
required
Kind
string
Allowed values: stay appointment
user_id
User Id
Any of:
string
platform
Platform
Any of:
string
conversation_id
Conversation Id
Any of:
string
botpress_conversation_id
Botpress Conversation Id
Any of:
string
status
Status
Any of:
string
hotel
Hotel
Any of:
string
hotel_country
Hotel Country
Any of:
string
check_in_date
Check In Date
Any of:
string format: date
nights
Nights
Any of:
integer
guests
Guests
Any of:
integer
total_value
Total Value
Any of:
integer
currency
Currency
Any of:
string
observation
Observation
Any of:
string
meeting_type
Meeting Type
Any of:
string
project
Project
Any of:
string
scheduled_at
Scheduled At
Any of:
string format: date-time
notes
Notes
Any of:
string
meeting_result
Meeting Result
Any of:
string
booked_at
Booked At
Any of:
string format: date-time
created_at
Created At
Any of:
string format: date-time
source_updated_at
Source Updated At
Any of:
string format: date-time
last_edited_by
Last Edited By
Any of:
string
last_edited_at
Last Edited At
Any of:
string format: date-time
attributes
Attributes
Any of:
object
key
additional properties
any
id
Id

Example

{
"booking_id": "bk-0001",
"kind": "stay",
"user_id": "+10000000042",
"platform": "whatsapp",
"conversation_id": "conv_01_test",
"status": "confirmed",
"hotel": "Hostal Prueba",
"hotel_country": "CO",
"check_in_date": "2026-10-10",
"nights": 3,
"guests": 2,
"total_value": 450000,
"currency": "COP",
"booked_at": "2026-09-20T12:00:00.000Z",
"created_at": "2026-09-20T12:00:00.000Z",
"source_updated_at": "2026-09-21T08:00:00.000Z",
"attributes": {
"customer_info": {
"source": "cloudbeds"
}
}
}

Updated, unchanged or stale

Media typeapplication/json

Example

{
"id": "8c2f3d4e-5a6b-4c7d-9e8f-0a1b2c3d4e5f",
"booking_id": "ap-0001",
"kind": "appointment",
"user_id": "+10000000042",
"platform": "whatsapp",
"conversation_id": "conv_01_test",
"botpress_conversation_id": "bp-000001",
"status": null,
"meeting_type": "in_person",
"project": "Proyecto Prueba",
"scheduled_at": "2026-10-03T15:00:00.000Z",
"notes": "Visita en sala de ventas - Proyecto Prueba",
"meeting_result": null,
"booked_at": "2026-10-01T12:00:00.000Z",
"created_at": "2026-10-01T12:00:00.000Z",
"source_updated_at": null,
"last_edited_by": null,
"last_edited_at": null,
"attributes": {
"project_id": "p-1"
},
"result": "updated"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

Created

Media typeapplication/json

Example

{
"id": "7b1e2c3d-4f5a-4b6c-8d7e-9f0a1b2c3d4e",
"booking_id": "bk-0001",
"kind": "stay",
"user_id": "+10000000042",
"platform": "whatsapp",
"conversation_id": "conv_01_test",
"botpress_conversation_id": null,
"status": "confirmed",
"hotel": "Hostal Prueba",
"hotel_country": "CO",
"check_in_date": "2026-10-10",
"nights": 3,
"guests": 2,
"total_value": 450000,
"currency": "COP",
"observation": null,
"booked_at": "2026-09-20T12:00:00.000Z",
"created_at": "2026-09-20T12:00:00.000Z",
"source_updated_at": "2026-09-21T08:00:00.000Z",
"last_edited_by": null,
"last_edited_at": null,
"attributes": {
"customer_info": {
"source": "cloudbeds"
}
},
"result": "created"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The body is not valid JSON, or not a JSON object

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/invalid-json",
"title": "The body is not valid JSON",
"status": 400,
"code": "invalid_json",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

Missing, malformed, unknown or revoked key (one answer for all)

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/unauthorized",
"title": "Missing, malformed, unknown or revoked key",
"status": 401,
"code": "unauthorized",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The key belongs to another client, or the client does not exist

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/forbidden",
"title": "The key does not belong to this client",
"status": 403,
"code": "forbidden",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The body is over 1 MiB

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/payload-too-large",
"title": "The body is too large",
"status": 413,
"code": "payload_too_large",
"detail": "The limit is 1 MiB.",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

A write needs Content-Type: application/json

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/unsupported-media-type",
"title": "Content-Type must be application/json",
"status": 415,
"code": "unsupported_media_type",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The record cannot be stored: no key (missing_key), an unknown field, a wrong type, a value outside its list, a field of the other kind, a time without an offset. Nothing was stored

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/validation-failed",
"title": "The request has invalid fields",
"status": 422,
"code": "validation_failed",
"detail": "2 fields are invalid",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W",
"errors": [
{
"pointer": "/nights",
"code": "not_an_integer",
"message": "must be a whole number"
},
{
"pointer": "/scheduled_at",
"code": "field_not_allowed",
"message": "is not a field of a stay"
}
]
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The key made too many requests this minute (only when a limit is set); wait the Retry-After seconds

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/rate-limited",
"title": "Too many requests",
"status": 429,
"code": "rate_limited",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

Unexpected error: quote the request_id

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/internal-error",
"title": "Internal error",
"status": 500,
"code": "internal_error",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.