Python
import os
from profound import Profound
client = Profound(
api_key=os.environ.get("PROFOUND_API_KEY"),
)
category = client.organizations.categories.create_prompts(
category_id="7c9e6679-7425-40de-944b-e07fc1f90ae7",
prompts=[
{"prompt": "x", "topic": {}, "language": "", "tags": [], "regions": [{}], "platforms": [{}], "personas": []}
],
dry_run=False,
)
print(category)import Profound from '@profoundai/client';
const client = new Profound({
apiKey: process.env['PROFOUND_API_KEY'], // defaults to the PROFOUND_API_KEY env var
environment: 'production',
});
const category = await client.organizations.categories.createPrompts('7c9e6679-7425-40de-944b-e07fc1f90ae7', {
prompts: [
{
prompt: 'x',
topic: {},
language: '',
tags: [],
regions: [{}],
platforms: [{}],
personas: [],
},
],
dry_run: false,
});
console.log(category);use profound::*;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = ProfoundClient::builder()
.api_key(std::env::var("PROFOUND_API_KEY")?)
.build()?;
let response = client
.organizations()
.categories()
.create_prompts(
"7c9e6679-7425-40de-944b-e07fc1f90ae7",
CreatePromptsBody {
prompts: vec![CreatePromptInput {
id: None,
prompt: "x".to_string(),
topic: IdOrName { id: None, name: None },
language: "".to_string(),
tags: None,
regions: vec![IdOrName { id: None, name: None }],
platforms: vec![IdOrName { id: None, name: None }],
personas: None,
analysis_types: None,
prompt_type: None,
asset: None,
}],
dry_run: None,
},
)
.send()
.await?;
println!("{:?}", response);
Ok(())
}curl --request POST \
--url https://api.tryprofound.com/v1/org/categories/{category_id}/prompts \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"prompts": [
{
"prompt": "<string>",
"topic": {
"id": "<string>",
"name": "<string>"
},
"language": "<string>",
"regions": [
{
"id": "<string>",
"name": "<string>"
}
],
"platforms": [
{
"id": "<string>",
"name": "<string>"
}
],
"id": "<string>",
"tags": [],
"personas": [],
"analysis_types": [],
"prompt_type": "<string>",
"asset": {
"id": "<string>",
"name": "<string>"
}
}
],
"dry_run": false
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompts: [
{
prompt: '<string>',
topic: {id: '<string>', name: '<string>'},
language: '<string>',
regions: [{id: '<string>', name: '<string>'}],
platforms: [{id: '<string>', name: '<string>'}],
id: '<string>',
tags: [],
personas: [],
analysis_types: [],
prompt_type: '<string>',
asset: {id: '<string>', name: '<string>'}
}
],
dry_run: false
})
};
fetch('https://api.tryprofound.com/v1/org/categories/{category_id}/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.tryprofound.com/v1/org/categories/{category_id}/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([
'prompts' => [
[
'prompt' => '<string>',
'topic' => [
'id' => '<string>',
'name' => '<string>'
],
'language' => '<string>',
'regions' => [
[
'id' => '<string>',
'name' => '<string>'
]
],
'platforms' => [
[
'id' => '<string>',
'name' => '<string>'
]
],
'id' => '<string>',
'tags' => [
],
'personas' => [
],
'analysis_types' => [
],
'prompt_type' => '<string>',
'asset' => [
'id' => '<string>',
'name' => '<string>'
]
]
],
'dry_run' => false
]),
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.tryprofound.com/v1/org/categories/{category_id}/prompts"
payload := strings.NewReader("{\n \"prompts\": [\n {\n \"prompt\": \"<string>\",\n \"topic\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"language\": \"<string>\",\n \"regions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"platforms\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"tags\": [],\n \"personas\": [],\n \"analysis_types\": [],\n \"prompt_type\": \"<string>\",\n \"asset\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n }\n ],\n \"dry_run\": false\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.tryprofound.com/v1/org/categories/{category_id}/prompts")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompts\": [\n {\n \"prompt\": \"<string>\",\n \"topic\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"language\": \"<string>\",\n \"regions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"platforms\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"tags\": [],\n \"personas\": [],\n \"analysis_types\": [],\n \"prompt_type\": \"<string>\",\n \"asset\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n }\n ],\n \"dry_run\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryprofound.com/v1/org/categories/{category_id}/prompts")
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 \"prompts\": [\n {\n \"prompt\": \"<string>\",\n \"topic\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"language\": \"<string>\",\n \"regions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"platforms\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"tags\": [],\n \"personas\": [],\n \"analysis_types\": [],\n \"prompt_type\": \"<string>\",\n \"asset\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n }\n ],\n \"dry_run\": false\n}"
response = http.request(request)
puts response.read_body{
"dry_run": true,
"created": 0,
"topics_created": 0,
"tags_created": 0,
"prompts": []
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Prompts
Create prompts
Create one or more prompts in a category. Topics and tags are auto-created if referenced by name and not yet existing. Use dry_run to preview without persisting.
POST
/
v1
/
org
/
categories
/
{category_id}
/
prompts
Python
import os
from profound import Profound
client = Profound(
api_key=os.environ.get("PROFOUND_API_KEY"),
)
category = client.organizations.categories.create_prompts(
category_id="7c9e6679-7425-40de-944b-e07fc1f90ae7",
prompts=[
{"prompt": "x", "topic": {}, "language": "", "tags": [], "regions": [{}], "platforms": [{}], "personas": []}
],
dry_run=False,
)
print(category)import Profound from '@profoundai/client';
const client = new Profound({
apiKey: process.env['PROFOUND_API_KEY'], // defaults to the PROFOUND_API_KEY env var
environment: 'production',
});
const category = await client.organizations.categories.createPrompts('7c9e6679-7425-40de-944b-e07fc1f90ae7', {
prompts: [
{
prompt: 'x',
topic: {},
language: '',
tags: [],
regions: [{}],
platforms: [{}],
personas: [],
},
],
dry_run: false,
});
console.log(category);use profound::*;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = ProfoundClient::builder()
.api_key(std::env::var("PROFOUND_API_KEY")?)
.build()?;
let response = client
.organizations()
.categories()
.create_prompts(
"7c9e6679-7425-40de-944b-e07fc1f90ae7",
CreatePromptsBody {
prompts: vec![CreatePromptInput {
id: None,
prompt: "x".to_string(),
topic: IdOrName { id: None, name: None },
language: "".to_string(),
tags: None,
regions: vec![IdOrName { id: None, name: None }],
platforms: vec![IdOrName { id: None, name: None }],
personas: None,
analysis_types: None,
prompt_type: None,
asset: None,
}],
dry_run: None,
},
)
.send()
.await?;
println!("{:?}", response);
Ok(())
}curl --request POST \
--url https://api.tryprofound.com/v1/org/categories/{category_id}/prompts \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"prompts": [
{
"prompt": "<string>",
"topic": {
"id": "<string>",
"name": "<string>"
},
"language": "<string>",
"regions": [
{
"id": "<string>",
"name": "<string>"
}
],
"platforms": [
{
"id": "<string>",
"name": "<string>"
}
],
"id": "<string>",
"tags": [],
"personas": [],
"analysis_types": [],
"prompt_type": "<string>",
"asset": {
"id": "<string>",
"name": "<string>"
}
}
],
"dry_run": false
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompts: [
{
prompt: '<string>',
topic: {id: '<string>', name: '<string>'},
language: '<string>',
regions: [{id: '<string>', name: '<string>'}],
platforms: [{id: '<string>', name: '<string>'}],
id: '<string>',
tags: [],
personas: [],
analysis_types: [],
prompt_type: '<string>',
asset: {id: '<string>', name: '<string>'}
}
],
dry_run: false
})
};
fetch('https://api.tryprofound.com/v1/org/categories/{category_id}/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.tryprofound.com/v1/org/categories/{category_id}/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([
'prompts' => [
[
'prompt' => '<string>',
'topic' => [
'id' => '<string>',
'name' => '<string>'
],
'language' => '<string>',
'regions' => [
[
'id' => '<string>',
'name' => '<string>'
]
],
'platforms' => [
[
'id' => '<string>',
'name' => '<string>'
]
],
'id' => '<string>',
'tags' => [
],
'personas' => [
],
'analysis_types' => [
],
'prompt_type' => '<string>',
'asset' => [
'id' => '<string>',
'name' => '<string>'
]
]
],
'dry_run' => false
]),
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.tryprofound.com/v1/org/categories/{category_id}/prompts"
payload := strings.NewReader("{\n \"prompts\": [\n {\n \"prompt\": \"<string>\",\n \"topic\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"language\": \"<string>\",\n \"regions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"platforms\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"tags\": [],\n \"personas\": [],\n \"analysis_types\": [],\n \"prompt_type\": \"<string>\",\n \"asset\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n }\n ],\n \"dry_run\": false\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.tryprofound.com/v1/org/categories/{category_id}/prompts")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompts\": [\n {\n \"prompt\": \"<string>\",\n \"topic\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"language\": \"<string>\",\n \"regions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"platforms\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"tags\": [],\n \"personas\": [],\n \"analysis_types\": [],\n \"prompt_type\": \"<string>\",\n \"asset\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n }\n ],\n \"dry_run\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryprofound.com/v1/org/categories/{category_id}/prompts")
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 \"prompts\": [\n {\n \"prompt\": \"<string>\",\n \"topic\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"language\": \"<string>\",\n \"regions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"platforms\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"tags\": [],\n \"personas\": [],\n \"analysis_types\": [],\n \"prompt_type\": \"<string>\",\n \"asset\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n }\n ],\n \"dry_run\": false\n}"
response = http.request(request)
puts response.read_body{
"dry_run": true,
"created": 0,
"topics_created": 0,
"tags_created": 0,
"prompts": []
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
APIKeyHeaderBearerAuth
Path Parameters
Body
application/json
Response
Successful Response
Response from creating prompts.
Whether this was a dry run (no changes persisted).
Number of prompts created.
Number of new topics created.
Number of new tags created.
List of created (or previewed) prompts with resolved references.
Show child attributes
Show child attributes
Was this page helpful?