Skip to main content
POST
/
v1
/
auth
Obtain an access token
curl --request POST \
  --url https://api.example.com/v1/auth \
  --header 'Content-Type: application/json' \
  --data '
{
  "client_id": "nc_client_a1b2c3d4e5f6g7h8",
  "client_secret": "nc_secret_x9y8z7w6v5u4t3s2"
}
'
import requests

url = "https://api.example.com/v1/auth"

payload = {
"client_id": "nc_client_a1b2c3d4e5f6g7h8",
"client_secret": "nc_secret_x9y8z7w6v5u4t3s2"
}
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({
client_id: 'nc_client_a1b2c3d4e5f6g7h8',
client_secret: 'nc_secret_x9y8z7w6v5u4t3s2'
})
};

fetch('https://api.example.com/v1/auth', 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.example.com/v1/auth",
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([
'client_id' => 'nc_client_a1b2c3d4e5f6g7h8',
'client_secret' => 'nc_secret_x9y8z7w6v5u4t3s2'
]),
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://api.example.com/v1/auth"

payload := strings.NewReader("{\n \"client_id\": \"nc_client_a1b2c3d4e5f6g7h8\",\n \"client_secret\": \"nc_secret_x9y8z7w6v5u4t3s2\"\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://api.example.com/v1/auth")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"nc_client_a1b2c3d4e5f6g7h8\",\n \"client_secret\": \"nc_secret_x9y8z7w6v5u4t3s2\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/auth")

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 \"client_id\": \"nc_client_a1b2c3d4e5f6g7h8\",\n \"client_secret\": \"nc_secret_x9y8z7w6v5u4t3s2\"\n}"

response = http.request(request)
puts response.read_body
{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL25ldXJhY2FsbC5hdXRoMC5jb20vIn0...",
  "expires_at": 1735689600,
  "client_id_audience": "https://api.neuracall.com/call-analysis",
  "scope": "read:call-analysis-requests write:call-analysis-request read:call-analysis-audio read:call-analysis-transcription read:prompt-template write:prompt-template read:call-analysis-stats"
}
{
"code": "001-001-0001",
"message": "The requested resource was not found"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
{
"code": "001-001-0001",
"message": "The requested resource was not found"
}

Body

application/json

Request body for authentication

client_id
string
required

Your application's client ID provided by Neuracall

Example:

"nc_client_a1b2c3d4e5f6g7h8"

client_secret
string
required

Your application's client secret. Keep this secure and never expose it publicly

Example:

"nc_secret_x9y8z7w6v5u4t3s2"

Response

Successful Response

Authentication response containing access token and metadata

access_token
string
required

JWT access token to include in the Authorization header of subsequent requests

Example:

"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL25ldXJhY2FsbC5hdXRoMC5jb20vIn0..."

expires_at
integer
required

Unix timestamp (seconds) when the token expires. Request a new token before this time

Example:

1735689600

client_id_audience
string
required

The audience identifier for this token

Example:

"https://api.neuracall.com/call-analysis"

scope
string

Space-separated list of granted permission scopes

Example:

"read:call-analysis-requests write:call-analysis-request read:call-analysis-audio"