curl --request POST \
--url https://melso.ai/api/secrets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "text",
"name": "OPENAI_API_KEY",
"text": "replace-with-the-key",
"share": "workspace"
}
'import requests
url = "https://melso.ai/api/secrets"
payload = {
"kind": "text",
"name": "OPENAI_API_KEY",
"text": "replace-with-the-key",
"share": "workspace"
}
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({
kind: 'text',
name: 'OPENAI_API_KEY',
text: 'replace-with-the-key',
share: 'workspace'
})
};
fetch('https://melso.ai/api/secrets', 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://melso.ai/api/secrets",
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([
'kind' => 'text',
'name' => 'OPENAI_API_KEY',
'text' => 'replace-with-the-key',
'share' => 'workspace'
]),
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://melso.ai/api/secrets"
payload := strings.NewReader("{\n \"kind\": \"text\",\n \"name\": \"OPENAI_API_KEY\",\n \"text\": \"replace-with-the-key\",\n \"share\": \"workspace\"\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://melso.ai/api/secrets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"text\",\n \"name\": \"OPENAI_API_KEY\",\n \"text\": \"replace-with-the-key\",\n \"share\": \"workspace\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://melso.ai/api/secrets")
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 \"kind\": \"text\",\n \"name\": \"OPENAI_API_KEY\",\n \"text\": \"replace-with-the-key\",\n \"share\": \"workspace\"\n}"
response = http.request(request)
puts response.read_body{
"item": "<unknown>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Create vault item
Workspace member; Run tokens rejected. The caller owns the item.
Request: Exactly one value: text:string (at most 64 KB), login:{url,username,password,totp_secret?}, card:{cardholder?,number,exp_month,exp_year,cvc,billing_address?} or file:{filename,content_base64} (at most 1 MB decoded). Optional kind (must match the value); name (a login or card’s display name, or a text item’s variable name, which env_name can also supply); env_name (required for a file; derived from name for a login or card, such as STRIPE_LOGIN); share and area_ids; replace:boolean to overwrite your item with the same variable name instead of returning 409. totp_secret is the base32 2FA setup key. A new item without share is private; a replaced item keeps its sharing.
Response: {item:VaultItem}
Status: 201; 400 invalid value, name, Area or reserved variable (MELSO_*, HOME, PATH and other runtime keys); 403 Run token; 409 variable already used; 503 vault unavailable. Authentication and resource-access errors follow Overview.
curl --request POST \
--url https://melso.ai/api/secrets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "text",
"name": "OPENAI_API_KEY",
"text": "replace-with-the-key",
"share": "workspace"
}
'import requests
url = "https://melso.ai/api/secrets"
payload = {
"kind": "text",
"name": "OPENAI_API_KEY",
"text": "replace-with-the-key",
"share": "workspace"
}
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({
kind: 'text',
name: 'OPENAI_API_KEY',
text: 'replace-with-the-key',
share: 'workspace'
})
};
fetch('https://melso.ai/api/secrets', 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://melso.ai/api/secrets",
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([
'kind' => 'text',
'name' => 'OPENAI_API_KEY',
'text' => 'replace-with-the-key',
'share' => 'workspace'
]),
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://melso.ai/api/secrets"
payload := strings.NewReader("{\n \"kind\": \"text\",\n \"name\": \"OPENAI_API_KEY\",\n \"text\": \"replace-with-the-key\",\n \"share\": \"workspace\"\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://melso.ai/api/secrets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"text\",\n \"name\": \"OPENAI_API_KEY\",\n \"text\": \"replace-with-the-key\",\n \"share\": \"workspace\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://melso.ai/api/secrets")
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 \"kind\": \"text\",\n \"name\": \"OPENAI_API_KEY\",\n \"text\": \"replace-with-the-key\",\n \"share\": \"workspace\"\n}"
response = http.request(request)
puts response.read_body{
"item": "<unknown>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
Company API key (mwk_) or personal access token (mel_). A PAT requires X-Workspace-ID on company-scoped routes. An API key implies its own company.
Headers
Company UUID for a personal token on company-scoped operations. A company API key already binds its company.
Body
Response
{item:VaultItem}