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

# Create site

> Create a site — a web-property configuration record (domain, brand, template, page sections) keyed by a URL-safe `key_name` unique within your organization. The `value` payload is free-form JSON that you define. Returns 409 if the key already exists.



## OpenAPI

````yaml /openapi.json post /sites
openapi: 3.1.0
info:
  title: OpenLoop API
  version: 0.1.0
  description: >-
    Unified reference for the OpenLoop Patient (clinical) and Payments & Revenue
    APIs.
servers:
  - url: https://api.openloophealth.com/v0.1
    description: Production partner edge
  - url: https://api-staging.openloophealth.com/v0.1
    description: Staging partner edge (sandbox credentials)
security: []
paths:
  /sites:
    post:
      tags:
        - Sites
      summary: Create site
      description: >-
        Create a site — a web-property configuration record (domain, brand,
        template, page sections) keyed by a URL-safe `key_name` unique within
        your organization. The `value` payload is free-form JSON that you
        define. Returns 409 if the key already exists.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                key_name:
                  type: string
                  pattern: ^[a-z0-9-]{3,64}$
                value:
                  type: string
                  minLength: 1
                  maxLength: 65536
                status:
                  type: string
                  enum:
                    - deployed
                    - draft
                    - error
              required:
                - key_name
                - value
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Site'
                  request_id:
                    type: string
                required:
                  - data
                  - request_id
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict (key already exists for tenant)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - serviceToken: []
        - userToken: []
components:
  schemas:
    Site:
      type: object
      properties:
        key_name:
          type: string
        value:
          type: string
        status:
          type: string
          enum:
            - deployed
            - draft
            - error
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        tenant_id:
          type: string
        program_count:
          type: integer
          minimum: 0
      required:
        - key_name
        - value
        - status
        - created_at
        - updated_at
        - tenant_id
        - program_count
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            error_code:
              type: string
          required:
            - message
            - error_code
        request_id:
          type: string
      required:
        - error
        - request_id
  securitySchemes:
    serviceToken:
      type: oauth2
      description: >-
        Service (M2M) access token issued by POST /auth/token using the
        client_credentials grant. Required scopes, where known, are listed on
        each operation below.
      flows:
        clientCredentials:
          tokenUrl: https://api.openloophealth.com/v0.1/auth/token
          scopes: {}
    userToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        User access token issued by POST /auth/token via the verification-code
        grant (after Verify a one-time code) or the refresh_token grant.

````

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