post__conversation
⚠️ TEST ENVIRONMENT ONLY
POST /conversation
Create Conversation
Create a new AI conversation associated with a repository. Conversations are the context containers for AI interactions, allowing users to have multi-turn conversations with AI models through the Flashback platform.
Key Features:
Creates a new conversation context for AI interactions
Associates conversation with a specific repository
Automatically inherits workspace and organization from the repository
Tracks conversation metadata and token usage
System events are logged for audit purposes
Important Notes:
Users must have access to the repository's workspace to create conversations
The repository must belong to a workspace (cannot be orphaned)
Each conversation is tied to a single repository
Conversations are soft-deleted (marked as deleted but not physically removed)
Security:
Access is validated against workspace permissions
Only users with workspace read access can create conversations
Conversation creation triggers system events for audit trails
TypeScript Client Library
public createConversation = async (data: CreateConversationRequest): Promise<CreateConversationResponse> => {
return this.makeRequest<CreateConversationResponse>('conversation', 'POST', data);
};Code Samples
# You can also use wget
curl -X POST https://backend.flashback.tech/conversation \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'POST https://backend.flashback.tech/conversation HTTP/1.1
Host: backend.flashback.tech
Content-Type: application/json
Accept: application/jsonconst inputBody = '{
"repoId": "repo-123"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://backend.flashback.tech/conversation',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://backend.flashback.tech/conversation',
params: {
}, headers: headers
p JSON.parse(result)import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://backend.flashback.tech/conversation', headers = headers)
print(r.json())<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://backend.flashback.tech/conversation', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...URL obj = new URL("https://backend.flashback.tech/conversation");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://backend.flashback.tech/conversation", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}Body parameter
{
"repoId": "repo-123"
}Parameters
body
body
object
true
none
» repoId
body
string
true
Unique identifier of the repository
Example responses
200 Response
{
"success": true,
"conversationId": "550e8400-e29b-41d4-a716-446655440000"
}Responses
Response Schema
Status Code 200
» success
boolean
false
none
Operation success status
» conversationId
string
false
none
Unique identifier for the created conversation
Status Code 400
» success
boolean
false
none
none
» message
string
false
none
Error message
Status Code 403
» success
boolean
false
none
none
» message
string
false
none
Error message
Status Code 404
» success
boolean
false
none
none
» message
string
false
none
Error message
Status Code 500
» success
boolean
false
none
none
» message
string
false
none
Error message
To perform this operation, you must be authenticated by means of one of the following methods: BearerAuth
Last updated
Was this helpful?