Login
Authenticate healthcare provider and obtain access token for API usage
curl --request POST \
--url https://sdp.suki.ai/api/v1/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"partner_id": "your-partner-id",
"partner_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"provider_id": "provider-123"
}
'import requests
url = "https://sdp.suki.ai/api/v1/auth/login"
payload = {
"partner_id": "your-partner-id",
"partner_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"provider_id": "provider-123"
}
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({
partner_id: 'your-partner-id',
partner_token: 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...',
provider_id: 'provider-123'
})
};
fetch('https://sdp.suki.ai/api/v1/auth/login', 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://sdp.suki.ai/api/v1/auth/login",
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([
'partner_id' => 'your-partner-id',
'partner_token' => 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...',
'provider_id' => 'provider-123'
]),
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://sdp.suki.ai/api/v1/auth/login"
payload := strings.NewReader("{\n \"partner_id\": \"your-partner-id\",\n \"partner_token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"provider_id\": \"provider-123\"\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://sdp.suki.ai/api/v1/auth/login")
.header("Content-Type", "application/json")
.body("{\n \"partner_id\": \"your-partner-id\",\n \"partner_token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"provider_id\": \"provider-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/auth/login")
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 \"partner_id\": \"your-partner-id\",\n \"partner_token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"provider_id\": \"provider-123\"\n}"
response = http.request(request)
puts response.read_body{
"suki_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}{
"code": 401,
"message": "invalid token"
}{
"code": 403,
"message": "forbidden"
}{
"code": 404,
"message": "not found"
}{
"code": 500,
"message": "internal server error"
}suki_token/sdp_suki_token) that you must use to authorize all subsequent API calls for that user.
The suki_token is a that is valid for one hour.
jwt_bearer field.Guides
Single Auth Token Authentication
Provider Authentication
Bearer Partner Authentication
Code examples
- Python
- TypeScript
import requests
url = "https://sdp.suki-stage.com/api/v1/auth/login"
payload = {
"partner_id": "your-partner-id",
"partner_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"provider_id": "provider-123" # Required for Bearer and Single Auth Token partners; omit for Standard
}
response = requests.post(url, json=payload)
if response.status_code == 200:
data = response.json()
suki_token = data["suki_token"]
print(f"Authentication successful. Token: {suki_token}")
else:
print(f"Authentication failed: {response.status_code}")
print(response.json())
const response = await fetch('https://sdp.suki-stage.com/api/v1/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
partner_id: 'your-partner-id',
partner_token: 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...',
provider_id: 'provider-123' // Required for Bearer and Single Auth Token partners; omit for Standard
})
});
if (response.ok) {
const data = await response.json();
const sukiToken = data.suki_token;
console.log(`Authentication successful. Token: ${sukiToken}`);
} else {
const error = await response.json();
console.error(`Authentication failed: ${response.status}`, error);
}
Body
Partner credentials from onboarding. Bearer partners and Single Auth Token authentication must also include provider_id.
Unique identifier for the partner. This will be shared securely by Suki to the partner through a separate partner registration process.
"your-partner-id"
JWT token issued by trusted authorization server. The token must include Provider Email.
"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
Optional for standard partners.
Required for:
- Bearer authentication. Send
provider_idso Suki can identify the provider during Login or Register. - Single Auth Token authentication. Send
provider_idso Suki can identify the clinician during Login or Register.
"provider-123"
Response
Request succeeded.
Suki access token returned after successful Login.
JWT access token for the authenticated provider. Pass this value as sdp_suki_token on subsequent requests. Expires after one hour.
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
Was this page helpful?
curl --request POST \
--url https://sdp.suki.ai/api/v1/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"partner_id": "your-partner-id",
"partner_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"provider_id": "provider-123"
}
'import requests
url = "https://sdp.suki.ai/api/v1/auth/login"
payload = {
"partner_id": "your-partner-id",
"partner_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"provider_id": "provider-123"
}
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({
partner_id: 'your-partner-id',
partner_token: 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...',
provider_id: 'provider-123'
})
};
fetch('https://sdp.suki.ai/api/v1/auth/login', 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://sdp.suki.ai/api/v1/auth/login",
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([
'partner_id' => 'your-partner-id',
'partner_token' => 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...',
'provider_id' => 'provider-123'
]),
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://sdp.suki.ai/api/v1/auth/login"
payload := strings.NewReader("{\n \"partner_id\": \"your-partner-id\",\n \"partner_token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"provider_id\": \"provider-123\"\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://sdp.suki.ai/api/v1/auth/login")
.header("Content-Type", "application/json")
.body("{\n \"partner_id\": \"your-partner-id\",\n \"partner_token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"provider_id\": \"provider-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sdp.suki.ai/api/v1/auth/login")
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 \"partner_id\": \"your-partner-id\",\n \"partner_token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"provider_id\": \"provider-123\"\n}"
response = http.request(request)
puts response.read_body{
"suki_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}{
"code": 401,
"message": "invalid token"
}{
"code": 403,
"message": "forbidden"
}{
"code": 404,
"message": "not found"
}{
"code": 500,
"message": "internal server error"
}