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

# List sites

> List, retrieve, create and update sites.



## OpenAPI

````yaml /openapi/fleet-manager-openapi.yaml get /api/v1/sites/
openapi: 3.0.3
info:
  title: Fleet Manager API
  version: 1.0.0
  description: API for the Nscale Fleet Manager
servers: []
security: []
paths:
  /api/v1/sites/:
    get:
      tags:
        - Sites
      summary: List sites
      description: List, retrieve, create and update sites.
      operationId: api_v1_sites_list
      parameters:
        - name: annotation_eq
          required: false
          in: query
          description: >-
            Filter by annotation key=value pairs (AND semantics). Use
            annotation_eq[key]=value.
          style: deepObject
          explode: true
          schema:
            type: object
            additionalProperties:
              type: string
        - name: annotation_has
          required: false
          in: query
          description: Filter by annotation key existence (comma-separated, AND semantics).
          schema:
            type: string
        - in: query
          name: inventory_only
          schema:
            type: boolean
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
            maximum: 500
            minimum: 1
        - in: query
          name: name
          schema:
            type: string
        - in: query
          name: organisation_id
          schema:
            type: array
            items:
              type: string
              format: uuid
          description: Multiple values may be separated by commas.
          explode: false
          style: form
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - in: query
          name: slug
          schema:
            type: string
        - name: tag
          required: false
          in: query
          description: Filter by tags (comma-separated, OR semantics).
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedSiteList'
          description: ''
        '400':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication credentials were not provided or are invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have permission to perform this action.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - oauth2:
            - site:read
        - cookieAuth: []
