Login with credentials
POSThttps://demo.frigate.video/api/login
Authenticates a user with username and password. Returns a JWT token as a secure HTTP-only cookie that can be used for subsequent API requests. The JWT token can also be retrieved from the response and used as a Bearer token in the Authorization header.
Example using Bearer token:
curl -H "Authorization: Bearer <token_value>" https://frigate_ip:8971/api/profile
Request​
- application/json
Bodyrequired
userUser (string)required
passwordPassword (string)required
Responses​
- 200
- 401
- 422
Successful Response
- application/json
- Schema
Schema
Login Failed - Invalid credentials
- application/json
- Schema
Schema
Validation Error
- application/json
- Schema
- Example (auto)
Schema
detail object[]
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
- python
- nodejs
- javascript
- curl
- rust
- HTTP.CLIENT
- REQUESTS
import http.client
import json
conn = http.client.HTTPSConnection("demo.frigate.video")
payload = json.dumps({
"user": "string",
"password": "string"
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
conn.request("POST", "/api/login", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
ResponseClear