> ## Documentation Index
> Fetch the complete documentation index at: https://dialnexa.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Agent Tone

> Generate Agent Tone with the DialNexa API. Drafts an agent tone and inferred locale from the supplied context without changing an agent.

Read only

Generate Agent Tone uses your workspace API key. Drafts an agent tone and inferred locale from the supplied context without changing an agent.

## Before you begin

Use a server-side [API key](https://dialnexa.com/docs/api-reference/api-fundamentals.md#authenticate-dialnexa-api-requests) for the intended workspace.

## Generate Agent Tone request

The request panel lists supported query parameters and body fields. For a request body, the example below supplies the required fields. Replace sample values with your own inputs.

```bash theme={null}
curl --request POST 'https://api.dialnexa.com/v1/agent-builder/generate-agent-tone' \
  --header "Authorization: Bearer $DIALNEXA_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "company_and_offering": "Example company and offering",
  "target_customer": "Example target customer",
  "primary_goal": "Example primary goal",
  "success_criteria": "Example success criteria",
  "information_to_collect": "Example information to collect",
  "objections_and_faqs": "Example objections and faqs"
}'
```

## Verify the result

Expect HTTP `201`. Read the `data` property in the success envelope; the response panel documents its fields.

This operation also accepts the matching `/v1/assistant` path. The request and result contracts are shared. Use one path consistently for your integration.

## Retry safety

This operation does not modify workspace resources. Retry after a transient connection failure.

## Errors and recovery

* `400`: A field is missing, `company_and_offering`, `target_customer`, `primary_goal`, or `success_criteria` is empty, or no tone could be generated. `information_to_collect` and `objections_and_faqs` must be present but can be empty strings.
* `401`: Missing, expired, or invalid API key.

## Related endpoints

* [Get Agent Builder Inventory](https://dialnexa.com/docs/api-reference/v1/agent-builder/inventory.md)
* [Build Agent Configuration](https://dialnexa.com/docs/api-reference/v1/agent-builder/run.md)
* [Stream Agent Build](https://dialnexa.com/docs/api-reference/v1/agent-builder/stream.md)
* [Generate Agent Objectives](https://dialnexa.com/docs/api-reference/v1/agent-builder/generate-objectives.md)
* [API authentication](https://dialnexa.com/docs/api-reference/api-fundamentals.md#authenticate-dialnexa-api-requests)


## OpenAPI

````yaml POST /v1/agent-builder/generate-agent-tone
openapi: 3.0.0
info:
  title: DialNexa API
  description: Public `/v1` REST API for the DialNexa voice AI platform.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: Agents
  - name: Batch Calls
  - name: Calls
  - name: Knowledge Base
  - name: Languages
  - name: LLMs
  - name: Phone Numbers
  - name: Organization Folders
  - name: Transcribers
  - name: Webhooks
  - name: Voices
  - name: Workflows
  - name: Workflow Leads
  - name: Authentication
  - name: Agent Builder
  - name: Agent Evaluations
paths:
  /v1/agent-builder/generate-agent-tone:
    post:
      tags:
        - Agent Builder
      summary: Generate Agent Tone
      description: >-
        Drafts an agent tone and inferred locale from the supplied context
        without changing an agent.
      operationId: generateAgentTone
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateAgentTone'
            examples:
              request:
                value:
                  company_and_offering: Example company and offering
                  target_customer: Example target customer
                  primary_goal: Example primary goal
                  success_criteria: Example success criteria
                  information_to_collect: Example information to collect
                  objections_and_faqs: Example objections and faqs
      responses:
        '201':
          description: Generated agent tone
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                  - statusCode
                  - message
                  - data
                  - timestamp
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  error:
                    type: boolean
                    enum:
                      - false
                  statusCode:
                    type: integer
                    example: 201
                  message:
                    type: string
                    example: Success
                  data:
                    type: object
                    properties:
                      agent_tone:
                        type: string
                      inferred_region:
                        type: string
                      inferred_language:
                        type: string
                  timestamp:
                    type: string
                    format: date-time
        '400':
          description: >-
            A field is missing, a required field is empty, or no tone could be
            generated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                noTone:
                  summary: 400 error
                  value:
                    statusCode: 400
                    error: true
                    success: false
                    data: []
                    message: Could not generate agent tone from intake context
                    errors:
                      - Could not generate agent tone from intake context
        '401':
          description: Missing, expired, or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  summary: 401 error
                  value:
                    statusCode: 401
                    error: true
                    success: false
                    data: []
                    message: Invalid API key
                    errors: []
        '500':
          description: The request could not be completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  summary: Server error
                  value:
                    statusCode: 500
                    error: true
                    success: false
                    data: []
                    message: Internal server error
                    errors: []
      security:
        - bearer: []
components:
  schemas:
    GenerateAgentTone:
      type: object
      properties:
        company_and_offering:
          type: string
        target_customer:
          type: string
        primary_goal:
          type: string
        success_criteria:
          type: string
        information_to_collect:
          type: string
        objections_and_faqs:
          type: string
      required:
        - company_and_offering
        - target_customer
        - primary_goal
        - success_criteria
        - information_to_collect
        - objections_and_faqs
    ErrorResponse:
      type: object
      description: Error body on endpoints without response filtering.
      properties:
        statusCode:
          type: integer
          example: 404
        error:
          type: boolean
          enum:
            - true
        success:
          type: boolean
          enum:
            - false
        data:
          oneOf:
            - type: object
              properties:
                code:
                  type: string
                  description: Machine-readable refusal code.
            - type: array
              items: {}
          description: >-
            For a coded refusal, an object with code and the details listed for
            that code. Otherwise an empty array.
        message:
          type: string
        errors:
          type: array
          items:
            type: string
          description: Validation messages for a 400. Empty for other errors.
        validation_errors:
          type: array
          description: >-
            Present when uploaded rows fail number validation (batch and
            workflow lead uploads): one group per distinct error.
          items:
            type: object
            properties:
              error:
                type: string
              rows:
                type: array
                items:
                  type: integer
                description: Row numbers with this error.
              phone_numbers:
                type: array
                items:
                  type: string
        invalid_row_count:
          type: integer
          description: 'Present with validation_errors: how many rows failed.'
      required:
        - statusCode
        - error
        - success
        - data
        - message
        - errors
  securitySchemes:
    bearer:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.