--- title: "Initiate CLI Authentication" description: "Create a new CLI authentication session and return polling and login codes." api: "POST /api/v1/auth/cli" --- ## Request The secret server key for authentication. The admin access token. The project ID. ## Response The code used to poll for the authentication status. This should be used with the poll endpoint. The code presented to the user for completing authentication in a browser. ISO 8601 timestamp of when the authentication session expires. ```bash cURL curl -X POST 'https://api.stack-auth.com/api/v1/auth/cli' \ -H 'x-stack-secret-server-key: YOUR_SECRET_SERVER_KEY' \ -H 'x-stack-project-id: YOUR_PROJECT_ID' ``` ```json 200 Response { "polling_code": "poll_abc123def456", "login_code": "ABCD-1234", "expires_at": "2024-01-01T00:15:00Z" } ```