Update a custom API provider
curl --request PATCH \
--url https://api.paywithlocus.com/api/credits/custom-endpoints/{providerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"baseUrl": "<string>",
"traffic": {
"requestsPerMinute": 30000,
"maxConcurrency": 500,
"timeoutSeconds": 60,
"circuitBreaker": {
"failureThreshold": 51,
"windowSeconds": 300,
"cooldownSeconds": 1800
}
}
}
'import requests
url = "https://api.paywithlocus.com/api/credits/custom-endpoints/{providerId}"
payload = {
"name": "<string>",
"description": "<string>",
"baseUrl": "<string>",
"traffic": {
"requestsPerMinute": 30000,
"maxConcurrency": 500,
"timeoutSeconds": 60,
"circuitBreaker": {
"failureThreshold": 51,
"windowSeconds": 300,
"cooldownSeconds": 1800
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
baseUrl: '<string>',
traffic: {
requestsPerMinute: 30000,
maxConcurrency: 500,
timeoutSeconds: 60,
circuitBreaker: {failureThreshold: 51, windowSeconds: 300, cooldownSeconds: 1800}
}
})
};
fetch('https://api.paywithlocus.com/api/credits/custom-endpoints/{providerId}', 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.paywithlocus.com/api/credits/custom-endpoints/{providerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'baseUrl' => '<string>',
'traffic' => [
'requestsPerMinute' => 30000,
'maxConcurrency' => 500,
'timeoutSeconds' => 60,
'circuitBreaker' => [
'failureThreshold' => 51,
'windowSeconds' => 300,
'cooldownSeconds' => 1800
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paywithlocus.com/api/credits/custom-endpoints/{providerId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"baseUrl\": \"<string>\",\n \"traffic\": {\n \"requestsPerMinute\": 30000,\n \"maxConcurrency\": 500,\n \"timeoutSeconds\": 60,\n \"circuitBreaker\": {\n \"failureThreshold\": 51,\n \"windowSeconds\": 300,\n \"cooldownSeconds\": 1800\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.paywithlocus.com/api/credits/custom-endpoints/{providerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"baseUrl\": \"<string>\",\n \"traffic\": {\n \"requestsPerMinute\": 30000,\n \"maxConcurrency\": 500,\n \"timeoutSeconds\": 60,\n \"circuitBreaker\": {\n \"failureThreshold\": 51,\n \"windowSeconds\": 300,\n \"cooldownSeconds\": 1800\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/custom-endpoints/{providerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"baseUrl\": \"<string>\",\n \"traffic\": {\n \"requestsPerMinute\": 30000,\n \"maxConcurrency\": 500,\n \"timeoutSeconds\": 60,\n \"circuitBreaker\": {\n \"failureThreshold\": 51,\n \"windowSeconds\": 300,\n \"cooldownSeconds\": 1800\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"provider": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"publicProvider": "<string>",
"name": "<string>",
"description": "<string>",
"baseUrl": "<string>",
"auth": {
"type": "bearer",
"name": "<string>",
"prefix": "<string>",
"configured": true,
"hint": "<string>",
"version": 1,
"updatedAt": "2023-11-07T05:31:56Z"
},
"traffic": {
"requestsPerMinute": 30000,
"maxConcurrency": 500,
"timeoutSeconds": 60,
"circuitBreaker": {
"failureThreshold": 51,
"windowSeconds": 300,
"cooldownSeconds": 1800
}
},
"endpoints": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"publicSlug": "<string>",
"name": "<string>",
"description": "<string>",
"method": "GET",
"path": "<string>",
"inputSchema": {},
"inputExample": {},
"outputSchema": {},
"outputExample": "<unknown>",
"providerCostUsdc": "<string>",
"markupBps": 1,
"flatMarkupUsdc": "<string>",
"endUserPriceUsdc": "<string>",
"enabled": true,
"pricingRevision": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Custom APIs
Update a custom API provider
Updates provider presentation, SSRF-checked base URL, authentication, or traffic protection. Supplying a new credential rotates the encrypted secret; type=none removes it. Requires the same enterprise owner, scope, and recent step-up controls as creation.
PATCH
/
credits
/
custom-endpoints
/
{providerId}
Update a custom API provider
curl --request PATCH \
--url https://api.paywithlocus.com/api/credits/custom-endpoints/{providerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"baseUrl": "<string>",
"traffic": {
"requestsPerMinute": 30000,
"maxConcurrency": 500,
"timeoutSeconds": 60,
"circuitBreaker": {
"failureThreshold": 51,
"windowSeconds": 300,
"cooldownSeconds": 1800
}
}
}
'import requests
url = "https://api.paywithlocus.com/api/credits/custom-endpoints/{providerId}"
payload = {
"name": "<string>",
"description": "<string>",
"baseUrl": "<string>",
"traffic": {
"requestsPerMinute": 30000,
"maxConcurrency": 500,
"timeoutSeconds": 60,
"circuitBreaker": {
"failureThreshold": 51,
"windowSeconds": 300,
"cooldownSeconds": 1800
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
baseUrl: '<string>',
traffic: {
requestsPerMinute: 30000,
maxConcurrency: 500,
timeoutSeconds: 60,
circuitBreaker: {failureThreshold: 51, windowSeconds: 300, cooldownSeconds: 1800}
}
})
};
fetch('https://api.paywithlocus.com/api/credits/custom-endpoints/{providerId}', 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.paywithlocus.com/api/credits/custom-endpoints/{providerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'baseUrl' => '<string>',
'traffic' => [
'requestsPerMinute' => 30000,
'maxConcurrency' => 500,
'timeoutSeconds' => 60,
'circuitBreaker' => [
'failureThreshold' => 51,
'windowSeconds' => 300,
'cooldownSeconds' => 1800
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paywithlocus.com/api/credits/custom-endpoints/{providerId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"baseUrl\": \"<string>\",\n \"traffic\": {\n \"requestsPerMinute\": 30000,\n \"maxConcurrency\": 500,\n \"timeoutSeconds\": 60,\n \"circuitBreaker\": {\n \"failureThreshold\": 51,\n \"windowSeconds\": 300,\n \"cooldownSeconds\": 1800\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.paywithlocus.com/api/credits/custom-endpoints/{providerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"baseUrl\": \"<string>\",\n \"traffic\": {\n \"requestsPerMinute\": 30000,\n \"maxConcurrency\": 500,\n \"timeoutSeconds\": 60,\n \"circuitBreaker\": {\n \"failureThreshold\": 51,\n \"windowSeconds\": 300,\n \"cooldownSeconds\": 1800\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/custom-endpoints/{providerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"baseUrl\": \"<string>\",\n \"traffic\": {\n \"requestsPerMinute\": 30000,\n \"maxConcurrency\": 500,\n \"timeoutSeconds\": 60,\n \"circuitBreaker\": {\n \"failureThreshold\": 51,\n \"windowSeconds\": 300,\n \"cooldownSeconds\": 1800\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"provider": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"publicProvider": "<string>",
"name": "<string>",
"description": "<string>",
"baseUrl": "<string>",
"auth": {
"type": "bearer",
"name": "<string>",
"prefix": "<string>",
"configured": true,
"hint": "<string>",
"version": 1,
"updatedAt": "2023-11-07T05:31:56Z"
},
"traffic": {
"requestsPerMinute": 30000,
"maxConcurrency": 500,
"timeoutSeconds": 60,
"circuitBreaker": {
"failureThreshold": 51,
"windowSeconds": 300,
"cooldownSeconds": 1800
}
},
"endpoints": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"publicSlug": "<string>",
"name": "<string>",
"description": "<string>",
"method": "GET",
"path": "<string>",
"inputSchema": {},
"inputExample": {},
"outputSchema": {},
"outputExample": "<unknown>",
"providerCostUsdc": "<string>",
"markupBps": 1,
"flatMarkupUsdc": "<string>",
"endUserPriceUsdc": "<string>",
"enabled": true,
"pricingRevision": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Authorizations
Locus Pro dashboard session (Cognito).
Path Parameters
Workspace-owned custom provider ID. This is distinct from its public custom-{slug} catalog name.
Body
application/json