# Create Wallet

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://api.g.alchemy.com/signer/v1/signup

Enables the creation of a Smart Wallet using Alchemy Signer. It allows applications to authenticate users and facilitate signature operations on their behalf. A Smart Wallet is either an on-chain Modular Account with Alchemy Signer as the owner, a standalone EOA signer managed through Alchemy Signer, or a standalone Solana Wallet managed through the Alchemy Signer.


Reference: https://www.alchemy.com/docs/wallets/api-reference/signer/signer-api-endpoints/create-account

## Headers

| Name | Type | Required | Description |
|------|------|----------|-------------|
| Authorization | string | Yes | Bearer token authentication. Use 'Bearer <apiKey>' as the value. |

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://api.g.alchemy.com/signer/v1/signup \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "string",
  "passkey": {
    "challenge": "string",
    "attestation": {
      "credentialId": "string",
      "clientDataJson": "string",
      "attestationObject": "string",
      "transports": [
        "string"
      ]
    }
  },
  "targetPublicKey": "string",
  "expirationSeconds": "string",
  "redirectParams": "string"
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    email: 'string',
    passkey: {
      challenge: 'string',
      attestation: {
        credentialId: 'string',
        clientDataJson: 'string',
        attestationObject: 'string',
        transports: ['string']
      }
    },
    targetPublicKey: 'string',
    expirationSeconds: 'string',
    redirectParams: 'string'
  })
};

fetch('https://api.g.alchemy.com/signer/v1/signup', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.g.alchemy.com/signer/v1/signup"

payload = {
    "email": "string",
    "passkey": {
        "challenge": "string",
        "attestation": {
            "credentialId": "string",
            "clientDataJson": "string",
            "attestationObject": "string",
            "transports": ["string"]
        }
    },
    "targetPublicKey": "string",
    "expirationSeconds": "string",
    "redirectParams": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.g.alchemy.com/signer/v1/signup"

	payload := strings.NewReader("{\n  \"email\": \"string\",\n  \"passkey\": {\n    \"challenge\": \"string\",\n    \"attestation\": {\n      \"credentialId\": \"string\",\n      \"clientDataJson\": \"string\",\n      \"attestationObject\": \"string\",\n      \"transports\": [\n        \"string\"\n      ]\n    }\n  },\n  \"targetPublicKey\": \"string\",\n  \"expirationSeconds\": \"string\",\n  \"redirectParams\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://api.g.alchemy.com/signer/v1/signup")
  .header("Content-Type", "application/json")
  .header("Authorization", "Bearer <token>")
  .body("{\n  \"email\": \"string\",\n  \"passkey\": {\n    \"challenge\": \"string\",\n    \"attestation\": {\n      \"credentialId\": \"string\",\n      \"clientDataJson\": \"string\",\n      \"attestationObject\": \"string\",\n      \"transports\": [\n        \"string\"\n      ]\n    }\n  },\n  \"targetPublicKey\": \"string\",\n  \"expirationSeconds\": \"string\",\n  \"redirectParams\": \"string\"\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://api.g.alchemy.com/signer/v1/signup");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n  \"email\": \"string\",\n  \"passkey\": {\n    \"challenge\": \"string\",\n    \"attestation\": {\n      \"credentialId\": \"string\",\n      \"clientDataJson\": \"string\",\n      \"attestationObject\": \"string\",\n      \"transports\": [\n        \"string\"\n      ]\n    }\n  },\n  \"targetPublicKey\": \"string\",\n  \"expirationSeconds\": \"string\",\n  \"redirectParams\": \"string\"\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## Operation Specification

```yaml
path: /signup
method: POST
operation:
  summary: Create Wallet
  description: |
    Enables the creation of a Smart Wallet using Alchemy Signer. It allows applications to authenticate users and facilitate signature operations on their behalf. A Smart Wallet is either an on-chain Modular Account with Alchemy Signer as the owner, a standalone EOA signer managed through Alchemy Signer, or a standalone Solana Wallet managed through the Alchemy Signer.
  security:
    - apiKey: []
  x-readme:
    samples-languages:
      - javascript
      - curl
      - python
      - go
  requestBody:
    content:
      application/json:
        schema:
          type: object
          properties:
            email:
              type: string
              description: Used for user authentication when passkey is not provided. Specifies the user's email address.
            passkey:
              type: object
              description: Used for authentication when email is not provided. Enables passkey-based authentication.
              properties:
                challenge:
                  type: string
                  description: A challenge string for passkey authentication.
                attestation:
                  type: object
                  description: Provides attestation details required for passkey authentication.
                  properties:
                    credentialId:
                      type: string
                      description: The credential ID used for attestation.
                    clientDataJson:
                      type: string
                      description: JSON data from the client used for attestation.
                    attestationObject:
                      type: string
                      description: The attestation object received during the authentication process.
                    transports:
                      type: array
                      description: Transport protocols used during attestation.
                      items:
                        type: string
                  required:
                    - credentialId
                    - clientDataJson
                    - attestationObject
                    - transports
              required:
                - challenge
                - attestation
            targetPublicKey:
              type: string
              description: |
                Authentication of a client is done via an HPKE flow that allows the client and TEE to exchange an encrypted bundle without revealing it to a middleman (you, us, or Turnkey). The targetPublicKey is the public key that the client uses to decrypt the shared secret.

                See more in the [Turnkey Docs](https://docs.turnkey.com/embedded-wallets/sub-organization-auth).
            expirationSeconds:
              type: string
              description: |
                Specifies the duration of the login session in seconds. After this period, the user has to re-login to refresh their session. The default value is 900 seconds (15 minutes).
            redirectParams:
              type: string
              description: Redirect parameters appended to the magic link.
  responses:
    '200':
      description: Wallet creation response.
      content:
        application/json:
          schema:
            type: object
            properties:
              orgId:
                type: string
                description: The organization ID associated with the user and application, enabling the management of Smart Wallets.
              userId:
                type: string
                description: A unique identifier for the user.
              address:
                type: string
                description: The EVM address of the signer.
              solanaAddress:
                type: string
                description: The Solana address of the signer.
              otpId:
                type: string
                description: OTP request identifier
            required:
              - orgId
  operationId: createAccount
```
