Log in
POST
/api/v1/login/{env}
const url = 'https://osctrl.net/api/v1/login/example';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"exp_hours":1,"password":"example","username":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://osctrl.net/api/v1/login/example \ --header 'Content-Type: application/json' \ --data '{ "exp_hours": 1, "password": "example", "username": "example" }'Authenticates an API user and returns a JWT token.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”env
required
string
Environment name or UUID
Request Bodyrequired
Section titled “Request Bodyrequired”Request body
Media typeapplication/json
object
exp_hours
integer
password
string
username
string
Examplegenerated
{ "exp_hours": 1, "password": "example", "username": "example"}Responses
Section titled “Responses”OK
Media typeapplication/json
object
csrf_token
string
token
string
Examplegenerated
{ "csrf_token": "example", "token": "example"}Bad request
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Unauthorized
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Forbidden
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Not found
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Conflict
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Too many requests
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Internal server error
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Service unavailable
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}