---
title: "Create or update a collection alias"
method: PUT
path: "/aliases/{aliasName}"
tags: ["collections"]
---

# Create or update a collection alias

`PUT /aliases/{aliasName}`

Create or update a collection alias. An alias is a virtual collection name that points to a real collection. If you're familiar with symbolic links on Linux, it's very similar to that. Aliases are useful when you want to reindex your data in the background on a new collection and switch your application to it without any changes to your code.

## Path parameters

- `aliasName` string, required

## Request body

- CollectionAliasSchema
  - `collection_name` string, required — Name of the collection you wish to map the alias to

## Response `200`

The collection alias was created/updated

- CollectionAlias
  - `name` string, required — Name of the collection alias
  - `collection_name` string, required — Name of the collection the alias mapped to

## Other responses

- `400` — Bad request, see error message for details
- `404` — Alias not found

## Changes

- **2024-02-13** `14b1d3553228` — 2 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `404`
- **2022-08-04** `6c2fe01b69bc` — 2 info
  - removed the non-success response with the status `400`
  - removed the non-success response with the status `404`

[Change history](https://skmtc.dev/typesense/apis/typesense-api/changes/aliases/:aliasName/put.md)

---

[API](https://skmtc.dev/typesense/apis/typesense-api.md) · [All operations](https://skmtc.dev/typesense/apis/typesense-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/typesense/typesense-api/revisions/1d9b3b61638e/schema)
