Dispatch action
Single endpoint that dispatches based on the action field in the body.
Supported actions:
create_workspacecreate_usercreate_jobupdate_jobcreate_talentadd-task-reporting
curl -X POST "https://nufeegfofxlwnvlpvfgn.supabase.co/functions/v1/external-api" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"action": "create_workspace",
"name": "Acme Corp",
"language": "fr",
"departments": [
"Engineering",
"Sales"
]
}'
import requests
import json
url = "https://nufeegfofxlwnvlpvfgn.supabase.co/functions/v1/external-api"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"action": "create_workspace",
"name": "Acme Corp",
"language": "fr",
"departments": [
"Engineering",
"Sales"
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://nufeegfofxlwnvlpvfgn.supabase.co/functions/v1/external-api", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"action": "create_workspace",
"name": "Acme Corp",
"language": "fr",
"departments": [
"Engineering",
"Sales"
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"action": "create_workspace",
"name": "Acme Corp",
"language": "fr",
"departments": [
"Engineering",
"Sales"
]
}`)
req, err := http.NewRequest("POST", "https://nufeegfofxlwnvlpvfgn.supabase.co/functions/v1/external-api", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://nufeegfofxlwnvlpvfgn.supabase.co/functions/v1/external-api')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"action": "create_workspace",
"name": "Acme Corp",
"language": "fr",
"departments": [
"Engineering",
"Sales"
]
}'
response = http.request(request)
puts response.body
{
"success": true,
"data": {}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
{
"error": "Error",
"message": "Method not allowed",
"code": 405
}
{
"error": "Internal Server Error",
"message": "An unexpected error occurred on the server",
"code": 500,
"requestId": "req_1234567890"
}
POST
/external-api
POST
Bearer Token
Bearer Tokenstring
RequiredStatic token configured as EXTERNAL_API_TOKEN server-side.
Static token configured as
EXTERNAL_API_TOKEN server-side.Content-Typestring
RequiredThe media type of the request body
Options: application/json
No request body parameters defined
Request Preview
Response
Response will appear here after sending the request
Authentication
header
Authorizationstring
RequiredBearer token. Static token configured as EXTERNAL_API_TOKEN server-side.
Body
application/json
datastring
RequiredRaw application/json data
Responses
successboolean
RequiredAllowed values:
truedataobject
Requirederrorstring
Requirederrorstring
Requirederrorstring
RequiredMethod not allowed
errorstring
RequiredWas this page helpful?
Last updated today
Built with Documentation.AI