---
title: "Update Collection"
method: PATCH
path: "/collections/{collectionId}"
tags: ["Collection"]
---

# Update Collection

`PATCH /collections/{collectionId}`

## Request

- Base URL: `https://data.lucid.app`
- URL: `https://data.lucid.app/collections/{collectionId}`
- Auth: OAuth 2
  - Authorization code: `https://lucid.app/oauth2/authorize`
  - Token URL: `https://api.lucid.co/oauth2/token` scopes: `data-service.admin`

This endpoint takes a JSON object and uses it to update the collection's name and/or data source. The JSON object of the updated collection is returned. Updates will only occur if the user has access to the data source. Only top level collections can be updated. Metadata collections cannot be updated.

## Path parameters

- `collectionId` integer, required

## Request body

- object
  - `dataSource` string: URI of data source to move collection to
  - `name` string: New name for the collection

## Response `200`

OK with Collection

- object
  - `uri` string, required: URI of the collection
  - `dataSource` string, required: Link to get parent data source
  - `name` string, required: Name of the collection
  - `lastSync` string, required: Date the collection was last synced with upstream source
  - `versionTimestamp` string, required: Timestamp of the last time the collection, the collection's schema, the collection's contents, one of its collection properties, or anything in any of its metadata collections was changed. It can be used to tell if a copy of the data is out of date and needs to be refreshed.
  - `created` string, required: Date the collection was created
  - `lastModified` string, required: Date the collection was last modified
  - `items` string, required: Link to get items in the collection
  - `schema` string, required: Link to get schema for the collection
  - `properties` string, required: Link to get properties for the collection
  - `metadata` string, required: Link to get metadata for the collection
  - `metadataType` string: If a metadata collection, this specifies what tyep of metadata it contains
  - `parent` string: If a metadata collection, this link will get its parent collection
  - `syncStarted` string: Represents the sync status of the collection. When it is null, there is no sync happening. When it has a DateTime value, that value represents the start time for the sync that is currently happening.
  - `deleted` string: Date the collection was deleted

---

[API](https://skmtc.dev/lucid/apis/lucid-data-api.md) - [All operations](https://skmtc.dev/lucid/apis/lucid-data-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lucid/apis/lucid-data-api/revisions/c14ed29dbeab?raw)
