# Create a formation preset

Section: Your data › PVP tracker › Formation presets

```
POST https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/formation-presets
```

Saves one of your teams. `matchType` is `attack`, `defense` or `both`.

**Parameters**

- `seasonId` (path): The season id.

## Authentication

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

## Path parameters

| Name | Value |
| --- | --- |
| `seasonId` |  |

## Headers

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

## Body

Content type: `application/json`

```json
{
  "name": "Shun SHanako DEF",
  "matchType": "defense",
  "team": [
    {
      "studentId": "yuuka"
    },
    {
      "studentId": "hanako_swimsuit"
    },
    {
      "studentId": "shun"
    },
    {
      "studentId": "tsubaki"
    },
    {
      "studentId": "michiru_dress"
    },
    {
      "studentId": "hibiki"
    }
  ],
  "usedByMe": true
}
```

## Example responses

### 201 Created

```json
{
  "data": {
    "id": "mh7d76991k97a1ah49qegezqsh8e1nga",
    "createdAt": "2026-09-08T18:36:12.624Z",
    "name": "Shun SHanako DEF",
    "matchType": "defense",
    "seasonId": "kh73y62jqqhmwbxbnrtpdfe7w18dydwx",
    "team": [
      {
        "studentId": "yuuka"
      },
      {
        "studentId": "hanako_swimsuit"
      },
      {
        "studentId": "shun"
      },
      {
        "studentId": "tsubaki"
      },
      {
        "studentId": "michiru_dress"
      },
      {
        "studentId": "hibiki"
      }
    ],
    "teamKey": "c5cf00744a2aa7a4",
    "usedByMe": true
  }
}
```

## Examples

### cURL

```bash
curl -X POST https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/formation-presets \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {{api_key}}' \
  --data-raw '{
  "name": "Shun SHanako DEF",
  "matchType": "defense",
  "team": [
    {
      "studentId": "yuuka"
    },
    {
      "studentId": "hanako_swimsuit"
    },
    {
      "studentId": "shun"
    },
    {
      "studentId": "tsubaki"
    },
    {
      "studentId": "michiru_dress"
    },
    {
      "studentId": "hibiki"
    }
  ],
  "usedByMe": true
}'
```

### JavaScript

```javascript
const response = await fetch("https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/formation-presets", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer {{api_key}}",
  },
  body: JSON.stringify({
    "name": "Shun SHanako DEF",
    "matchType": "defense",
    "team": [
      {
        "studentId": "yuuka"
      },
      {
        "studentId": "hanako_swimsuit"
      },
      {
        "studentId": "shun"
      },
      {
        "studentId": "tsubaki"
      },
      {
        "studentId": "michiru_dress"
      },
      {
        "studentId": "hibiki"
      }
    ],
    "usedByMe": true
  }),
});

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

### Python

```python
import requests

url = "https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/formation-presets"
headers = {
    "Authorization": "Bearer {{api_key}}",
}
payload = {
    "name": "Shun SHanako DEF",
    "matchType": "defense",
    "team": [
        {
            "studentId": "yuuka",
        },
        {
            "studentId": "hanako_swimsuit",
        },
        {
            "studentId": "shun",
        },
        {
            "studentId": "tsubaki",
        },
        {
            "studentId": "michiru_dress",
        },
        {
            "studentId": "hibiki",
        },
    ],
    "usedByMe": True,
}

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": "Shun SHanako DEF",
  "matchType": "defense",
  "team": [
    {
      "studentId": "yuuka"
    },
    {
      "studentId": "hanako_swimsuit"
    },
    {
      "studentId": "shun"
    },
    {
      "studentId": "tsubaki"
    },
    {
      "studentId": "michiru_dress"
    },
    {
      "studentId": "hibiki"
    }
  ],
  "usedByMe": true
}`)

	req, err := http.NewRequest("POST", "https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/formation-presets", 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))
}
```
