---
updatedAt: 2025-08-11T18:18:17.000Z
agentTools:
  projectIndex: https://docs.keycafe.com/llms.txt
---

# Link Fob

Link a Keycafe fob to a key with a PUT request to the endpoint with the key ID.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Keycafe API",
    "version": "0"
  },
  "x-explorer-enabled": true,
  "x-proxy-enabled": true,
  "x-samples-languages": [
    "shell",
    "python",
    "go"
  ],
  "servers": [
    {
      "url": "https://www.keycafe.com/"
    }
  ],
  "components": {
    "securitySchemes": {
      "BasicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "BasicAuth": []
    }
  ],
  "paths": {
    "/v0/key/{key_id}": {
      "put": {
        "tags": [
          "Key"
        ],
        "summary": "Edit Key",
        "description": "Edit a key with a PUT request to the endpoint with the key ID.",
        "operationId": "edit-key",
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the key. </br> Example: 123456",
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": ""
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The key name. </br> Example: Bob's Home Key",
                    "x-readme-id": "0.0"
                  },
                  "description": {
                    "type": "string",
                    "description": "The key description. The maximum length is 60 characters. </br> Example: The front door key",
                    "x-readme-id": "0.1"
                  },
                  "notes": {
                    "type": "string",
                    "description": "The internal notes. These will not be displayed to the guest. The maximum length is 100 characters. </br> Example: The cleaners come every Monday at 10:00",
                    "x-readme-id": "0.2"
                  },
                  "pickupNote": {
                    "type": "string",
                    "description": "A note to send to the guest after a pickup. The maximum length is 240 characters. </br> Example: Don't mind the dog. He's harmless.",
                    "x-readme-id": "0.3"
                  },
                  "address": {
                    "type": "object",
                    "description": "A nested object containing the location address.",
                    "properties": {
                      "street": {
                        "type": "string",
                        "description": "The street address. </br> Example: 123 Main St.",
                        "x-readme-id": "1.0"
                      },
                      "unit": {
                        "type": "string",
                        "description": "The address unit number. </br> Example: 1A",
                        "x-readme-id": "1.1"
                      },
                      "city": {
                        "type": "string",
                        "description": "The address city. </br> Example: Vancouver",
                        "x-readme-id": "1.2"
                      },
                      "stateProv": {
                        "type": "string",
                        "description": "The address state or province. </br> Example: BC",
                        "x-readme-id": "1.3"
                      },
                      "country": {
                        "type": "string",
                        "description": "The address country. </br> Example: Canada",
                        "x-readme-id": "1.4"
                      },
                      "postalCode": {
                        "type": "string",
                        "description": "The address postal code. </br> Example: A1A1A1",
                        "x-readme-id": "1.5"
                      }
                    },
                    "x-readme-id": "0.4"
                  },
                  "homeLocation": {
                    "type": "object",
                    "description": "The location where the key is expected to be dropped off. This is used to communicate to a user where they should drop the key off, and should not be confused with the currentLocation property, which is read-only and can only be modified by a drop off. A drop off will also update the key's home location to the most recent drop off location, and this property may only be set while the key is checked out. Only the ID property is necessary to set a home location.",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "format": "int64",
                        "x-readme-id": "1.0"
                      }
                    },
                    "x-readme-id": "0.5"
                  },
                  "virtual": {
                    "type": "boolean",
                    "description": "True if the key should be virtual and allow key codes.",
                    "x-readme-id": "0.6"
                  },
                  "code": {
                    "type": "string",
                    "description": "A 4 to 16 digit numeric code which allows instant pickups for virtual keys when the code is entered locally at the Keycafe SmartBox.",
                    "x-readme-id": "0.7"
                  },
                  "roaming": {
                    "type": "boolean",
                    "description": "Determines if the key can be dropped off at any location (<code>true</code>) or only at its home location (<code>false</code>). Applies only to MS4 and newer devices."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Key successfully updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "Unique identifier for the key.",
                      "example": 123456
                    },
                    "name": {
                      "type": "string",
                      "description": "Display name of the key.",
                      "example": "Bob's Home Key"
                    },
                    "description": {
                      "type": "string",
                      "description": "Description or purpose of the key.",
                      "example": "The front door key"
                    },
                    "serialNumber": {
                      "type": "string",
                      "description": "Unique serial number associated with the key.",
                      "example": "XXXXX"
                    },
                    "notes": {
                      "type": "string",
                      "description": "Internal notes regarding key usage or management.",
                      "example": "The cleaners come every Monday at 10:00"
                    },
                    "pickupNote": {
                      "type": "string",
                      "description": "Instructions or messages displayed to guests during pickup.",
                      "example": "Don't mind the dog. He's harmless."
                    },
                    "address": {
                      "type": "object",
                      "description": "Physical address linked to the key.",
                      "properties": {
                        "street": {
                          "type": "string",
                          "description": "Street name and number.",
                          "example": "123 Main St."
                        },
                        "unit": {
                          "type": "string",
                          "description": "Unit or apartment number.",
                          "example": "1A"
                        },
                        "city": {
                          "type": "string",
                          "description": "City name.",
                          "example": "Vancouver"
                        },
                        "stateProv": {
                          "type": "string",
                          "description": "State or province.",
                          "example": "BC"
                        },
                        "country": {
                          "type": "string",
                          "description": "Country name.",
                          "example": "Canada"
                        },
                        "postalCode": {
                          "type": "string",
                          "description": "Postal or ZIP code.",
                          "example": "A1A1A1"
                        }
                      }
                    },
                    "homeLocation": {
                      "type": "object",
                      "description": "The default return location for the key.",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Unique ID of the home location.",
                          "example": 123456
                        },
                        "name": {
                          "type": "string",
                          "description": "Name of the home location.",
                          "example": "Corner Cafe"
                        },
                        "timezone": {
                          "type": "string",
                          "description": "Timezone of the home location.",
                          "example": "America/Vancouver"
                        },
                        "address": {
                          "type": "object",
                          "description": "Address of the home location.",
                          "properties": {
                            "street": {
                              "type": "string",
                              "description": "Street name and number.",
                              "example": "123 Main St."
                            },
                            "unit": {
                              "type": "string",
                              "description": "Unit or apartment number.",
                              "example": "1A"
                            },
                            "city": {
                              "type": "string",
                              "description": "City name.",
                              "example": "Vancouver"
                            },
                            "stateProv": {
                              "type": "string",
                              "description": "State or province.",
                              "example": "BC"
                            },
                            "country": {
                              "type": "string",
                              "description": "Country name.",
                              "example": "Canada"
                            },
                            "postalCode": {
                              "type": "string",
                              "description": "Postal or ZIP code.",
                              "example": "A1A1A1"
                            },
                            "latitude": {
                              "type": "number",
                              "description": "Geographic latitude of the location.",
                              "example": 9.2839043
                            },
                            "longitude": {
                              "type": "number",
                              "description": "Geographic longitude of the location.",
                              "example": -123.1053527
                            }
                          }
                        },
                        "hours": {
                          "type": "array",
                          "description": "Opening hours of the location.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "dayOfWeek": {
                                "type": "integer",
                                "description": "Day of the week (0 = Sunday, 6 = Saturday).",
                                "example": 0
                              },
                              "startMinuteOfDay": {
                                "type": "integer",
                                "description": "Start time in minutes after midnight.",
                                "example": 360
                              },
                              "endMinuteOfDay": {
                                "type": "integer",
                                "description": "End time in minutes after midnight.",
                                "example": 1320
                              }
                            }
                          }
                        }
                      }
                    },
                    "owner": {
                      "type": "object",
                      "description": "User who owns this key.",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Unique identifier for the key owner.",
                          "example": 123456
                        },
                        "email": {
                          "type": "string",
                          "description": "Email address of the owner.",
                          "example": "user@yourdomain.com"
                        },
                        "mobile": {
                          "type": "string",
                          "description": "Mobile number of the owner.",
                          "example": 16042656073
                        },
                        "firstName": {
                          "type": "string",
                          "description": "First name of the owner.",
                          "example": "Bob"
                        },
                        "lastName": {
                          "type": "string",
                          "description": "Last name of the owner.",
                          "example": "Smith"
                        }
                      }
                    },
                    "roaming": {
                      "type": "boolean",
                      "description": "Determines if the key can be dropped off at any location"
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": "{\n    \"id\": 123456,\n    \"name\": \"Bob's Home Key\",\n    \"description\": \"The front door key\",\n    \"serialNumber\": \"XXXXX\",\n    \"notes\": \"The cleaners come every Monday at 10:00\",\n    \"pickupNote\": \"Don't mind the dog. He's harmless.\",\n    \"address\": {\n        \"street\": \"123 Main St.\",\n        \"unit\": \"1A\",\n        \"city\": \"Vancouver\",\n        \"stateProv\": \"BC\",\n        \"country\": \"Canada\",\n        \"postalCode\": \"A1A1A1\"\n    },\n    \"homeLocation\": {\n        \"id\": 123456,\n        \"name\": \"Corner Cafe\",\n        \"timezone\": \"America/Vancouver\",\n        \"address\": {\n            \"street\": \"123 Main St.\",\n            \"unit\": \"1A\",\n            \"city\": \"Vancouver\",\n            \"stateProv\": \"BC\",\n            \"country\": \"Canada\",\n            \"postalCode\": \"A1A1A1\",\n            \"latitude\": 9.2839043,\n            \"longitude\": -123.1053527\n        },\n        \"hours\": [\n            { \"dayOfWeek\": 0, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 },\n            { \"dayOfWeek\": 1, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 },\n            { \"dayOfWeek\": 2, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 },\n            { \"dayOfWeek\": 3, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 },\n            { \"dayOfWeek\": 4, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 },\n            { \"dayOfWeek\": 5, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 },\n            { \"dayOfWeek\": 6, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 }\n        ]\n    },\n    \"owner\": {\n        \"id\": 123456,\n        \"email\": \"user@yourdomain.com\",\n        \"mobile\": \"16042656073\",\n        \"firstName\": \"Bob\",\n        \"lastName\": \"Smith\"\n    },\n \"roaming\": true}"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/v0/key/{key_ID}": {
      "put": {
        "tags": [
          "Key"
        ],
        "summary": "Link Fob",
        "description": "Link a Keycafe fob to a key with a PUT request to the endpoint with the key ID.",
        "operationId": "link-fob",
        "parameters": [
          {
            "name": "key_ID",
            "in": "path",
            "required": true,
            "description": "Unique identifier for the key. </br> Example: 123456",
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": ""
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "serialNumber"
                ],
                "properties": {
                  "serialNumber": {
                    "type": "string",
                    "description": "The serial number of the Keycafe fob. </br> Example: 012ABC",
                    "x-readme-id": "0.0"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fob successfully linked to the key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "Unique identifier for the key.",
                      "example": 123456
                    },
                    "name": {
                      "type": "string",
                      "description": "Name or label of the key.",
                      "example": "Bob's Home Key"
                    },
                    "owner": {
                      "type": "object",
                      "description": "Owner of the key.",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Unique identifier of the key owner.",
                          "example": 123456
                        },
                        "firstName": {
                          "type": "string",
                          "description": "First name of the key owner.",
                          "example": "Bob"
                        },
                        "lastName": {
                          "type": "string",
                          "description": "Last name of the key owner.",
                          "example": "Smith"
                        },
                        "email": {
                          "type": "string",
                          "description": "Email address of the key owner.",
                          "example": "test@yourdomain.com"
                        },
                        "mobile": {
                          "type": "string",
                          "description": "Mobile phone number of the key owner.",
                          "example": 16042656073
                        }
                      }
                    },
                    "serialNumber": {
                      "type": "string",
                      "description": "Serial number of the fob that has been linked.",
                      "example": "XXXXXX"
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": "{  \n   \"id\": 123456,\n   \"name\": \"Bob's Home Key\",\n   \"owner\":{  \n      \"mobile\": \"16042656073\",\n      \"id\": 123456,\n      \"firstName\": \"Bob\",\n      \"lastName\": \"Smith\",\n      \"email\": \"test@yourdomain.com\"\n   },\n   \"serialNumber\": \"XXXXXX\"\n}"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```