Skip to main content
POST
/
api
/
v1
/
user
/
api-keys
Create Api Key
curl --request POST \
  --url https://app.asisso.com/api/v1/user/api-keys \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>"
}
'
import requests

url = "https://app.asisso.com/api/v1/user/api-keys"

payload = { "name": "<string>" }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};

fetch('https://app.asisso.com/api/v1/user/api-keys', 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://app.asisso.com/api/v1/user/api-keys",
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([
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://app.asisso.com/api/v1/user/api-keys"

payload := strings.NewReader("{\n \"name\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

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://app.asisso.com/api/v1/user/api-keys")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.asisso.com/api/v1/user/api-keys")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "name": "<string>",
  "key_prefix": "<string>",
  "api_key": "<string>",
  "created_at": "2023-11-07T05:31:56Z"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}
The full key is only returned once at creation. Store it immediately in a secrets manager or environment variable — it cannot be retrieved again.

Authentication

This endpoint requires a valid user session token. If you do not yet have an API key, obtain a session token by logging in first and pass it as a Bearer token in the Authorization header. Step 1 — Log in to get a session token
curl -X POST https://your-asisso-instance/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "password": "your-password"}'
The response contains a token field. Use it in the next step. Step 2 — Create an API key
curl -X POST https://your-asisso-instance/api/v1/user/api-keys \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"name": "my-api-key"}'
Once you have an API key, you can use X-API-Key: <key> in place of Authorization: Bearer for all subsequent requests.

Headers

authorization
string | null
X-API-Key
string | null

Body

application/json
name
string
required

Response

Successful Response

id
integer
required
name
string
required
key_prefix
string
required
api_key
string
required
created_at
string<date-time>
required