> ## Documentation Index
> Fetch the complete documentation index at: https://build.practicehub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create locations



## OpenAPI

````yaml /openapi.json post /locations
openapi: 3.0.3
info:
  title: PracticeHub API
  version: 1.0.0
  description: >
    The canonical PracticeHub REST API. Every clinic account is a tenant
    addressed by the host the practice signs in on:
    `https://{clinic}.{region}.practicehub.io` (region host `neptune` London,
    `mercury` Frankfurt, `vulcan` Ohio, `jupiter` Singapore, `apollo` Sydney).


    ## Filtering

    List endpoints accept `?attribute=operator:value` with operators `eq`, `ne`,
    `gt`, `gte`, `lt`, `lte`, `null`, `not-null`, `like`, `contains`, `in`,
    `not-in`, `between` (`null`/`not-null` take no value; `in`, `not-in`,
    `between` take comma-separated values; `contains` is a case-insensitive
    substring match with no wildcards to escape). A value with no operator is an
    equality match. Only attributes marked filterable may be filtered (422
    otherwise).


    ## Metadata

    Every record carries an integrator-owned `metadata` object of string, number
    or boolean values (max 50 keys). Send `metadata` on create/update to merge
    keys (`null` removes a key) and filter with `?metadata[key]=operator:value`.


    ## Sorting & pagination

    `?sort=attr[,attr]:asc|desc` on sortable attributes; `?page=` and
    `?page_size=` (max 100). List responses wrap rows in `data` with `links` and
    `meta`.
servers:
  - url: https://{clinic}.{region}.practicehub.io/v3/api
    description: PracticeHub API — the host the practice signs in on
    variables:
      clinic:
        default: your-clinic
        description: The clinic subdomain
      region:
        default: neptune
        enum:
          - neptune
          - mercury
          - vulcan
          - jupiter
          - apollo
        description: >-
          The region host from the practice login URL: neptune (London), mercury
          (Frankfurt), vulcan (Ohio), jupiter (Singapore), apollo (Sydney)
security:
  - bearerAuth: []
tags:
  - name: Utility
    description: Liveness, identity and discovery
  - name: Availability
    description: Free, bookable slots — check before creating an appointment
  - name: Appointments
    description: The appointments resource
  - name: Appointment Types
    description: The appointment_types resource
  - name: Practitioner Availabilities
    description: The practitioner_availabilities resource
  - name: Resources
    description: The resources resource
  - name: Patients
    description: The patients resource
  - name: Tags
    description: The tags resource
  - name: Patient Tags
    description: The patient_tags resource
  - name: Numbers
    description: The numbers resource
  - name: Addresses
    description: The addresses resource
  - name: Patient Logs
    description: The patient_logs resource
  - name: Patient Log Tags
    description: The patient_log_tags resource
  - name: Files
    description: The files resource
  - name: Care Plans
    description: The care_plans resource
  - name: Clinical Notes
    description: Clinical notes on the patient record
  - name: Form Templates
    description: The form_templates resource
  - name: Invoices
    description: The invoices resource
  - name: Line Items
    description: The line_items resource
  - name: Payments
    description: The payments resource
  - name: Refunds
    description: The refunds resource
  - name: Payment Allocations
    description: The payment_allocations resource
  - name: Payment Methods
    description: The payment_methods resource
  - name: Billable Items
    description: The billable_items resource
  - name: Locations
    description: The locations resource
  - name: Practitioners
    description: The practitioners resource
  - name: Modalities
    description: The modalities resource
  - name: Referral Sources
    description: The referral_sources resource
  - name: Deleted Entities
    description: The deleted_entities resource
