Skip to content
The Things Stack documentation home
Getting Started Concepts Cloud Enterprise Integrations API Hardware
Getting Started Concepts
Cloud Enterprise
Integrations API Hardware
Get The Things Stack

    Recent searches

      Popular pages

      • Getting Started
      • Adding Gateways
      • Adding Devices
      • Payload Formatters
      • Webhooks
      • Authentication

      No results for “”.

      • Check the spelling, or try fewer or more general words.
      • Ask the community on The Things Network Forum
      • Contact support
      ↑↓ to navigate ↵ to open Esc to close

      Integrations

      • Overview
      • Adding Applications
      • Data Formats
      • Payload Formatters
      • Webhooks
      • Storage Integration
      • Integrate with popular IoT platforms
      • Other integrations
      • Application Packages
        • Managing Application Packages using the CLI
        • Managing Application Packages using the API
        • LoRa Cloud Modem and Geolocation Services
      • Examples

      Managing Application Packages using the API

      Updated 14 March 2025 Edit on GitHub
      Copy page
      • View as MarkdownThis page as plain text
      • Open in ChatGPTAsk questions about this page
      • Open in ClaudeAsk questions about this page

      Besides using the CLI, you can also use the application package HTTP APIs exposed by The Things Stack to interact with the available application packages.

      Listing the Available Packages

      To list the available application packages for the given device dev1 of the application app1:

      curl 'https://eu1.cloud.thethings.network/api/v3/as/applications/app1/devices/dev1/packages' \
        -X 'GET' \
        -H 'content-type: application/json' \
        -H 'authorization: Bearer NNSXS.XXXXXXXXX'
      

      This gives the result in the JSON format:

      {
        "packages": [
          {
            "name": "aws-iot",
            "default_f_port": 198
          },
          {
            "name": "azure-iot-hub",
            "default_f_port": 196
          },
          {
            "name": "lora-cloud-geolocation-v3",
            "default_f_port": 197
          },
          {
            "name": "storage-integration",
            "default_f_port": 200
          },
          {
            "name": "lora-cloud-device-management-v1",
            "default_f_port": 199
          }
        ]
      }
      

      In the following examples, replace the test-package with any of the packages listed above.

      Creating Associations

      To create a default association between the application package and the FPort 100 of an application app1:

      curl 'https://eu1.cloud.thethings.network/api/v3/as/applications/app1/packages/associations/100' \
        -X 'PUT' \
        -H 'content-type: application/json' \
        -H 'authorization: Bearer NNSXS.XXXXXXXXX' \
        --data-raw '{"default":{"package_name":"test-package","field_mask":{"paths":["package_name"]}}}'
      

      The default association will associate the application package with all devices within a given application.

      Output
      {
        "ids": {
          "application_ids": {
            "application_id": "app1"
          },
          "f_port": 100
        },
        "created_at": "2021-12-30T10:26:31.302076317Z",
        "updated_at": "2021-12-30T10:26:31.302076317Z"
      }
      

      To create an association between the application package and the FPort 100 of a device dev1 of an application app1:

      curl 'https://eu1.cloud.thethings.network/api/v3/as/applications/app1/devices/dev1/packages/associations/100' \
        -X 'PUT' \
        -H 'content-type: application/json' \
        -H 'authorization: Bearer XXXXXXXXX' \
        --data-raw '{"association":{"package_name":"test-package","field_mask":{"paths":["package_name"]}}}'
      

      This will associate the application package with a single device within a given application.

      Output
      {
        "ids": {
          "end_device_ids": {
            "device_id": "dev1",
            "application_ids": {
              "application_id": "app1"
            }
          },
          "f_port": 100
        },
        "created_at": "2021-12-30T10:55:09.496854413Z",
        "updated_at": "2021-12-30T10:55:09.496854413Z"
      }
      

      Listing Associations

      To list all default associations associated with an application app1:

      curl 'https://eu1.cloud.thethings.network/api/v3/as/applications/app1/packages/associations' \
        -X 'GET' \
        -H 'content-type: application/json' \
        -H 'authorization: Bearer XXXXXXXXX'
      
      Output
      {
        "defaults": [
          {
            "ids": {
              "application_ids": {
                "application_id": "app1"
              },
              "f_port": 100
            },
            "created_at": "2021-12-30T10:26:31.302076317Z",
            "updated_at": "2021-12-30T10:26:31.302076317Z",
            "package_name": "test-package"
          },
          {
            "ids": {
              "application_ids": {
                "application_id": "app1"
              },
              "f_port": 199
            },
            "created_at": "2021-07-08T12:30:41.725276723Z",
            "updated_at": "2021-10-07T08:40:08.559179797Z",
            "package_name": "lora-cloud-device-management-v1"
          }
        ]
      }
      

      To list all associations associated with a device dev1 of an application app1:

      curl 'https://eu1.cloud.thethings.network/api/v3/as/applications/app1/devices/dev1/packages/associations' \
        -X 'GET' \
        -H 'content-type: application/json' \
        -H 'authorization: Bearer XXXXXXXXX'
      
      Output
      {
        "associations": [
          {
            "ids": {
              "end_device_ids": {
                "device_id": "dev1",
                "application_ids": {
                  "application_id": "app1"
                }
              },
              "f_port": 200
            },
            "created_at": "2021-12-30T10:55:09.496854413Z",
            "updated_at": "2021-12-30T10:55:09.496854413Z"
          }
        ]
      }
      

      Retrieving Associations

      To retrieve a default association associated with an FPort 100 of an application app1:

      curl 'https://eu1.cloud.thethings.network/api/v3/as/applications/app1/packages/associations/100' \
        -X 'GET' \
        -H 'content-type: application/json' \
        -H 'authorization: Bearer XXXXXXXXX'
      
      Output
      {
        "ids": {
          "application_ids": {
            "application_id": "app1"
          },
          "f_port": 100
        },
        "created_at": "2021-12-30T10:26:31.302076317Z",
        "updated_at": "2021-12-30T10:26:31.302076317Z"
      }
      

      To retrieve an association associated with an FPort 100 of a device dev1 of an application app1:

      curl 'https://eu1.cloud.thethings.network/api/v3/as/applications/app1/devices/dev1/packages/associations/100' \
        -X 'GET' \
        -H 'content-type: application/json' \
        -H 'authorization: Bearer XXXXXXXXX'
      
      Output
      {
        "ids": {
          "end_device_ids": {
            "device_id": "dev1",
            "application_ids": {
              "application_id": "app1"
            }
          },
          "f_port": 100
        },
        "created_at": "2021-12-30T10:55:09.496854413Z",
        "updated_at": "2021-12-30T10:55:09.496854413Z"
      }
      

      Deleting Associations

      To delete a default association associated with an FPort 100 of a given application app1:

      curl 'https://eu1.cloud.thethings.network/api/v3/as/applications/app1/packages/associations/100' \
      -X 'DELETE' \
      -H 'content-type: application/json' \
      -H 'authorization: Bearer NNSXS.XXXXXXXXX'
      

      To delete an association associated with an FPort 100 of a device dev1 of an application app1:

      curl 'https://eu1.cloud.thethings.network/api/v3/as/applications/app1/devices/dev1/packages/associations/100' \
      -X 'DELETE' \
      -H 'content-type: application/json' \
      -H 'authorization: Bearer NNSXS.XXXXXXXXX'
      
      ← Managing Application Packages using the CLI LoRa Cloud Modem and Geolocation Services →

      On this page

      • Listing the Available Packages
      • Creating Associations
      • Listing Associations
      • Retrieving Associations

      Sections

      Getting Started

      Concepts

      Cloud

      Enterprise

      Integrations

      API

      Hardware

      Sitemap

      View our Sitemap

      Contributing

      GitHub

      About Us

      The Things Industries

      Privacy Policy

      Cookie settings

      Cookie Settings

      We use cookies to enhance your experience, analyze site traffic and deliver personalized content. Read our Privacy Policy.

      Cookie categories