cURL
curl -X POST 'https://api.gumloop.com/api/v1/brain/sources/jVustMhHWG43CFQBFMckcn/approve' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN'from gumloop import Gumloop
client = Gumloop(access_token="YOUR_ACCESS_TOKEN")
print(client.brain.approve_source("jVustMhHWG43CFQBFMckcn").source.status)
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gumloop.com/api/v1/brain/sources/{source_id}/approve', 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.gumloop.com/api/v1/brain/sources/{source_id}/approve",
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.gumloop.com/api/v1/brain/sources/{source_id}/approve"
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.gumloop.com/api/v1/brain/sources/{source_id}/approve")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gumloop.com/api/v1/brain/sources/{source_id}/approve")
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{
"source": {
"id": "PFqdAMir8PA2Xc6qcszSN9",
"name": "Engineering docs",
"source_type": "direct_file_uploads",
"status": "draft",
"scope": "personal",
"team_id": "<string>",
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}Approve source
Approve a draft source. It becomes active, the paused estimate run resumes as a real indexing run, and credits are charged. Later uploads index without another approval.
POST
/
brain
/
sources
/
{source_id}
/
approve
cURL
curl -X POST 'https://api.gumloop.com/api/v1/brain/sources/jVustMhHWG43CFQBFMckcn/approve' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN'from gumloop import Gumloop
client = Gumloop(access_token="YOUR_ACCESS_TOKEN")
print(client.brain.approve_source("jVustMhHWG43CFQBFMckcn").source.status)
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gumloop.com/api/v1/brain/sources/{source_id}/approve', 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.gumloop.com/api/v1/brain/sources/{source_id}/approve",
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.gumloop.com/api/v1/brain/sources/{source_id}/approve"
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.gumloop.com/api/v1/brain/sources/{source_id}/approve")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gumloop.com/api/v1/brain/sources/{source_id}/approve")
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{
"source": {
"id": "PFqdAMir8PA2Xc6qcszSN9",
"name": "Engineering docs",
"source_type": "direct_file_uploads",
"status": "draft",
"scope": "personal",
"team_id": "<string>",
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}Was this page helpful?
