## Update a property definition `client.Prism.Properties.Update(ctx, objectType, propertyID, params) (*PropertyDefinition, error)` **patch** `/v2/prism/{teamId}/{objectType}/properties/{propertyId}` Patches the editable fields (`name`, `icon`, `enabled`) of a property definition. `type` and scoping fields are immutable; `type` must be supplied in the body so the server knows which per-type table to write. ### Parameters - `objectType PrismPropertyUpdateParamsObjectType` - `const PrismPropertyUpdateParamsObjectTypeComment PrismPropertyUpdateParamsObjectType = "comment"` - `const PrismPropertyUpdateParamsObjectTypeDeal PrismPropertyUpdateParamsObjectType = "deal"` - `const PrismPropertyUpdateParamsObjectTypeEngagement PrismPropertyUpdateParamsObjectType = "engagement"` - `const PrismPropertyUpdateParamsObjectTypeIdentity PrismPropertyUpdateParamsObjectType = "identity"` - `const PrismPropertyUpdateParamsObjectTypeAIChatThread PrismPropertyUpdateParamsObjectType = "ai_chat_thread"` - `const PrismPropertyUpdateParamsObjectTypeAIChatMessage PrismPropertyUpdateParamsObjectType = "ai_chat_message"` - `const PrismPropertyUpdateParamsObjectTypeAgentSite PrismPropertyUpdateParamsObjectType = "agent_site"` - `const PrismPropertyUpdateParamsObjectTypeDocument PrismPropertyUpdateParamsObjectType = "document"` - `const PrismPropertyUpdateParamsObjectTypeAction PrismPropertyUpdateParamsObjectType = "action"` - `const PrismPropertyUpdateParamsObjectTypeEvent PrismPropertyUpdateParamsObjectType = "event"` - `const PrismPropertyUpdateParamsObjectTypeOrganization PrismPropertyUpdateParamsObjectType = "organization"` - `const PrismPropertyUpdateParamsObjectTypeContact PrismPropertyUpdateParamsObjectType = "contact"` - `propertyID string` - `params PrismPropertyUpdateParams` - `TeamID param.Field[string]` Path param - `PropertyDefinitionPatch param.Field[PropertyDefinitionPatch]` Body param: Partial update of a property definition. Only `name`, `icon`, `enabled`, and `required` are editable. `type` identifies the per-type table to write. - `IdempotencyKey param.Field[string]` Header param: A unique key (UUID or any opaque string up to 255 chars) for an authenticated POST, PUT, or PATCH request. The server retains the initial claim for 24 hours and replays a completed non-5xx response only when the method, path, and request body all match. Reusing a non-expired key with a different method, path, or body returns 409 `idempotency_key_mismatch`; reusing it after expiry returns 409 `idempotency_key_stale`, so use a new key. Replays include the `idempotent-replay: true` response header. ### Returns - `type PropertyDefinition struct{…}` Definition for a single property on an object type. Definitions with team_id and crm_id null are shared defaults; values may be scoped to a team and/or list (crm). - `ID string` - `Slug string` - `Type PropertyDefinitionType` Storage type for a property definition. Determines which per-type table holds the values, and which display formats the property can take. - `const PropertyDefinitionTypeNum PropertyDefinitionType = "num"` - `const PropertyDefinitionTypeStr PropertyDefinitionType = "str"` - `const PropertyDefinitionTypeBool PropertyDefinitionType = "bool"` - `const PropertyDefinitionTypeDate PropertyDefinitionType = "date"` - `const PropertyDefinitionTypeText PropertyDefinitionType = "text"` - `const PropertyDefinitionTypeByte PropertyDefinitionType = "byte"` - `const PropertyDefinitionTypeSelectStr PropertyDefinitionType = "select_str"` - `const PropertyDefinitionTypeMultiStr PropertyDefinitionType = "multi_str"` - `const PropertyDefinitionTypeMultiselectStr PropertyDefinitionType = "multiselect_str"` - `const PropertyDefinitionTypeJsonb PropertyDefinitionType = "jsonb"` - `const PropertyDefinitionTypeRefIdentity PropertyDefinitionType = "ref_identity"` - `const PropertyDefinitionTypeRefUser PropertyDefinitionType = "ref_user"` - `const PropertyDefinitionTypeRefOrganization PropertyDefinitionType = "ref_organization"` - `const PropertyDefinitionTypeRefContact PropertyDefinitionType = "ref_contact"` - `const PropertyDefinitionTypeRefThread PropertyDefinitionType = "ref_thread"` - `const PropertyDefinitionTypeRefMessage PropertyDefinitionType = "ref_message"` - `const PropertyDefinitionTypeRefEvent PropertyDefinitionType = "ref_event"` - `const PropertyDefinitionTypeRefAccount PropertyDefinitionType = "ref_account"` - `const PropertyDefinitionTypeRefAIChatThread PropertyDefinitionType = "ref_ai_chat_thread"` - `const PropertyDefinitionTypeRefAIChatMessage PropertyDefinitionType = "ref_ai_chat_message"` - `const PropertyDefinitionTypeMultirefAIChatMessage PropertyDefinitionType = "multiref_ai_chat_message"` - `const PropertyDefinitionTypeMultirefAgentSite PropertyDefinitionType = "multiref_agent_site"` - `const PropertyDefinitionTypeMultirefAction PropertyDefinitionType = "multiref_action"` - `const PropertyDefinitionTypeMultirefComment PropertyDefinitionType = "multiref_comment"` - `const PropertyDefinitionTypeMultirefContact PropertyDefinitionType = "multiref_contact"` - `const PropertyDefinitionTypeMultirefLabel PropertyDefinitionType = "multiref_label"` - `const PropertyDefinitionTypeMultirefThread PropertyDefinitionType = "multiref_thread"` - `const PropertyDefinitionTypeMultirefMessages PropertyDefinitionType = "multiref_messages"` - `const PropertyDefinitionTypeMultirefDocument PropertyDefinitionType = "multiref_document"` - `const PropertyDefinitionTypeMultirefIdentity PropertyDefinitionType = "multiref_identity"` - `const PropertyDefinitionTypeMultirefOrganization PropertyDefinitionType = "multiref_organization"` - `const PropertyDefinitionTypeMultirefEngagement PropertyDefinitionType = "multiref_engagement"` - `const PropertyDefinitionTypeMultirefAttendee PropertyDefinitionType = "multiref_attendee"` - `const PropertyDefinitionTypeMultirefMeetingEntry PropertyDefinitionType = "multiref_meeting_entry"` - `const PropertyDefinitionTypeMultirefReadReceipt PropertyDefinitionType = "multiref_read_receipt"` - `const PropertyDefinitionTypeMultirefAccount PropertyDefinitionType = "multiref_account"` - `const PropertyDefinitionTypeMultirefSource PropertyDefinitionType = "multiref_source"` - `Alias PropertyDefinitionAlias` Reserved alias naming this definition, or null. `app_stage` marks the list pipeline stage definition. Resolve stages by this field rather than by name, slug, or team_id: a superseded native `status` definition can coexist with the pipeline one and is otherwise identical on the wire. - `const PropertyDefinitionAliasAppStage PropertyDefinitionAlias = "app_stage"` - `CRMID string` Identifier of the list this definition is scoped to, when applicable. - `ListID string` Canonical identifier of the list this definition is scoped to. - `Locked bool` - `Name string` - `Native bool` - `Options []PropertyOption` Present only for select_str and multiselect_str types. - `ID string` - `Slug string` - `ColorScheme string` - `CRMID string` - `Description string` - `Icon string` - `ListID string` - `OptionGroup string` - `SortIndex int64` - `Value string` Display value for the option. - `Required bool` When true, records of this object type must carry a non-empty value for this property on create, and a patch may not clear it. - `RoleID string` The property's display format. Always populated on definitions created through this API; a null here means the definition predates that and will render as an unknown format until it is patched. - `TeamID string` ### Example ```go 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.Update( context.TODO(), micro.PrismPropertyUpdateParamsObjectTypeComment, "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", micro.PrismPropertyUpdateParams{ PropertyDefinitionPatch: micro.PropertyDefinitionPatchParam{ Type: micro.F(micro.PropertyDefinitionPatchTypeNum), }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", propertyDefinition.ID) } ``` #### Response ```json { "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" } ```