openapi: 3.2.0 info: title: Ansible Connect. AI API version: 1.0.0 (v1) description: Equip the automation developer at Lightspeed. servers: - url: https://lightspeed-instance/api/v1 description: Direct access to a Lightspeed instance - url: https://aap/api/lightspeed/v1 description: Access through an Ansible Automation Platfrom gateway tags: - name: AI description: AI-related operations paths: /ai/chat/: post: operationId: ai_chat_create description: Send a message to the backend chatbot service and get a reply. summary: Chat request tags: - AI requestBody: content: application/json: schema: $ref: '#/components/schemas/ChatRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/ChatRequest' multipart/form-data: schema: $ref: '#/components/schemas/ChatRequest' required: true security: - oauth2: - read - write - cookieAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ChatResponse' description: '' '400': description: Bad request '403': description: Forbidden '413': description: Prompt too long '422': description: Validation failed '500': description: Internal server error '503': description: Service unavailable x-ai-description: Query the Ansible Automation Platform RAG database for documentation and product guidance on installing, configuring, and using AAP. /ai/completions/: post: operationId: ai_completions_create description: Returns inline code suggestions based on a given Ansible editor context. summary: Inline code suggestions tags: - AI requestBody: content: application/json: schema: $ref: '#/components/schemas/CompletionRequest' examples: ValidExample: value: prompt: "---\n- hosts: all\n become: yes\n\n tasks:\n - name: Install ssh\n" summary: Request Sample description: A valid sample request. application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CompletionRequest' multipart/form-data: schema: $ref: '#/components/schemas/CompletionRequest' required: true security: - oauth2: - read - write - cookieAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/CompletionResponse' examples: ValidExample: value: predictions: - " ansible.builtin.package:\n name: openssh-server\n state: present" summary: Response sample description: A valid sample response. description: '' '204': description: Empty response '400': description: Bad Request '401': description: Unauthorized '429': description: Request was throttled '503': description: Service Unavailable x-ai-description: Create new ai completion /ai/contentmatches/: post: operationId: ai_contentmatches_create description: Returns content matches that were the highest likelihood sources for a given code suggestion. summary: Code suggestion attributions tags: - AI requestBody: content: application/json: schema: $ref: '#/components/schemas/ContentMatchRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/ContentMatchRequest' multipart/form-data: schema: $ref: '#/components/schemas/ContentMatchRequest' required: true security: - oauth2: - read - write - cookieAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ContentMatchResponse' description: '' '400': description: Bad Request '401': description: Unauthorized '429': description: Request was throttled '503': description: Service Unavailable x-ai-description: Create new ai contentmatch /ai/explanations/: post: operationId: ai_explanations_create description: Returns a text that explains a playbook. summary: Playbook explanation tags: - AI requestBody: content: application/json: schema: $ref: '#/components/schemas/ExplanationRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/ExplanationRequest' multipart/form-data: schema: $ref: '#/components/schemas/ExplanationRequest' required: true security: - oauth2: - read - write - cookieAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ExplanationResponse' description: '' '204': description: Empty response '400': description: Bad Request '401': description: Unauthorized '429': description: Request was throttled '503': description: Service Unavailable x-ai-description: Create an explanation of a playbook /ai/explanations/role/: post: operationId: ai_explanations_role_create description: Returns a text that explains a role. summary: Role explanation tags: - AI requestBody: content: application/json: schema: $ref: '#/components/schemas/ExplanationRoleRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/ExplanationRoleRequest' multipart/form-data: schema: $ref: '#/components/schemas/ExplanationRoleRequest' required: true security: - oauth2: - read - write - cookieAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ExplanationResponse' description: '' '204': description: Empty response '400': description: Bad Request '401': description: Unauthorized '429': description: Request was throttled '503': description: Service Unavailable x-ai-description: Create an explanation of a role /ai/feedback/: post: operationId: ai_feedback_create summary: Feedback API for the AI service tags: - AI requestBody: content: application/json: schema: $ref: '#/components/schemas/FeedbackRequest' examples: ValidInlineSuggestionFeedbackExample: value: inlineSuggestion: userActionTime: 5155 action: '0' suggestionId: a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6 summary: Feedback Request sample for inline suggestion to identify if the suggestion is accepted or ignored. description: A valid inline suggestion feedback sample request to get details about the suggestion like user decision time, user action and suggestion id. application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/FeedbackRequest' multipart/form-data: schema: $ref: '#/components/schemas/FeedbackRequest' security: - oauth2: - read - write - cookieAuth: [] responses: '200': description: Success '400': description: Bad Request '401': description: Unauthorized x-ai-description: Create new ai feedback /ai/generations/playbook/: post: operationId: ai_generations_playbook_create description: Returns a playbook based on a text input. summary: Playbook generation tags: - AI requestBody: content: application/json: schema: $ref: '#/components/schemas/GenerationPlaybookRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/GenerationPlaybookRequest' multipart/form-data: schema: $ref: '#/components/schemas/GenerationPlaybookRequest' required: true security: - oauth2: - read - write - cookieAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/GenerationPlaybookResponse' description: '' '204': description: Empty response '400': description: Bad Request '401': description: Unauthorized '429': description: Request was throttled '503': description: Service Unavailable x-ai-description: Generate a playbook based on a text input /ai/generations/role/: post: operationId: ai_generations_role_create description: Returns a role based on a text input. summary: Role generation tags: - AI requestBody: content: application/json: schema: $ref: '#/components/schemas/GenerationRoleRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/GenerationRoleRequest' multipart/form-data: schema: $ref: '#/components/schemas/GenerationRoleRequest' required: true security: - oauth2: - read - write - cookieAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/GenerationRoleResponse' description: '' '401': description: Unauthorized x-ai-description: Generate a role based on a text input /ai/streaming_chat/: post: operationId: ai_streaming_chat_create description: Send a message to the backend chatbot service and get a streaming reply. summary: Streaming chat request tags: - AI requestBody: content: application/json: schema: $ref: '#/components/schemas/StreamingChatRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/StreamingChatRequest' multipart/form-data: schema: $ref: '#/components/schemas/StreamingChatRequest' required: true security: - oauth2: - read - write - cookieAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ChatResponse' description: '' '400': description: Bad request '403': description: Forbidden '413': description: Prompt too long '422': description: Validation failed '500': description: Internal server error '503': description: Service unavailable x-ai-description: Create new ai streaming chat components: schemas: ChatRequest: type: object properties: conversation_id: type: string description: An ID that identifies the particular conversation is being requested for. query: type: string title: Query string description: A query string to be sent to LLM. model: type: string title: Model name description: A model to be used on LLM. provider: type: string title: Provider name description: A name that identifies a LLM provider. no_tools: type: boolean title: Bypass tools description: Whether to bypass all tools and MCP servers required: - query PlaybookGenerationAction: type: object properties: action: enum: - '0' - '1' - '2' - '3' type: string description: '* `0` - OPEN * `1` - CLOSE_CANCEL * `2` - TRANSITION * `3` - CLOSE_ACCEPT' x-spec-enum-id: 693e8c4f477a387e wizardId: type: string format: uuid title: wizard ID description: A UUID that identifies the UI session. fromPage: type: integer title: page of origin description: A number that indicate the page of origin toPage: type: integer title: destination page description: A number that indicate the destination page required: - action - wizardId ContentMatchList: type: object properties: contentmatch: type: array items: $ref: '#/components/schemas/ContentMatch' required: - contentmatch RoleGenerationAction: type: object properties: action: enum: - '0' - '1' - '2' - '3' type: string description: '* `0` - OPEN * `1` - CLOSE_CANCEL * `2` - TRANSITION * `3` - CLOSE_ACCEPT' x-spec-enum-id: 693e8c4f477a387e wizardId: type: string format: uuid title: wizard ID description: A UUID that identifies the UI session. fromPage: type: integer title: page of origin description: A number that indicate the page of origin toPage: type: integer title: destination page description: A number that indicate the destination page required: - action - wizardId PlaybookGenerationFeedback: type: object properties: action: enum: - '0' - '1' - '2' type: string description: '* `0` - ACCEPTED * `1` - REJECTED * `2` - IGNORED' x-spec-enum-id: 4c6feea9f2cd2c84 wizardId: type: string format: uuid title: Outline ID description: A UUID that identifies the UI session. required: - action - wizardId Metadata: type: object properties: ansibleExtensionVersion: type: string title: Ansible vscode/vscodium extension version description: User's installed Ansible extension version, in format vMAJOR.MINOR.PATCH pattern: v?\d+\.\d+\.\d+ ExplanationRoleRequest: type: object properties: ansibleExtensionVersion: type: string title: Ansible vscode/vscodium extension version description: User's installed Ansible extension version, in format vMAJOR.MINOR.PATCH pattern: v?\d+\.\d+\.\d+ files: type: array items: $ref: '#/components/schemas/GenerationRoleFileEntry' description: A list of role files to be explained. roleName: type: string title: Role name description: The name of the role. model: type: string default: '' focusOnFile: type: string default: '' explanationId: type: string format: uuid title: Explanation ID description: A UUID that identifies the explanation. required: - files - roleName IssueFeedback: type: object properties: type: enum: - bug-report - feature-request type: string description: '* `bug-report` - Bug Report * `feature-request` - Feature Request' x-spec-enum-id: 230f84d522c678e0 title: type: string title: Issue title description: The title of the issue. description: type: string title: Issue description description: The description of the issue. required: - description - title - type ContentMatchRequest: type: object properties: ansibleExtensionVersion: type: string title: Ansible vscode/vscodium extension version description: User's installed Ansible extension version, in format vMAJOR.MINOR.PATCH pattern: v?\d+\.\d+\.\d+ suggestions: type: array items: type: string suggestionId: type: string format: uuid title: Suggestion ID description: A UUID that identifies the particular suggestion content match data is being requested for. model: type: string metadata: $ref: '#/components/schemas/Metadata' required: - suggestions FeedbackRequest: type: object properties: ansibleExtensionVersion: type: string title: Ansible vscode/vscodium extension version description: User's installed Ansible extension version, in format vMAJOR.MINOR.PATCH pattern: v?\d+\.\d+\.\d+ inlineSuggestion: $ref: '#/components/schemas/InlineSuggestionFeedback' issueFeedback: $ref: '#/components/schemas/IssueFeedback' metadata: $ref: '#/components/schemas/Metadata' model: type: string playbookExplanationFeedback: $ref: '#/components/schemas/PlaybookExplanationFeedback' playbookGenerationFeedback: $ref: '#/components/schemas/PlaybookGenerationFeedback' playbookGenerationAction: $ref: '#/components/schemas/PlaybookGenerationAction' roleGenerationAction: $ref: '#/components/schemas/RoleGenerationAction' sentimentFeedback: $ref: '#/components/schemas/SentimentFeedback' suggestionQualityFeedback: $ref: '#/components/schemas/SuggestionQualityFeedback' chatFeedback: $ref: '#/components/schemas/ChatFeedback' ExplanationRequest: type: object properties: ansibleExtensionVersion: type: string title: Ansible vscode/vscodium extension version description: User's installed Ansible extension version, in format vMAJOR.MINOR.PATCH pattern: v?\d+\.\d+\.\d+ content: type: string title: Playbook content description: The playbook that needs to be explained. customPrompt: type: string default: '' title: Custom prompt description: Custom prompt passed to the LLM when explaining a playbook. explanationId: type: string format: uuid title: Explanation ID description: A UUID that identifies the particular explanation data is being requested for. model: type: string default: '' metadata: $ref: '#/components/schemas/Metadata' required: - content ChatFeedback: type: object properties: query: type: string title: Prompt description: Prompt being sent to the LLM. response: $ref: '#/components/schemas/ChatResponse' sentiment: enum: - '0' - '1' - NOT_LIKE type: string description: '* `0` - LIKE * `1` - 1 * `NOT_LIKE` - NOT_LIKE' x-spec-enum-id: e7383390620e7763 required: - query - response - sentiment ChatResponse: type: object properties: conversation_id: type: string description: An ID that identifies the particular conversation is being requested for. referenced_documents: type: array items: $ref: '#/components/schemas/ReferencedDocuments' response: type: string truncated: type: boolean required: - conversation_id - response - truncated GenerationRoleResponse: type: object properties: role: type: string description: Name of the role. files: type: array items: $ref: '#/components/schemas/GenerationRoleFileEntry' generationId: type: string format: uuid title: Generation ID description: A UUID that identifies the particular summary data is being requested for. outline: type: string warnings: type: array items: $ref: '#/components/schemas/GenerationWarningResponse' required: - files - outline - role PlaybookExplanationFeedback: type: object properties: action: enum: - '0' - '1' - '2' type: string description: '* `0` - ACCEPTED * `1` - REJECTED * `2` - IGNORED' x-spec-enum-id: 4c6feea9f2cd2c84 explanationId: type: string format: uuid title: Explanation ID description: A UUID that identifies the playbook explanation. required: - action - explanationId CompletionResponse: type: object properties: model: type: string suggestionId: type: string format: uuid predictions: type: array items: type: string required: - predictions GenerationWarningResponse: type: object properties: id: type: string message: type: string details: type: string required: - id - message ContentMatch: type: object properties: repo_name: type: string repo_url: type: string format: uri path: type: string license: type: string data_source_description: type: string score: type: number format: double required: - data_source_description - license - path - repo_name - repo_url - score GenerationRoleFileEntry: type: object properties: path: type: string content: type: string file_type: type: string required: - content - file_type - path CompletionRequest: type: object properties: ansibleExtensionVersion: type: string title: Ansible vscode/vscodium extension version description: User's installed Ansible extension version, in format vMAJOR.MINOR.PATCH pattern: v?\d+\.\d+\.\d+ prompt: type: string description: Editor prompt. suggestionId: type: string format: uuid title: Suggestion ID description: A UUID that identifies a suggestion. metadata: $ref: '#/components/schemas/CompletionMetadata' model: type: string required: - prompt SentimentFeedback: type: object properties: value: type: integer maximum: 5 minimum: 1 feedback: type: string title: Free form text feedback description: Free form text feedback describing the reason for sentiment value. required: - feedback - value GenerationPlaybookResponse: type: object properties: playbook: type: string format: type: string generationId: type: string format: uuid title: Generation ID description: A UUID that identifies the particular summary data is being requested for. outline: type: string warnings: type: array items: $ref: '#/components/schemas/GenerationWarningResponse' required: - format - outline - playbook ExplanationResponse: type: object properties: content: type: string format: type: string explanationId: type: string format: uuid title: Explanation ID description: A UUID that identifies the particular explanation data is being requested for. required: - content - format ContentMatchResponse: type: object properties: contentmatches: type: array items: $ref: '#/components/schemas/ContentMatchList' required: - contentmatches StreamingChatRequest: type: object properties: conversation_id: type: string description: An ID that identifies the particular conversation is being requested for. query: type: string title: Query string description: A query string to be sent to LLM. model: type: string title: Model name description: A model to be used on LLM. provider: type: string title: Provider name description: A name that identifies a LLM provider. no_tools: type: boolean title: Bypass tools description: Whether to bypass all tools and MCP servers media_type: type: string description: A media type to be used in the output from LLM. required: - query ReferencedDocuments: type: object properties: docs_url: type: string title: type: string required: - docs_url - title GenerationRoleRequest: type: object properties: name: type: string default: '' title: the name of the role description: You can force a specific role name for the role with this key. text: type: string title: the goal of the role description: Can be in one or a few sentences. WCA will do HAP filtering as appropriate, and reject input above a certain HAP threshold. outline: type: string default: '' title: an outline of the role description: An outline of the role should be a numbered list. createOutline: type: boolean default: false title: generate outline description: Indicates whether the answer should also include an outline of the Ansible Role. additionalContext: type: object additionalProperties: true title: inline suggestions description: Parameter use for the inline suggestions. fileTypes: type: array items: type: string default: - task - default title: file types description: The file types generated by the model. Default is ['task', 'default']. The file type name is based on the inner role directories, without the trailing 's' generationId: type: string format: uuid title: generation ID description: A UUID that identifies the particular generation data is being requested for. wizardId: type: string format: uuid title: wizard ID description: A UUID to track the succession of interaction from the user. model: type: string metadata: $ref: '#/components/schemas/Metadata' required: - text GenerationPlaybookRequest: type: object properties: text: type: string title: Description content description: The description that needs to be converted to a playbook. customPrompt: type: string default: '' title: Custom prompt description: Custom prompt passed to the LLM when generating the text of a playbook. generationId: type: string format: uuid title: generation ID description: A UUID that identifies the particular generation data is being requested for. createOutline: type: boolean default: false title: generate outline description: Indicates whether the answer should also include an outline of the Ansible Playbook. outline: type: string default: '' description: A long step by step outline of the expected Ansible Playbook. wizardId: type: string format: uuid title: wizard ID description: A UUID to track the succession of interaction from the user. model: type: string metadata: $ref: '#/components/schemas/Metadata' required: - text SuggestionQualityFeedback: type: object properties: prompt: type: string title: File Content used as context description: File Content till end of task name description before cursor position. providedSuggestion: type: string title: Provided Model suggestion description: Inline suggestion from model as shared by user for given prompt. expectedSuggestion: type: string title: Expected Model suggestion description: Suggestion expected by the user. additionalComment: type: string title: Additional Comment description: Additional comment describing why the change was required in suggestion. required: - expectedSuggestion - prompt - providedSuggestion InlineSuggestionFeedback: type: object properties: userActionTime: type: number format: double documentUri: type: string action: enum: - '0' - '1' - '2' type: string description: '* `0` - ACCEPTED * `1` - REJECTED * `2` - IGNORED' x-spec-enum-id: 4c6feea9f2cd2c84 error: type: string suggestionId: type: string format: uuid title: Suggestion ID description: A UUID that identifies a suggestion. required: - action - suggestionId CompletionMetadata: type: object properties: ansibleExtensionVersion: type: string title: Ansible vscode/vscodium extension version description: User's installed Ansible extension version, in format vMAJOR.MINOR.PATCH pattern: v?\d+\.\d+\.\d+ documentUri: type: string activityId: type: string format: uuid title: Activity ID description: A UUID that identifies a user activity session within a given document. ansibleFileType: type: string title: Ansible File Type description: Ansible file type (playbook/tasks_in_role/tasks) additionalContext: type: object additionalProperties: true title: Additional Context description: Additional context for completion API securitySchemes: cookieAuth: type: apiKey in: cookie name: sessionid oauth2: type: oauth2 flows: authorizationCode: authorizationUrl: /o/authorize/ tokenUrl: /o/token/ scopes: read: Read basic user information write: Request Ansible content suggestions delete: Delete resources