/applications/{id}/assign - Assign organization

PATCH /applications/{id}/assign

Assign an organization to an application

Path parameters

  • id string Required

    Application ID

application/json

Body Required

  • organization_id string Required

    Organization Logto ID to assign to the application (use the logto_id from organization responses)

Responses

  • 200 application/json

    Organization assigned successfully

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object
      Hide data attributes Show data attributes object
      • id string

        Unique application identifier (system_id + module_id)

      • system_id string

        ID of the system hosting this application

      • module_id string

        Module identifier within the system

      • instance_of string

        Application type (e.g., nethvoice, webtop, mail)

      • name string | null

        Human-readable label from inventory (e.g., "Nextcloud")

      • source string | null

        Image source from inventory (e.g., "ghcr.io/nethserver/nextcloud")

      • display_name string | null

        User-friendly name set in NS8 and inherited from inventory (e.g., "Milan Office PBX")

      • node_id integer | null

        Node ID within the cluster

      • node_label string | null

        Node label from inventory (e.g., Leader Node, Worker Node)

      • version string | null

        Application version

      • organization_id string | null

        Assigned organization ID

      • organization_type string | null

        Type of the assigned organization

        Values are distributor, reseller, or customer.

      • status string

        Assignment status

        Values are unassigned or assigned.

      • inventory_data object | null

        Raw inventory data from system

        Additional properties are allowed.

      • backup_data object | null

        Backup status information

        Additional properties are allowed.

      • services_data object | null

        Services health status

        Additional properties are allowed.

      • url string | null

        Application URL

      • notes string | null

        Additional notes

      • is_user_facing boolean

        Whether this is a user-facing application (vs system component)

      • created_at string(date-time)

        Record creation timestamp

      • updated_at string(date-time)

        Last update timestamp

      • first_seen_at string(date-time)

        First time the application was seen in inventory

      • last_inventory_at string(date-time) | null

        Last inventory collection timestamp

      • deleted_at string(date-time) | null

        Soft delete timestamp (null if not deleted)

      • rebranding_enabled boolean

        Whether rebranding is active for this application (direct or inherited)

      • rebranding_org_id string | null

        Logto organization ID (logto_id) that provides the rebranding assets (the org itself or an ancestor). Use this value as the :org_id parameter in /api/rebranding/:org_id/* endpoints.

      • system object

        Minimal system info for application responses

        Hide system attributes Show system attributes object
        • id string

          System ID

        • name string

          System name

      • organization object

        Simplified organization for selection and assignment

        Hide organization attributes Show organization attributes object
        • id string

          Database UUID of the organization (or "no_org" for unassigned filter)

        • logto_id string

          Logto organization ID (or "no_org" for unassigned filter)

        • name string

          Organization name

        • description string

          Organization description

        • type string

          Organization type ("unassigned" is the special "No organization" filter entry)

          Values are owner, distributor, reseller, customer, or unassigned.

  • 400 application/json

    Bad request - validation error

    Hide response attributes Show response attributes object
    • code integer

      HTTP error code

    • message string

      Error message

    • data object
      Hide data attributes Show data attributes object
      • type string

        Type of error

        Values are validation_error or external_api_error.

      • errors array[object]
        Hide errors attributes Show errors attributes object
        • key string

          Field name that failed validation

        • message string

          Error code or message

        • value string

          Value that failed validation

      • details

        Additional error details

  • 401 application/json

    Unauthorized - invalid or missing token

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
  • 403 application/json

    Forbidden - insufficient permissions

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
  • 404 application/json

    Resource not found

    Hide response attributes Show response attributes object
    • code integer

      HTTP error code

    • message string

      Error message

    • data object
      Hide data attributes Show data attributes object
      • type string

        Type of error

        Values are validation_error or external_api_error.

      • errors array[object]
        Hide errors attributes Show errors attributes object
        • key string

          Field name that failed validation

        • message string

          Error code or message

        • value string

          Value that failed validation

      • details

        Additional error details

PATCH /applications/{id}/assign
curl \
 --request PATCH 'https://collect.your-domain.com/api/applications/sys_abc123_mail1/assign' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"organization_id":"akkbs6x2wo82"}'
Request examples
{
  "organization_id": "akkbs6x2wo82"
}
Response examples (200)
{
  "code": 200,
  "message": "organization assigned successfully",
  "data": {
    "id": "sys_abc123_mail1",
    "system_id": "sys_abc123",
    "module_id": "mail1",
    "instance_of": "mail",
    "name": "Nextcloud",
    "source": "ghcr.io/nethserver/nextcloud",
    "display_name": "Milan Office PBX",
    "node_id": 1,
    "node_label": "Leader Node",
    "version": "1.2.3",
    "organization_id": "org_xyz789",
    "organization_type": "customer",
    "status": "assigned",
    "inventory_data": {},
    "backup_data": {},
    "services_data": {},
    "url": "https://cluster.example.com/cluster-admin/#/apps/mail1",
    "notes": "Primary mail server for corporate domain",
    "is_user_facing": true,
    "created_at": "2025-07-01T09:00:00Z",
    "updated_at": "2025-07-10T10:30:00Z",
    "first_seen_at": "2025-06-15T08:00:00Z",
    "last_inventory_at": "2025-07-21T10:25:00Z",
    "deleted_at": "2026-05-04T09:42:00Z",
    "rebranding_enabled": true,
    "rebranding_org_id": "org_dist001",
    "system": {
      "id": "sys_abc123",
      "name": "Production Cluster"
    },
    "organization": {
      "id": "4405ffd0-0aca-44ef-bae2-c8545bce94f4",
      "logto_id": "akkbs6x2wo82",
      "name": "ACME Corp",
      "description": "Main customer organization",
      "type": "customer"
    }
  }
}
Response examples (400)
{
  "code": 400,
  "message": "validation failed",
  "data": {
    "type": "validation_error",
    "errors": [
      {
        "key": "username",
        "message": "required",
        "value": "string"
      }
    ]
  }
}
Response examples (401)
{
  "code": 401,
  "message": "invalid token",
  "data": {}
}
Response examples (403)
{
  "code": 403,
  "message": "insufficient permissions",
  "data": {}
}
Response examples (404)
{
  "code": 400,
  "message": "validation failed",
  "data": {
    "type": "validation_error",
    "errors": [
      {
        "key": "username",
        "message": "required",
        "value": "string"
      }
    ]
  }
}