{"type":"api","title":"Obtain or Refresh JWT Token","meta":{"id":"/apps/pubhub/media/cisco-edge-intelligence-2-2-0-api/2d8524cb89cd60e1e2e66bcc438913d05fdc9eff/262737b2-b3c2-32cd-b07b-fdbdcd23918f","info":{"title":"Edge Intelligence Local Manager API Documentation","description":"This API enables management of data policies within the Cisco Edge Intelligence IOx Application.\n\n**Key Features**:\n- User Authentication\n- Data Policy Management\n- Agent Management\n\n**Versioning**:\n- Current version: v2\n- Access pattern: `/api/v{version_number}/edge-intelligence`\n\n**Security**:\n- All endpoints secured with JWT Bearer token authentication\n- Tokens expire after 5 mins\n- Refresh tokens using the `/token` endpoint\n","version":"2.2.0"},"tags":[{"name":"Authentication","description":"User authentication and token management"},{"name":"Policy Management","description":"Data policy management"},{"name":"Agent Management","description":"Edge Intelligence Agent management"},{"name":"Metrics","description":"Edge Intelligence Metrics"}],"x-parser-conf":{"overview":{"markdownPath":"reference/overview.md"}},"openapi":"3.0.1","servers":[{"url":"https://localhost/api/v2/edge-intelligence","description":"Local development server"}],"securitySchemes":{"Bearer":{"type":"apiKey","description":"JWT Authorization header using the Bearer scheme.\nExample: \"Authorization: Bearer {token}\"\n","name":"Authorization","in":"header"}}},"spec":{"tags":["Authentication"],"summary":"Obtain or Refresh JWT Token","description":"Authenticates user and returns a JWT token. Used for:\n1. Initial login with username/password\n2. Refreshing an existing token\n3. Checking if password change is required (first-time login)\n","operationId":"getToken","requestBody":{"description":"Authentication credentials","required":true,"content":{"application/json":{"schema":{"oneOf":[{"description":"Contains login credentials","type":"object","required":["username","password"],"properties":{"username":{"description":"username","type":"string","example":"admin"},"password":{"description":"password","type":"string","format":"password","example":"securePassword@123"}},"$$ref":"#/components/schemas/LoginCredentials"},{"description":"RefreshToken","type":"object","required":["token"],"properties":{"token":{"description":"token","type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}},"$$ref":"#/components/schemas/RefreshToken"}]},"examples":{"usernamePasswordExample":{"summary":"Example with username and password","value":{"username":"exampleUser","password":"examplePass"}},"tokenExample":{"summary":"Example with token","value":{"token":"exampleToken"}}}}}},"responses":{"200":{"description":"Successful authentication","content":{"application/json":{"schema":{"type":"object","description":"Success response object","properties":{"success":{"type":"boolean","description":"boolean value indicating success or failure"},"data":{"type":"object","description":"data of action"},"message":{"type":"string","description":"message description of success or failure"}},"$$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","description":"Error response object","properties":{"success":{"type":"boolean","description":"boolean value indicating success or failure"},"error":{"type":"object","description":"error message","properties":{"code":{"type":"string","description":"error code of failure"},"message":{"type":"string","description":"detailed error message"}}}},"$$ref":"#/components/schemas/ErrorResponse"}}},"$$ref":"#/components/responses/BadRequest"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","description":"Error response object","properties":{"success":{"type":"boolean","description":"boolean value indicating success or failure"},"error":{"type":"object","description":"error message","properties":{"code":{"type":"string","description":"error code of failure"},"message":{"type":"string","description":"detailed error message"}}}},"$$ref":"#/components/schemas/ErrorResponse"},"example":{"success":false,"error":{"code":"INVALID_TOKEN","message":"Invalid token"}}}},"$$ref":"#/components/responses/Unauthorized"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","description":"Error response object","properties":{"success":{"type":"boolean","description":"boolean value indicating success or failure"},"error":{"type":"object","description":"error message","properties":{"code":{"type":"string","description":"error code of failure"},"message":{"type":"string","description":"detailed error message"}}}},"$$ref":"#/components/schemas/ErrorResponse"},"example":{"success":false,"error":{"code":"FORBIDDEN","message":"Unauthorised operation performed"}}}},"$$ref":"#/components/responses/Forbidden"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","description":"Error response object","properties":{"success":{"type":"boolean","description":"boolean value indicating success or failure"},"error":{"type":"object","description":"error message","properties":{"code":{"type":"string","description":"error code of failure"},"message":{"type":"string","description":"detailed error message"}}}},"$$ref":"#/components/schemas/ErrorResponse"}}},"$$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"Error response object","properties":{"success":{"type":"boolean","description":"boolean value indicating success or failure"},"error":{"type":"object","description":"error message","properties":{"code":{"type":"string","description":"error code of failure"},"message":{"type":"string","description":"detailed error message"}}}},"$$ref":"#/components/schemas/ErrorResponse"},"example":{"success":false,"error":{"code":"INTERNAL_SERVER_ERROR","message":"Internal server error"}}}},"$$ref":"#/components/responses/InternalServerError"}},"__originalOperationId":"getToken","method":"post","path":"/token"}}