Set Field Visibility Rule for Content Type
PUT https://{{base_url}}/v3/content_types/{{content_type_uid}}
The Set Field Visibility Rule for Content Type API request lets you add Field Visibility Rules to existing content types. These rules allow you to show and hide fields based on the state or value of certain fields.
To configure the permissions for your application via OAuth, please include the cm.content-types.management:write scope.
To use the API Request, you will need to authenticate yourself either with a Management Token (highly recommended) or an Authtoken.Â
Read more about it in Authentication.
For more information, refer to the Set Field Visibility Rule for Content Type API Reference document
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
include_branch | boolean | Set this to 'true' to include the '_branch' top-level key in the response. This key states the unique ID of the branch where the concerned Contentstack module resides. |
Request Body
{"content_type"=>{"title"=>"Page", "uid"=>"page", "schema"=>[{"display_name"=>"Title", "uid"=>"title", "data_type"=>"text", "field_metadata"=>{"_default"=>true}, "unique"=>false, "mandatory"=>true, "multiple"=>false}, {"display_name"=>"URL", "uid"=>"url", "data_type"=>"text", "field_metadata"=>{"_default"=>true}, "unique"=>false, "multiple"=>false}, {"display_name"=>"Single Line Textbox", "uid"=>"single_line_textbox", "data_type"=>"text", "field_metadata"=>{"_default"=>true}, "unique"=>false, "multiple"=>false}, {"display_name"=>"Multi Line Textbox", "uid"=>"multi_line_textbox", "data_type"=>"text", "field_metadata"=>{"_default"=>true}, "unique"=>false, "multiple"=>false}], "field_rules"=>[{"conditions"=>[{"operand_field"=>"single_line_textbox", "operator"=>"equals", "value"=>"abc"}], "match_type"=>"all", "actions"=>[{"action"=>"show", "target_field"=>"multi_line_textbox"}]}], "options"=>{"title"=>"title", "publishable"=>true, "is_page"=>true, "singleton"=>false, "sub_title"=>["url"], "url_pattern"=>"/:title", "url_prefix"=>"/"}}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
api_key | string | Enter the API key of your stack. | |
authtoken | string | Enter your authtoken. | |
authorization | string | For this call we recommend you to use management token. | |
Content-Type | string | Enter "application/json" to pass a Request body. | |
branch | string | Enter your branch unique ID. |