Create Session From Extraction
curl --request POST \
--url https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"session_id": "<string>",
"dataset_id": "<string>",
"leads_count": 123,
"status": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}user-extractions
Create Session From Extraction
Create an enrichment session from a saved extraction.
This endpoint converts an extraction (stored as JSON in Supabase storage) into a new enrichment session with associated dataset and dataset_rows.
Flow:
- Fetch user_extractions record (validate ownership)
- Download JSON from extraction-files bucket using storage_path
- Parse JSON array of lead objects
- Create processing_sessions record (pipeline_type=“enrichment”)
- Create datasets record (source_type=“extraction”)
- Create dataset_rows records (one per lead)
- Update user_extractions.session_id to link them
- Return session details
Args: extraction_id: The ID of the extraction to convert current_user: Authenticated user information cache: Redis cache instance settings: Application settings
Returns: CreateSessionResponse with session_id and metadata
Raises: HTTPException: If extraction not found, access denied, or processing fails
POST
/
api
/
v1
/
user-extractions
/
{extraction_id}
/
create-session
Create Session From Extraction
curl --request POST \
--url https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/user-extractions/{extraction_id}/create-session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"session_id": "<string>",
"dataset_id": "<string>",
"leads_count": 123,
"status": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
⌘I