components:
  schemas:
    PaginatedSiteList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Site'
    ErrorResponse:
      type: object
      description: >-
        Uniform error body for every 4xx/5xx response. `detail` is a
        human-readable message, always present, safe to display to end users.
        `code` is the machine-readable identifier. `field_errors` lists
        per-input-field validation messages and is empty for non-field errors
        (auth, permission, not-found, conflict, server).
      required:
        - detail
        - code
        - field_errors
      properties:
        detail:
          type: string
        code:
          $ref: '#/components/schemas/ErrorCodeEnum'
        field_errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
    Site:
      type: object
      description: Serializer for Site model.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        annotations:
          type: object
          additionalProperties:
            type: string
          description: >-
            Key-value annotations. Keys must start with a lowercase letter and
            contain only lowercase alphanumeric segments joined by hyphens or
            underscores (e.g. 'org-id', 'gpu_ready').
        tags:
          type: array
          items:
            type: string
          description: >-
            Tags for the resource. Must start with a lowercase letter and
            contain only lowercase alphanumeric segments joined by hyphens or
            underscores (e.g. 'gpu-ready', 'needs_review'). Stored deduplicated
            and sorted.
        organisation_name:
          type: string
          readOnly: true
        links:
          allOf:
            - $ref: '#/components/schemas/SiteLinks'
          readOnly: true
        counts:
          allOf:
            - $ref: '#/components/schemas/SiteDeviceCounts'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        name:
          type: string
          maxLength: 255
        slug:
          type: string
          maxLength: 50
          pattern: ^[-a-zA-Z0-9_]+$
        country:
          allOf:
            - $ref: '#/components/schemas/CountryEnum'
          nullable: true
        inventory_only:
          type: boolean
          description: >-
            Fleet Manager publishes this site's inventory but manages no
            hardware here. Set at create from deployment config
            (netboxAgent.inventoryOnlySites) and immutable afterwards; every
            Device created here inherits Device.inventory_only.
        organisation:
          type: string
          format: uuid
      required:
        - counts
        - created_at
        - id
        - links
        - name
        - organisation
        - organisation_name
        - slug
        - updated_at
    ErrorCodeEnum:
      type: string
      description: >-
        Stable machine-readable error identifier. New members may be added
        within this API version; clients must tolerate unknown values.
      enum:
        - error
        - invalid
        - parse_error
        - authentication_failed
        - not_authenticated
        - permission_denied
        - not_found
        - method_not_allowed
        - not_acceptable
        - unsupported_media_type
        - conflict
        - enrollment_infrastructure_reference_pending
        - enrollment_infrastructure_reference_changed
        - unprocessable_entity
        - throttled
        - service_unavailable
    FieldError:
      type: object
      description: One input field's validation messages.
      required:
        - field
        - messages
      properties:
        field:
          type: string
          description: >-
            Dotted path to the offending input field, or to the collection row
            when the whole row is invalid (e.g. `filters.end_date`,
            `memberships.0.role`, `memberships.0`).
        messages:
          type: array
          minItems: 1
          items:
            type: string
    SiteLinks:
      type: object
      description: Serializer for site links.
      properties:
        self:
          type: string
          format: uri
          readOnly: true
        collection:
          type: string
          format: uri
          readOnly: true
        organisation:
          type: string
          format: uri
          readOnly: true
        locations:
          type: string
          format: uri
          readOnly: true
        racks:
          type: string
          format: uri
          readOnly: true
        devices:
          type: string
          format: uri
          readOnly: true
        jobs:
          type: string
          format: uri
          readOnly: true
      required:
        - collection
        - devices
        - jobs
        - locations
        - organisation
        - racks
        - self
    SiteDeviceCounts:
      type: object
      description: >-
        Schema for the nested counts field on Site responses.


        Every bucket bar ``inventory_only_devices`` is scoped to FM-managed
        devices

        (see ``device_status_count_aggregations``), so an ``inventory_only``
        site

        legitimately reports zero across them however many inventory rows it
        holds —

        ``inventory_only_devices`` is where those rows are counted. Filter the
        site

        list by ``inventory_only`` to list the same universe a given bucket
        measures.
      properties:
        total:
          type: integer
          description: >-
            Number of FM-managed devices at the site; excludes inventory-only
            devices.
        inventory_only_devices:
          type: integer
          description: >-
            Number of inventory-only devices at the site, the population
            excluded from total and from every status breakdown. Add the two for
            every device row the site holds.
        customer_ready:
          allOf:
            - $ref: '#/components/schemas/CustomerReadyCount'
          description: Counts of customer-ready vs non-customer-ready devices
        inventory_status:
          allOf:
            - $ref: '#/components/schemas/DeviceInventoryStatusCounts'
          description: Count of devices per inventory status
        operational_status:
          allOf:
            - $ref: '#/components/schemas/DeviceOperationalStatusCounts'
          description: Count of devices per operational status
        health_status:
          allOf:
            - $ref: '#/components/schemas/DeviceHealthStatusCounts'
          description: Count of devices per health status
      required:
        - customer_ready
        - health_status
        - inventory_only_devices
        - inventory_status
        - operational_status
        - total
    CountryEnum:
      enum:
        - AF
        - AX
        - 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
        - CG
        - CK
        - CR
        - CI
        - HR
        - CU
        - CW
        - CY
        - CZ
        - CD
        - 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
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IR
        - IQ
        - IE
        - IM
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KI
        - 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
        - KP
        - MK
        - MP
        - 'NO'
        - OM
        - PK
        - PW
        - PS
        - PA
        - PG
        - PY
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - RE
        - RO
        - RU
        - RW
        - BL
        - SH
        - KN
        - LC
        - MF
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SX
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - KR
        - 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
        - VA
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
      type: string
      description: |-
        * `AF` - Afghanistan
        * `AX` - Åland Islands
        * `AL` - Albania
        * `DZ` - Algeria
        * `AS` - American Samoa
        * `AD` - Andorra
        * `AO` - Angola
        * `AI` - Anguilla
        * `AQ` - Antarctica
        * `AG` - Antigua and Barbuda
        * `AR` - Argentina
        * `AM` - Armenia
        * `AW` - Aruba
        * `AU` - Australia
        * `AT` - Austria
        * `AZ` - Azerbaijan
        * `BS` - Bahamas (The)
        * `BH` - Bahrain
        * `BD` - Bangladesh
        * `BB` - Barbados
        * `BY` - Belarus
        * `BE` - Belgium
        * `BZ` - Belize
        * `BJ` - Benin
        * `BM` - Bermuda
        * `BT` - Bhutan
        * `BO` - Bolivia
        * `BQ` - Bonaire, Sint Eustatius and Saba
        * `BA` - Bosnia and Herzegovina
        * `BW` - Botswana
        * `BV` - Bouvet Island
        * `BR` - Brazil
        * `IO` - British Indian Ocean Territory
        * `BN` - Brunei
        * `BG` - Bulgaria
        * `BF` - Burkina Faso
        * `BI` - Burundi
        * `CV` - Cabo Verde
        * `KH` - Cambodia
        * `CM` - Cameroon
        * `CA` - Canada
        * `KY` - Cayman Islands
        * `CF` - Central African Republic
        * `TD` - Chad
        * `CL` - Chile
        * `CN` - China
        * `CX` - Christmas Island
        * `CC` - Cocos (Keeling) Islands
        * `CO` - Colombia
        * `KM` - Comoros
        * `CG` - Congo
        * `CK` - Cook Islands
        * `CR` - Costa Rica
        * `CI` - Côte d'Ivoire
        * `HR` - Croatia
        * `CU` - Cuba
        * `CW` - Curaçao
        * `CY` - Cyprus
        * `CZ` - Czechia
        * `CD` - Democratic Republic of the Congo
        * `DK` - Denmark
        * `DJ` - Djibouti
        * `DM` - Dominica
        * `DO` - Dominican Republic
        * `EC` - Ecuador
        * `EG` - Egypt
        * `SV` - El Salvador
        * `GQ` - Equatorial Guinea
        * `ER` - Eritrea
        * `EE` - Estonia
        * `SZ` - Eswatini
        * `ET` - Ethiopia
        * `FK` - Falkland Islands (Malvinas)
        * `FO` - Faroe Islands
        * `FJ` - Fiji
        * `FI` - Finland
        * `FR` - France
        * `GF` - French Guiana
        * `PF` - French Polynesia
        * `TF` - French Southern Territories
        * `GA` - Gabon
        * `GM` - Gambia
        * `GE` - Georgia
        * `DE` - Germany
        * `GH` - Ghana
        * `GI` - Gibraltar
        * `GR` - Greece
        * `GL` - Greenland
        * `GD` - Grenada
        * `GP` - Guadeloupe
        * `GU` - Guam
        * `GT` - Guatemala
        * `GG` - Guernsey
        * `GN` - Guinea
        * `GW` - Guinea-Bissau
        * `GY` - Guyana
        * `HT` - Haiti
        * `HM` - Heard Island and McDonald Islands
        * `HN` - Honduras
        * `HK` - Hong Kong
        * `HU` - Hungary
        * `IS` - Iceland
        * `IN` - India
        * `ID` - Indonesia
        * `IR` - Iran
        * `IQ` - Iraq
        * `IE` - Ireland
        * `IM` - Isle of Man
        * `IL` - Israel
        * `IT` - Italy
        * `JM` - Jamaica
        * `JP` - Japan
        * `JE` - Jersey
        * `JO` - Jordan
        * `KZ` - Kazakhstan
        * `KE` - Kenya
        * `KI` - Kiribati
        * `KW` - Kuwait
        * `KG` - Kyrgyzstan
        * `LA` - Laos
        * `LV` - Latvia
        * `LB` - Lebanon
        * `LS` - Lesotho
        * `LR` - Liberia
        * `LY` - Libya
        * `LI` - Liechtenstein
        * `LT` - Lithuania
        * `LU` - Luxembourg
        * `MO` - Macao
        * `MG` - Madagascar
        * `MW` - Malawi
        * `MY` - Malaysia
        * `MV` - Maldives
        * `ML` - Mali
        * `MT` - Malta
        * `MH` - Marshall Islands
        * `MQ` - Martinique
        * `MR` - Mauritania
        * `MU` - Mauritius
        * `YT` - Mayotte
        * `MX` - Mexico
        * `FM` - Micronesia
        * `MD` - Moldova
        * `MC` - Monaco
        * `MN` - Mongolia
        * `ME` - Montenegro
        * `MS` - Montserrat
        * `MA` - Morocco
        * `MZ` - Mozambique
        * `MM` - Myanmar
        * `NA` - Namibia
        * `NR` - Nauru
        * `NP` - Nepal
        * `NL` - Netherlands
        * `NC` - New Caledonia
        * `NZ` - New Zealand
        * `NI` - Nicaragua
        * `NE` - Niger
        * `NG` - Nigeria
        * `NU` - Niue
        * `NF` - Norfolk Island
        * `KP` - North Korea
        * `MK` - North Macedonia
        * `MP` - Northern Mariana Islands
        * `NO` - Norway
        * `OM` - Oman
        * `PK` - Pakistan
        * `PW` - Palau
        * `PS` - Palestine
        * `PA` - Panama
        * `PG` - Papua New Guinea
        * `PY` - Paraguay
        * `PE` - Peru
        * `PH` - Philippines
        * `PN` - Pitcairn
        * `PL` - Poland
        * `PT` - Portugal
        * `PR` - Puerto Rico
        * `QA` - Qatar
        * `RE` - Réunion
        * `RO` - Romania
        * `RU` - Russia
        * `RW` - Rwanda
        * `BL` - Saint Barthélemy
        * `SH` - Saint Helena
        * `KN` - Saint Kitts and Nevis
        * `LC` - Saint Lucia
        * `MF` - Saint Martin (French part)
        * `PM` - Saint Pierre and Miquelon
        * `VC` - Saint Vincent and the Grenadines
        * `WS` - Samoa
        * `SM` - San Marino
        * `ST` - Sao Tome and Principe
        * `SA` - Saudi Arabia
        * `SN` - Senegal
        * `RS` - Serbia
        * `SC` - Seychelles
        * `SL` - Sierra Leone
        * `SG` - Singapore
        * `SX` - Sint Maarten (Dutch part)
        * `SK` - Slovakia
        * `SI` - Slovenia
        * `SB` - Solomon Islands
        * `SO` - Somalia
        * `ZA` - South Africa
        * `GS` - South Georgia
        * `KR` - South Korea
        * `SS` - South Sudan
        * `ES` - Spain
        * `LK` - Sri Lanka
        * `SD` - Sudan
        * `SR` - Suriname
        * `SJ` - Svalbard and Jan Mayen
        * `SE` - Sweden
        * `CH` - Switzerland
        * `SY` - Syria
        * `TW` - Taiwan
        * `TJ` - Tajikistan
        * `TZ` - Tanzania
        * `TH` - Thailand
        * `TL` - Timor-Leste
        * `TG` - Togo
        * `TK` - Tokelau
        * `TO` - Tonga
        * `TT` - Trinidad and Tobago
        * `TN` - Tunisia
        * `TR` - Türkiye
        * `TM` - Turkmenistan
        * `TC` - Turks and Caicos Islands
        * `TV` - Tuvalu
        * `UG` - Uganda
        * `UA` - Ukraine
        * `AE` - United Arab Emirates
        * `GB` - United Kingdom
        * `UM` - United States Minor Outlying Islands
        * `US` - United States of America
        * `UY` - Uruguay
        * `UZ` - Uzbekistan
        * `VU` - Vanuatu
        * `VA` - Vatican City
        * `VE` - Venezuela
        * `VN` - Vietnam
        * `VG` - Virgin Islands (British)
        * `VI` - Virgin Islands (U.S.)
        * `WF` - Wallis and Futuna
        * `EH` - Western Sahara
        * `YE` - Yemen
        * `ZM` - Zambia
        * `ZW` - Zimbabwe
    CustomerReadyCount:
      type: object
      description: Serializer for customer_ready true/false counts.
      properties:
        'true':
          type: integer
          description: Count of customer-ready devices
        'false':
          type: integer
          description: Count of non-customer-ready devices
      required:
        - 'false'
        - 'true'
    DeviceInventoryStatusCounts:
      type: object
      description: Count of devices per inventory status.
      properties:
        planned:
          type: integer
        staged:
          type: integer
        active:
          type: integer
        failed:
          type: integer
        offline:
          type: integer
        rma:
          type: integer
        returned:
          type: integer
        decommissioning:
          type: integer
        decommissioned:
          type: integer
        inventory:
          type: integer
        unknown:
          type: integer
      required:
        - active
        - decommissioned
        - decommissioning
        - failed
        - inventory
        - offline
        - planned
        - returned
        - rma
        - staged
        - unknown
    DeviceOperationalStatusCounts:
      type: object
      description: Count of devices per operational status.
      properties:
        unknown:
          type: integer
        quarantine:
          type: integer
        validation:
          type: integer
        available:
          type: integer
        in_use:
          type: integer
        delegated:
          type: integer
        pending_handover:
          type: integer
        drained:
          type: integer
        failed:
          type: integer
      required:
        - available
        - delegated
        - drained
        - failed
        - in_use
        - pending_handover
        - quarantine
        - unknown
        - validation
    DeviceHealthStatusCounts:
      type: object
      description: Count of devices per health status.
      properties:
        unknown:
          type: integer
        healthy:
          type: integer
        degraded:
          type: integer
        critical:
          type: integer
      required:
        - critical
        - degraded
        - healthy
        - unknown
  securitySchemes:
    oauth2:
      type: oauth2
      flows: {}
    cookieAuth:
      type: apiKey
      in: cookie
      name: sessionid

````

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