Skills
Create a skill
Creates a skill in a project. You can create a skill from the fields in the request body or from a built-in skill. If the project already has a skill from the same built-in skill, the API returns that skill unchanged.
POST
/
skills
Create a skill
curl --request POST \
--url https://api-trial.cognigy.ai/v1/skills \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"projectId": "<string>",
"builtinSlug": "my-skill-slug",
"bundledTools": [
"<string>"
],
"compatibility": "<string>",
"description": "<string>",
"instructions": "<string>",
"license": "<string>",
"metadata": {},
"name": "<string>",
"resources": [
{
"content": "<string>",
"path": "<string>",
"contentType": "<string>"
}
],
"source": "user"
}
'import requests
url = "https://api-trial.cognigy.ai/v1/skills"
payload = {
"projectId": "<string>",
"builtinSlug": "my-skill-slug",
"bundledTools": ["<string>"],
"compatibility": "<string>",
"description": "<string>",
"instructions": "<string>",
"license": "<string>",
"metadata": {},
"name": "<string>",
"resources": [
{
"content": "<string>",
"path": "<string>",
"contentType": "<string>"
}
],
"source": "user"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
projectId: '<string>',
builtinSlug: 'my-skill-slug',
bundledTools: ['<string>'],
compatibility: '<string>',
description: '<string>',
instructions: '<string>',
license: '<string>',
metadata: {},
name: '<string>',
resources: [{content: '<string>', path: '<string>', contentType: '<string>'}],
source: 'user'
})
};
fetch('https://api-trial.cognigy.ai/v1/skills', 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-trial.cognigy.ai/v1/skills",
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([
'projectId' => '<string>',
'builtinSlug' => 'my-skill-slug',
'bundledTools' => [
'<string>'
],
'compatibility' => '<string>',
'description' => '<string>',
'instructions' => '<string>',
'license' => '<string>',
'metadata' => [
],
'name' => '<string>',
'resources' => [
[
'content' => '<string>',
'path' => '<string>',
'contentType' => '<string>'
]
],
'source' => 'user'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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-trial.cognigy.ai/v1/skills"
payload := strings.NewReader("{\n \"projectId\": \"<string>\",\n \"builtinSlug\": \"my-skill-slug\",\n \"bundledTools\": [\n \"<string>\"\n ],\n \"compatibility\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"license\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"resources\": [\n {\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"source\": \"user\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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-trial.cognigy.ai/v1/skills")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"<string>\",\n \"builtinSlug\": \"my-skill-slug\",\n \"bundledTools\": [\n \"<string>\"\n ],\n \"compatibility\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"license\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"resources\": [\n {\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"source\": \"user\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-trial.cognigy.ai/v1/skills")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"<string>\",\n \"builtinSlug\": \"my-skill-slug\",\n \"bundledTools\": [\n \"<string>\"\n ],\n \"compatibility\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"license\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"resources\": [\n {\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"source\": \"user\"\n}"
response = http.request(request)
puts response.read_body{
"builtinSlug": "<string>",
"bundledTools": [
"<string>"
],
"compatibility": "<string>",
"createdAt": 123,
"createdBy": "507f1f77bcf86cd799439011",
"description": "<string>",
"id": "507f1f77bcf86cd799439011",
"instructions": "<string>",
"lastChangedAt": 123,
"lastChangedBy": "507f1f77bcf86cd799439011",
"license": "<string>",
"metadata": {},
"name": "<string>",
"organisationId": "507f1f77bcf86cd799439011",
"projectId": "507f1f77bcf86cd799439011",
"referenceId": "<string>",
"resources": [
{
"content": "<string>",
"contentType": "<string>",
"encoding": "utf-8",
"path": "<string>"
}
],
"source": "user"
}{
"code": "reserved_tool_name",
"detail": "request body validation failed",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"instance": "/v1/{resource}",
"status": 400,
"title": "Bad Request",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "access denied: insufficient permissions",
"instance": "/v1/{resource}/{id}",
"status": 403,
"title": "Forbidden",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "a resource with this identifier already exists",
"instance": "/v1/{resource}",
"status": 409,
"title": "Conflict",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "internal server error",
"instance": "/v1/{resource}",
"status": 500,
"title": "Internal Server Error",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}Body
application/json
The skill to create.
The way the skill is created. The allowed values are user and
builtin. If you omit it or set it to user, the skill is created from
the fields in the request body. If you set it to builtin, the skill is
created from the built-in skill that builtinSlug identifies, and the API
ignores the name, description, instructions, and other values in the body.
Available options:
user, builtin Example:
"user"
Response
Returns the created skill.
⌘I
Create a skill
curl --request POST \
--url https://api-trial.cognigy.ai/v1/skills \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"projectId": "<string>",
"builtinSlug": "my-skill-slug",
"bundledTools": [
"<string>"
],
"compatibility": "<string>",
"description": "<string>",
"instructions": "<string>",
"license": "<string>",
"metadata": {},
"name": "<string>",
"resources": [
{
"content": "<string>",
"path": "<string>",
"contentType": "<string>"
}
],
"source": "user"
}
'import requests
url = "https://api-trial.cognigy.ai/v1/skills"
payload = {
"projectId": "<string>",
"builtinSlug": "my-skill-slug",
"bundledTools": ["<string>"],
"compatibility": "<string>",
"description": "<string>",
"instructions": "<string>",
"license": "<string>",
"metadata": {},
"name": "<string>",
"resources": [
{
"content": "<string>",
"path": "<string>",
"contentType": "<string>"
}
],
"source": "user"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
projectId: '<string>',
builtinSlug: 'my-skill-slug',
bundledTools: ['<string>'],
compatibility: '<string>',
description: '<string>',
instructions: '<string>',
license: '<string>',
metadata: {},
name: '<string>',
resources: [{content: '<string>', path: '<string>', contentType: '<string>'}],
source: 'user'
})
};
fetch('https://api-trial.cognigy.ai/v1/skills', 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-trial.cognigy.ai/v1/skills",
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([
'projectId' => '<string>',
'builtinSlug' => 'my-skill-slug',
'bundledTools' => [
'<string>'
],
'compatibility' => '<string>',
'description' => '<string>',
'instructions' => '<string>',
'license' => '<string>',
'metadata' => [
],
'name' => '<string>',
'resources' => [
[
'content' => '<string>',
'path' => '<string>',
'contentType' => '<string>'
]
],
'source' => 'user'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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-trial.cognigy.ai/v1/skills"
payload := strings.NewReader("{\n \"projectId\": \"<string>\",\n \"builtinSlug\": \"my-skill-slug\",\n \"bundledTools\": [\n \"<string>\"\n ],\n \"compatibility\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"license\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"resources\": [\n {\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"source\": \"user\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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-trial.cognigy.ai/v1/skills")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"<string>\",\n \"builtinSlug\": \"my-skill-slug\",\n \"bundledTools\": [\n \"<string>\"\n ],\n \"compatibility\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"license\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"resources\": [\n {\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"source\": \"user\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-trial.cognigy.ai/v1/skills")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"<string>\",\n \"builtinSlug\": \"my-skill-slug\",\n \"bundledTools\": [\n \"<string>\"\n ],\n \"compatibility\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"license\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"resources\": [\n {\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"source\": \"user\"\n}"
response = http.request(request)
puts response.read_body{
"builtinSlug": "<string>",
"bundledTools": [
"<string>"
],
"compatibility": "<string>",
"createdAt": 123,
"createdBy": "507f1f77bcf86cd799439011",
"description": "<string>",
"id": "507f1f77bcf86cd799439011",
"instructions": "<string>",
"lastChangedAt": 123,
"lastChangedBy": "507f1f77bcf86cd799439011",
"license": "<string>",
"metadata": {},
"name": "<string>",
"organisationId": "507f1f77bcf86cd799439011",
"projectId": "507f1f77bcf86cd799439011",
"referenceId": "<string>",
"resources": [
{
"content": "<string>",
"contentType": "<string>",
"encoding": "utf-8",
"path": "<string>"
}
],
"source": "user"
}{
"code": "reserved_tool_name",
"detail": "request body validation failed",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"instance": "/v1/{resource}",
"status": 400,
"title": "Bad Request",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "access denied: insufficient permissions",
"instance": "/v1/{resource}/{id}",
"status": 403,
"title": "Forbidden",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "a resource with this identifier already exists",
"instance": "/v1/{resource}",
"status": 409,
"title": "Conflict",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "internal server error",
"instance": "/v1/{resource}",
"status": 500,
"title": "Internal Server Error",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}