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

# Create a site



## OpenAPI

````yaml /openapi.json post /sites
openapi: 3.1.0
info:
  title: Cula Tracking API
  version: 0.3.10
servers:
  - url: https://api.demo.cula.earth/tracking/v1
security: []
tags:
  - name: Organisations
    description: ''
  - name: Sites
    description: ''
  - name: Machines
    description: ''
  - name: Machine Variables
    description: ''
  - name: Machine Data Imports
    description: ''
  - name: Delivery Configs
    description: ''
  - name: Deliveries
    description: ''
  - name: Material Sourcing Configs
    description: ''
  - name: Material Sourcings
    description: ''
  - name: Material Conversion Configs
    description: ''
  - name: Material Conversions
    description: ''
  - name: Material Utilization Configs
    description: ''
  - name: Material Utilizations
    description: ''
  - name: Material Batches
    description: ''
  - name: Material Pools
    description: ''
  - name: Material Containers
    description: ''
  - name: Sinks
    description: ''
  - name: Documents
    description: ''
  - name: Webhooks
    description: ''
paths:
  /sites:
    post:
      tags:
        - Sites
      summary: Create a site
      parameters:
        - name: Cula-Organisation-Id
          in: header
          description: >-
            ID of the organisation the request operates on behalf of (e.g.
            `org_...`). Must be an organisation the API client has access to.
          required: true
          schema:
            type: string
            example: org_01k83mfmhgchya944v86ryvhpq
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSiteRequest'
      responses:
        '201':
          description: Site
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SiteResponse'
        '400':
          description: Invalid request payload or parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: bad_request
                message: The field limit must not be greater than 100.
        '401':
          description: Missing or invalid access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: unauthorized
                message: Invalid or expired token
        '409':
          description: Conflicting resource state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: conflict
                message: >-
                  There exists already an object with external ID MY-CUSTOM-ID
                  within this organisation.
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: internal_server_error
                message: Internal server error.
      security:
        - AccessToken: []
