{"openapi":"3.0.0","info":{"title":"Afineo Webservices API — token","description":"Module `token` of the Afineo API v3 (3 endpoints).\n\nAuthentication: obtain a JWT token by providing credentials (login/password), check token validity, or disable active tokens. A valid token is required in the Authorization header for all other API calls.\n\nFull specification: https://api.afineo.io/openapi.json","version":"3.0.0","contact":{"name":"Afineo Solutions","url":"https://www.afineo.com"},"x-logo":{"url":"./logo.png","altText":"Afineo - Powerful Data, Powerful People"}},"servers":[{"url":"https://{instance}.afineo.io","description":"Afineo instance","variables":{"instance":{"description":"Your Afineo instance name","default":"client"}}}],"tags":[{"name":"token","description":"Authentication: obtain a JWT token by providing credentials (login/password), check token validity, or disable active tokens. A valid token is required in the Authorization header for all other API calls."}],"paths":{"/api/v3/token/disable/":{"post":{"tags":["token"],"summary":"Disable all active tokens","description":"## Purpose\n\nInvalidates all active JWT tokens for the account.\n\n## Use Cases\n\n- Force re-authentication for all sessions\n- Reset sessions after security concerns\n- Clear tokens when limit (10) reached\n\n⚠️ All existing tokens will be immediately invalidated.\n","security":[],"responses":{"200":{"description":"Token disabling response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Success Response","properties":{"status_code":{"type":"integer","example":1,"description":"Status code (1 = success)"},"status_message":{"type":"string","example":"5 tokens disabled","description":"Number of tokens that were disabled"},"result":{"type":"array","items":{"type":"object"},"example":[],"description":"Empty array on success"}},"required":["status_code","status_message","result"]},{"type":"object","title":"Error Response","properties":{"status_code":{"type":"integer","example":3,"description":"Status code (3 = error, 0 = authentication failed)"},"status_message":{"type":"string","example":"Invalid login or password","description":"Error message"},"result":{"type":"array","items":{"type":"object"},"example":[],"description":"Empty array on error"}},"required":["status_code","status_message","result"]}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"l":{"type":"string","description":"User login (username). Account must have API access permissions.","example":"mylogin"},"p":{"type":"string","description":"User password. Use a service account for API integrations.","example":"mypassword"}},"required":["l","p"]}}}}}},"/api/v3/token/get/":{"post":{"tags":["token"],"summary":"Get JWT authentication token","description":"## Purpose\n\nGenerates a JWT token for API authentication. Use login credentials to obtain a bearer token for subsequent API calls.\n\n## Constraints\n\n- Token lifetime: 1 hour\n- Maximum active tokens per account: 10\n- Tokens auto-expire after 1 hour\n\n## Usage\n\nInclude the token in subsequent requests:\n\n```\nAuthorization: Bearer <jwt_token>\n```\n","security":[],"responses":{"200":{"description":"Token generation response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Success Response","properties":{"status_code":{"type":"integer","example":1,"description":"Status code (1 = success)"},"status_message":{"type":"string","example":"JWT token generated successfully","description":"Status message"},"result":{"type":"object","properties":{"jwt_token":{"type":"string","example":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...","description":"JWT token to use in Authorization header"},"token_type":{"type":"string","example":"Bearer","description":"Token type for Authorization header"},"expires_at":{"type":"string","example":"2024-12-07T15:30:45+00:00","description":"Token expiration date and time (ISO 8601 format)"},"issued_at":{"type":"string","example":"2024-12-07T14:30:45+00:00","description":"Token creation date and time (ISO 8601 format)"},"internal_token":{"type":"string","example":"abc123def456...","description":"Internal token for compatibility (deprecated)"}},"required":["jwt_token","token_type","expires_at","issued_at","internal_token"]}},"required":["status_code","status_message","result"]},{"type":"object","title":"Error Response","properties":{"status_code":{"type":"integer","example":3,"description":"Status code (3 = error, 0 = authentication failed)"},"status_message":{"type":"string","example":"Invalid login or password","description":"Error message"},"result":{"type":"array","items":{"type":"object"},"example":[],"description":"Empty array on error"}},"required":["status_code","status_message","result"]}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"l":{"type":"string","description":"User login (username). Account must have API access permissions.","example":"mylogin"},"p":{"type":"string","description":"User password. Use a service account for API integrations.","example":"mypassword"},"HTTP_REFERER":{"type":"string","description":"Internal referer for authentication (delayedExecutor, API_REST, etc.)","example":"API_REST-b47f1ad6b862bcff9b680f5cfa78a979"}},"required":["l","p"]}}}}}},"/api/v3/token/info/":{"post":{"tags":["token"],"summary":"Get current token information","description":"## Purpose\n\nReturns metadata about the current JWT token (validity, issue date, expiration).\n\n## Use Cases\n\n- Verify authentication state\n- Check remaining token lifetime\n- Determine if token refresh is needed\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Token information response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Success Response","properties":{"status_code":{"type":"integer","example":1,"description":"Status code (1 = success)"},"status_message":{"type":"string","example":"The JWT token is valid","description":"Token validation message"},"result":{"type":"object","properties":{"token_type":{"type":"string","example":"JWT","description":"Type of the token"},"user_id":{"type":"integer","example":1687,"description":"User ID associated with the token"},"created_at":{"type":"string","example":"2024-12-07T14:30:45+00:00","description":"Token creation date and time (ISO 8601 format)"},"expires_at":{"type":"string","example":"2024-12-07T15:30:45+00:00","description":"Token expiration date and time (ISO 8601 format)"},"issued_at":{"type":"string","example":"2024-12-07T14:30:45+00:00","description":"Token issuance date and time (ISO 8601 format)"},"not_before":{"type":"string","nullable":true,"example":"2024-12-07T14:30:45+00:00","description":"Token not valid before this date and time (ISO 8601 format)"},"internal_token":{"type":"string","example":"abc123def456...","description":"Internal token identifier"}},"required":["token_type","user_id","created_at","expires_at","issued_at","internal_token"]}},"required":["status_code","status_message","result"]},{"type":"object","title":"Error Response","properties":{"status_code":{"type":"integer","example":3,"description":"Status code (3 = error)"},"status_message":{"type":"string","example":"Bearer token missing in Authorization header","description":"Error message"},"result":{"type":"array","items":{"type":"object"},"example":[],"description":"Empty array on error"}},"required":["status_code","status_message","result"]}]}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token generated with /api/v3/token/get/"}}}}