> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Team

> Create a new Team record.

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`Team-Create`** role.
</Note>

## Request Body

### Required Fields

<ParamField body="BusinessId" type="integer" required>
  Business Id.
</ParamField>

<ParamField body="Name" type="string" required>
  Team name.
</ParamField>

### Optional Fields

<ParamField body="Description" type="string">
  Team description.
</ParamField>

<ParamField body="TunnelPrivateGroupId" type="string">
  Tunnel private group ID.
</ParamField>

<ParamField body="TeamMembers" type="integer[]">
  Team Members.
</ParamField>

<ParamField body="TeamAdministrators" type="integer[]">
  Team Administrators.
</ParamField>

<ParamField body="CreateSingleInvoiceForTeam" type="boolean">
  Create a single invoice for the team.
</ParamField>

<ParamField body="UseSpecialPrices" type="boolean">
  Use special prices.
</ParamField>

<ParamField body="PayingMemberId" type="integer">
  Paying Member Id.
</ParamField>

<ParamField body="DefaultMemberTariffId" type="integer">
  Default Member Tariff Id.
</ParamField>

<ParamField body="MaxTeamMemberCount" type="number">
  Maximum team member count.
</ParamField>

<ParamField body="TransferCreditsToPayingMember" type="boolean">
  Transfer credits to paying member.
</ParamField>

<ParamField body="ShareTimePasses" type="boolean">
  Share time passes.
</ParamField>

<ParamField body="ShareExtraServices" type="boolean">
  Share extra services.
</ParamField>

<ParamField body="ShareBookingCredit" type="boolean">
  Share booking credit.
</ParamField>

<ParamField body="DiscountExtraServices" type="number">
  Discount for extra services.
</ParamField>

<ParamField body="DiscountTimePasses" type="number">
  Discount for time passes.
</ParamField>

<ParamField body="DiscountCharges" type="number">
  Discount for charges.
</ParamField>

<ParamField body="DiscountTariffs" type="number">
  Discount for tariffs.
</ParamField>

<ParamField body="ProfileSummary" type="string">
  Profile summary.
</ParamField>

<ParamField body="ProfileTags" type="string">
  Profile tags.
</ParamField>

<ParamField body="ProfileWebsite" type="string">
  Profile website.
</ParamField>

<ParamField body="GoogleMapsLink" type="string">
  Google Maps link.
</ParamField>

<ParamField body="ProfileIsPublic" type="boolean">
  Whether the profile is public.
</ParamField>

<ParamField body="HasCommunityGroup" type="boolean">
  Whether the team has a community group.
</ParamField>

<ParamField body="NewTeamLogoUrl" type="string">
  New Team Logo Url.
</ParamField>

<ParamField body="ClearTeamLogoFile" type="boolean">
  Clear Team Logo File.
</ParamField>

<ParamField body="NewTeamImage1Url" type="string">
  New Team Image1Url.
</ParamField>

<ParamField body="ClearTeamImage1File" type="boolean">
  Clear Team Image1File.
</ParamField>

<ParamField body="NewTeamImage2Url" type="string">
  New Team Image2Url.
</ParamField>

<ParamField body="ClearTeamImage2File" type="boolean">
  Clear Team Image2File.
</ParamField>

<ParamField body="NewTeamImage3Url" type="string">
  New Team Image3Url.
</ParamField>

<ParamField body="ClearTeamImage3File" type="boolean">
  Clear Team Image3File.
</ParamField>

<ParamField body="Twitter" type="string">
  Twitter handle.
</ParamField>

<ParamField body="Facebook" type="string">
  Facebook URL.
</ParamField>

<ParamField body="Linkedin" type="string">
  LinkedIn URL.
</ParamField>

<ParamField body="Skype" type="string">
  Skype handle.
</ParamField>

<ParamField body="Telegram" type="string">
  Telegram handle.
</ParamField>

<ParamField body="Github" type="string">
  GitHub URL.
</ParamField>

<ParamField body="Pinterest" type="string">
  Pinterest URL.
</ParamField>

<ParamField body="Flickr" type="string">
  Flickr URL.
</ParamField>

<ParamField body="Instagram" type="string">
  Instagram URL.
</ParamField>

<ParamField body="Vimeo" type="string">
  Vimeo URL.
</ParamField>

<ParamField body="Tumblr" type="string">
  Tumblr URL.
</ParamField>

<ParamField body="Blogger" type="string">
  Blogger URL.
</ParamField>

<ParamField body="DisableAttendanceDashboard" type="boolean">
  Disable attendance dashboard.
</ParamField>

<ParamField body="ExtraServices" type="integer[]">
  Extra Services.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    "https://spaces.nexudus.com/api/spaces/teams" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "BusinessId": 0,
      "Name": ""
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/spaces/teams',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        BusinessId: 0,
        Name: ''
      })
    }
  );

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

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://spaces.nexudus.com/api/spaces/teams',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'BusinessId': 0,
          'Name': ''
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="Status" type="integer">
  HTTP status code. `200` on success.
</ResponseField>

<ResponseField name="Message" type="string">
  A human-readable message confirming the creation.
</ResponseField>

<ResponseField name="Value" type="object">
  Contains the `Id` of the newly created record.
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `true` if the team was created successfully.
</ResponseField>

<ResponseField name="Errors" type="array">
  `null` on success.
</ResponseField>

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "Team was successfully created.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}
```

### 400

<ResponseField name="Message" type="string">
  A summary of the validation error(s), in the format `PropertyName: error message`.
</ResponseField>

<ResponseField name="Value" type="any">
  `null` on validation failure.
</ResponseField>

<ResponseField name="Errors" type="object[]">
  Array of validation errors.

  <Expandable>
    <ResponseField name="AttemptedValue" type="any">
      The value that was submitted for the field, or `null` if missing.
    </ResponseField>

    <ResponseField name="Message" type="string">
      The validation error message.
    </ResponseField>

    <ResponseField name="PropertyName" type="string">
      The name of the property that failed validation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `false` when the request fails validation.
</ResponseField>

```json Example Response theme={null}
{
  "Message": "Name: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Name"
    }
  ],
  "WasSuccessful": false
}
```
