> For the complete documentation index, see [llms.txt](https://docs.ur.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ur.app/api-reference/api/kyc-and-kyb/managed-custody-kyc/create-the-account-and-onboarding-session.md).

# Create the account and onboarding session

Mints or reuses the user's URID, provisions the UR-managed wallet, and opens an onboarding session. This is the first step of both Managed Custody KYC paths: the SDK path starts in state ConfirmYourCountryOfResidence and the shared-token path starts in state PartnerDataIngestion. Repeated calls with the same X-External-User-Id while a session is active return the existing session with idempotentReplay set to true.

```json
{"openapi":"3.1.0","info":{"title":"UR API","version":"1.0.0"},"tags":[{"name":"Managed Custody KYC","description":"SDK KYC and shared-token KYC reuse for Managed Custody Mode."}],"servers":[{"url":"https://openapi.ur.app","description":"Production (partner API)"},{"url":"https://uropenapi-qa.ur-inc.xyz","description":"Testnet (partner API)"}],"security":[{"partnerAuth":[]},{"userWalletAuth":[]}],"components":{"securitySchemes":{"partnerAuth":{"type":"apiKey","in":"header","name":"X-Api-Signature","description":"Partner Auth: EIP-191 signature by the partner's registered backend key, with X-Api-Deadline and optional X-Api-PublicKey headers. See the Signature and verify guide."},"userWalletAuth":{"type":"apiKey","in":"header","name":"sign","description":"User wallet auth (External Wallet Access Mode): EIP-191 signature by the user's wallet key, with tokenId, network, hash, and deadline headers. See the Signature and verify guide."}},"schemas":{"KycCreateAccountRequest":{"type":"object","description":"Body for create-account. The user's identity travels in the X-External-User-Id header, not the body. Do not send a Sumsub applicantId on either KYC path; the applicant is assigned or handed off later.","required":["email"],"properties":{"email":{"type":"string","description":"The user's email address. Must be unique across UR partners; reusing the same email under a different partner returns L1_CONFLICT (code 30015)."},"nationality":{"type":"string","description":"ISO 3166-1 alpha-3 country code. Sending it lets UR fail country gates before the URID is minted."},"residency":{"type":"string","description":"ISO 3166-1 alpha-3 country code of residence."},"dob":{"type":"string","description":"Date of birth in YYYY-MM-DD format."},"documentExpiry":{"type":"string","description":"Passport or ID expiry date in YYYY-MM-DD format."}}},"KycCreateAccountResponse":{"type":"object","properties":{"code":{"type":"integer","description":"Business result code. 0 means success; business rejections return HTTP 200 with a non-zero code."},"message":{"type":"string","description":"Human-readable diagnostic for non-zero codes."},"data":{"type":"object","properties":{"sessionId":{"type":"string","description":"UUID for this onboarding attempt. Constant for the lifetime of the attempt; use it in every subsequent KYC endpoint."},"urId":{"type":"integer","format":"int64","description":"The user's URID, equal to the on-chain NFT token id. Stable for the user's lifetime across all retries."},"evmAddress":{"type":"string","description":"The user's UR-managed wallet address. Form A is signed by this address."},"state":{"type":"string","description":"Session entry state: ConfirmYourCountryOfResidence on the SDK path, PartnerDataIngestion on the shared-token path."},"idempotentReplay":{"type":"boolean","description":"True when an active onboarding session already exists for (partnerId, X-External-User-Id). The existing session is returned unchanged so repeated calls cannot mint duplicate URIDs."}}}}}}},"paths":{"/api/fma/v1/create-account":{"post":{"tags":["Managed Custody KYC"],"operationId":"kycMcCreateAccount","summary":"Create the account and onboarding session","description":"Mints or reuses the user's URID, provisions the UR-managed wallet, and opens an onboarding session. This is the first step of both Managed Custody KYC paths: the SDK path starts in state ConfirmYourCountryOfResidence and the shared-token path starts in state PartnerDataIngestion. Repeated calls with the same X-External-User-Id while a session is active return the existing session with idempotentReplay set to true.","parameters":[{"name":"X-External-User-Id","in":"header","required":true,"schema":{"type":"string"},"description":"Your partner-side user id. This endpoint identifies the user by X-External-User-Id only; there is no X-Ur-Id yet."},{"name":"X-Api-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"Partner Auth EIP-191 signature over the canonical message plus the deadline."},{"name":"X-Api-Deadline","in":"header","required":true,"schema":{"type":"string"},"description":"Unix timestamp in seconds after which the signature is no longer valid."},{"name":"X-Api-PublicKey","in":"header","required":true,"schema":{"type":"string"},"description":"Partner public key used to verify the signature."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KycCreateAccountRequest"}}}},"responses":{"200":{"description":"Business result envelope. code 0 means success; business rejections return HTTP 200 with a non-zero code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KycCreateAccountResponse"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ur.app/api-reference/api/kyc-and-kyb/managed-custody-kyc/create-the-account-and-onboarding-session.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
