---
title: "Create an onramp mobile challenge"
method: POST
path: "/v2/onramp/mobile/sessions/challenges"
tags: ["Onramp (App2App)"]
---

# Create an onramp mobile challenge

`POST /v2/onramp/mobile/sessions/challenges`

## Request

- Base URL: `https://api.cdp.coinbase.com/platform`
- URL: `https://api.cdp.coinbase.com/platform/v2/onramp/mobile/sessions/challenges`
- Auth: HTTP bearer

Issues a challenge for initiating an onramp flow from a partner mobile app. Authenticate this request from the partner backend with a CDP API key; do not embed the API key in the mobile client. The project is identified by the API key JWT.

Pass the challenge to the mobile app. The app signs it using platform attestation (iOS App Attest or Android Play Integrity) and submits it to the [Create Onramp Mobile Session](#operation/createOnrampMobileSession) endpoint without CDP API key authentication to obtain a ready-to-use onramp URL. The `redirectUrl` is required so the Coinbase app knows where to return the user after completing or dismissing the transaction.

## Request body

- intersection
  - required: `redirectUrl`
  - [`OnrampSessionRequest`](https://skmtc.dev/coinbase/apis/coinbase-developer-platform-apis/revisions/06cb41a4fb57/schema?at=%2Fcomponents%2Fschemas%2FOnrampSessionRequest)

## Response `201`

Onramp mobile challenge created successfully.

- OnrampMobileChallenge: A server-issued challenge for platform attestation in an App2App onramp handoff.
  - `challenge` string, required: An opaque server-issued token to be used with platform attestation (iOS App Attest or Android Play Integrity Standard). Treat it as an opaque string — do not attempt to parse its contents. Pass this value along with the attestation payload to the [Create Onramp Mobile Session](#operation/createOnrampMobileSession) endpoint to complete the App2App handoff. **iOS**: pass this value directly to `DCAppAttestService.generateAssertion(keyId, clientDataHash: SHA256(challenge))`. **Android**: pass this value unchanged as `requestHash` to `StandardIntegrityManager.requestToken(requestHash)`. Do not hash it.
  - `expiresAt` string, date-time, required: The time at which the challenge expires. Challenges are short-lived; submit the attestation to [Create Onramp Mobile Session](#operation/createOnrampMobileSession) before this time or request a new challenge.

## Other responses

- `400`: Invalid request.
- `401`: Unauthorized.
- `403`: App not permitted to initiate a mobile handoff.
- `429`: Rate limit exceeded.
- `500`: Internal server error.
- `503`: Service unavailable.

## Changes

- **2026-12-01** `06cb41a4fb57`: 6 warning, 1 info
  - added the new `policy_not_applicable` enum value to the `errorType` response property for the response status `400`
  - added the new `policy_not_applicable` enum value to the `errorType` response property for the response status `401`
  - added the new `policy_not_applicable` enum value to the `errorType` response property for the response status `403`
  - added the new `policy_not_applicable` enum value to the `errorType` response property for the response status `429`
  - …3 more
- **2026-10-22** `fa99d7ef723f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/coinbase/apis/coinbase-developer-platform-apis/changes/v2/onramp/mobile/sessions/challenges/post.md)

---

[API](https://skmtc.dev/coinbase/apis/coinbase-developer-platform-apis.md) - [All operations](https://skmtc.dev/coinbase/apis/coinbase-developer-platform-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/coinbase/apis/coinbase-developer-platform-apis/revisions/06cb41a4fb57?raw)
