Authentication
Sign in
Authenticates a user and returns a JWT token.
curl -X POST "https://api.neostra.io/api/v1/auth/signin" \
-H "Content-Type: application/json" \
-d '{
"email": "admin@acmecorp.com",
"password": "example_string"
}'
import requests
import json
url = "https://api.neostra.io/api/v1/auth/signin"
headers = {
"Content-Type": "application/json"
}
data = {
"email": "admin@acmecorp.com",
"password": "example_string"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.neostra.io/api/v1/auth/signin", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"email": "admin@acmecorp.com",
"password": "example_string"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"email": "admin@acmecorp.com",
"password": "example_string"
}`)
req, err := http.NewRequest("POST", "https://api.neostra.io/api/v1/auth/signin", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.neostra.io/api/v1/auth/signin')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = '{
"email": "admin@acmecorp.com",
"password": "example_string"
}'
response = http.request(request)
puts response.body
{
"status": 200,
"message": "Success",
"data": {
"token": "example_string",
"refreshToken": "example_string",
"expiresIn": 3600,
"user": {
"id": "example_string",
"email": "user@example.com",
"name": "John Doe",
"roles": [
"example_string"
]
}
},
"errors": [
"example_string"
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
POST
/api/v1/auth/signin
POST
Content-Typestring
RequiredThe media type of the request body
Options: application/json
emailstring
RequiredUser email address
Format: email
passwordstring
RequiredUser password
Format: password
Request Preview
Response
Response will appear here after sending the request
Responses
statusinteger
HTTP status code
messagestring
Response message
dataobject
errorsstring[]
List of error details, if any
Was this page helpful?
Last updated 1 week ago
Built with Documentation.AI