curl -X POST 'https://your-hatch-server/api/sync/vaults' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"encryption": {}
}'
const res = await fetch("https://your-hatch-server/api/sync/vaults", {
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "string",
"encryption": {}
}),
})
const data = await res.json()
import requests
res = requests.request("POST", "https://your-hatch-server/api/sync/vaults", headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"}, json={
"name": "string",
"encryption": {},
})
data = res.json()
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"name": "string",
"encryption": {}
}`)
req, err := http.NewRequest("POST", "https://your-hatch-server/api/sync/vaults", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(string(data))
}
require "net/http"
require "json"
uri = URI('https://your-hatch-server/api/sync/vaults')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer <token>'
req['Content-Type'] = 'application/json'
req.body = JSON.generate({
'name' => 'string',
'encryption' => {}
})
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(req)
end
puts res.body
<?php
$ch = curl_init('https://your-hatch-server/api/sync/vaults');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <token>',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{
"name": "string",
"encryption": {}
}',
]);
$response = curl_exec($ch);
echo $response;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://your-hatch-server/api/sync/vaults"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"string\",\"encryption\":{}}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
{
"vault": {
"id": "string",
"name": "string",
"rev": 0,
"files": 0,
"bytes": 0,
"encryption": "string",
"role": "owner",
"owner": {
"name": "string",
"email": "string"
},
"members": 0
}
}
{
"message": "string",
"code": "string",
"retryable": true,
"requestId": "string"
}