Skip to main content
POST
/
api-keys
Crear API Key
curl --request POST \
  --url https://api.linahealthcareplatform.com/api/v1/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "permissions": []
}
'
import requests

url = "https://api.linahealthcareplatform.com/api/v1/api-keys"

payload = {
"name": "<string>",
"permissions": []
}
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({name: '<string>', permissions: []})
};

fetch('https://api.linahealthcareplatform.com/api/v1/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://api.linahealthcareplatform.com/api/v1/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>',
'permissions' => [

]
]),
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://api.linahealthcareplatform.com/api/v1/api-keys"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"permissions\": []\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://api.linahealthcareplatform.com/api/v1/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"permissions\": []\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.linahealthcareplatform.com/api/v1/api-keys")

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 \"name\": \"<string>\",\n \"permissions\": []\n}"

response = http.request(request)
puts response.read_body
{
  "id": "key_abc123",
  "name": "Backend producción",
  "key": "lina_sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
  "permissions": ["patients:read", "patients:write", "forms:read"],
  "createdAt": "2026-05-14T10:00:00Z"
}
La API key completa solo se muestra una vez en la respuesta. Guárdala en un lugar seguro.

Body

name
string
required
Nombre descriptivo para identificar la API key (ej. “Backend producción”).
permissions
string[]
Lista de permisos asignados a la key. Si se omite, se asignan todos los permisos.Valores permitidos: patients:read, patients:write, forms:read, forms:write, schedules:read, schedules:write, calls:read, calls:write, conversations:read, conversations:write, credits:read, webhooks:read, webhooks:write.
{
  "id": "key_abc123",
  "name": "Backend producción",
  "key": "lina_sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
  "permissions": ["patients:read", "patients:write", "forms:read"],
  "createdAt": "2026-05-14T10:00:00Z"
}
id
string
Identificador único de la API key.
name
string
Nombre descriptivo de la key.
key
string
La API key completa. Solo se muestra en esta respuesta. Úsala para obtener tokens de acceso.
permissions
string[]
Lista de permisos asignados.
createdAt
string
Fecha de creación en formato ISO 8601.

Authorizations

Authorization
string
header
required

Token JWT obtenido via POST /auth/token

Body

application/json
name
string
required

Nombre identificativo

permissions
enum<string>[]
Available options:
read,
write,
calls,
conversations,
webhooks,
admin

Response

201 - application/json

Key creada (solo se muestra una vez)

id
string
name
string
key
string
maskedKey
string
permissions
string[]
createdAt
string<date-time>