• VillaSlotDocumentation
  • Introduction
  • Getting Started
  • API
    • Discovery
      • GETGet my context
    • Villas
      • GETList villas
      • POSTCreate a villa
      • GETGet a villa
      • PATCHRename a villa
      • POSTArchive a villa
      • POSTUpload a villa photo
      • GETGet opening hours
      • PUTReplace opening hours
      • GETGet the rate grid
      • PUTReplace the rate grid
      • GETGet availability
    • Bookings
      • GETList bookings over a period
      • POSTCreate a booking
      • GETGet a booking
      • POSTConfirm a booking
      • POSTComplete a booking
      • POSTCancel a booking
      • POSTReschedule a booking
    • Customers
      • GETList customers
      • POSTCreate a customer
      • POSTImport a batch of customers
      • GETGet a customer
      • PATCHUpdate a customer
    • Booking settings
      • GETGet booking settings
      • PATCHUpdate booking settings
  1. Documentation
  2. API
  3. Customers
  4. Create a customer
Buydocschangelogsdemocommunity

Create a customer

PreviousList customersNextImport a batch of customers
On this page
AuthorizationRequest bodyExampleResponseWhat it refuses

POST /api/v1/customers

Creates a customer in the organization of the key. The id returned here is the customerId a booking needs.

Authorization

Role in the organizationThis endpoint
ownerAllowed
adminAllowed
memberAllowed

Request body

FieldTypeRequiredDescription
namestringyesThe customer name
emailstringnoUnique inside the organization when present
phonestringno
notesstringnoFree text for the team

Example

bash
curl -X POST -H "x-api-key: $VILLASLOT_API_KEY" -H "content-type: application/json" \
  -d '{"name":"Tomas Lindqvist","email":"tomas@example.com"}' \
  "https://villaslot.app/api/v1/customers"

Response

  • 201 Created — the created customer.

What it refuses

  • 409 Conflict — the plan limit for customers is reached.
  • 422 Unprocessable Entity — the name is missing, the email is malformed, or another customer of the organization already carries that email. Search first and reuse the existing id.
  • 401 Unauthorized — missing or invalid key, or a key whose bearer left the organization.
  • 404 Not Found — unknown id, or an id belonging to another organization. The two are deliberately indistinguishable.
  • 429 Too Many Requests — over 120 requests in a minute for this key.