---
title: "Log the Agent in"
method: POST
path: "/login"
---

# Log the Agent in

`POST /login`

## Request

- Base URL: `http://localhost:6286`
- URL: `http://localhost:6286/login`
- Auth: none declared
- TypeScript: <https://skmtc.dev/iconik/apis/agent-api/docs/login/post.ts> (a function with typed inputs; its response is checked against the schema)

Logs the Agent in to Iconik. With an auth token and app id in the body the Agent authenticates as that user, asking for confirmation in the UI if another user is already logged in. With an empty body the Agent opens a browser window for the user to log in, unless it already has a valid session.

## Request body

- AuthRequestBody
  - `auth` object: Optional authentication token and app id. If not provided, the Agent will trigger the UI based login flow via the browser.
    - `token` string, required: The authentication token to use in the Agent
    - `appId` string, required: The application id the token is for

## Response `200`

Default Response

- LoginResponse
  - `userId` string, required: Id of the user the Agent is logged in as

---

[API](https://skmtc.dev/iconik/apis/agent-api.md) - [All operations](https://skmtc.dev/iconik/apis/agent-api/llms.txt) - [OpenAPI document](https://skmtc.dev/iconik/apis/agent-api/revisions/cd5eb7819e60?raw)