components:
  schemas:
    CreateSiteRequest:
      type: object
      properties:
        name:
          type: string
          description: Human-readable name for the new managed site.
          maxLength: 100
          minLength: 3
        address:
          type: string
          maxLength: 200
          minLength: 3
          description: >-
            Free-form postal address of the new site (e.g. "Friedrichstr. 1,
            10117 Berlin, Germany"). The server geocodes it before saving —
            check the response for the persisted location.
        managed_by_site:
          description: >-
            The site managing this record. Must be a site within your API key's
            scope and must match the managing site of the provided organisation.
            Reference it either by its ID or by its external ID, but not both.
          oneOf:
            - $ref: '#/components/schemas/SiteIdReference'
            - $ref: '#/components/schemas/SiteExternalIdReference'
        organisation:
          description: >-
            The organisation this site is grouped under. Reference it either by
            its ID or by its external ID, but not both.
          oneOf:
            - $ref: '#/components/schemas/OrganisationIdReference'
            - $ref: '#/components/schemas/OrganisationExternalIdReference'
        external_id:
          type: string
          example: MY-CUSTOM-ID
          description: >-
            A optional custom ID that can be set to an internal ID from your
            system. This ID must be unique within all objects of the
            organisation you operate in. You can later use this external ID to
            reference and query this object. Be aware that you can update this
            ID later. If you need an immutable ID, use the object ID returned
            when creating the object.
          nullable: false
          maxLength: 100
          minLength: 1
          pattern: ^[A-Za-z0-9\-_]+$
      required:
        - name
        - address
        - managed_by_site
        - organisation
    SiteResponse:
      type: object
      properties:
        id:
          type: string
          example: ste_01k8g7aec6dt5zrtamc72ww446
        name:
          type: string
          nullable: true
          example: Biomass Lutz
        location:
          deprecated: true
          description: 'Deprecated: use `coordinates` and `address` instead.'
          allOf:
            - $ref: '#/components/schemas/Location'
        coordinates:
          description: Latitude/longitude coordinates of the site.
          allOf:
            - $ref: '#/components/schemas/Coordinates'
        address:
          nullable: true
          description: Postal address of the site, if known.
          type: object
          allOf:
            - $ref: '#/components/schemas/Address'
        organisation_id:
          type: string
          example: org_01k83mfmhgchya944v86ryvhpq
          nullable: true
          deprecated: true
          description: 'Deprecated: use `organisation` instead.'
        organisation:
          nullable: true
          description: The organisation this site is grouped under.
          type: object
          allOf:
            - $ref: '#/components/schemas/OrganisationReference'
        external_id:
          type: string
          nullable: true
          example: SITE-EXT-0001
        managed_by_site:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/SiteReference'
      required:
        - id
        - name
        - location
        - coordinates
        - address
        - organisation_id
        - organisation
        - external_id
        - managed_by_site
    Error:
      type: object
      properties:
        code:
          type: string
          example: bad_request
        message:
          type: string
          example: The field limit must not be greater than 100.
      required:
        - code
        - message
    SiteIdReference:
      type: object
      properties:
        id:
          type: string
          example: ste_01k8g7aec6dt5zrtamc72ww446
      description: References a site by its ID.
      required:
        - id
    SiteExternalIdReference:
      type: object
      properties:
        external_id:
          type: string
          example: SITE-EXT-0001
          nullable: false
          maxLength: 100
          minLength: 1
          pattern: ^[A-Za-z0-9\-_]+$
      description: References a site by the external ID you assigned to it.
      required:
        - external_id
    OrganisationIdReference:
      type: object
      properties:
        id:
          type: string
          example: org_01k83mfmhgchya944v86ryvhpq
      description: References an organisation by its ID.
      required:
        - id
    OrganisationExternalIdReference:
      type: object
      properties:
        external_id:
          type: string
          example: ORG-EXT-0001
          nullable: false
          maxLength: 100
          minLength: 1
          pattern: ^[A-Za-z0-9\-_]+$
      description: References an organisation by the external ID you assigned to it.
      required:
        - external_id
    Location:
      type: object
      properties:
        geocode:
          $ref: '#/components/schemas/GeoPoint'
        address:
          $ref: '#/components/schemas/DeprecatedAddress'
      description: Either geocoordinates or an address (or both).
    Coordinates:
      type: object
      properties:
        lat:
          type: number
          format: double
          description: Latitude in decimal degrees.
          example: 52.520008
          minimum: -90
          maximum: 90
        long:
          type: number
          format: double
          description: Longitude in decimal degrees.
          example: 13.404954
          minimum: -180
          maximum: 180
      description: Latitude/longitude coordinates in WGS84 decimal degrees.
      required:
        - lat
        - long
    Address:
      type: object
      properties:
        street:
          type: string
          nullable: true
          description: Street name and number, if known.
          example: Friedrichstrasse 1
        postcode:
          type: string
          nullable: true
          description: Postal/ZIP code, if known.
          example: '10117'
        city:
          type: string
          description: City or locality.
          example: Berlin
        country:
          type: string
          description: Full country name.
          example: Germany
        country_code:
          type: string
          pattern: ^[A-Z]{2}$
          description: ISO 3166-1 alpha-2 country code.
          example: DE
      required:
        - street
        - postcode
        - city
        - country
        - country_code
    OrganisationReference:
      type: object
      properties:
        id:
          type: string
          nullable: true
          example: org_01k83mfmhgchya944v86ryvhpq
        external_id:
          type: string
          nullable: true
          example: ORG-EXT-0001
      description: >-
        References an organisation by its ID and the external ID you assigned to
        it (if any).
      required:
        - id
        - external_id
    SiteReference:
      type: object
      properties:
        id:
          type: string
          nullable: true
          example: ste_01k8g7aec6dt5zrtamc72ww446
        external_id:
          type: string
          nullable: true
          example: SITE-EXT-0001
      description: >-
        References a site by its ID and the external ID you assigned to it (if
        any).
      required:
        - id
        - external_id
    GeoPoint:
      type: object
      properties:
        latitude:
          type: number
          example: 51.339
        longitude:
          type: number
          example: 12.371
      required:
        - latitude
        - longitude
    DeprecatedAddress:
      type: object
      properties:
        address_line_1:
          type: string
          example: Yard A
        address_line_2:
          type: string
          nullable: true
          example: null
        postal_code:
          type: string
          example: '10115'
        city:
          type: string
          example: Berlin
        country_code:
          type: string
          pattern: ^[A-Z]{2}$
          example: DE
      required:
        - address_line_1
        - postal_code
        - city
        - country_code
  securitySchemes:
    AccessToken:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://auth.demo.cula.earth/oauth2/token
          scopes: {}
      description: >-
        OAuth 2.0 client credentials. Exchange your client_id and client_secret
        for an access token scoped to the organisation that provides data
        access.

````