# Generate a draft content type suggestion

Generates a content type suggestion from all draft variant code by calling the AI Service.

Endpoint: POST /api/v1/components/drafts/{id}/model-suggestion
Version: v1
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http Bearer

## Path parameters:

  - `id` (string, required)
    The component draft identifier.

## Query parameters:

  - `environmentId` (string)
    The environment identifier.

## Request body:

  - `application/json, text/json, application/*+json` (unknown)
    Optional payload containing Rendering Host atoms to enhance the AI model suggestion alongside variant code.

## Request fields (application/json):

  - `atoms` (string)
    Raw atoms payload from Rendering Host, representing small reusable UI building blocks.
    Example: <button class="btn btn-primary">Submit</button>

## Response 200:

  - `200` (unknown)
    Successful operation

## Response 200 fields (application/json):

  - `name` (string)
    The content type draft name.
    Example: Promo

  - `description` (string)
    The description of the content type draft.
    Example: Draft content type

  - `fieldGroups` (array)
    The content type draft field groups.

  - `fieldGroups.name` (string)
    The name of the field group.
    Example: GroupName

  - `fieldGroups.sortOrder` (integer)
    The sort order.
    Example: 1

  - `fieldGroups.fields` (array)
    The content type draft fields.

  - `fieldGroups.fields.name` (string)
    The field draft name.
    Example: PromoText

  - `fieldGroups.fields.type` (string)
    The field draft type.
    Example: Single-Line Text

  - `fieldGroups.fields.helperText` (string)
    Help text for the field draft.
    Example: Helper Text

  - `fieldGroups.fields.value` (object)
    The default value of the field draft. Accepts string or object types.
    Example: {"text":"Field Value Text"}

  - `fieldGroups.fields.source` (string)
    The source of the field.
    Example: /sitecore/content/Tenant/Site/Home

  - `fieldGroups.fields.sortOrder` (integer)
    The sort order.
    Example: 1

  - `fieldGroups.fields.validationRules` (array)
    The validation rules assigned to the field as a list of validation rule item IDs.
    Example: ["59D4EE10-627C-4FD3-A964-61A88B092CBC","A76C1092-EE2E-4021-B9EE-21E541CDA1D7"]

## Response 400:

  - `400` (unknown)
    One or more validation errors occurred

## Response 400 fields (application/json):

  - `type` (string)
    The type of the error response entity.

  - `title` (string)
    The title of the error response entity.

  - `status` (integer)
    The response status code.

  - `detail` (string)
    A detailed explanation, specific to this occurrence of the problem.

  - `instance` (string)
    If available, a URI reference that identifies the specific occurrence of the problem.

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `type` (string)
    The type of the error response entity.

  - `title` (string)
    The title of the error response entity.

  - `status` (integer)
    The response status code.

  - `detail` (string)
    A detailed explanation, specific to this occurrence of the problem.

  - `instance` (string)
    If available, a URI reference that identifies the specific occurrence of the problem.

## Response 404:

  - `404` (unknown)
    Invalid component draft id

## Response 404 fields (application/json):

  - `type` (string)
    The type of the error response entity.

  - `title` (string)
    The title of the error response entity.

  - `status` (integer)
    The response status code.

  - `detail` (string)
    A detailed explanation, specific to this occurrence of the problem.

  - `instance` (string)
    If available, a URI reference that identifies the specific occurrence of the problem.

