View all methods
catalog.entityTypes.create
Create a new entity type in your software catalog.
Facts
| Method | POST https://api.getdx.com/catalog.entityTypes.create |
| Required scope | catalog:write:entities |
Arguments
Required arguments
| Name | Type | Description |
|---|---|---|
token |
Token |
Auth token passed as an HTTP header. |
identifier |
Text |
The user defined unique identifier for the entity type. |
name |
Text |
The user defined name of the entity type. |
Optional arguments
| Name | Type | Description |
|---|---|---|
description |
Text |
The description of the entity type. |
properties |
Array<Property> |
A list of properties defined for the entity type. |
aliases |
Record<AliasTypeKey, boolean> |
Key/Value object of the aliases available for the entity type. See the catalog docs for a list of supported aliases. |
Example request
This is a typical request:
curl -X POST https://api.getdx.com/catalog.entityTypes.create \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer xxxx-xxxxxxxxx-xxxx' \
--data '{
"identifier": "www",
"name": "Website",
"description": "DX Website entities.",
"ordering": 0,
"properties": [
{
"type": "multi_select",
"identifier": "language",
"name": "Language",
"description": "Languages used by the website",
"visibility": "visible",
"ordering": 0,
"definition": {
"options": [
{ "value": "Ruby", "color": "#fb923c" },
{ "value": "HTML", "color": "#fb923c" },
{ "value": "Shell", "color": "#fb923c" }
]
},
}
],
"aliases": {
"github_repo": true
}
}'
Example response
This is a typical success response:
{
"ok": true,
"entity_type": {
"identifier": "www",
"created_at": "2025-01-02 20:48:45.77969",
"updated_at": "2025-01-02 20:48:45.77969",
"name": "Website",
"description": "DX Website entities.",
"ordering": 0,
"properties": [
{
"type": "multi_select",
"identifier": "language",
"name": "Language",
"description": "Languages used by the website",
"visibility": "visible",
"ordering": 0,
"definition": {
"options": [
{ "value": "Ruby", "color": "#fb923c" },
{ "value": "HTML", "color": "#fb923c" },
{ "value": "Shell", "color": "#fb923c" }
]
}
}
],
"aliases": {
"github_repo": true
}
}
}
Errors
This table lists the expected errors that this method could return. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok param in the response.
| Error | Description |
|---|---|
not_authed |
No authentication token provided. |
invalid_auth |
Some aspect of authentication cannot be validated. |
Legacy path
This method is temporarily still available at the following legacy path:
POST https://api.getdx.com/entityTypes.create