Create service account
POST
https://example.com
/
api
/
service-accounts
Create service account
curl --request POST \
--url https://example.com/api/service-accounts \
--header 'Content-Type: application/json' \
--cookie better-auth.session_token= \
--data '
{
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {cookie: 'better-auth.session_token=', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://example.com/api/service-accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://example.com/api/service-accounts"
payload = { "name": "<string>" }
headers = {
"cookie": "better-auth.session_token=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://example.com/api/service-accounts"
payload := strings.NewReader("{\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "better-auth.session_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))
}{
"id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}⌘I
Create service account
curl --request POST \
--url https://example.com/api/service-accounts \
--header 'Content-Type: application/json' \
--cookie better-auth.session_token= \
--data '
{
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {cookie: 'better-auth.session_token=', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://example.com/api/service-accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://example.com/api/service-accounts"
payload = { "name": "<string>" }
headers = {
"cookie": "better-auth.session_token=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://example.com/api/service-accounts"
payload := strings.NewReader("{\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "better-auth.session_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))
}{
"id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}