# Create a roster

Section: Your data › Rosters

```
POST https://ba.joexyz.online/api/v1/me/rosters
```

Creates a roster and returns it.

## Authentication

Bearer Token — `Authorization: Bearer <token>` (inherited from folder "Your data")

## Headers

| Name | Value |
| --- | --- |
| `Content-Type` | `application/json` |

## Body

Content type: `application/json`

```json
{
  "name": "Joe",
  "introduction": "Hello.\n\n**Note:** This isn't my full roster. Let me know if there's anyone in particular that you're looking for.",
  "accountLevel": 90,
  "studentRepId": "kei",
  "visibility": "public",
  "gameServer": "EU",
  "friendCode": "KQZRTVMW"
}
```

## Example responses

### 201 Created

```json
{
  "data": {
    "id": "k17fp61xb5wqf8f6ge798sa1t17sg20f",
    "createdAt": "2025-10-15T00:22:23.815Z",
    "name": "Joe",
    "accountLevel": 90,
    "friendCode": "KQZRTVMW",
    "gameServer": "EU",
    "introduction": "Hello.\n\n**Note:** This isn't my full roster. Let me know if there's anyone in particular that you're looking for.",
    "lastUpdated": 1783978245235,
    "studentRepId": "kei",
    "students": [],
    "visibility": "public"
  }
}
```

### 400 Bad Request

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Object is missing the required field `friendCode`."
  }
}
```

## Examples

### cURL

```bash
curl -X POST https://ba.joexyz.online/api/v1/me/rosters \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {{api_key}}' \
  --data-raw '{
  "name": "Joe",
  "introduction": "Hello.\n\n**Note:** This isn'\''t my full roster. Let me know if there'\''s anyone in particular that you'\''re looking for.",
  "accountLevel": 90,
  "studentRepId": "kei",
  "visibility": "public",
  "gameServer": "EU",
  "friendCode": "KQZRTVMW"
}'
```

### JavaScript

```javascript
const response = await fetch("https://ba.joexyz.online/api/v1/me/rosters", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer {{api_key}}",
  },
  body: JSON.stringify({
    "name": "Joe",
    "introduction": "Hello.\n\n**Note:** This isn't my full roster. Let me know if there's anyone in particular that you're looking for.",
    "accountLevel": 90,
    "studentRepId": "kei",
    "visibility": "public",
    "gameServer": "EU",
    "friendCode": "KQZRTVMW"
  }),
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

url = "https://ba.joexyz.online/api/v1/me/rosters"
headers = {
    "Authorization": "Bearer {{api_key}}",
}
payload = {
    "name": "Joe",
    "introduction": "Hello.\n\n**Note:** This isn't my full roster. Let me know if there's anyone in particular that you're looking for.",
    "accountLevel": 90,
    "studentRepId": "kei",
    "visibility": "public",
    "gameServer": "EU",
    "friendCode": "KQZRTVMW",
}

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

### Go

```go
package main

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

func main() {
	body := strings.NewReader(`{
  "name": "Joe",
  "introduction": "Hello.\n\n**Note:** This isn't my full roster. Let me know if there's anyone in particular that you're looking for.",
  "accountLevel": 90,
  "studentRepId": "kei",
  "visibility": "public",
  "gameServer": "EU",
  "friendCode": "KQZRTVMW"
}`)

	req, err := http.NewRequest("POST", "https://ba.joexyz.online/api/v1/me/rosters", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", "Bearer {{api_key}}")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	data, _ := io.ReadAll(res.Body)
	fmt.Println(string(data))
}
```
