Create a property definition
Define a new property on this object type, scoped to the calling team. Search the existing properties first (GET this path with term) and reuse a match instead of defining a second property for the same fact. Pass list_id in the body to scope the definition to one list/app; without it the property is workspace-global and appears on every list. A name already used in that scope, an explicitly requested slug already taken, or a slug that a shared property already owns all return 409 naming the definition to use instead. The property’s display format is resolved from type automatically — pass role_id only to override it. For select_str and multiselect_str types you may pre-seed the choices via options.
Create a property definition
package main
import (
"context"
"fmt"
"github.com/micro-so/micro-sdk-go"
"github.com/micro-so/micro-sdk-go/option"
)
func main() {
client := micro.NewClient(
option.WithAPIKey("My API Key"),
option.WithTeamID("My Team ID"),
)
propertyDefinition, err := client.Prism.Properties.New(
context.TODO(),
micro.PrismPropertyNewParamsObjectTypeComment,
micro.PrismPropertyNewParams{
PropertyDefinitionCreate: micro.PropertyDefinitionCreateParam{
Name: micro.F("name"),
Type: micro.F(micro.PropertyDefinitionCreateTypeNum),
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", propertyDefinition.ID)
}
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"slug": "slug",
"type": "num",
"alias": "app_stage",
"crm_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"locked": true,
"name": "name",
"native": true,
"options": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"slug": "slug",
"color_scheme": "color_scheme",
"crm_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"description": "description",
"icon": "icon",
"list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"option_group": "option_group",
"sort_index": 0,
"value": "value"
}
],
"required": true,
"role_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}Returns Examples
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"slug": "slug",
"type": "num",
"alias": "app_stage",
"crm_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"locked": true,
"name": "name",
"native": true,
"options": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"slug": "slug",
"color_scheme": "color_scheme",
"crm_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"description": "description",
"icon": "icon",
"list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"option_group": "option_group",
"sort_index": 0,
"value": "value"
}
],
"required": true,
"role_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}