# Entity definitions API

Use the Entity definitions API to manage entity definitions or retrieve all entities for a specific defintion.
## Authentication
To use this API, you need:
- The URL of your Content Hub server. You can get this from your Content Hub
  Administrator. Enter this URL in the <b>{{server}}</b> variable by hovering your mouse
  over the variable in the <b>Try it</b> pane and then clicking <b>Edit</b>.

- An access token and the client ID. Both are sent with every request. You 
  can create a token through the [Content Hub
  interface](https://doc.sitecore.com/ch/en/users/content-hub/create-an-oauth-client.html) 
  or by [requesting one using the API
  itself](https://doc.sitecore.com/ch/en/developers/cloud-dev/oauth-tokens.html#grant-flows).     

Version: v1.0
License: closed source
Metadata:
  - product: Content Hub

## Servers

```
https://{server}
```

Variables:
- `server`
Default: "your-server"

## Security

### OAuth2.0

Type: oauth2

## Download OpenAPI description

[Entity definitions API](https://api-docs.sitecore.com/_bundle/ch/entity-definitions-api/index.yaml)

## Entity definitions

Use these endpoints to manage entity definitions.

### Retrieve all entity definitions

 - [GET /api/entitydefinitions](https://api-docs.sitecore.com/ch/entity-definitions-api/entity-definitions/entitydefinitions.md): Lists all entity definitions.

### Retrieve an entity definition by name

 - [GET /api/entitydefinitions/{name}](https://api-docs.sitecore.com/ch/entity-definitions-api/entity-definitions/entitydefinitionbyname.md): Retrieves an entity definition using its name, with options to include conditional members, load permissions, and exclude light entity definitions.

### Update an entity definition

 - [PUT /api/entitydefinitions/{name}](https://api-docs.sitecore.com/ch/entity-definitions-api/entity-definitions/updateentitydefinition.md): Updates an entity definition with the details provided.

### Delete an entity definition by name

 - [DELETE /api/entitydefinitions/{name}](https://api-docs.sitecore.com/ch/entity-definitions-api/entity-definitions/deleteentitydefinitionbyname.md): Removes the entity definition with a specific name.

### Retrieve an entity definition by name (V2)

 - [GET /api/entitydefinitions/name/{name}](https://api-docs.sitecore.com/ch/entity-definitions-api/entity-definitions/entitydefinitionbynamev2.md): Retrieves an entity definition by its name (V2 endpoint).

### Retrieve an entity definition by ID

 - [GET /api/entitydefinitions/{id}](https://api-docs.sitecore.com/ch/entity-definitions-api/entity-definitions/entitydefinitionbyid.md): Retrieves an entity definition by its ID, with options to include conditional members, load permissions, and exclude light entity definitions.

### Delete an entity definition by ID

 - [DELETE /api/entitydefinitions/{id}](https://api-docs.sitecore.com/ch/entity-definitions-api/entity-definitions/deleteentitydefinitionbyid.md): Removes the entity definition identified by the given ID.

### Calculate the impact of changes to an entity definition

 - [POST /api/entitydefinitions/{name}/impact](https://api-docs.sitecore.com/ch/entity-definitions-api/entity-definitions/calculategraphimpact.md): Submits a modified version of an entity definition and returns an analysis of the impact those changes would have compared to the current definition. Used to preview the effects of schema changes before applying them.

## Entities

Use this endpoint to retrieve all entities that match a specific entity definition.

### Retrieve all entities for a specific entity definition

 - [GET /api/entitydefinitions/{name}/entities](https://api-docs.sitecore.com/ch/entity-definitions-api/entities/entitiesbydefinition.md): Lists all entities that match a specific entity definition, with support for filtering, pagination, and localization.

