Projects API reference
Reference documentation for the projects HTTP endpoint.
The Projects API lets you create and manage projects and datasets.
For role and permission management, we suggest using the newer Access API instead.
Authentication
- All requests must be authenticated.
- Updating or deleting a project requires the Administrator role. Managing datasets, tags, tokens, and CORS origins requires the Administrator or Developer role, or equivalent permissions.
Base API server URL
Sanity API base URL
https://api.sanity.io/{apiVersion}Variables
- apiVersionstringdefault:
"v2021-06-07"API version
Endpoints
Query parameters
Whether to include project members in the response.
Whether to include project features in the response.
- organizationIdstring
Only return projects that belong to this organization.
Only return projects where you have explicit project membership.
Also return projects you can read through your organization membership. Ignored when
onlyExplicitMembershipistrue.Only return projects you created.
Responses
A list of projects.
- idstring
- displayNamestring
This field is deprecated. Use the /user-applications API instead.
- organizationIdstring|null
- metadataobject
Show child attributes
- colorstring
- isBlockedboolean
- isDisabledboolean
- isDisabledByUserboolean
- activityFeedEnabledboolean
- createdAtstring (date-time)
- updatedAtstring (date-time)
- membersarray
Only included when
includeMembersistrue.Show child attributes
items
- idstring
The member's legacy role. Only returned in the create project response and on API versions before v2021-06-07. Use
rolesinstead.Example:administrator- rolesarray
Show child attributes
items
- namestring
- titlestring
- descriptionstring
- isCurrentUserboolean
Whether this member is you. Not included in the create project response.
- isRobotboolean
Whether this member is a token rather than a person. Not included in the create project response.
- createdAtstring (date-time)
- updatedAtstring (date-time)
- featuresarray
Only included when
includeFeaturesistrue.Show child attributes
items
- string
- organizationobject
The project's organization. Only included when retrieving a single project with
includeOrganizationset totrue.
items
Request body application/json
The display name of the project.
Example:My Project- organizationIdstring
Assign the created project to the specified organization. The organization to which organizationId belongs must already exist and you must have sufficient permissions to assign a project to the organization. If omitted, a new organization is created for you and the project is assigned to it.
Example:oAbC123xyz - idstring
A preferred ID for the project, 5 to 16 characters. It is converted to lowercase.
Example:wefsadfj - metadataobject
Show child attributes
- colorstringExample:
#000000 This field is deprecated. Use the /user-applications API instead.
Example:https://my-project.my-domain.com
This field is deprecated. Use the /user-applications API instead.
Whether to create a default localhost CORS origin for the project.
Responses
Project created successfully.
- idstring
- displayNamestring
This field is deprecated. Use the /user-applications API instead.
- organizationIdstring|null
- metadataobject
Show child attributes
- colorstring
- isBlockedboolean
- isDisabledboolean
- isDisabledByUserboolean
- activityFeedEnabledboolean
- createdAtstring (date-time)
- updatedAtstring (date-time)
- membersarray
Only included when
includeMembersistrue.Show child attributes
items
- idstring
The member's legacy role. Only returned in the create project response and on API versions before v2021-06-07. Use
rolesinstead.Example:administrator- rolesarray
Show child attributes
items
- namestring
- titlestring
- descriptionstring
- isCurrentUserboolean
Whether this member is you. Not included in the create project response.
- isRobotboolean
Whether this member is a token rather than a person. Not included in the create project response.
- createdAtstring (date-time)
- updatedAtstring (date-time)
- featuresarray
Only included when
includeFeaturesistrue.Show child attributes
items
- string
- organizationobject
The project's organization. Only included when retrieving a single project with
includeOrganizationset totrue.
Path parameters
The unique ID of the project.
Query parameters
Whether to include project members in the response.
Whether to include project features in the response.
Whether to include the project's organization in the response.
Responses
Project details.
- idstring
- displayNamestring
This field is deprecated. Use the /user-applications API instead.
- organizationIdstring|null
- metadataobject
Show child attributes
- colorstring
- isBlockedboolean
- isDisabledboolean
- isDisabledByUserboolean
- activityFeedEnabledboolean
- createdAtstring (date-time)
- updatedAtstring (date-time)
- membersarray
Only included when
includeMembersistrue.Show child attributes
items
- idstring
The member's legacy role. Only returned in the create project response and on API versions before v2021-06-07. Use
rolesinstead.Example:administrator- rolesarray
Show child attributes
items
- namestring
- titlestring
- descriptionstring
- isCurrentUserboolean
Whether this member is you. Not included in the create project response.
- isRobotboolean
Whether this member is a token rather than a person. Not included in the create project response.
- createdAtstring (date-time)
- updatedAtstring (date-time)
- featuresarray
Only included when
includeFeaturesistrue.Show child attributes
items
- string
- organizationobject
The project's organization. Only included when retrieving a single project with
includeOrganizationset totrue.
Path parameters
The unique ID of the project.
Request body application/json
- displayNamestring
Your studio hostname for deployment on Sanity's hosted service: https://
.sanity.studio/. This field is deprecated. Use the /user-applications API instead. Example:my-project- metadataobject
Show child attributes
- colorstring
The color of the project.
Example:#000000 The external studio hostname for deployment on a custom domain. This field is deprecated. Use the /user-applications API instead.
Example:https://my-project.my-domain.com
- isDisabledByUserboolean
- activityFeedEnabledboolean
Responses
Project updated successfully. Returns the updated project.
- idstring
- displayNamestring
This field is deprecated. Use the /user-applications API instead.
- organizationIdstring|null
- metadataobject
Show child attributes
- colorstring
- isBlockedboolean
- isDisabledboolean
- isDisabledByUserboolean
- activityFeedEnabledboolean
- createdAtstring (date-time)
- updatedAtstring (date-time)
- membersarray
Only included when
includeMembersistrue.Show child attributes
items
- idstring
The member's legacy role. Only returned in the create project response and on API versions before v2021-06-07. Use
rolesinstead.Example:administrator- rolesarray
Show child attributes
items
- namestring
- titlestring
- descriptionstring
- isCurrentUserboolean
Whether this member is you. Not included in the create project response.
- isRobotboolean
Whether this member is a token rather than a person. Not included in the create project response.
- createdAtstring (date-time)
- updatedAtstring (date-time)
- featuresarray
Only included when
includeFeaturesistrue.Show child attributes
items
- string
- organizationobject
The project's organization. Only included when retrieving a single project with
includeOrganizationset totrue.
List all CORS entries
/projects/{projectId}/corsReturns a list of all CORS origins for a specific project.
Path parameters
Responses
A list of CORS entries.
- idinteger
- originstring
- allowCredentialsboolean
- createdAtstring (date-time)
items
Path parameters
Request body application/json
The origin to allow, including the protocol. It can't include a path. Use
*to allow all origins.Example:https://www.example.comWhether to allow authenticated requests from this origin. Can't be
truewhenoriginis*.
Responses
The origin is invalid, for example because it includes a path. Setting origin to * with allowCredentials: true fails with A blanket wildcard origin "*" cannot allow credentials. Set allowCredentials to false, or use a specific origin.
The origin already exists for the project. The request fails with Duplicate origin already exists for this project.
Delete a CORS entry
/projects/{projectId}/cors/{id}Deletes a specific CORS origin for a project.
List all datasets available to the project
/projects/{projectId}/datasetsReturns a list of all datasets for the project.
Path parameters
Query parameters
- includeStatsstring
Include statistics for each dataset in a
statsfield. Any value turns this on, includingfalse, so omit the parameter to leave statistics out. - datasetProfilestring
Only return datasets with this dataset profile.
- addonForstring
Only return add-on datasets for the dataset with this name. If no dataset has this name, the request fails with
Dataset "<name>" not found.
Responses
OK
- namestring
- aclModestring
- descriptionstring
Only included when the dataset has a description.
- createdAtstring (date-time)
- createdByUserIdstring
- addonForstring|null
Only returned on API version v2023-11-13 or later.
- datasetProfilestring
Only returned on API version v2023-11-13 or later.
- featuresarray
Only returned on API version v2023-11-13 or later.
Show child attributes
items
- string
- statsobject
Dataset statistics. Only included when you set
includeStats. - tagsarray
- embeddingsobject
Only included when embeddings are configured.
Show child attributes
- enabledboolean
- projectionstring
items
Request body application/json
The ACL mode to set for the new dataset. Defaults to public. Setting
privaterequires the private datasets feature, andcustomrequires the third-party login feature. Otherwise, the request fails withACL mode "<mode>" not allowed for this project.Example:public- descriptionstring|null
A description of the dataset.
- embeddingsobject
The settings for the embeddings index for the dataset.
Show child attributes
Whether the embeddings index is enabled for the dataset. Required when you include
embeddings.- projectionstring
The GROQ projection that defines which fields to include in the embeddings index. If you don't include a projection, we process the entire document JSON into a less verbose format and embed all of it. Example: "{title, author}" or "{...}" for all fields
Example:{title, author}
Responses
OK
- datasetNamestring
- aclModestring
- descriptionstring|null
- datasetProfilestring
Only returned on API version v2023-11-13 or later.
- addonForstring
Only returned on API version v2023-11-13 or later.
- featuresarray
Only returned on API version v2023-11-13 or later.
Show child attributes
items
- string
The request is invalid. For example, including embeddings when embeddings aren't available for your organization fails with Dataset embeddings are not available for this organization.
Update a dataset
/projects/{projectId}/datasets/{name}Updates a specific dataset in the project.
Request body application/json
- aclModestring
The ACL mode to set for the dataset. Omit to keep the current mode. Setting
privaterequires the private datasets feature, andcustomrequires the third-party login feature. Otherwise, the request fails withACL mode "<mode>" not allowed for this project.Example:public - descriptionstring|null
A description of the dataset. Set to
nullto clear it.
Responses
Copy a dataset
/projects/{projectId}/datasets/{name}/copyCopies a dataset to a new dataset.
This feature is part of Advanced Dataset Management, available on the Enterprise plan. Without it, the request fails with Your current plan does not include the advanced dataset management feature.
Path parameters
The unique ID of the project.
The name of the dataset to copy.
Request body application/json
The name of the new dataset to create.
If true, revision history is not copied, which will usually result in a much faster copy. If false or omitted, revision history is copied to targetDataset.
If true, content release documents are not copied to targetDataset.
Deprecated. The API accepts this field for backward compatibility but ignores it.
Responses
OK
- datasetNamestring
The name of the source dataset.
Example:production - messagestringExample:
Starting copying dataset production to production-copy... - aclModestring
The ACL mode of the source dataset.
Example:public - jobIdstring
The ID of the copy job. Use it with the Jobs API to check the status of the copy.
List copy jobs history
/projects/{projectId}/datasets/copyLists the dataset copy jobs for the project.
Path parameters
The unique ID of the project.
Query parameters
Start position in list.
Number of items to return.
Comma separated list of job states.
items
- itemsstring
Responses
OK
- idstringExample:
123456 - statestringExample:
pending - createdAtstring (date-time)Example:
2021-01-01T00:00:00Z - updatedAtstring (date-time)Example:
2021-01-01T00:00:00Z - sourceDatasetstringExample:
my-dataset - targetDatasetstringExample:
my-dataset-copy - withHistoryboolean
Whether the copy included document history.
- authorsarray
Show child attributes
items
- stringExample:
user_123
items
List active features for the project
/projects/{projectId}/featuresReturns a list of active features for the project.
Path parameters
The unique ID of the project.
Responses
OK
- stringExample:
privateDataset
items
List your permissions for the project
/projects/{projectId}/permissionsReturns the legacy permissions for your project role, such as manageProject or readAll.
The list is based on the original fixed project roles (Administrator, Write, and Read), not on the current roles system, so it doesn't reflect everything your role allows. Members with other roles, such as Developer, Contributor, or custom roles, and organization members without project membership, get an empty array.
Path parameters
The unique ID of the project.
Responses
OK
- string
items
Path parameters
The unique ID of the project.
The project user ID, which starts with
p. Global user IDs, which start withg, are rejected. To fetch several users, pass a comma-separated list of IDs. The response is then an array.
Responses
OK
- idstring
- sanityUserIdstring
- projectIdstring
- displayNamestring
- familyNamestring
- givenNamestring
- middleNamestring
- imageUrlstring
- emailstring
- createdAtstring (date-time)
- updatedAtstring (date-time)
List tokens for the project
/projects/{projectId}/tokensReturns a list of tokens for the project.
This endpoint does not reveal the actual token, only details about the token.
Create a new token for the project
/projects/{projectId}/tokensCreates a new token for the project. To manage tokens with the newer Access API, see the Access API reference.
Path parameters
The unique ID of the project.
Query parameters
Whether to email the project's administrators about the new token. You can only set it to false within five minutes of creating the project. Otherwise, the request fails with
Cannot skip token notification.
Request body application/json
Responses
OK
A role can't be assigned to tokens, such as administrator. The request fails with Role "<title>" can't be assigned to robot users.
sendNotification is false more than five minutes after the project was created. The request fails with Cannot skip token notification.
A role doesn't exist in the project. The request fails with Role "<name>" not found.
A token with the same label already exists in the project. The request fails with Token with same label already exists.
Delete a token for the project
/projects/{projectId}/tokens/{tokenId}Deletes a token for the project.
List tags for a dataset
/projects/{projectId}/datasets/{name}/tagsReturns a list of tags for the dataset.
List tags for the project
/projects/{projectId}/tagsReturns a list of tags for the project.
Each tag's datasets list is empty unless you have read access to the project's datasets.
Create a new tag for the project
/projects/{projectId}/tagsCreates a new tag for the project.
Datasets cannot be assigned at tag creation. To assign a tag to a dataset, use PUT /projects/{projectId}/datasets/{datasetName}/tags/{tagIdentifier}.
Requires a project plan that includes advanced roles management.
Path parameters
The unique ID of the project.
Request body application/json
The title of the tag.
The name of the tag. It starts with a lowercase letter or digit, followed by 1 to 20 letters, digits, hyphens, or underscores. You can't rename a tag after you create it.
- descriptionstring
The description of the tag.
- metadataobject
A set of additional configuration options
Show child attributes
- tonestring
The color of your tag.
Retrieve a tag
/projects/{projectId}/tags/{tagIdentifier}Returns a tag by name.
The datasets list is empty unless you have read access to the project's datasets.
Path parameters
The unique ID of the project.
The name of the tag.
Update a tag by identifier
/projects/{projectId}/tags/{tagIdentifier}Updates a tag by identifier.
You can update the title, description, and metadata. A tag can't be renamed: sending a different name fails with a 400 error.
Requires a project plan that includes advanced roles management.
Path parameters
The unique ID of the project.
The name of the tag.
Request body application/json
- titlestring
The title of the tag.
- descriptionstring
The description of the tag.
- metadataobject
A set of additional configuration options
Show child attributes
- tonestring
The color of your tag.
Delete a tag by identifier
/projects/{projectId}/tags/{tagIdentifier}Deletes a tag by identifier.
The tag must not be assigned to any datasets. Otherwise, the request fails with a 422 error: Tag is applied to a dataset.
Requires a project plan that includes advanced roles management.
Path parameters
The unique ID of the project.
The name of the tag.
Responses
The tag is assigned to one or more datasets. Remove it from them first.
Assign a tag to a dataset
/projects/{projectId}/datasets/{datasetName}/tags/{tagIdentifier}Assigns a tag to a dataset. Requires a project plan that includes advanced roles management.
Path parameters
The unique ID of the project.
The name of the dataset.
The name of the tag.
Responses
OK
Remove a tag from a dataset
/projects/{projectId}/datasets/{datasetName}/tags/{tagIdentifier}Removes a tag from a dataset. Requires a project plan that includes advanced roles management.
Path parameters
The unique ID of the project.
The name of the dataset.
The name of the tag.
Responses
Get embeddings index settings for a dataset
/projects/{projectId}/datasets/{name}/settings/embeddingsReturns the settings for the embeddings index for a dataset.
Path parameters
The unique ID of the project.
The name of the dataset.
Responses
OK
- enabledboolean
- projectionstring
The GROQ projection that defines which fields to include in the embeddings index. If you don't include a projection, we process the entire document JSON into a less verbose format and embed all of it. Example: "{title, author}" or "{...}" for all fields
Example:{title, author} - statusstring
The status of the embeddings index.
disabledwhen embeddings are off,unknownwhen the status couldn't be fetched, and otherwiseready,updating, orerror.Example:updating
Update embeddings index settings for a dataset
/projects/{projectId}/datasets/{name}/settings/embeddingsUpdates the settings for the embeddings index for a dataset.
Path parameters
The unique ID of the project.
The name of the dataset.
Request body application/json
Whether to enable the embeddings index for the dataset.
- projectionstring
The GROQ projection that defines which fields to include in the embeddings index. If you don't include a projection, we process the entire document JSON into a less verbose format and embed all of it. Example: "{title, author}" or "{...}" for all fields
Example:{title, author}
application/jsonEnables the embeddings index for a dataset.
{
"enabled": true,
"projection": "{title, author}"
}Responses
The change was applied synchronously, for example when disabling embeddings. Returns an empty object.
- object
The change is being applied in the background, for example when enabling embeddings. Returns an empty object. Check progress with the GET endpoint.
- object
Enabling embeddings fails with Enabling embeddings on existing datasets is coming soon. To try embeddings today, create a new dataset with embeddings enabled. when embeddings aren't available for the dataset. This applies to some datasets created before March 1, 2026, and to datasets in organizations where embeddings aren't enabled.
Another embeddings update is still running for the dataset. The request fails with An embeddings update is already in progress for this dataset.