Create Teams

The Create Teams API allows you to create a team within Zenput.

Below is a sample call and a full description of input format, input parameters, and success and error output formats.

POST: /api/v3/teams/

$ curl -X POST \
  https://www.zenput.com/api/v3/teams/ \
    -H 'content-type: application/json' \
  -H 'X-API-TOKEN: your-api-token-goes-here' \
  -d '{
  "name": "Team name",
  "description": "Team description",
  "users": [
    {
      "id": 0
    }
  ],
  "locations": [
    {
      "id": 0
    }
  ],
  "external_key": "team-external-key",
  "parent": {
    "id": 0
  }
}'

Input format:

{
  "name": name,
  "description": description,
  "users": [
    {
      "id": user_id,
    }
  ],
  "locations": [
    {
      "id": location_id
    }
  ],
  "external_key": external_key,
  "parent": {
    "id": parent_id,
  }
}

Input parameters

Name

Required

Type

Description

name

Required

Text

Team's name

description

No

Text

Team's description

user_id

No

Integer

ID from an existing user to be assigned to this team.

location_id

No

Integer

ID from an existing location to be assigned to this team.

external_key

No

Text

A value to uniquely identify this team. If provided, it needs to be unique.

parent_id

No

Integer

ID from an existing team, to set it as the parent for the new team

🚧

IDs must be from an existing resource

*_id parameters must be from already existing resources.

Output format, success

{
  "meta": {
    "status_code": 201
  },
  "data": {
    "id": 0,
    "name": "Team name",
    "description": "Team description",
    "children": [],
    "users": [
      {
        "id": 1,
        "username": "[email protected]",
        "display_name": "Example user",
        "user_role": {
          "id": 1,
          "name": "User role"
        },
        "groups": [
          {
            "id": 1,
            "name": "Submitter"
          }
        ]
      }
    ],
    "locations": [
      {
        "id": 1,
        "name": "Location name",
        "is_active": true
      }
    ],
    "company": {
      "id": 1,
      "name": "Zenput",
      "features": []
    },
    "external_key": "team-external-key",
    "created_user": {
      "id": 1,
      "username": "[email protected]",
      "display_name": "Example user",
      "user_role": {
        "id": 1,
        "name": "User role"
      },
      "groups": [
        {
          "id": 1,
          "name": "Submitter"
        }
      ]
    },
    "parent": {
      "id": 1,
      "name": "Parent team name"
    },
    "is_editable": true,
    "is_company_root": false,
    "has_accounts": true,
    "has_children": false,
    "has_users": true
  }
}

Output format, failure

{
  "meta": {
    "status_code": 400
  },
  "errors": [
    {
      "field": "locations",
      "message": "One or more objects do not exist",
      "code": "invalid"
    }
  ]
}