paths:
  /locations:
    post:
      tags:
        - Locations
      summary: Create locations
      operationId: create_locations
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationsCreate'
      responses:
        '201':
          description: The resource
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Locations'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '403':
          $ref: '#/components/responses/ReadOnlyKey'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Any unique string (≤255 chars). A retry with the same key within 24
        hours replays the original response (Idempotent-Replayed: true) instead
        of creating a second record.
      schema:
        type: string
        maxLength: 255
  schemas:
    LocationsCreate:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
          description: >-
            The location's name as shown across the app. Locations are managed
            in Settings.
        website:
          type: string
          maxLength: 255
          nullable: true
          description: The location's website URL.
        email:
          type: string
          format: email
          maxLength: 255
          nullable: true
          description: Contact email address for the location.
        phone_number:
          type: string
          maxLength: 255
          nullable: true
          description: Contact phone number for the location.
        custom_reference:
          type: string
          maxLength: 255
          nullable: true
          description: >-
            Your own reference for the location (write-only; e.g. a branch code
            in your other system).
        online_booking:
          type: boolean
          nullable: true
          description: Whether the location is offered in online booking.
        line_1:
          type: string
          maxLength: 255
          nullable: true
          description: >-
            First line of the location's postal address (write-only — a
            location's address is not readable through the API yet).
        line_2:
          type: string
          maxLength: 255
          nullable: true
          description: Second address line (write-only).
        line_3:
          type: string
          maxLength: 255
          nullable: true
          description: Third address line (write-only).
        city:
          type: string
          maxLength: 255
          nullable: true
          description: Town or city of the address (write-only).
        state:
          type: string
          maxLength: 255
          nullable: true
          description: County, state or region (write-only).
        postal_code:
          type: string
          maxLength: 255
          nullable: true
          description: Postcode / ZIP (write-only).
        country:
          type: string
          enum:
            - AF
            - AL
            - DZ
            - AS
            - AD
            - AO
            - AI
            - AQ
            - AG
            - AR
            - AM
            - AW
            - AU
            - AT
            - AZ
            - BS
            - BH
            - BD
            - BB
            - BY
            - BE
            - BZ
            - BJ
            - BM
            - BT
            - BO
            - BQ
            - BA
            - BW
            - BV
            - BR
            - IO
            - BN
            - BG
            - BF
            - BI
            - CV
            - KH
            - CM
            - CA
            - KY
            - CF
            - TD
            - CL
            - CN
            - CX
            - CC
            - CO
            - KM
            - CD
            - CG
            - CK
            - CR
            - HR
            - CU
            - CW
            - CY
            - CZ
            - CI
            - DK
            - DJ
            - DM
            - DO
            - EC
            - EG
            - SV
            - GQ
            - ER
            - EE
            - SZ
            - ET
            - FK
            - FO
            - FJ
            - FI
            - FR
            - GF
            - PF
            - TF
            - GA
            - GM
            - GE
            - DE
            - GH
            - GI
            - GR
            - GL
            - GD
            - GP
            - GU
            - GT
            - GG
            - GN
            - GW
            - GY
            - HT
            - HM
            - VA
            - HN
            - HK
            - HU
            - IS
            - IN
            - ID
            - IR
            - IQ
            - IE
            - IM
            - IL
            - IT
            - JM
            - JP
            - JE
            - JO
            - KZ
            - KE
            - KI
            - KP
            - KR
            - KW
            - KG
            - LA
            - LV
            - LB
            - LS
            - LR
            - LY
            - LI
            - LT
            - LU
            - MO
            - MG
            - MW
            - MY
            - MV
            - ML
            - MT
            - MH
            - MQ
            - MR
            - MU
            - YT
            - MX
            - FM
            - MD
            - MC
            - MN
            - ME
            - MS
            - MA
            - MZ
            - MM
            - NA
            - NR
            - NP
            - NL
            - NC
            - NZ
            - NI
            - NE
            - NG
            - NU
            - NF
            - MP
            - 'NO'
            - OM
            - PK
            - PW
            - PS
            - PA
            - PG
            - PY
            - PE
            - PH
            - PN
            - PL
            - PT
            - PR
            - QA
            - MK
            - RO
            - RU
            - RW
            - RE
            - BL
            - SH
            - KN
            - LC
            - MF
            - PM
            - VC
            - WS
            - SM
            - ST
            - SA
            - SN
            - RS
            - SC
            - SL
            - SG
            - SX
            - SK
            - SI
            - SB
            - SO
            - ZA
            - GS
            - SS
            - ES
            - LK
            - SD
            - SR
            - SJ
            - SE
            - CH
            - SY
            - TW
            - TJ
            - TZ
            - TH
            - TL
            - TG
            - TK
            - TO
            - TT
            - TN
            - TR
            - TM
            - TC
            - TV
            - UG
            - UA
            - AE
            - GB
            - UM
            - US
            - UY
            - UZ
            - VU
            - VE
            - VN
            - VG
            - VI
            - WF
            - EH
            - YE
            - ZM
            - ZW
            - AX
          nullable: true
          description: ISO 3166-1 alpha-2 country code, e.g. GB (write-only).
        metadata:
          $ref: '#/components/schemas/Metadata'
      required:
        - name
    Locations:
      type: object
      properties:
        id:
          type: integer
          description: >-
            Unique id of the location. location_id on appointments, resources
            and availability windows refers to these.
        name:
          type: string
          maxLength: 255
          description: >-
            The location's name as shown across the app. Locations are managed
            in Settings.
        email:
          type: string
          format: email
          maxLength: 255
          nullable: true
          description: Contact email address for the location.
        phone_number:
          type: string
          maxLength: 255
          nullable: true
          description: Contact phone number for the location.
        website:
          type: string
          maxLength: 255
          nullable: true
          description: The location's website URL.
        shift_open:
          type: boolean
          nullable: true
          description: >-
            Whether a working shift is currently open at this location — flips
            as the team opens and closes the day's shift.
        online_booking:
          type: boolean
          nullable: true
          description: Whether the location is offered in online booking.
        feedback_url:
          type: string
          maxLength: 255
          nullable: true
          description: >-
            Third-party review site URL patients are directed to after a
            qualifying rating — the location's Patient Review settings.
        feedback_rating_trigger:
          type: integer
          nullable: true
          description: >-
            Minimum rating, 1–5: a patient rating this value or higher is
            directed to the review site.
        feedback_visit_trigger:
          type: string
          nullable: true
          description: Number of completed visits before the review request is triggered.
        updated_at:
          type: string
          description: When the record was last changed, YYYY-MM-DDTHH:MM:SSZ, UTC.
        created_at:
          type: string
          description: When the record was created, YYYY-MM-DDTHH:MM:SSZ, UTC.
        calendar_view:
          type: integer
          nullable: true
          description: >-
            Calendar layout: 1 = resource view (rooms/tables — an appointment
            here needs a resource_id), 2 = practitioner view (no resource_id).
        metadata:
          $ref: '#/components/schemas/Metadata'
      example:
        id: 1
        name: City Centre Clinic
        email: hello@citycentreclinic.example
        phone_number: '+441614960102'
        website: https://citycentreclinic.example
        shift_open: true
        online_booking: true
        feedback_url: https://reviews.example.org/city-centre-clinic
        feedback_rating_trigger: 4
        feedback_visit_trigger: '3'
        updated_at: '2026-05-14T09:30:00Z'
        created_at: '2024-10-01T12:00:00Z'
        calendar_view: 2
    Metadata:
      type: object
      description: >-
        Integrator-owned key/value metadata (max 50 keys). Values are strings
        (≤500 chars), numbers or booleans and read back with the type they were
        written with. On write, a null value removes the key. Filter with
        metadata[key]=op:value; number operands compare numerically.
      additionalProperties:
        nullable: true
        oneOf:
          - type: string
            maxLength: 500
          - type: number
          - type: boolean
    Error:
      type: object
      required:
        - message
        - code
      properties:
        message:
          type: string
          description: Human-readable; may change — do not parse
        code:
          type: string
          description: >-
            Stable machine-readable code (snake_case), e.g. validation_failed,
            not_found, key_read_only, not_online_bookable, group_full,
            appointment_rule, billing_rule, idempotency_key_reused, rate_limited
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Present on validation failures, keyed by attribute
  responses:
    Unauthenticated:
      description: Missing or invalid credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ReadOnlyKey:
      description: The API key is read-only
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: >-
        A domain rule rejected the change (e.g. group_full, already processed,
        void)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: Invalid input; `errors` is keyed by attribute
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key from Developers → API Keys, sent as Authorization: Bearer <key>.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.