# Create response POST https://api.moveworks.ai/rest/v1beta1/conversations/{conversation_id}/responses Content-Type: application/json Creates a response object for processing. Returns immediately with the response object. Use `GetResponse` by `response_id` to poll for the complete result. Reference: https://docs.moveworks.com/api-reference/conversations-api/responses/create-response ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Create response version: endpoint_responses.createResponse paths: /conversations/{conversation_id}/responses: post: operationId: create-response summary: Create response description: >- Creates a response object for processing. Returns immediately with the response object. Use `GetResponse` by `response_id` to poll for the complete result. tags: - - subpackage_responses parameters: - name: conversation_id in: path description: 'Unique conversation identifier (format: conv_)' required: true schema: type: string - name: Authorization in: header description: >- JWT bearer token authentication. Obtain an access token from the Moveworks auth endpoint and include it in the Authorization header as 'Bearer '. required: true schema: type: string - name: Assistant-Name in: header description: >- The Moveworks assistant identifier that was configured for your organization. required: true schema: type: string responses: '202': description: Response accepted for processing (acknowledgement) content: application/json: schema: $ref: '#/components/schemas/Response' '400': description: Bad request - Invalid input parameters content: {} '401': description: Unauthorized - Invalid or missing authentication content: {} '404': description: Not found - Resource does not exist content: {} '429': description: Rate limit exceeded content: {} '500': description: Internal server error content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateResponseRequest' components: schemas: UserInput: type: object properties: text: type: string description: User's input text required: - text CreateResponseRequest: type: object properties: input: $ref: '#/components/schemas/UserInput' required: - input ResponseStatus: type: string enum: - value: CREATED - value: IN_PROGRESS - value: COMPLETED - value: FAILED OutputItemType: type: string enum: - value: MESSAGE ActorType: type: string enum: - value: USER - value: ASSISTANT CommonmarkTextContent: type: object properties: text: type: string description: Commonmark-formatted text content fallback_text: type: string description: Fallback plain text version of the content required: - text Content0: type: object properties: commonmark_text: $ref: '#/components/schemas/CommonmarkTextContent' required: - commonmark_text PlainTextContent: type: object properties: text: type: string description: Plain text content required: - text Content1: type: object properties: plain_text: $ref: '#/components/schemas/PlainTextContent' required: - plain_text Content: oneOf: - $ref: '#/components/schemas/Content0' - $ref: '#/components/schemas/Content1' CitationLocation: type: object properties: start: type: integer description: Start position in message text (0-indexed) end: type: integer description: End position in message text (exclusive) required: - start - end Citation: type: object properties: id: type: string description: Entity identifier type: type: string description: Entity type (e.g., person, ticket, document) mention: type: string description: Mention text in the message location: $ref: '#/components/schemas/CitationLocation' url: type: string format: uri description: URL to the entity required: - id - type - mention - location - url Message: type: object properties: message_id: type: string description: 'Unique message identifier (format: msg_)' conversation_id: type: string description: Parent conversation identifier response_id: type: string description: Associated response identifier actor: $ref: '#/components/schemas/ActorType' content: $ref: '#/components/schemas/Content' citations: type: array items: $ref: '#/components/schemas/Citation' description: Entity citations (assistant messages only) created_at: type: string format: date-time description: Creation timestamp (ISO 8601) required: - message_id - conversation_id - response_id - actor - content - citations - created_at OutputItem: type: object properties: type: $ref: '#/components/schemas/OutputItemType' message: $ref: '#/components/schemas/Message' required: - type Error: type: object properties: code: type: string description: Machine-readable error code message: type: string description: Human-readable error message required: - code - message Response: type: object properties: response_id: type: string description: 'Unique response identifier (format: resp_)' conversation_id: type: string description: Parent conversation identifier status: $ref: '#/components/schemas/ResponseStatus' created_at: type: string format: date-time description: Creation timestamp (ISO 8601) updated_at: type: string format: date-time description: Last update timestamp (ISO 8601) completed_at: type: - string - 'null' format: date-time description: Completion timestamp (ISO 8601), null if not completed outputs: type: array items: $ref: '#/components/schemas/OutputItem' description: Output items error: oneOf: - $ref: '#/components/schemas/Error' - type: 'null' description: Error details (only present if status is FAILED) required: - response_id - conversation_id - status - created_at - updated_at - outputs ``` ## SDK Code Examples ```python Responses_createResponse_example import requests url = "https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/responses" payload = { "input": { "text": "Who does John Doe report to?" } } headers = { "Assistant-Name": "acmecorp-conversations-rest-api", "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Responses_createResponse_example const url = 'https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/responses'; const options = { method: 'POST', headers: { 'Assistant-Name': 'acmecorp-conversations-rest-api', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"input":{"text":"Who does John Doe report to?"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Responses_createResponse_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/responses" payload := strings.NewReader("{\n \"input\": {\n \"text\": \"Who does John Doe report to?\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Assistant-Name", "acmecorp-conversations-rest-api") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Responses_createResponse_example require 'uri' require 'net/http' url = URI("https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/responses") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Assistant-Name"] = 'acmecorp-conversations-rest-api' request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"input\": {\n \"text\": \"Who does John Doe report to?\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Responses_createResponse_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/responses") .header("Assistant-Name", "acmecorp-conversations-rest-api") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"input\": {\n \"text\": \"Who does John Doe report to?\"\n }\n}") .asString(); ``` ```php Responses_createResponse_example request('POST', 'https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/responses', [ 'body' => '{ "input": { "text": "Who does John Doe report to?" } }', 'headers' => [ 'Assistant-Name' => 'acmecorp-conversations-rest-api', 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Responses_createResponse_example using RestSharp; var client = new RestClient("https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/responses"); var request = new RestRequest(Method.POST); request.AddHeader("Assistant-Name", "acmecorp-conversations-rest-api"); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"input\": {\n \"text\": \"Who does John Doe report to?\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Responses_createResponse_example import Foundation let headers = [ "Assistant-Name": "acmecorp-conversations-rest-api", "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["input": ["text": "Who does John Doe report to?"]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/responses")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```