Creating a new Lock Holder

To Create new Lock Holder, make a POST request to the Lock Holders end point:

https://api.unloc.app/integrators/v1/lock-holders/

Including at least the following three parameters inside the request's body:

  • name: Display name for the Lock Holder.
  • countryIso: ISO 3166-1 alpha-2 country code: "US", "NO", "NL", "SE"...
  • organizationId: Custom unique ID for the Lock Holder. Use alphanumerical characters, underscores, or dashes only.

Here's an example:

curl --location --request POST '<<api_url>>/integrators/v1/lock-holders/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibm' \
--data '{
    "name": "Emerald road 15",
    "countryIso": "DK",
    "organizationId": "opk-4155ll-51600b"
}'

The response would look similar to this:

{
    "lockHolder": {
        "id": "373c3bdd-ff32-4caa-9eca-bfc54e5042d5",
        "name": "Emerald road 15",
        "countryIso": "DK",
        "organizationId": "opk-4155ll-51600b",
        "organizationIdSuffix": "",
        "activeInstallerInviteCodes": [
            "d3-3b-zM-Jk"
        ]
    }
}

Three new fields are returned:

  • id: The Unloc API identifier for this Lock Holder.
  • organizationIdSuffix: Returns the value set for organizationIdSuffix on this Lock Holder. Since it is an optional value, if not passed, it's set to an empty string.
  • activeInstallerInviteCodes: Used by a Lock installer using the Unloc Installer App to onboard a Lock to this Lock Holder.

Did this page help you?