Logo
Unifi Controller API Documentation

Login

POST {{url}}/api/auth/login

Returns an array of API keys for the company that the user belongs to. The API key is required for all other API request and should be set in the Authorization header like this: Authorization: [api_key]. This will allow the calls made to be authenticated and authorized with the permissions and access available to the company.

Input json { "type": "object", "properties": { "username": { "type": "string" }, "password": { "type": "string" } }, "required": ["username", "password"], "additionalProperties": false }

Output json { "type": "object", "properties": { "type": "array", "items": { "apiKey": { "type": "string" }, "type": { "type": "string" } } }, "required": [] }

 

Body PARAM

Key Datatype Required Description 



HEADERS

Key Datatype Required Description 
Content-Type
string
x-csrf-token
string




RESPONSES

status





Curl
curl -X POST 'url/api/auth/login' -H 'Content-Type: application/json' -H 'x-csrf-token: csrf_token()' -d '{"username":"username","password":"password"}'

ENDPOINTS