Skip to content
EntitlerDocs

POST/v1/devices/{device_id}:assign

Assign a keypad device

Puts a keypad device on a customer's lane, by the customer's external ID and an optional product, and answers the codes that set its days to the lane's paid-up time and payment terms, in the order they are entered. Without a customer, takes it off its lane. A lane another keypad holds is DEVICE_LANE_TAKEN, and a retired keypad is DEVICE_RETIRED. Needs customers:write.

curl -X POST 'https://api.entitler.co/v1/devices/<device_id>:assign' \
  -H "Authorization: Bearer $ENTITLER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customerExternalId":"customerExternalId","productId":"productId","target":{"environmentId":"environmentId","projectId":"projectId","teamId":"teamId"}}'

Credentials

Send any one of these:

  • Bearer token

Path parameters

NameTypeDescription
device_idrequiredstring

Request body

object

  • customerExternalIdstring
  • productIdstring
  • targetProductTarget
    • environmentIdstring
    • projectIdstring
    • teamIdstring

Responses

200The AssignDeviceResponse message.

AssignDeviceResponse

  • codesarray of DeviceCoderequired
    • codestringrequired
    • countinteger (int64)required

      at least 0; at most 4294967295

    • daysinteger (int64)required

      at least 0; at most 4294967295

    • deviceIdstringrequired
    • issuedAtintegerrequired

      at least 0; at most 18446744073709552000

    • kindDeviceCodeKindrequired

      One of DEVICE_CODE_KIND_UNSPECIFIED, DEVICE_CODE_KIND_ADD_DAYS, DEVICE_CODE_KIND_SET_DAYS, DEVICE_CODE_KIND_UNLOCK.

  • deviceKeypadDevice
    • assignedAtinteger

      at least 0; at most 18446744073709552000

    • customerExternalIdstring
    • digitsKeypadDigitsrequired

      One of KEYPAD_DIGITS_UNSPECIFIED, KEYPAD_DIGITS_FULL, KEYPAD_DIGITS_RESTRICTED.

    • externalIdstringrequired
    • idstringrequired
    • productIdstring
    • registeredAtintegerrequired

      at least 0; at most 18446744073709552000

    • retiredAtinteger

      at least 0; at most 18446744073709552000

ErrorA refusal, with the HTTP status of its gRPC code.

Error

  • errorobjectrequired
    • codestringrequired
    • parametersobjectrequired

      Each value: string

    • reasonstringor nullrequired