curl --request POST \
--url https://scribe-api.telepatia.ai/v1/institutional/accounts/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounts": [
{
"doctorSpecialties": [
"cardiology"
],
"email": "dr.juan@clinica.com",
"internalCode": "DOC-001",
"nameFull": "Dr. Juan Pérez"
},
{
"doctorSpecialties": [
"pediatrics"
],
"email": "dra.ana@clinica.com",
"internalCode": "DOC-002",
"nameFull": "Dra. Ana Gómez"
}
]
}
'import requests
url = "https://scribe-api.telepatia.ai/v1/institutional/accounts/batch"
payload = { "accounts": [
{
"doctorSpecialties": ["cardiology"],
"email": "dr.juan@clinica.com",
"internalCode": "DOC-001",
"nameFull": "Dr. Juan Pérez"
},
{
"doctorSpecialties": ["pediatrics"],
"email": "dra.ana@clinica.com",
"internalCode": "DOC-002",
"nameFull": "Dra. Ana Gómez"
}
] }
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({
accounts: [
{
doctorSpecialties: ['cardiology'],
email: 'dr.juan@clinica.com',
internalCode: 'DOC-001',
nameFull: 'Dr. Juan Pérez'
},
{
doctorSpecialties: ['pediatrics'],
email: 'dra.ana@clinica.com',
internalCode: 'DOC-002',
nameFull: 'Dra. Ana Gómez'
}
]
})
};
fetch('https://scribe-api.telepatia.ai/v1/institutional/accounts/batch', 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://scribe-api.telepatia.ai/v1/institutional/accounts/batch",
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([
'accounts' => [
[
'doctorSpecialties' => [
'cardiology'
],
'email' => 'dr.juan@clinica.com',
'internalCode' => 'DOC-001',
'nameFull' => 'Dr. Juan Pérez'
],
[
'doctorSpecialties' => [
'pediatrics'
],
'email' => 'dra.ana@clinica.com',
'internalCode' => 'DOC-002',
'nameFull' => 'Dra. Ana Gómez'
]
]
]),
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://scribe-api.telepatia.ai/v1/institutional/accounts/batch"
payload := strings.NewReader("{\n \"accounts\": [\n {\n \"doctorSpecialties\": [\n \"cardiology\"\n ],\n \"email\": \"dr.juan@clinica.com\",\n \"internalCode\": \"DOC-001\",\n \"nameFull\": \"Dr. Juan Pérez\"\n },\n {\n \"doctorSpecialties\": [\n \"pediatrics\"\n ],\n \"email\": \"dra.ana@clinica.com\",\n \"internalCode\": \"DOC-002\",\n \"nameFull\": \"Dra. Ana Gómez\"\n }\n ]\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://scribe-api.telepatia.ai/v1/institutional/accounts/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounts\": [\n {\n \"doctorSpecialties\": [\n \"cardiology\"\n ],\n \"email\": \"dr.juan@clinica.com\",\n \"internalCode\": \"DOC-001\",\n \"nameFull\": \"Dr. Juan Pérez\"\n },\n {\n \"doctorSpecialties\": [\n \"pediatrics\"\n ],\n \"email\": \"dra.ana@clinica.com\",\n \"internalCode\": \"DOC-002\",\n \"nameFull\": \"Dra. Ana Gómez\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe-api.telepatia.ai/v1/institutional/accounts/batch")
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 \"accounts\": [\n {\n \"doctorSpecialties\": [\n \"cardiology\"\n ],\n \"email\": \"dr.juan@clinica.com\",\n \"internalCode\": \"DOC-001\",\n \"nameFull\": \"Dr. Juan Pérez\"\n },\n {\n \"doctorSpecialties\": [\n \"pediatrics\"\n ],\n \"email\": \"dra.ana@clinica.com\",\n \"internalCode\": \"DOC-002\",\n \"nameFull\": \"Dra. Ana Gómez\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"createdCount": 1,
"failedCount": 1,
"results": [
{
"account": {
"apiKey": "<shown-once-store-securely>",
"apiKeyExpiresInDays": 365,
"email": "dr.juan@clinica.com",
"expiresAt": "2027-06-17T00:00:00Z",
"id": "acc_a1b2c3d4e5f6g7h8",
"internalCode": "DOC-001",
"publishableApiKey": "<shown-once-store-securely>"
},
"email": "dr.juan@clinica.com",
"index": 0,
"status": "created"
},
{
"email": "dra.ana@clinica.com",
"error": {
"code": "resource_conflict",
"message": "An account with this internalCode already exists for this institution.",
"param": "internalCode",
"type": "invalid_request_error"
},
"index": 1,
"status": "error"
}
]
}Create doctor accounts in bulk
Create several doctor accounts for the authenticated institution in one call (1–10 accounts). Each item takes the same fields as POST /accounts. The whole request is rejected with 400 before any account is created when it repeats an email or an internalCode. Because each account is committed independently, the endpoint does not roll back: it returns 200 with a per-item results array — one entry per account, in the order received, each marked created or error — plus createdCount and failedCount.
curl --request POST \
--url https://scribe-api.telepatia.ai/v1/institutional/accounts/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounts": [
{
"doctorSpecialties": [
"cardiology"
],
"email": "dr.juan@clinica.com",
"internalCode": "DOC-001",
"nameFull": "Dr. Juan Pérez"
},
{
"doctorSpecialties": [
"pediatrics"
],
"email": "dra.ana@clinica.com",
"internalCode": "DOC-002",
"nameFull": "Dra. Ana Gómez"
}
]
}
'import requests
url = "https://scribe-api.telepatia.ai/v1/institutional/accounts/batch"
payload = { "accounts": [
{
"doctorSpecialties": ["cardiology"],
"email": "dr.juan@clinica.com",
"internalCode": "DOC-001",
"nameFull": "Dr. Juan Pérez"
},
{
"doctorSpecialties": ["pediatrics"],
"email": "dra.ana@clinica.com",
"internalCode": "DOC-002",
"nameFull": "Dra. Ana Gómez"
}
] }
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({
accounts: [
{
doctorSpecialties: ['cardiology'],
email: 'dr.juan@clinica.com',
internalCode: 'DOC-001',
nameFull: 'Dr. Juan Pérez'
},
{
doctorSpecialties: ['pediatrics'],
email: 'dra.ana@clinica.com',
internalCode: 'DOC-002',
nameFull: 'Dra. Ana Gómez'
}
]
})
};
fetch('https://scribe-api.telepatia.ai/v1/institutional/accounts/batch', 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://scribe-api.telepatia.ai/v1/institutional/accounts/batch",
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([
'accounts' => [
[
'doctorSpecialties' => [
'cardiology'
],
'email' => 'dr.juan@clinica.com',
'internalCode' => 'DOC-001',
'nameFull' => 'Dr. Juan Pérez'
],
[
'doctorSpecialties' => [
'pediatrics'
],
'email' => 'dra.ana@clinica.com',
'internalCode' => 'DOC-002',
'nameFull' => 'Dra. Ana Gómez'
]
]
]),
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://scribe-api.telepatia.ai/v1/institutional/accounts/batch"
payload := strings.NewReader("{\n \"accounts\": [\n {\n \"doctorSpecialties\": [\n \"cardiology\"\n ],\n \"email\": \"dr.juan@clinica.com\",\n \"internalCode\": \"DOC-001\",\n \"nameFull\": \"Dr. Juan Pérez\"\n },\n {\n \"doctorSpecialties\": [\n \"pediatrics\"\n ],\n \"email\": \"dra.ana@clinica.com\",\n \"internalCode\": \"DOC-002\",\n \"nameFull\": \"Dra. Ana Gómez\"\n }\n ]\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://scribe-api.telepatia.ai/v1/institutional/accounts/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounts\": [\n {\n \"doctorSpecialties\": [\n \"cardiology\"\n ],\n \"email\": \"dr.juan@clinica.com\",\n \"internalCode\": \"DOC-001\",\n \"nameFull\": \"Dr. Juan Pérez\"\n },\n {\n \"doctorSpecialties\": [\n \"pediatrics\"\n ],\n \"email\": \"dra.ana@clinica.com\",\n \"internalCode\": \"DOC-002\",\n \"nameFull\": \"Dra. Ana Gómez\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe-api.telepatia.ai/v1/institutional/accounts/batch")
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 \"accounts\": [\n {\n \"doctorSpecialties\": [\n \"cardiology\"\n ],\n \"email\": \"dr.juan@clinica.com\",\n \"internalCode\": \"DOC-001\",\n \"nameFull\": \"Dr. Juan Pérez\"\n },\n {\n \"doctorSpecialties\": [\n \"pediatrics\"\n ],\n \"email\": \"dra.ana@clinica.com\",\n \"internalCode\": \"DOC-002\",\n \"nameFull\": \"Dra. Ana Gómez\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"createdCount": 1,
"failedCount": 1,
"results": [
{
"account": {
"apiKey": "<shown-once-store-securely>",
"apiKeyExpiresInDays": 365,
"email": "dr.juan@clinica.com",
"expiresAt": "2027-06-17T00:00:00Z",
"id": "acc_a1b2c3d4e5f6g7h8",
"internalCode": "DOC-001",
"publishableApiKey": "<shown-once-store-securely>"
},
"email": "dr.juan@clinica.com",
"index": 0,
"status": "created"
},
{
"email": "dra.ana@clinica.com",
"error": {
"code": "resource_conflict",
"message": "An account with this internalCode already exists for this institution.",
"param": "internalCode",
"type": "invalid_request_error"
},
"index": 1,
"status": "error"
}
]
}Authorizations
API key passed as a Bearer token
Body
Request body for creating several institutional doctor accounts in one call.
The doctor accounts to create (1–10). Each item takes the same fields as the single-create endpoint. The whole request is rejected before any account is created when it repeats an email or an internalCode.
1 - 10 elementsShow child attributes
Show child attributes
Response
Successful Response
Per-item outcome of a batch account-creation request.
The request never fails as a whole once creation starts: each account is created independently, so an entry can succeed while another fails. The results keep the request order.