---
title: "Add AI Prompt"
method: POST
path: "/users/{userId}/ai/prompts"
tags: ["AI"]
---

# Add AI Prompt

`POST /users/{userId}/ai/prompts`

## Request

- Base URL: `https://api.crowdin.com/api/v2`
- URL: `https://api.crowdin.com/api/v2/users/{userId}/ai/prompts`
- Auth: none declared
- TypeScript: <https://skmtc.dev/crowdin/apis/crowdin-api-v2/docs/users/:userId/ai/prompts/post.ts> (a function with typed inputs; its response is checked against the schema)

**Required scopes:** `ai.prompt` (Read and Write).

## Path parameters

- `userId` integer, required

## Request body

- CrowdinAiPromptCreateForm
  - `name` string, required: AI prompt name
  - `action` 'pre_translate' | 'qa_check', required
  - `aiProviderId` integer: AI Provider identifier. Get via [List AI Providers](#operation/api.ai.providers.getMany)
  - `aiModelId` string: Ai Model id. Get via [List AI Provider Models](#operation/api.ai.providers.models.getMany)
  - `isEnabled` boolean: If `aiProviderId` or `aiModelId` is not set, default value would be `false`
  - `enabledProjectIds` integer[]: Array of project ids. Get via [List Projects](#operation/api.projects.getMany)
  - `config` union, required: AI prompt configuration
    - AiPromptConfigBasicModePreTranslate
      - `mode` 'basic', required
      - `companyDescription` string: Use field `snippets` instead
      - `projectDescription` string: Use field `snippets` instead
      - `audienceDescription` string: Use field `snippets` instead
      - `customPlaceholders` string[]: Use field `snippets` instead
      - `snippets` string[]: Array of snippets. Get via [List AI Snippets](#operation/api.ai.snippets.getMany)
      - `otherLanguageTranslations` object
        - `isEnabled` boolean
        - `languageIds` string[]: Array of language ids. Get via [List Supported Languages](#operation/api.languages.getMany)
      - `glossaryTerms` boolean
      - `tmSuggestions` boolean
      - `fileContent` boolean
      - `fileContext` boolean
      - `generateFileSummary` boolean
      - `screenshots` boolean
      - `projectContext` boolean
      - `publicProjectDescription` boolean: Deprecated. Use field `projectContext` instead
      - `siblingsStrings` boolean
      - `retryOnQaIssues` boolean
    - AiPromptConfigBasicModeQaCheck
      - `mode` 'basic', required
      - `evaluationSteps` string[], required
      - `customPlaceholders` string[]: Use field `snippets` instead
      - `snippets` string[]
      - `glossaryTerms` boolean
      - `tmSuggestions` boolean
      - `fileContext` boolean
      - `screenshots` boolean
      - `projectContext` boolean
      - `publicProjectDescription` boolean: Deprecated. Use field `projectContext` instead
    - AiPromptConfigCrowdinAdvancedMode
      - `mode` 'advanced', required
      - `generateFileSummary` boolean
      - `glossaryTerms` boolean
      - `tmSuggestions` boolean
      - `screenshots` boolean
      - `prompt` string, required
      - `otherLanguageTranslations` object: __Note:__ Not available for QA check action
        - `isEnabled` boolean
        - `languageIds` string[]: Array of language ids. Get via [List Supported Languages](#operation/api.languages.getMany)
      - `retryOnQaIssues` boolean: Available only for pre-translate action
    - AiPromptConfigExternalMode
      - `mode` 'external', required
      - `identifier` string, required: Application identifier. Get via [List Applications](#operation/api.applications.installations.getMany)
      - `key` string, required: Module key
      - `options` object: Options to compile the prompt. Get from configurator
      - `retryOnQaIssues` boolean: Available only for pre-translate action and may be disabled by AI prompt provider

## Response `201`

AI prompt was added successfully

- CrowdinAiPromptResource: Base schema of resource container. Container is a wrapper object that contains payload in required `data` property and provides space for adding any other metadata.
  - `data` CrowdinAiPrompt, required
    - `id` integer
    - `name` string
    - `action` string
    - `aiProviderId` integer, nullable
    - `aiModelId` string, nullable
    - `isEnabled` boolean
    - `enabledProjectIds` integer[]
    - `config` union
      - object: AI prompt configuration
        - `mode` 'basic', required
        - `companyDescription` string: Use field `snippets` instead
        - `projectDescription` string: Use field `snippets` instead
        - `audienceDescription` string: Use field `snippets` instead
        - `customPlaceholders` string[]: Use field `snippets` instead
        - `snippets` string[]: Array of snippets. Get via [List AI Snippets](#operation/api.ai.snippets.getMany)
        - `otherLanguageTranslations` object
          - `isEnabled` boolean
          - `languageIds` string[]: Array of language ids. Get via [List Supported Languages](#operation/api.languages.getMany)
        - `glossaryTerms` boolean
        - `tmSuggestions` boolean
        - `fileContent` boolean
        - `fileContext` boolean
        - `generateFileSummary` boolean
        - `screenshots` boolean
        - `projectContext` boolean
        - `publicProjectDescription` boolean: Deprecated. Use field `projectContext` instead
        - `siblingsStrings` boolean
        - `retryOnQaIssues` boolean
      - object: AI prompt configuration
        - `mode` 'basic', required
        - `evaluationSteps` string[], required
        - `customPlaceholders` string[]: Use field `snippets` instead
        - `snippets` string[]
        - `glossaryTerms` boolean
        - `tmSuggestions` boolean
        - `fileContext` boolean
        - `screenshots` boolean
        - `projectContext` boolean
        - `publicProjectDescription` boolean: Deprecated. Use field `projectContext` instead
      - object: AI prompt configuration
        - `mode` 'advanced', required
        - `generateFileSummary` boolean
        - `glossaryTerms` boolean
        - `tmSuggestions` boolean
        - `screenshots` boolean
        - `prompt` string, required
        - `otherLanguageTranslations` object: __Note:__ Not available for QA check action
          - `isEnabled` boolean
          - `languageIds` string[]: Array of language ids. Get via [List Supported Languages](#operation/api.languages.getMany)
        - `retryOnQaIssues` boolean: Available only for pre-translate action
      - object: AI prompt configuration
        - `mode` 'external', required
        - `identifier` string, required: Application identifier. Get via [List Applications](#operation/api.applications.installations.getMany)
        - `key` string, required: Module key
        - `options` object: Options to compile the prompt. Get from configurator
        - `retryOnQaIssues` boolean: Available only for pre-translate action and may be disabled by AI prompt provider
    - `promptPreview` string, nullable
    - `isFineTuningAvailable` boolean
    - `createdBy` integer, nullable: Identifier of the user who created the prompt
    - `updatedBy` integer, nullable: Identifier of the user who last updated the prompt
    - `lastUsedBy` integer, nullable: Identifier of the user who last used the prompt
    - `lastUsedAt` string, date-time, nullable: Date and time when the prompt was last used
    - `usageCount` integer: Total number of times the prompt has been used
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `400`: Invalid Request Parameters
- `401`: Unauthorized
- `403`: Forbidden
- `404`: User with specified id was not found
- `405`: Method Not Allowed

---

[API](https://skmtc.dev/crowdin/apis/crowdin-api-v2.md) - [All operations](https://skmtc.dev/crowdin/apis/crowdin-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/crowdin/apis/crowdin-api-v2/revisions/27aae7751699?raw)
