NinjaOne organization API

Organizations

OpenAPI Specification

ninjaone-organization-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: NinjaOne Public API 2.0 Asset Tags organization API
  description: NinjaOne Public API documentation.
  contact:
    email: api@ninjarmm.com
  version: 2.0.9-draft
security:
- oauth2:
  - monitoring
  - management
  - control
- sessionKey:
  - monitoring
  - management
  - control
tags:
- name: organization
  description: Organizations
paths:
  /v2/organization/{id}/locations:
    get:
      tags:
      - organization
      summary: Organization locations
      description: Returns list of locations for organization
      operationId: getOrganizationLocations
      parameters:
      - name: id
        in: path
        description: Organization identifier
        required: true
        schema:
          type: integer
          format: int32
      responses:
        default:
          description: default response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Location'
  /v2/organization/{id}/end-users:
    get:
      tags:
      - organization
      summary: List users
      description: Returns list of end-users for organization
      operationId: getEndUsers
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      - name: includeRoles
        in: query
        description: Includes user role information
        schema:
          type: boolean
          default: false
      responses:
        default:
          description: default response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'
  /v2/organization/{id}/locations/{locationId}/backup/usage:
    get:
      tags:
      - organization
      summary: Organization location backup usage
      description: Returns a location backup usage
      operationId: getLocationUsage
      parameters:
      - name: id
        in: path
        description: Organization identifier
        required: true
        schema:
          type: integer
          format: int32
      - name: locationId
        in: path
        description: Location identifier
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Returns a location backup usage
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationBackupUsageSummary'
  /v2/organization/{id}/custom-fields:
    get:
      tags:
      - organization
      summary: Organization custom fields
      description: Returns list of organization custom fields
      operationId: getNodeCustomFields_1
      parameters:
      - name: id
        in: path
        description: Organization identifier
        required: true
        schema:
          type: integer
          format: int32
      responses:
        default:
          description: default response
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: object
    patch:
      tags:
      - organization
      summary: Update Field Values
      description: Update organization custom field values
      operationId: updateNodeAttributeValues_1
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                type: object
      responses:
        default:
          description: default response
          content:
            '*/*': {}
  /v2/organization/{id}:
    get:
      tags:
      - organization
      summary: Organization information
      description: Returns organization details (policy mappings, locations)
      operationId: getOrganization
      parameters:
      - name: id
        in: path
        description: Organization identifier
        required: true
        schema:
          type: integer
          format: int32
      responses:
        default:
          description: default response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationDetailed'
  /v2/organization/{id}/devices:
    get:
      tags:
      - organization
      summary: Organization devices
      description: Returns list of devices for organization
      operationId: getOrganizationDevices
      parameters:
      - name: id
        in: path
        description: Organization identifier
        required: true
        schema:
          type: integer
          format: int32
      - name: pageSize
        in: query
        description: Limit number of devices to return
        schema:
          type: integer
          format: int32
      - name: after
        in: query
        description: Last Node ID from previous page
        schema:
          type: integer
          format: int32
      responses:
        default:
          description: default response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/NodeWithDetailedReferences'
  /v2/organization/{id}/locations/backup/usage:
    get:
      tags:
      - organization
      summary: Organization locations backup usage
      description: Returns a list of locations backup usage
      operationId: getOrganizationLocationUsage
      parameters:
      - name: id
        in: path
        description: Organization identifier
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Returns list of locations backup usage
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LocationBackupUsageSummary'
components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: integer
          description: User identifier
          format: int32
        uid:
          type: string
          description: User universally unique identifier
          format: uuid
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
        phone:
          type: string
        enabled:
          type: boolean
        administrator:
          type: boolean
        permitAllClients:
          type: boolean
        notifyAllClients:
          type: boolean
        mustChangePw:
          type: boolean
        mfaConfigured:
          type: boolean
        userType:
          type: string
          enum:
          - TECHNICIAN
          - END_USER
        invitationStatus:
          type: string
          enum:
          - REGISTERED
          - PENDING
          - EXPIRED
        organizationId:
          type: integer
          description: Identifier of organization for end-users
          format: int32
        deviceIds:
          type: array
          description: Device IDs which end-user is authorized to access
          items:
            type: integer
            description: Device IDs which end-user is authorized to access
            format: int32
        assignedDeviceIds:
          type: array
          description: Device IDs which user is assigned
          items:
            type: integer
            description: Device IDs which user is assigned
            format: int32
        tags:
          type: array
          description: Tags
          items:
            type: string
            description: Tags
        fields:
          type: object
          additionalProperties:
            type: object
            description: Custom Fields
          description: Custom Fields
        roles:
          type: array
          description: A list of role names assigned to the user. This is provided when the 'includeRoles' query parameter is set to 'true'
          items:
            type: string
            description: A list of role names assigned to the user. This is provided when the 'includeRoles' query parameter is set to 'true'
      description: Assigned device owner
    LocationBackupUsageSummary:
      type: object
      properties:
        locationId:
          type: integer
          description: Device location id
          format: int32
        locationName:
          type: string
          description: Device location name
        locationDescription:
          type: string
          description: Device location description
        revisionsCurrentSize:
          type: integer
          format: int64
        revisionsPreviousSize:
          type: integer
          format: int64
        revisionsDeletedSize:
          type: integer
          format: int64
        localFileFolderSize:
          type: integer
          format: int64
        localImageSize:
          type: integer
          format: int64
        localImageV2Size:
          type: integer
          format: int64
        cloudFileFolderSize:
          type: integer
          format: int64
        cloudImageSize:
          type: integer
          format: int64
        cloudImageV2Size:
          type: integer
          format: int64
        lastSuccessfulBackupJob:
          type: number
          format: double
        lastFailedBackupJob:
          type: number
          format: double
        organizationId:
          type: integer
          format: int32
        organizationName:
          type: string
        revisionsTotalSize:
          type: integer
          description: Revisions total size
          format: int64
          readOnly: true
        cloudTotalSize:
          type: integer
          description: Revisions cloud total size
          format: int64
          readOnly: true
        localTotalSize:
          type: integer
          description: Revisions local total size
          format: int64
          readOnly: true
    Policy:
      type: object
      properties:
        id:
          type: integer
          description: Policy identifier
          format: int32
        parentPolicyId:
          type: integer
          description: Parent Policy identifier
          format: int32
        name:
          type: string
          description: Name
        description:
          type: string
          description: Description
        nodeClass:
          type: string
          description: Node Class
          enum:
          - WINDOWS_SERVER
          - WINDOWS_WORKSTATION
          - LINUX_WORKSTATION
          - MAC
          - ANDROID
          - APPLE_IOS
          - APPLE_IPADOS
          - VMWARE_VM_HOST
          - VMWARE_VM_GUEST
          - HYPERV_VMM_HOST
          - HYPERV_VMM_GUEST
          - LINUX_SERVER
          - MAC_SERVER
          - CLOUD_MONITOR_TARGET
          - NMS_SWITCH
          - NMS_ROUTER
          - NMS_FIREWALL
          - NMS_PRIVATE_NETWORK_GATEWAY
          - NMS_PRINTER
          - NMS_SCANNER
          - NMS_DIAL_MANAGER
          - NMS_WAP
          - NMS_IPSLA
          - NMS_COMPUTER
          - NMS_VM_HOST
          - NMS_APPLIANCE
          - NMS_OTHER
          - NMS_SERVER
          - NMS_PHONE
          - NMS_VIRTUAL_MACHINE
          - NMS_NETWORK_MANAGEMENT_AGENT
          - UNMANAGED_DEVICE
          - MANAGED_DEVICE
        updated:
          type: number
          description: Last update timestamp
          format: double
        nodeClassDefault:
          type: boolean
          description: Is Default Policy for Node Class
        tags:
          type: array
          description: Tags
          items:
            type: string
            description: Tags
        fields:
          type: object
          additionalProperties:
            type: object
            description: Custom Fields
          description: Custom Fields
      description: Assigned policy (overrides organization and location policy mapping)
    NodeReferences:
      type: object
      properties:
        organization:
          $ref: '#/components/schemas/Organization'
        location:
          $ref: '#/components/schemas/Location'
        rolePolicy:
          $ref: '#/components/schemas/Policy'
        policy:
          $ref: '#/components/schemas/Policy'
        role:
          $ref: '#/components/schemas/NodeRole'
        backupUsage:
          $ref: '#/components/schemas/BackupUsage'
        warranty:
          $ref: '#/components/schemas/WarrantyDates'
        assignedOwner:
          $ref: '#/components/schemas/User'
      description: Expanded entity references
    Location:
      type: object
      properties:
        name:
          type: string
          description: Location name
        address:
          type: string
          description: Address
        description:
          type: string
          description: Description
        userData:
          type: object
          additionalProperties: true
          description: Custom attributes
        tags:
          type: array
          description: Tags
          items:
            type: string
            description: Tags
        fields:
          type: object
          additionalProperties:
            type: object
            description: Custom Fields
          description: Custom Fields
        id:
          type: integer
          description: Location identifier
          format: int32
      description: Location
    Organization:
      type: object
      properties:
        name:
          type: string
          description: Organization full name
        description:
          type: string
          description: Organization Description
        userData:
          type: object
          additionalProperties: true
          description: Custom attributes
        nodeApprovalMode:
          type: string
          description: Device Approval Mode
          enum:
          - AUTOMATIC
          - MANUAL
          - REJECT
        tags:
          type: array
          description: Tags
          items:
            type: string
            description: Tags
        fields:
          type: object
          additionalProperties:
            type: object
            description: Custom Fields
          description: Custom Fields
        id:
          type: integer
          description: Organization identifier
          format: int32
      description: Organization
    BackupUsage:
      type: object
      properties:
        revisionsCurrentSize:
          type: integer
          description: Revisions current size
          format: int64
        revisionsPreviousSize:
          type: integer
          description: Revisions previous size
          format: int64
        revisionsDeletedSize:
          type: integer
          description: Revisions deleted size
          format: int64
        localFileFolderSize:
          type: integer
          description: Revisions local file folder size
          format: int64
        localImageSize:
          type: integer
          description: Revisions local image size
          format: int64
        localImageV2Size:
          type: integer
          description: Revisions local image v2 size
          format: int64
        cloudFileFolderSize:
          type: integer
          description: Revisions cloud file folder size
          format: int64
        cloudImageSize:
          type: integer
          description: Revisions cloud image size
          format: int64
        cloudImageV2Size:
          type: integer
          description: Revisions cloud image v2 size
          format: int64
        lastSuccessfulBackupJob:
          type: number
          description: Last successful job. This is provided when the 'includeLastBackupJobTimes' query parameter is set to 'true'
          format: double
        lastFailedBackupJob:
          type: number
          description: Last failed job. This is provided when the 'includeLastBackupJobTimes' query parameter is set to 'true'
          format: double
        revisionsTotalSize:
          type: integer
          description: Revisions total size
          format: int64
          readOnly: true
        cloudTotalSize:
          type: integer
          description: Revisions cloud total size
          format: int64
          readOnly: true
        localTotalSize:
          type: integer
          description: Revisions local total size
          format: int64
          readOnly: true
      description: Device Backup Usage
    OrganizationDetailed:
      type: object
      properties:
        name:
          type: string
          description: Organization full name
        description:
          type: string
          description: Organization Description
        userData:
          type: object
          additionalProperties: true
          description: Custom attributes
        nodeApprovalMode:
          type: string
          description: Device Approval Mode
          enum:
          - AUTOMATIC
          - MANUAL
          - REJECT
        tags:
          type: array
          description: Tags
          items:
            type: string
            description: Tags
        fields:
          type: object
          additionalProperties:
            type: object
            description: Custom Fields
          description: Custom Fields
        id:
          type: integer
          description: Organization identifier
          format: int32
        locations:
          type: array
          description: List of locations
          items:
            $ref: '#/components/schemas/Location'
        policies:
          type: array
          description: Node role policy assignments
          items:
            $ref: '#/components/schemas/NodeRolePolicyAssignment'
        settings:
          $ref: '#/components/schemas/OrganizationSettings'
    OrganizationSettings:
      type: object
      properties:
        trayicon:
          $ref: '#/components/schemas/FeatureSettings'
        splashtop:
          $ref: '#/components/schemas/FeatureSettings'
        teamviewer:
          $ref: '#/components/schemas/FeatureSettings'
        backup:
          $ref: '#/components/schemas/FeatureSettings'
        psa:
          $ref: '#/components/schemas/FeatureSettings'
      description: Organization settings
    WarrantyDates:
      type: object
      properties:
        startDate:
          type: number
          description: Warranty Start Date (Seconds)
          format: double
        endDate:
          type: number
          description: Warranty End Date (Seconds)
          format: double
        manufacturerFulfillmentDate:
          type: number
          description: Manufacturer Fulfillment Date
          format: double
      description: Warranty Info
    NodeRolePolicyAssignment:
      type: object
      properties:
        nodeRoleId:
          type: integer
          description: Node Role Identifier
          format: int32
        policyId:
          type: integer
          description: Policy Identifier
          format: int32
      description: Node role policy assignments
    Maintenance:
      type: object
      properties:
        status:
          type: string
          description: Maintenance mode status
          enum:
          - PENDING
          - IN_MAINTENANCE
          - FAILED
        start:
          type: number
          description: Maintenance mode start time
          format: double
        end:
          type: number
          description: Maintenance mode end time
          format: double
      description: Maintenance mode status
    NodeRole:
      type: object
      properties:
        id:
          type: integer
          description: Device Role identifier
          format: int32
        name:
          type: string
          description: Name
        description:
          type: string
          description: Description
        nodeClass:
          type: string
          description: Node Class
          enum:
          - WINDOWS_SERVER
          - WINDOWS_WORKSTATION
          - LINUX_WORKSTATION
          - MAC
          - ANDROID
          - APPLE_IOS
          - APPLE_IPADOS
          - VMWARE_VM_HOST
          - VMWARE_VM_GUEST
          - HYPERV_VMM_HOST
          - HYPERV_VMM_GUEST
          - LINUX_SERVER
          - MAC_SERVER
          - CLOUD_MONITOR_TARGET
          - NMS_SWITCH
          - NMS_ROUTER
          - NMS_FIREWALL
          - NMS_PRIVATE_NETWORK_GATEWAY
          - NMS_PRINTER
          - NMS_SCANNER
          - NMS_DIAL_MANAGER
          - NMS_WAP
          - NMS_IPSLA
          - NMS_COMPUTER
          - NMS_VM_HOST
          - NMS_APPLIANCE
          - NMS_OTHER
          - NMS_SERVER
          - NMS_PHONE
          - NMS_VIRTUAL_MACHINE
          - NMS_NETWORK_MANAGEMENT_AGENT
          - UNMANAGED_DEVICE
          - MANAGED_DEVICE
        custom:
          type: boolean
          description: Is custom node role?
        chassisType:
          type: string
          description: Chassis Type
          enum:
          - UNKNOWN
          - DESKTOP
          - LAPTOP
          - MOBILE
        created:
          type: number
          description: Date created
          format: double
        tags:
          type: array
          description: Tags
          items:
            type: string
            description: Tags
        fields:
          type: object
          additionalProperties:
            type: object
            description: Custom Fields
          description: Custom Fields
        nodeRoleParentId:
          type: integer
          description: Node Role Parent Id
          format: int32
        icon:
          type: string
          description: Icon
      description: Device Role
    FeatureSettings:
      type: object
      properties:
        product:
          type: string
          description: Configured product code
        enabled:
          type: boolean
          description: Is enabled
        targets:
          type: array
          description: Feature deployment targets
          items:
            type: string
            description: Feature deployment targets
        options:
          type: object
          additionalProperties:
            type: object
            description: Feature options
          description: Feature options
      description: Feature/product/integration configuration settings
    NodeWithDetailedReferences:
      type: object
      properties:
        id:
          type: integer
          description: Node (Device) identifier
          format: int32
        uid:
          type: string
          description: Node (Device) UUID
          format: uuid
        assignedOwnerUid:
          type: string
          description: Node (Device) Owner UUID
          format: uuid
        parentDeviceId:
          type: integer
          description: Parent Node identifier
          format: int32
        organizationId:
          type: integer
          description: Organization identifier
          format: int32
        locationId:
          type: integer
          description: Location identifier
          format: int32
        nodeClass:
          type: string
          description: Node Class
          enum:
          - WINDOWS_SERVER
          - WINDOWS_WORKSTATION
          - LINUX_WORKSTATION
          - MAC
          - ANDROID
          - APPLE_IOS
          - APPLE_IPADOS
          - VMWARE_VM_HOST
          - VMWARE_VM_GUEST
          - HYPERV_VMM_HOST
          - HYPERV_VMM_GUEST
          - LINUX_SERVER
          - MAC_SERVER
          - CLOUD_MONITOR_TARGET
          - NMS_SWITCH
          - NMS_ROUTER
          - NMS_FIREWALL
          - NMS_PRIVATE_NETWORK_GATEWAY
          - NMS_PRINTER
          - NMS_SCANNER
          - NMS_DIAL_MANAGER
          - NMS_WAP
          - NMS_IPSLA
          - NMS_COMPUTER
          - NMS_VM_HOST
          - NMS_APPLIANCE
          - NMS_OTHER
          - NMS_SERVER
          - NMS_PHONE
          - NMS_VIRTUAL_MACHINE
          - NMS_NETWORK_MANAGEMENT_AGENT
          - UNMANAGED_DEVICE
          - MANAGED_DEVICE
        nodeRoleId:
          type: integer
          description: Node Role identifier
          format: int32
        rolePolicyId:
          type: integer
          description: Node Role policy ID based on organization and location Policy Mapping
          format: int32
        policyId:
          type: integer
          description: Assigned policy ID (overrides organization and location policy mapping)
          format: int32
        approvalStatus:
          type: string
          description: Approval Status
          enum:
          - PENDING
          - APPROVED
        offline:
          type: boolean
          description: Is Offline?
        displayName:
          type: string
          description: Display Name
        systemName:
          type: string
          description: System Name
        dnsName:
          type: string
          description: DNS Name
        netbiosName:
          type: string
          description: NETBIOS Name
        created:
          type: number
          description: Created
          format: double
        lastContact:
          type: number
          description: Last Contact
          format: double
        lastUpdate:
          type: number
          description: Last data submission timestamp
          format: double
        userData:
          type: object
          additionalProperties: true
          description: Custom attributes
        tags:
          type: array
          description: Tags
          items:
            type: string
            description: Tags
        fields:
          type: object
          additionalProperties:
            type: object
            description: Custom Fields
          description: Custom Fields
        maintenance:
          $ref: '#/components/schemas/Maintenance'
        references:
          $ref: '#/components/schemas/NodeReferences'
      description: Device information.
  securitySchemes:
    oauth2:
      type: http
      scheme: bearer
      bearerFormat: bearer
    sessionKey:
      type: apiKey
      name: sessionKey
      in: cookie