Create Prompt
Create a new prompt in a project.
curl --request POST \
--url https://api.adaline.ai/v2/prompts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "<string>",
"title": "<string>",
"draft": {
"config": {
"provider": "<string>",
"model": "<string>",
"settings": {}
},
"messages": [
{
"content": [
{
"modality": "text",
"value": "<string>"
}
]
}
],
"tools": [
{
"type": "function",
"definition": {
"schema": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true
}
},
"request": {
"type": "http",
"url": "<string>",
"headers": {},
"query": {},
"body": {},
"proxyUrl": "<string>",
"proxyHeaders": {},
"retry": {
"maxAttempts": 2,
"initialDelay": 2,
"exponentialFactor": 2
}
}
}
]
}
}
'import requests
url = "https://api.adaline.ai/v2/prompts"
payload = {
"projectId": "<string>",
"title": "<string>",
"draft": {
"config": {
"provider": "<string>",
"model": "<string>",
"settings": {}
},
"messages": [{ "content": [
{
"modality": "text",
"value": "<string>"
}
] }],
"tools": [
{
"type": "function",
"definition": { "schema": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": True
} },
"request": {
"type": "http",
"url": "<string>",
"headers": {},
"query": {},
"body": {},
"proxyUrl": "<string>",
"proxyHeaders": {},
"retry": {
"maxAttempts": 2,
"initialDelay": 2,
"exponentialFactor": 2
}
}
}
]
}
}
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({
projectId: '<string>',
title: '<string>',
draft: {
config: {provider: '<string>', model: '<string>', settings: {}},
messages: [{content: [{modality: 'text', value: '<string>'}]}],
tools: [
{
type: 'function',
definition: {
schema: {name: '<string>', description: '<string>', parameters: {}, strict: true}
},
request: {
type: 'http',
url: '<string>',
headers: {},
query: {},
body: JSON.stringify({}),
proxyUrl: '<string>',
proxyHeaders: {},
retry: {maxAttempts: 2, initialDelay: 2, exponentialFactor: 2}
}
}
]
}
})
};
fetch('https://api.adaline.ai/v2/prompts', 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.adaline.ai/v2/prompts",
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>',
'title' => '<string>',
'draft' => [
'config' => [
'provider' => '<string>',
'model' => '<string>',
'settings' => [
]
],
'messages' => [
[
'content' => [
[
'modality' => 'text',
'value' => '<string>'
]
]
]
],
'tools' => [
[
'type' => 'function',
'definition' => [
'schema' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => true
]
],
'request' => [
'type' => 'http',
'url' => '<string>',
'headers' => [
],
'query' => [
],
'body' => [
],
'proxyUrl' => '<string>',
'proxyHeaders' => [
],
'retry' => [
'maxAttempts' => 2,
'initialDelay' => 2,
'exponentialFactor' => 2
]
]
]
]
]
]),
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.adaline.ai/v2/prompts"
payload := strings.NewReader("{\n \"projectId\": \"<string>\",\n \"title\": \"<string>\",\n \"draft\": {\n \"config\": {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"settings\": {}\n },\n \"messages\": [\n {\n \"content\": [\n {\n \"modality\": \"text\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"definition\": {\n \"schema\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n }\n },\n \"request\": {\n \"type\": \"http\",\n \"url\": \"<string>\",\n \"headers\": {},\n \"query\": {},\n \"body\": {},\n \"proxyUrl\": \"<string>\",\n \"proxyHeaders\": {},\n \"retry\": {\n \"maxAttempts\": 2,\n \"initialDelay\": 2,\n \"exponentialFactor\": 2\n }\n }\n }\n ]\n }\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.adaline.ai/v2/prompts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"<string>\",\n \"title\": \"<string>\",\n \"draft\": {\n \"config\": {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"settings\": {}\n },\n \"messages\": [\n {\n \"content\": [\n {\n \"modality\": \"text\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"definition\": {\n \"schema\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n }\n },\n \"request\": {\n \"type\": \"http\",\n \"url\": \"<string>\",\n \"headers\": {},\n \"query\": {},\n \"body\": {},\n \"proxyUrl\": \"<string>\",\n \"proxyHeaders\": {},\n \"retry\": {\n \"maxAttempts\": 2,\n \"initialDelay\": 2,\n \"exponentialFactor\": 2\n }\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.adaline.ai/v2/prompts")
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 \"projectId\": \"<string>\",\n \"title\": \"<string>\",\n \"draft\": {\n \"config\": {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"settings\": {}\n },\n \"messages\": [\n {\n \"content\": [\n {\n \"modality\": \"text\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"definition\": {\n \"schema\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n }\n },\n \"request\": {\n \"type\": \"http\",\n \"url\": \"<string>\",\n \"headers\": {},\n \"query\": {},\n \"body\": {},\n \"proxyUrl\": \"<string>\",\n \"proxyHeaders\": {},\n \"retry\": {\n \"maxAttempts\": 2,\n \"initialDelay\": 2,\n \"exponentialFactor\": 2\n }\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"title": "<string>",
"icon": {
"value": "<string>"
},
"projectId": "<string>",
"createdAt": 17450965800000,
"updatedAt": 17450965800000,
"defaultPlaygroundId": "<string>",
"draft": {
"config": {
"provider": "<string>",
"model": "<string>",
"settings": {}
},
"messages": [
{
"content": [
{
"modality": "text",
"value": "<string>"
}
]
}
],
"tools": [
{
"type": "function",
"definition": {
"schema": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true
}
},
"request": {
"type": "http",
"url": "<string>",
"headers": {},
"query": {},
"body": {},
"proxyUrl": "<string>",
"proxyHeaders": {},
"retry": {
"maxAttempts": 2,
"initialDelay": 2,
"exponentialFactor": 2
}
}
}
],
"variables": {}
},
"contentLinks": {},
"defaultPlayground": {
"id": "<string>",
"messages": [
{
"content": [
{
"modality": "text",
"value": "<string>"
}
]
}
],
"variables": {},
"title": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Workspace API key. Pass as Authorization: Bearer <key>.
Body
Unique identifier for an entity, between 20 and 80 characters.
20 - 80Display title for an entity, up to 50 characters.
1 - 50Icon for an entity, either an emoji or an image URL. Discriminated by type.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Prompt created.
A complete prompt with draft, playground, and published versions.
Unique identifier for an entity, between 20 and 80 characters.
20 - 80Display title for an entity, up to 50 characters.
1 - 50Icon for an entity, either an emoji or an image URL. Discriminated by type.
Show child attributes
Show child attributes
Unique identifier for an entity, between 20 and 80 characters.
20 - 80Unix timestamp in milliseconds.
1672511400000 <= x <= 33229420200000Unix timestamp in milliseconds.
1672511400000 <= x <= 33229420200000Unique identifier for an entity, between 20 and 80 characters.
20 - 80A draft version of a prompt with config, messages, tools, and variables.
Show child attributes
Show child attributes
Map of content links (base64 content -> signed URL).
Show child attributes
Show child attributes
A prompt playground configuration with model settings and messages.
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.adaline.ai/v2/prompts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "<string>",
"title": "<string>",
"draft": {
"config": {
"provider": "<string>",
"model": "<string>",
"settings": {}
},
"messages": [
{
"content": [
{
"modality": "text",
"value": "<string>"
}
]
}
],
"tools": [
{
"type": "function",
"definition": {
"schema": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true
}
},
"request": {
"type": "http",
"url": "<string>",
"headers": {},
"query": {},
"body": {},
"proxyUrl": "<string>",
"proxyHeaders": {},
"retry": {
"maxAttempts": 2,
"initialDelay": 2,
"exponentialFactor": 2
}
}
}
]
}
}
'import requests
url = "https://api.adaline.ai/v2/prompts"
payload = {
"projectId": "<string>",
"title": "<string>",
"draft": {
"config": {
"provider": "<string>",
"model": "<string>",
"settings": {}
},
"messages": [{ "content": [
{
"modality": "text",
"value": "<string>"
}
] }],
"tools": [
{
"type": "function",
"definition": { "schema": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": True
} },
"request": {
"type": "http",
"url": "<string>",
"headers": {},
"query": {},
"body": {},
"proxyUrl": "<string>",
"proxyHeaders": {},
"retry": {
"maxAttempts": 2,
"initialDelay": 2,
"exponentialFactor": 2
}
}
}
]
}
}
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({
projectId: '<string>',
title: '<string>',
draft: {
config: {provider: '<string>', model: '<string>', settings: {}},
messages: [{content: [{modality: 'text', value: '<string>'}]}],
tools: [
{
type: 'function',
definition: {
schema: {name: '<string>', description: '<string>', parameters: {}, strict: true}
},
request: {
type: 'http',
url: '<string>',
headers: {},
query: {},
body: JSON.stringify({}),
proxyUrl: '<string>',
proxyHeaders: {},
retry: {maxAttempts: 2, initialDelay: 2, exponentialFactor: 2}
}
}
]
}
})
};
fetch('https://api.adaline.ai/v2/prompts', 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.adaline.ai/v2/prompts",
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>',
'title' => '<string>',
'draft' => [
'config' => [
'provider' => '<string>',
'model' => '<string>',
'settings' => [
]
],
'messages' => [
[
'content' => [
[
'modality' => 'text',
'value' => '<string>'
]
]
]
],
'tools' => [
[
'type' => 'function',
'definition' => [
'schema' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => true
]
],
'request' => [
'type' => 'http',
'url' => '<string>',
'headers' => [
],
'query' => [
],
'body' => [
],
'proxyUrl' => '<string>',
'proxyHeaders' => [
],
'retry' => [
'maxAttempts' => 2,
'initialDelay' => 2,
'exponentialFactor' => 2
]
]
]
]
]
]),
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.adaline.ai/v2/prompts"
payload := strings.NewReader("{\n \"projectId\": \"<string>\",\n \"title\": \"<string>\",\n \"draft\": {\n \"config\": {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"settings\": {}\n },\n \"messages\": [\n {\n \"content\": [\n {\n \"modality\": \"text\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"definition\": {\n \"schema\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n }\n },\n \"request\": {\n \"type\": \"http\",\n \"url\": \"<string>\",\n \"headers\": {},\n \"query\": {},\n \"body\": {},\n \"proxyUrl\": \"<string>\",\n \"proxyHeaders\": {},\n \"retry\": {\n \"maxAttempts\": 2,\n \"initialDelay\": 2,\n \"exponentialFactor\": 2\n }\n }\n }\n ]\n }\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.adaline.ai/v2/prompts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"<string>\",\n \"title\": \"<string>\",\n \"draft\": {\n \"config\": {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"settings\": {}\n },\n \"messages\": [\n {\n \"content\": [\n {\n \"modality\": \"text\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"definition\": {\n \"schema\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n }\n },\n \"request\": {\n \"type\": \"http\",\n \"url\": \"<string>\",\n \"headers\": {},\n \"query\": {},\n \"body\": {},\n \"proxyUrl\": \"<string>\",\n \"proxyHeaders\": {},\n \"retry\": {\n \"maxAttempts\": 2,\n \"initialDelay\": 2,\n \"exponentialFactor\": 2\n }\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.adaline.ai/v2/prompts")
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 \"projectId\": \"<string>\",\n \"title\": \"<string>\",\n \"draft\": {\n \"config\": {\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"settings\": {}\n },\n \"messages\": [\n {\n \"content\": [\n {\n \"modality\": \"text\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"definition\": {\n \"schema\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n }\n },\n \"request\": {\n \"type\": \"http\",\n \"url\": \"<string>\",\n \"headers\": {},\n \"query\": {},\n \"body\": {},\n \"proxyUrl\": \"<string>\",\n \"proxyHeaders\": {},\n \"retry\": {\n \"maxAttempts\": 2,\n \"initialDelay\": 2,\n \"exponentialFactor\": 2\n }\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"title": "<string>",
"icon": {
"value": "<string>"
},
"projectId": "<string>",
"createdAt": 17450965800000,
"updatedAt": 17450965800000,
"defaultPlaygroundId": "<string>",
"draft": {
"config": {
"provider": "<string>",
"model": "<string>",
"settings": {}
},
"messages": [
{
"content": [
{
"modality": "text",
"value": "<string>"
}
]
}
],
"tools": [
{
"type": "function",
"definition": {
"schema": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true
}
},
"request": {
"type": "http",
"url": "<string>",
"headers": {},
"query": {},
"body": {},
"proxyUrl": "<string>",
"proxyHeaders": {},
"retry": {
"maxAttempts": 2,
"initialDelay": 2,
"exponentialFactor": 2
}
}
}
],
"variables": {}
},
"contentLinks": {},
"defaultPlayground": {
"id": "<string>",
"messages": [
{
"content": [
{
"modality": "text",
"value": "<string>"
}
]
}
],
"variables": {},
"title": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}