---
title: "Complete agent authentication callback"
method: POST
path: "/agent/v2/auth/callback"
tags: ["Agent"]
---

# Complete agent authentication callback

`POST /agent/v2/auth/callback`

Submit either a wallet signature callback payload or an MFA callback payload to receive an API key.

## Request body

- union
  - AgentAuthCallbackSignatureRequest
    - `signature` string, required — Base58-encoded Ed25519 signature of the decoded challenge message bytes
    - `address` string, required — Solana wallet public key (base58) used to create the signature
    - `nonce` string, required — Nonce returned by /agent/v2/auth/init
    - `keyName` string, required — Human-readable label for the API key to be created
  - AgentAuthCallbackMfaRequest
    - `authCode` string, required — One-time auth code returned when MFA is required
    - `mfaCode` string, required — One-time MFA verification code
    - `keyName` string, required — Human-readable label for the API key to be created

## Response `200`

Successfully completed callback

- object
  - `success` boolean, required
  - `response` union
    - object
      - `apiKey` string, required — Newly created API key. This value is shown once and should be stored securely.
      - `keyId` string, required — Unique identifier for the created API key
      - `isSignup` boolean, required — Whether this authentication flow created a new account
    - object
      - `mfaRequired` boolean, required — Whether a second callback step with MFA is required
      - `mfaMethod` string, required — MFA method requested by the server (for example, totp)
      - `authCode` string, required — One-time auth code required for the MFA callback step

## Other responses

- `400` — Bad request - Invalid signature, nonce, auth code, or MFA code
- `429` — Too many requests - Rate limit exceeded
- `500` — Internal server error

---

[API](https://skmtc.net/bags/apis/bags-public-api-v2.md) · [All operations](https://skmtc.net/bags/apis/bags-public-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bags/bags-public-api-v2/versions/4a14b82cd39d/schema)
