> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.astropods.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.astropods.com/_mcp/server.

# Create an account

POST https://astropods.com/api/v1/accounts
Content-Type: application/json

Creates a personal or team account for the signed-in user.

Reference: https://docs.astropods.com/api-reference/astropods-api/accounts/create-an-account

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects a CreateAccountRequest.

- `display_name` (string, optional)
- `invitations` (list of AccountInvitation, optional)
- `name` (string, optional)
- `type` (string, optional)

## Response

### 201

Created

- `account_number` (integer, optional, nullable)
- `allowed_clusters` (list of ClusterBinding, optional)
- `avatar_url` (string, optional)
- `bio` (string, optional)
- `blueprint_order` (list of string, optional)
- `created_at` (string, optional)
- `display_name` (string, optional)
- `id` (string, optional)
- `invitations` (list of InviteResult, optional)
- `joined_account` (string, optional)
- `local_timezone` (string, optional)
- `location` (string, optional)
- `name` (string, optional)
- `owner` (AccountOwner, optional)
- `pronouns` (string, optional)
- `social_links` (list of string, optional)
- `type` (string, optional)
- `updated_at` (string, optional)
- `website` (string, optional)

## Errors

### 402 Payment Required Error

Payment Required

- `code` (string, optional)
- `details` (string, optional)
- `error` (string, optional)

### 409 Conflict Error

Conflict

- `code` (string, optional)
- `details` (string, optional)
- `error` (string, optional)

## Types

### AccountInvitation

- `kind` (string, optional)
- `role` (string, optional)
- `value` (string, optional)

### ClusterBinding

- `cluster_id` (string, optional)
- `display_name` (string, optional)
- `is_default` (boolean, optional)
- `private_link` (boolean, optional)
- `region` (string, optional)
- `region_flag` (string, optional)
- `region_label` (string, optional)

### InviteResult

- `email` (string, optional)
- `error` (string, optional)
- `invitation` (Invitation, optional)
- `kind` (string, optional)
- `success` (boolean, optional)
- `value` (string, optional)

### AccountOwner

- `first_name` (string, optional)
- `last_name` (string, optional)
- `profile_picture_url` (string, optional)

### Invitation

- `created_at` (string, optional)
- `email` (string, optional)
- `expires_at` (string, optional)
- `id` (string, optional)
- `inviter_user_id` (string, optional)
- `organization_id` (string, optional)
- `state` (string, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "account_number": 1,
  "allowed_clusters": [
    {
      "cluster_id": "string",
      "display_name": "string",
      "is_default": true,
      "private_link": true,
      "region": "string",
      "region_flag": "string",
      "region_label": "string"
    }
  ],
  "avatar_url": "string",
  "bio": "string",
  "blueprint_order": [
    "string"
  ],
  "created_at": "string",
  "display_name": "string",
  "id": "string",
  "invitations": [
    {
      "email": "string",
      "error": "string",
      "invitation": {
        "created_at": "string",
        "email": "string",
        "expires_at": "string",
        "id": "string",
        "inviter_user_id": "string",
        "organization_id": "string",
        "state": "string"
      },
      "kind": "string",
      "success": true,
      "value": "string"
    }
  ],
  "joined_account": "string",
  "local_timezone": "string",
  "location": "string",
  "name": "string",
  "owner": {
    "first_name": "string",
    "last_name": "string",
    "profile_picture_url": "string"
  },
  "pronouns": "string",
  "social_links": [
    "string"
  ],
  "type": "string",
  "updated_at": "string",
  "website": "string"
}
```

**SDK Code**

```python
import requests

url = "https://astropods.com/api/v1/accounts"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://astropods.com/api/v1/accounts';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://astropods.com/api/v1/accounts"

	payload := strings.NewReader("{}")

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

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

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://astropods.com/api/v1/accounts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://astropods.com/api/v1/accounts")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://astropods.com/api/v1/accounts', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://astropods.com/api/v1/accounts");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://astropods.com/api/v1/accounts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```