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

# Create Site

> Create a new site for a specified company.



## OpenAPI

````yaml /api-reference/openapi-v2-1.json post /site/company/{company_id}
openapi: 3.1.0
info:
  title: Nectar API Documentation
  version: 1.0.0 (v1)
  description: >-
    Complete API documentation for v2.1 endpoints to managing companies, sites,
    data, and documents
servers:
  - url: https://external.nectarclimate.com/v2.1
    description: Nectar API Server
security: []
paths:
  /site/company/{company_id}:
    post:
      tags:
        - Sites
      summary: Create Site
      description: Create a new site for a specified company.
      operationId: site_company_create
      parameters:
        - in: path
          name: company_id
          schema:
            type: string
            format: uuid
          description: ID of the company to create a site for.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SiteCreateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SiteCreateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SiteCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Site'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
        '403':
          description: 'Forbidden: Access to the company is denied.'
        '404':
          description: Company not found.
      security:
        - ExternalAuthentication: []
components:
  schemas:
    SiteCreateRequest:
      type: object
      description: Serializer for creating a new Site object.
      properties:
        externalId:
          type:
            - string
            - 'null'
          description: >-
            ID of the site on external platforms used during exports. Used to
            associate site in Nectar with site within your database.
        name:
          type: string
          minLength: 1
          description: Name of the site.
          maxLength: 255
        address:
          type: string
          description: Address of the site.
          maxLength: 255
        path:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 100
          description: >-
            List of location tags in increasing specificity used to filter
            sites. Filters must be entered from more general to more specific.
            E.g. ['US', 'CA', 'ON']
          maxItems: 10
        occupancyPercent:
          type:
            - string
            - 'null'
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,4})?$
          description: >-
            Occupancy percent, must be a number from 0 to 100. Usage for the
            site will be multiplied by this value for specified connections.
      required:
        - name
    Site:
      type: object
      description: Serializer for Site objects.
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the site.
        externalId:
          type:
            - string
            - 'null'
          description: >-
            ID of the site on external platforms used during exports. Used to
            associate site in Nectar with site within your database.
        name:
          type: string
          description: Name of the site.
          maxLength: 255
        address:
          type: string
          description: Address of the site.
          maxLength: 255
        path:
          type: array
          items:
            type: string
            maxLength: 100
          description: >-
            List of location tags in increasing specificity used to filter
            sites. Filters must be entered from more general to more specific.
            E.g. ['US', 'CA', 'ON']
          maxItems: 10
        occupancyPercent:
          type:
            - string
            - 'null'
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,4})?$
          description: >-
            Occupancy percent, must be a number from 0 to 100. Usage for the
            site will be multiplied by this value for specified connections.
        dataCollectionStopDate:
          type:
            - string
            - 'null'
          format: date
          description: >-
            Date when data collection for this site was stopped. A non-null
            value indicates the site has been soft-deleted/archived.
      required:
        - dataCollectionStopDate
        - id
        - name
    ErrorResponse:
      type: object
      description: Serializer for error responses.
      properties:
        detail:
          type: string
        error:
          type: string
  securitySchemes:
    ExternalAuthentication:
      type: apiKey
      in: header
      name: X-API-KEY

````