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

# Edit Alias Code

Edit an alias code with a PUT request to the endpoint with the alias code ID.

The post body should contain the data to be updated as a JSON object:

```json json
{
    code: "123456",
    location: {
        id: 7654321
    },
    access: {
        id: 1234567
    }
}
```

# 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/aliasCode/{alias_code_id}": {
      "put": {
        "tags": [
          "Alias Code"
        ],
        "summary": "Edit Alias Code",
        "description": "Edit an alias code with a PUT request to the endpoint with the alias code ID.",
        "operationId": "edit-alias-code",
        "parameters": [
          {
            "name": "alias_code_id",
            "in": "path",
            "required": true,
            "description": "The unique ID of alias. </br> Example: 123456",
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": ""
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "The code to be used by the visitor at the location. Must be distinct from any other codes at the location."
                  },
                  "location": {
                    "type": "object",
                    "description": "The private location the alias code will be used at. Only the ID property is necessary.",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "format": "int64"
                      }
                    }
                  },
                  "access": {
                    "type": "object",
                    "description": "The access linked to the alias code. Only the ID property is necessary.",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "format": "int64"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Alias code updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "Unique identifier for the alias code.",
                      "example": 123456
                    },
                    "code": {
                      "type": "string",
                      "description": "Updated alias code string used for key access.",
                      "example": "123456"
                    },
                    "access": {
                      "type": "object",
                      "description": "Updated access record associated with the alias code.",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Unique identifier of the access.",
                          "example": 1234567
                        },
                        "accessStartDate": {
                          "type": "string",
                          "description": "Start date of the access in YYYY-MM-DD format.",
                          "example": "2025-07-21"
                        },
                        "accessStartTime": {
                          "type": "string",
                          "description": "Start time of the access in HH:mm format.",
                          "example": "12:45"
                        },
                        "accessEndDate": {
                          "type": "string",
                          "description": "End date of the access in YYYY-MM-DD format.",
                          "example": "2025-07-23"
                        },
                        "accessEndTime": {
                          "type": "string",
                          "description": "End time of the access in HH:mm format.",
                          "example": "12:45"
                        },
                        "locale": {
                          "type": "string",
                          "description": "Language or locale setting.",
                          "example": "en"
                        },
                        "returnReminder": {
                          "type": "boolean",
                          "description": "Indicates if a return reminder is enabled.",
                          "example": false
                        },
                        "allowSetup": {
                          "type": "boolean",
                          "description": "Indicates if the guest can configure access setup.",
                          "example": false
                        }
                      }
                    },
                    "location": {
                      "type": "object",
                      "description": "Location where the alias code grants access.",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Unique identifier of the location.",
                          "example": 7654321
                        },
                        "name": {
                          "type": "string",
                          "description": "Name of the location.",
                          "example": "Corner Cafe"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": "{\n    \"id\": 123456,\n    \"code\": \"123456\",\n    \"access\": {\n      \t\"id\": 1234567,\n        \"accessStartDate\": \"2025-07-21\",\n        \"accessStartTime\": \"12:45\",\n        \"accessEndDate\": \"2025-07-23\",\n        \"accessEndTime\": \"12:45\",\n        \"locale\": \"en\",\n        \"returnReminder\": false,\n        \"allowSetup\": false\n    },\n    \"location\" : {\n        \"id\": 7654321,\n        \"name\": \"Corner Cafe\"\n    }\n}"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```