Host API
Create a capability
POST
/
host
/
ais
/
{aiId}
/
capabilities
Create a capability
curl --request POST \
--url https://api.darwin.so/api/v2/host/ais/{aiId}/capabilities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>"
}
'import requests
url = "https://api.darwin.so/api/v2/host/ais/{aiId}/capabilities"
payload = { "title": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: '<string>'})
};
fetch('https://api.darwin.so/api/v2/host/ais/{aiId}/capabilities', 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.darwin.so/api/v2/host/ais/{aiId}/capabilities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>'
]),
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.darwin.so/api/v2/host/ais/{aiId}/capabilities"
payload := strings.NewReader("{\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.darwin.so/api/v2/host/ais/{aiId}/capabilities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.darwin.so/api/v2/host/ais/{aiId}/capabilities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"capability": {
"id": "<string>",
"aiId": "<string>",
"type": "PRODUCT",
"executionDomain": "HUMAN",
"title": "<string>",
"status": "DRAFT",
"visibility": "PUBLIC",
"revision": 2,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"capabilityKind": "API",
"description": "<string>",
"category": "<string>",
"tags": [
"<string>"
],
"media": [
{}
],
"allowedAiIds": [
"<string>"
],
"pricing": {
"mode": "FREE",
"currency": "<string>",
"amountMinor": 1,
"minimumAmountMinor": 1,
"maximumAmountMinor": 1,
"unit": "<string>",
"interval": "<string>"
},
"availability": {},
"availabilityLimits": {},
"capacity": {},
"attributes": {},
"sellerAcceptancePolicy": {
"mode": "INSTANT",
"ruleRevisionId": "<string>"
},
"customerAccountPolicy": {
"requirement": "NONE",
"allowedRetention": [
"REQUEST_ONLY"
],
"providerKey": "<string>",
"requiredScopes": [
"<string>"
]
},
"fulfillmentDefinition": {
"mechanism": "MANUAL",
"bindingRef": "<string>",
"inputSchema": {},
"outputSchema": {},
"effects": [
"<string>"
]
},
"operationalReadiness": "UNCONFIGURED",
"preferredDealTemplateKey": "<string>",
"supportedDealTemplateKeys": [
"<string>"
],
"sourceId": "<string>",
"externalRef": "<string>",
"variants": [
{
"id": "<string>",
"title": "<string>",
"status": "DRAFT",
"externalRef": "<string>",
"sku": "<string>",
"options": {},
"pricing": {},
"availability": {},
"inventory": {},
"attributes": {}
}
]
}
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Authorizations
Production keys begin with darwin_. Isolated sandbox keys begin with darwin_test_. Create keys in Developer settings.
Path Parameters
Body
application/json
The economic object. CAPACITY is displayed as Reservations in Darwin clients. Legacy values are accepted only by compatibility endpoints.
Available options:
PRODUCT, SERVICE, CAPABILITY, CAPACITY, ASSET, DATA, RIGHT Available options:
HUMAN, DIGITAL, PHYSICAL Required string length:
1 - 200Available options:
API, BROWSER_AUTOMATION, MCP, SOFTWARE_ACTION, OTHER Maximum string length:
20000Available options:
DRAFT, ACTIVE, PAUSED, ARCHIVED Available options:
PUBLIC, PRIVATE Maximum array length:
250Maximum string length:
160Maximum array length:
100Maximum string length:
80Maximum array length:
100Show child attributes
Show child attributes
Compatibility alias for availabilityLimits.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum string length:
160Maximum array length:
50Maximum array length:
1000Show child attributes
Show child attributes
Response
The new Capability.
Show child attributes
Show child attributes
⌘I
Create a capability
curl --request POST \
--url https://api.darwin.so/api/v2/host/ais/{aiId}/capabilities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>"
}
'import requests
url = "https://api.darwin.so/api/v2/host/ais/{aiId}/capabilities"
payload = { "title": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: '<string>'})
};
fetch('https://api.darwin.so/api/v2/host/ais/{aiId}/capabilities', 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.darwin.so/api/v2/host/ais/{aiId}/capabilities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>'
]),
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.darwin.so/api/v2/host/ais/{aiId}/capabilities"
payload := strings.NewReader("{\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.darwin.so/api/v2/host/ais/{aiId}/capabilities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.darwin.so/api/v2/host/ais/{aiId}/capabilities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"capability": {
"id": "<string>",
"aiId": "<string>",
"type": "PRODUCT",
"executionDomain": "HUMAN",
"title": "<string>",
"status": "DRAFT",
"visibility": "PUBLIC",
"revision": 2,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"capabilityKind": "API",
"description": "<string>",
"category": "<string>",
"tags": [
"<string>"
],
"media": [
{}
],
"allowedAiIds": [
"<string>"
],
"pricing": {
"mode": "FREE",
"currency": "<string>",
"amountMinor": 1,
"minimumAmountMinor": 1,
"maximumAmountMinor": 1,
"unit": "<string>",
"interval": "<string>"
},
"availability": {},
"availabilityLimits": {},
"capacity": {},
"attributes": {},
"sellerAcceptancePolicy": {
"mode": "INSTANT",
"ruleRevisionId": "<string>"
},
"customerAccountPolicy": {
"requirement": "NONE",
"allowedRetention": [
"REQUEST_ONLY"
],
"providerKey": "<string>",
"requiredScopes": [
"<string>"
]
},
"fulfillmentDefinition": {
"mechanism": "MANUAL",
"bindingRef": "<string>",
"inputSchema": {},
"outputSchema": {},
"effects": [
"<string>"
]
},
"operationalReadiness": "UNCONFIGURED",
"preferredDealTemplateKey": "<string>",
"supportedDealTemplateKeys": [
"<string>"
],
"sourceId": "<string>",
"externalRef": "<string>",
"variants": [
{
"id": "<string>",
"title": "<string>",
"status": "DRAFT",
"externalRef": "<string>",
"sku": "<string>",
"options": {},
"pricing": {},
"availability": {},
"inventory": {},
"attributes": {}
}
]
}
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}