> ## 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 Objectives

> Generate Agent Objectives with the DialNexa API. Drafts call objectives from your company and customer context without changing an agent.

<span data-api-safety-label="read-only"><Badge color="gray" size="sm" shape="pill">Read only</Badge></span>

Generate Agent Objectives uses your workspace API key. Drafts call objectives from your company and customer context without changing an agent.

## Before you begin

Use a server-side [API key](/docs/api-reference/authentication) for the intended workspace.

## Generate Agent Objectives 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-objectives' \
  --header "Authorization: Bearer $DIALNEXA_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "company_and_offering": "Acme Corp - B2B payroll software for mid-market HR teams.",
  "target_customer": "HR directors at 200-2,000 employee companies evaluating payroll vendors.",
  "primary_goal": "Book demos and answer pricing and onboarding questions."
}'
```

## 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

* `401`: Missing, expired, or invalid API key.

## Related endpoints

* [Get Agent Builder Inventory](/docs/api-reference/v1/agent-builder/inventory)
* [Build Agent Configuration](/docs/api-reference/v1/agent-builder/run)
* [Stream Agent Build](/docs/api-reference/v1/agent-builder/stream)
* [Generate Agent Tone](/docs/api-reference/v1/agent-builder/generate-tone)
* [API authentication](/docs/api-reference/authentication)


## OpenAPI

````yaml POST /v1/agent-builder/generate-objectives
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: Transcribers
  - name: Webhooks
  - name: Voices
  - name: Workflows
  - name: Workflow Leads
  - name: Authentication
  - name: Agent Builder
paths:
  /v1/agent-builder/generate-objectives:
    post:
      tags:
        - Agent Builder
      summary: Generate Agent Objectives
      description: >-
        Drafts call objectives from your company and customer context without
        changing an agent.
      operationId: generateAgentObjectives
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateObjectives'
            examples:
              request:
                value:
                  company_and_offering: Acme Corp - B2B payroll software for mid-market HR teams.
                  target_customer: >-
                    HR directors at 200-2,000 employee companies evaluating
                    payroll vendors.
                  primary_goal: Book demos and answer pricing and onboarding questions.
      responses:
        '201':
          description: Generated objectives fields
          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:
                      success_criteria:
                        type: string
                      information_to_collect:
                        type: string
                      objections_and_faqs:
                        type: string
                  timestamp:
                    type: string
                    format: date-time
        '401':
          description: Missing, expired, or invalid API key.
      security:
        - bearer: []
components:
  schemas:
    GenerateObjectives:
      type: object
      properties:
        company_and_offering:
          type: string
          description: Company name and what the business offers
          example: Acme Corp - B2B payroll software for mid-market HR teams.
        target_customer:
          type: string
          description: Who the agent will speak with
          example: >-
            HR directors at 200-2,000 employee companies evaluating payroll
            vendors.
        primary_goal:
          type: string
          description: Primary outcome the agent should achieve on each call
          example: Book demos and answer pricing and onboarding questions.
      required:
        - company_and_offering
        - target_customer
        - primary_goal
  securitySchemes:
    bearer:
      scheme: bearer
      type: http

````