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

# Create an NPS tool definition



## OpenAPI

````yaml /openapi-v1.json post /v1/nps-tools
openapi: 3.0.0
info:
  title: Woku Client API v1
  description: >-
    Public REST API for programmatic management of woku Voice-of-Customer
    programs: trackers, VoC instruments (NPS, woku, CES, CSAT), action plans,
    support tickets, multi-channel sending and response capture. Requests are
    company-scoped by the API key; never send a company id.
  version: 1.0.0
  contact:
    name: Woku
    url: https://woku.app
    email: team@woku.app
servers:
  - url: https://clientapi.woku.app
    description: Production
security: []
tags: []
paths:
  /v1/nps-tools:
    post:
      tags:
        - v1 - nps-tools
      summary: Create an NPS tool definition
      operationId: V1NpsToolsController_createNpsTool
      parameters:
        - name: X-Woku-Idempotency-Key
          in: header
          description: >-
            Client-generated key to make the create safe to retry. A retry with
            the same key returns the original result instead of creating again.
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateNpsToolBodyDTO'
      responses:
        '201':
          description: NPS tool created
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponseDto'
        '403':
          description: Invalid or missing API key
      security:
        - bearer: []
components:
  schemas:
    CreateNpsToolBodyDTO:
      type: object
      properties:
        name:
          type: string
          description: Tool name for identification.
          example: Post-Purchase Survey
          maxLength: 140
        npsMessage:
          type: string
          description: >-
            Only the company, product or service recommended (e.g. "our
            company"), NOT the full question. The public question is composed as
            "On a scale of 0 to 10, how likely are you to recommend {npsMessage}
            to {audienceType}?".
          example: our company
          minLength: 3
          maxLength: 140
        audienceType:
          type: string
          description: >-
            Only who the survey targets (e.g. "a friend or colleague"), NOT the
            full question.
          example: a friend or colleague
          maxLength: 140
        availableLocales:
          description: Locales the tool is available in (subset of es/en).
          example:
            - es
            - en
          type: array
          items:
            type: string
        defaultLocale:
          type: string
          description: Default locale used when none is requested.
          example: es
          enum:
            - es
            - en
        localizedContent:
          type: array
          items:
            $ref: '#/components/schemas/NpsToolLocalizedContentBodyDTO'
      required:
        - name
        - npsMessage
    ValidationErrorResponseDto:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 400
        message:
          description: Array of validation error messages
          example:
            - email must be a valid email
            - password must be at least 8 characters
          type: array
          items:
            type: string
        error:
          type: string
          description: Error type
          example: Bad Request
      required:
        - statusCode
        - message
        - error
    NpsToolLocalizedContentBodyDTO:
      type: object
      properties:
        locale:
          type: string
          enum:
            - es
            - en
          example: en
        npsMessage:
          type: string
          description: >-
            Recommended company/product/service fragment for this locale (e.g.
            "our company"), NOT the full question.
          example: our company
          minLength: 3
          maxLength: 140
        audienceType:
          type: string
          description: Audience fragment for this locale, NOT the full question.
          example: a friend or colleague
          maxLength: 140
      required:
        - locale
        - npsMessage
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: Company secret API key.

````