{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/telenor-sverige/json-schema/telenor-sverige-contact-schema.json",
  "title": "Contact",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/telenor-sverige-partner-catalog-api-api-openapi.yml#/components/schemas/Contact",
  "type": "object",
  "required": [
    "id",
    "type",
    "phoneNumber"
  ],
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64",
      "description": "The id of the contact\n\nNote that the Contact.id is conditionally mandatory for updateContact. If Contact.id is not set, userId will be used instead. For createContact, the Contact.id is not required. "
    },
    "externalId": {
      "type": "string",
      "description": "The external id of the contact. This is mandatory in update Contact but should never be changed! This id is set by the system. When updating contact first get the contact to get the correct value on the externalid (since this can have been changed by system since creation or latest update).\nAny attempt to update this parameter will result in an error."
    },
    "type": {
      "type": "integer",
      "format": "int32",
      "description": "Type of the contact:<br/>0 = Member and 2 = ExternalContact.<br/>Note: For create contact only 2 is valid. <br/>Note2: At update this value should not be updated."
    },
    "phoneNumber": {
      "type": "string",
      "description": "Phone number of contact. \n\nCannot be updated for contacts with type=0"
    },
    "phoneNumberSecret": {
      "type": "boolean",
      "description": "Indicates if the above number is secret or not:<br/>true = secret and false = not secret"
    },
    "privateNumber": {
      "type": "string",
      "description": "The private number/short number of this contact.Allowable length and format of the private number depends on the Private Number Plan for the given organization and on available number plan range"
    },
    "fixedNumber": {
      "type": "string",
      "description": "The fixed number of this contact"
    },
    "departmentId": {
      "type": "integer",
      "format": "int32",
      "description": "For now this parameter should be omitted when creating contact and not changed when updating contact.<br /><br />The department this contact belongs to. This value is unique across all Enterprises, <br/>and is auto generated by the Directory database when a new Department is created. Towards TSG:<ul><li>-1 : remove the department ID</li><li>null: do not change.</li></ul>From TSG:<ul><li>null: no department ID set</li></ul>\n\nTo get the name of department use /catalog/departments"
    },
    "firstName": {
      "type": "string",
      "description": "First name of the contact"
    },
    "lastName": {
      "type": "string",
      "description": "Last name of the contact"
    },
    "title": {
      "type": "string",
      "description": "Title of the contact"
    },
    "emailAddress": {
      "type": "string",
      "description": "E-mail address of the contact"
    },
    "streetAddress": {
      "type": "string",
      "description": "Street address (street name and number) of the contact."
    },
    "streetZipCode": {
      "type": "string",
      "description": "Postal code for the contact. This is a four digit string"
    },
    "streetZipPlace": {
      "type": "string",
      "description": "Postal area for the contact corresponding to the four digit postal code "
    },
    "country": {
      "type": "string",
      "description": "Country of the contact address"
    },
    "postalAddress": {
      "type": "string",
      "description": "Postal address of the contact. this could be different form street address (eg. postbox)"
    },
    "companyName": {
      "type": "string",
      "description": "The name of the company that this contact belongs to"
    },
    "companyAddress": {
      "type": "string",
      "description": "The address of the company"
    },
    "office": {
      "type": "string",
      "description": "Office/location of the contact\n\nThis parameter is read only. If changed in an update request change will be ignored."
    },
    "hidden": {
      "type": "boolean",
      "description": "Flag indicating if this contact is hidden for regular end users\n\nThis parameter is read only. If changed in an update request change will be ignored."
    },
    "custValue0": {
      "type": "string",
      "description": "Custom values."
    },
    "custValue1": {
      "type": "string",
      "description": "Custom values."
    },
    "custValue2": {
      "type": "string",
      "description": "Custom values."
    },
    "custValue3": {
      "type": "string",
      "description": "Custom values."
    },
    "custValue4": {
      "type": "string",
      "description": "Custom values."
    },
    "custValue5": {
      "type": "string",
      "description": "Custom values."
    },
    "custValue6": {
      "type": "string",
      "description": "Custom values."
    },
    "custValue7": {
      "type": "string",
      "description": "Custom values."
    },
    "custValue8": {
      "type": "string",
      "description": "Custom values."
    },
    "custValue9": {
      "type": "string",
      "description": "Custom values."
    },
    "terminalList": {
      "type": "array",
      "description": "List of terminals belonging to the contact. <br /><br /><b>Note:</b> Not to be used when creating external contacts.",
      "items": {
        "$ref": "#/$defs/Terminal"
      }
    },
    "aboutMe": {
      "type": "string",
      "description": "Arbitrary text describing the contact."
    },
    "freeTextStatus": {
      "type": "string",
      "description": "Arbitrary text describing the contact’s status."
    },
    "contactImageId": {
      "type": "integer",
      "format": "int32",
      "description": "An unique id of the contact’s image."
    },
    "freeTextDuration": {
      "type": "string",
      "format": "date-time"
    },
    "keywords": {
      "type": "string",
      "description": "keywords for searching the contact. Comma separated list."
    }
  },
  "$defs": {
    "Terminal": {
      "type": "object",
      "properties": {
        "uid": {
          "type": "integer",
          "format": "int64",
          "description": "A numerical ID uniquely identifying the user in our system"
        },
        "id": {
          "type": "string",
          "description": "A number uniquely identifying the terminal in our system. Format: Trunk prefix (+46) or international prefix (0047).. To be processed as an encrypted terminal number if prefixed with :crypt:, "
        },
        "type": {
          "type": "integer",
          "format": "int32",
          "description": "Legal types:<ul><li>0 = PSTN</li><li>1 = PLMN</li><li>2 = NGN</li><li>3 = NGN_Softphone</li><li>4 = PLMN_Hybridphone</li><li>5 = NGN_Hybridphone</li><li>6 = Free Phone Number</li></ul>"
        },
        "state": {
          "type": "integer",
          "format": "int32",
          "description": "Legal states:<ul><li>0 = ATTACHED</li><li>1 = DETACHED</li><li>2 = ONCALL</li></ul>"
        },
        "secret": {
          "type": "boolean",
          "description": "Is terminal registered as secret or not."
        }
      }
    }
  }
}