Skip to main content
POST
/
agents
/
auth
/
start
JavaScript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
  apiKey: 'My API Key',
});

const agentAuthStartResponse = await client.agents.auth.start({
  profile_name: 'auth-abc123',
  target_domain: 'doordash.com',
});

console.log(agentAuthStartResponse.run_id);
{
  "run_id": "abc123xyz",
  "handoff_code": "aBcD123EfGh456IjKl789MnOp012QrStUvWxYzAbCdEf",
  "hosted_url": "https://agent-auth.onkernel.com/agents/auth/runs/abc123xyz?code=otp_abc123xyz",
  "expires_at": "2025-11-05T20:00:00Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request to start an agent authentication flow

target_domain
string
required

Target domain for authentication

Example:

"doordash.com"

profile_name
string
required

Name of the profile to use for this flow

Example:

"auth-abc123"

app_logo_url
string<uri>

Optional logo URL for the application

Example:

"https://example.com/logo.png"

proxy
object

Optional proxy configuration

Response

Run created successfully

Response from starting an agent authentication run

run_id
string
required

Unique identifier for the run

Example:

"abc123xyz"

handoff_code
string
required

One-time code for handoff

Example:

"aBcD123EfGh456IjKl789MnOp012QrStUvWxYzAbCdEf"

hosted_url
string<uri>
required

URL to redirect user to

Example:

"https://agent-auth.onkernel.com/agents/auth/runs/abc123xyz?code=otp_abc123xyz"

expires_at
string<date-time>
required

When the handoff code expires

Example:

"2025-11-05T20:00:00Z"