{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/the-things-network/json-schema/the-things-network-v3-application-registry-create-body-schema.json",
  "title": "v3ApplicationRegistryCreateBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/the-things-network-applicationregistry-api-openapi.yml#/components/schemas/v3ApplicationRegistryCreateBody",
  "type": "object",
  "properties": {
    "application": {
      "$ref": "#/$defs/v3Application"
    },
    "collaborator": {
      "type": "object",
      "properties": {
        "organization_ids": {
          "type": "object"
        },
        "user_ids": {
          "$ref": "#/$defs/v3UserIdentifiers"
        }
      },
      "description": "Collaborator to grant all rights on the newly created application.",
      "title": "Collaborator to grant all rights on the newly created application."
    }
  },
  "$defs": {
    "v3Application": {
      "type": "object",
      "properties": {
        "ids": {
          "$ref": "#/$defs/v3ApplicationIdentifiers",
          "description": "The identifiers of the application. These are public and can be seen by any authenticated user in the network."
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the application was created. This information is public and can be seen by any authenticated user in the network."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the application was last updated. This information is public and can be seen by any authenticated user in the network."
        },
        "deleted_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the application was deleted. This information is public and can be seen by any authenticated user in the network."
        },
        "name": {
          "type": "string",
          "description": "The name of the application."
        },
        "description": {
          "type": "string",
          "description": "A description for the application."
        },
        "attributes": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Key-value attributes for this application. Typically used for organizing applications or for storing integration-specific data."
        },
        "contact_info": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/$defs/v3ContactInfo"
          },
          "description": "Contact information for this application. Typically used to indicate who to contact with technical/security questions about the application.\nThis field is deprecated. Use administrative_contact and technical_contact instead."
        },
        "administrative_contact": {
          "$ref": "#/$defs/v3OrganizationOrUserIdentifiers"
        },
        "technical_contact": {
          "$ref": "#/$defs/v3OrganizationOrUserIdentifiers"
        },
        "network_server_address": {
          "type": "string",
          "description": "The address of the Network Server where this application is supposed to be registered.\nIf set, this fields indicates where end devices for this application should be registered.\n\nStored in Entity Registry.\nThe typical format of the address is \"host:port\". If the port is omitted,\nthe normal port inference (with DNS lookup, otherwise defaults) is used.\nThe connection shall be established with transport layer security (TLS).\nCustom certificate authorities may be configured out-of-band."
        },
        "application_server_address": {
          "type": "string",
          "description": "The address of the Application Server where this application is supposed to be registered.\nIf set, this fields indicates where end devices for this application should be registered.\n\nStored in Entity Registry.\nThe typical format of the address is \"host:port\". If the port is omitted,\nthe normal port inference (with DNS lookup, otherwise defaults) is used.\nThe connection shall be established with transport layer security (TLS).\nCustom certificate authorities may be configured out-of-band."
        },
        "join_server_address": {
          "type": "string",
          "description": "The address of the Join Server where this application is supposed to be registered.\nIf set, this fields indicates where end devices for this application should be registered.\n\nStored in Entity Registry.\nThe typical format of the address is \"host:port\". If the port is omitted,\nthe normal port inference (with DNS lookup, otherwise defaults) is used.\nThe connection shall be established with transport layer security (TLS).\nCustom certificate authorities may be configured out-of-band."
        },
        "dev_eui_counter": {
          "type": "integer",
          "format": "int64"
        }
      },
      "description": "Application is the message that defines an Application in the network."
    },
    "v3ApplicationIdentifiers": {
      "type": "object",
      "properties": {
        "application_id": {
          "type": "string"
        }
      }
    },
    "v3ContactInfo": {
      "type": "object",
      "properties": {
        "contact_type": {
          "$ref": "#/$defs/v3ContactType"
        },
        "contact_method": {
          "$ref": "#/$defs/v3ContactMethod"
        },
        "value": {
          "type": "string"
        },
        "public": {
          "type": "boolean"
        },
        "validated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "v3ContactMethod": {
      "type": "string",
      "enum": [
        "CONTACT_METHOD_OTHER",
        "CONTACT_METHOD_EMAIL",
        "CONTACT_METHOD_PHONE"
      ],
      "default": "CONTACT_METHOD_OTHER"
    },
    "v3ContactType": {
      "type": "string",
      "enum": [
        "CONTACT_TYPE_OTHER",
        "CONTACT_TYPE_ABUSE",
        "CONTACT_TYPE_BILLING",
        "CONTACT_TYPE_TECHNICAL"
      ],
      "default": "CONTACT_TYPE_OTHER"
    },
    "v3OrganizationIdentifiers": {
      "type": "object",
      "properties": {
        "organization_id": {
          "type": "string",
          "description": "This ID shares namespace with user IDs."
        }
      }
    },
    "v3OrganizationOrUserIdentifiers": {
      "type": "object",
      "properties": {
        "organization_ids": {
          "$ref": "#/$defs/v3OrganizationIdentifiers"
        },
        "user_ids": {
          "$ref": "#/$defs/v3UserIdentifiers"
        }
      },
      "description": "OrganizationOrUserIdentifiers contains either organization or user identifiers."
    },
    "v3UserIdentifiers": {
      "type": "object",
      "properties": {
        "user_id": {
          "type": "string",
          "description": "This ID shares namespace with organization IDs."
        },
        "email": {
          "type": "string",
          "description": "Secondary identifier, which can only be used in specific requests."
        }
      }
    }
  }
}