# Teams

You can use the /v2/teams endpoints to manage the teams for your organization. The Team object is really versatile so that you can represent all types of organizational structure, from hierarchical to matrix structure. That's why you can be an admin of a team while not being a member of that team

# The team object

Attributes

  • admins array of string

    Array containing the user _id of the admins of the team.

  • members array of string

    Array containing the user _id of the members of the team.

  • _id string

    A unique identifier for the team.

  • organization string

    The _id of the organization.

  • extid string

    An external id set by yourself to identify the team on your side.

  • name string

    The name of the team.

  • level_name string

    The level name of the team. For instance: "top management", "regional team", "agency".

  • _id string

    Note that _id of admins and members might take user_id as an ObjectID from the users. For example, we want to create a team with existing users. These users already have their user_id. So as a members of new team they will have their members_id passed from user_id.

  • public boolean

    If public is true, members of the team will be visible without authentification as the team name. Only first name, last name and photo of team members are visible. By default this property is set to false.

THE LOCATOR OBJECT

{
  "admins": ["5f1077cf21f43b0b99660619"],
  "members": ["5f1077cf21f43b0b99660619", "5f1077e1eaf7c424af51a847"],
  "_id": "5ef9e5489b10b33ad0898ca3",
  "organization": "5ef0cb128f284274b2361323",
  "extid": "2",
  "name": "sales",
  "level_name": "agency"
}
{
  "members": [
    {"_id": user_id},
    {"email": "email@company.com"},
    {"extid": "UserIdInCompanyDatabase"}    
  ]
}

# List all teams

ENDPOINT Authorization apiKey

GET /v2/teams HTTP/1.1

Path parameters

No parameters.

    Query parameters

    No parameters.

      Returns

      Returns an array of Team objects if there is some existing teams in your organization. Otherwise, returns an empty array.

      CODE SAMPLE

      curl --request GET 'https://api.vyte.in/v2/teams/' \
      --header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0' \
      

      RESPONSE SAMPLE

      [
        {
          "admins": ["5f1077cf21f43b0b99660619"],
          "members": ["5f1077cf21f43b0b99660619", "5f1077e1eaf7c424af51a847"],
          "_id": "5ef9e5489b10b33ad0898ca3",
          "organization": "5ef0cb128f284274b2361323",
          "extid": "2",
          "name": "sales",
          "level_name": "agency"
          "public": "false"
        }
      ]
      

      # Retrieve a team

      ENDPOINT Authorization apiKey

      GET /v2/teams/:team_id HTTP/1.1
      

      Path parameters

      • team_id string required

        The _id of the team.

      • Query parameters

        No parameters.

          Returns

          Returns a Team object if a valid id was provided, and returns an error otherwise.

          CODE SAMPLE

          curl --request GET 'https://api.vyte.in/v2/teams/5ef9e5489b10b33ad0898ca3' \
          --header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0' \
          

          RESPONSE SAMPLE

          {
            "admins": ["5f1077cf21f43b0b99660619"],
            "members": ["5f1077cf21f43b0b99660619", "5f1077e1eaf7c424af51a847"],
            "_id": "5ef9e5489b10b33ad0898ca3",
            "organization": "5ef0cb128f284274b2361323",
            "extid": "2",
            "name": "sales",
            "level_name": "agency"
            "public": "false"
          }
          

          # Create a team

          ENDPOINT Authorization apiKey

          POST /v2/teams HTTP/1.1
          

          Path parameters

          No parameters.

            Query parameters

            No parameters.

              Body parameters

              • admins array of string

                Array containing the _id of the admins of the team.

              • members array of string

                Array containing the _id of the members of the team.

              • extid string required

                An external id set by yourself to identify the team on your side.

              • name string required

                The name of the team.

              • level_name string

                The level name of the team.

              • public boolean

                If public is true, members of the team will be visible without authentification as the team name. Only first name, last name and photo of team members are visible. By default this property is set to false.

              Returns

              Returns the created Team object if a valid body was provided, and returns an error otherwise.

              curl  --request POST 'https://api.vyte.in/v2/teams' \
              --header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0' \
              --header 'Content-Type: application/json' \
              --data-raw '{
                "admins": [
                  "5f1077cf21f43b0b99660619"
                ],
                "members": [
                  "5f1077cf21f43b0b99660619",
                  "5f1077e1eaf7c424af51a847",
                ],
                "organization": "5ef0cb128f284274b2361323",
                "extid": "2",
                "name": "sales",
                "level_name": "agency",
                "public": "false"
              }'
              

              RESPONSE SAMPLE

              {
                "admins": ["5f1077cf21f43b0b99660619"],
                "members": ["5f1077cf21f43b0b99660619", "5f1077e1eaf7c424af51a847"],
                "_id": "5ef9e5489b10b33ad0898ca3",
                "organization": "5ef0cb128f284274b2361323",
                "extid": "2",
                "name": "sales",
                "level_name": "agency"
                "public": "false"
              }
              

              # Update a team

              ENDPOINT Authorization apiKey

              PUT /v2/teams/:team_id HTTP/1.1
              

              Path parameters

              • team_id string required

                The _id of the team.

              • Query parameters

                No parameters.

                  Body parameters

                  • admins array of string

                    Array containing the _id of the admins of the team.

                  • members array of string

                    Array containing the _id of the members of the team.

                  • extid string

                    An external id set by yourself to identify the team on your side.

                  • name string

                    The name of the team.

                  • level_name string

                    The level name of the team.

                  • public boolean

                    If public is true, members of the team will be visible without authentification as the team name. Only first name, last name and photo of team members are visible. By default this property is set to false.

                  Returns

                  Returns the updated Team object if a valid body was provided, and returns an error otherwise.

                  curl  --request PUT 'https://api.vyte.in/v2/teams/5ef9e5489b10b33ad0898ca3' \
                  --header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0' \
                  --header 'Content-Type: application/json' \
                  --data-raw '{
                    "level_name": "company",
                  }'
                  

                  RESPONSE SAMPLE

                  {
                    "admins": ["5f1077cf21f43b0b99660619"],
                    "members": ["5f1077cf21f43b0b99660619", "5f1077e1eaf7c424af51a847"],
                    "_id": "5ef9e5489b10b33ad0898ca3",
                    "organization": "5ef0cb128f284274b2361323",
                    "extid": "2",
                    "name": "sales",
                    "level_name": "company"
                    "public": "false"
                  }
                  

                  # Delete a team

                  ENDPOINT Authorization apiKey

                  DELETE /v2/teams/:team_id HTTP/1.1
                  

                  Path parameters

                  • team_id string required

                    The _id of the team.

                  • Query parameters

                    No parameters.

                      Returns

                      Returns an object containing the number of row affected and the status if there is no error, and returns an error otherwise.

                      curl --request DELETE 'https://api.vyte.in/v2/teams/5ef9e5489b10b33ad0898ca3' \
                      --header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0'
                      

                      RESPONSE SAMPLE

                      {
                        "n": 1,
                        "ok": 1
                      }
                      

                      # Book an event with a member of a team

                      This endpoint will let you book an event with a member of the team. Vyte will assign that event to a member of the team depending on several customizable rules. Contact our support via Intercom or via email at support@vyte.in to know more.

                      ENDPOINT Authorization apiKey

                      POST /v2/teams/:team_id/events HTTP/1.1
                      

                      Path parameters

                      • team_id string required

                        The _id of the team.

                      • Body parameters

                          This is finally an Event object as for a classic event creation.

                        • confirmed hash

                          Information about the status of the event.

                          + Show child attributes

                          • confirmed. flag boolean
                            Whether or not the event is confirmed.
                        • created_by hash

                          Information about the user who created the event. If it is a smart group scheduling event, the created_by is the user who create the event; if it is a booking page event, the created_by is the user who exposed his availability.

                          + Show child attributes

                          • created_by. email string required
                            The creator email.
                        • dates array of hashes

                          Available dates for the event. If no dates are provided, the first user will be able to propose some dates.

                          + Show child attributes

                          • dates. all_day boolean
                            Whether or not the event lasts all day long.
                          • dates. date date required

                            Starting date of the event. The date is expressed according to ISO 8601.

                          • dates. end_date date required

                            Ending date of the event. The date is expressed according to ISO 8601.

                        • invitees array of hashes

                          Information about the invitees.

                          + Show child attributes

                          • invitees. full_name string
                            Full name of the invitee.
                          • invitees. email string required
                            Email of the invitee.
                          • invitees. phone string
                            Phone number of the invitee.
                        • lang string

                          Language of the event. It is expressed according to ISO 639-1 and the available languages are : fr, en, es, it, pt, de, sv, nl. Default is en.

                        • locale string

                          Locale of the event used for date formatting. It is expressed according to ISO 639-1 and the available languages are : fr, en, es, it, pt, de, sv, nl. Default is en.

                        • messages list of hashes

                          You can provide a first message sent in the event conversation. Moreover, this message will be in the body of the first mail sent to the event invitees.

                          + Show child attributes

                          • messages[0]. body string required
                            Body of the message.
                        • places array of hashes

                          Available places for the event.

                          + Show child attributes

                          • places. name string required
                            Name of the places.
                          • places. address string

                            Address of the places. It can be a url, a mailing address, a phone number or whatever you consider as a meeting place.

                        • timezone string

                          The event timezone expressed according to TZ database name.

                        • title string required
                          The event title.
                        • vyteme boolean required has to be set to true

                          Whether or not it is a vyteme event. If you need information about vyteme event, please check up the introduction part.

                        Returns

                        An Event object if there is no error.

                        CODE SAMPLE

                        curl --request POST 'https://api.vyte.in/v2/teams/5ef9e5489b10b33ad0898ca3/events' \
                        --header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0' \
                        --header 'Content-Type: application/json' \
                        --data-raw '{
                            "title": "First team event",
                            "created_by": {
                                "email": "creator@example.com"
                            },
                            "dates": [
                                {
                                    "all_day": false,
                                    "date": "2020-07-16T09:00:00",
                                    "end_date": "2020-07-16T10:00:00"
                                },
                                {
                                    "all_day": false,
                                    "date": "2020-07-16T14:00:00+0100",
                                    "end_date": "2020-07-16T15:00:00"
                                }
                            ],
                            "places": [
                                {
                                    "name": "Place for the meeting."
                                }
                            ]
                        }'
                        

                        RESPONSE SAMPLE

                        {
                          "created_by": {
                            "email": "creator@example.com",
                            "user": "5eecc40bb2181073ac6ff375",
                            "picture_url": "",
                            "full_name": "Jean Dupont"
                          },
                          "confirmed": {
                            "flag": false,
                            "updated_at": null,
                            "multi": false
                          },
                          "third_party": {
                            "group_ids": []
                          },
                          "ics_sequence": 0,
                          "version": 0,
                          "group_pro": false,
                          "identification_alternatives": [],
                          "_id": "5f0d7eb02003d0971e2a961a",
                          "title": "First team event",
                          "dates": [
                            {
                              "created_by": {
                                "user": "5eecc40bb2181073ac6ff375"
                              },
                              "votes": {
                                "yes": [
                                  {
                                    "created_by": {
                                      "user": "5eecc40bb2181073ac6ff375"
                                    },
                                    "_id": "5f0d7eb02003d04dab2a961f"
                                  }
                                ],
                                "no": []
                              },
                              "all_day": false,
                              "confirmed": false,
                              "confirmed_invitees": [],
                              "_id": "5f0d7eb02003d0174a2a961c",
                              "date": "2020-07-16T07:00:00.000Z",
                              "end_date": "2020-07-16T08:00:00.000Z",
                              "updatedAt": "2020-07-14T09:45:20.862Z",
                              "createdAt": "2020-07-14T09:45:20.862Z"
                            },
                            {
                              "created_by": {
                                "user": "5eecc40bb2181073ac6ff375"
                              },
                              "votes": {
                                "yes": [
                                  {
                                    "created_by": {
                                      "user": "5eecc40bb2181073ac6ff375"
                                    },
                                    "_id": "5f0d7eb02003d04ac22a9620"
                                  }
                                ],
                                "no": []
                              },
                              "all_day": false,
                              "confirmed": false,
                              "confirmed_invitees": [],
                              "_id": "5f0d7eb02003d04b512a961b",
                              "date": "2020-07-16T13:00:00.000Z",
                              "end_date": "2020-07-16T13:00:00.000Z",
                              "updatedAt": "2020-07-14T09:45:20.862Z",
                              "createdAt": "2020-07-14T09:45:20.862Z"
                            }
                          ],
                          "places": [
                            {
                              "created_by": {
                                "user": "5eecc40bb2181073ac6ff375"
                              },
                              "votes": {
                                "yes": [
                                  {
                                    "created_by": {
                                      "user": "5eecc40bb2181073ac6ff375"
                                    },
                                    "_id": "5f0d7eb02003d05ff72a9621"
                                  }
                                ],
                                "no": []
                              },
                              "source": "app",
                              "_id": "5f0d7eb02003d081072a961d",
                              "name": "Place for the meeting.",
                              "updatedAt": "2020-07-14T09:45:20.862Z",
                              "createdAt": "2020-07-14T09:45:20.862Z"
                            }
                          ],
                          "api": true,
                          "invitees": [
                            {
                              "created_by": {
                                "user": "5eecc40bb2181073ac6ff375"
                              },
                              "stats": {
                                "voted": {
                                  "dates": true,
                                  "places": true
                                }
                              },
                              "star": false,
                              "_id": "5f0d7eb02003d097742a961e",
                              "email": "creator@example.com",
                              "user": "5eecc40bb2181073ac6ff375",
                              "su": true,
                              "full_name": "Jean Dupont",
                              "picture_url": "",
                              "timezone": "Europe/Paris",
                              "locale": "fr"
                            }
                          ],
                          "messages": [],
                          "declines": [],
                          "lang": "en",
                          "locale": "en",
                          "updatedAt": "2020-07-14T09:45:20.862Z",
                          "createdAt": "2020-07-14T09:45:20.862Z",
                          "invitees_length": 1,
                          "email": "reply-to-participants-to-first-created-event-atpcovzku@vytein.mailgun.org",
                          "key_store": {
                            "_id": "5f0d7eb02003d0f6e32a9622",
                            "hash": {
                              "5eecc40bb2181073ac6ff375": "a2nv79gx86d5i0o3"
                            },
                            "updatedAt": "2020-07-14T09:45:20.870Z",
                            "createdAt": "2020-07-14T09:45:20.870Z",
                            "__v": 0
                          },
                          "links": null,
                          "__v": 0
                        }
                        

                        # List team members' events

                        List all the events in which team members are involved to (as an administrator or an invitee).

                        ENDPOINT Authorization apiKey

                        GET /v2/teams/:team_id/events HTTP/1.1
                        

                        Path parameters

                        • team_id string required

                          The _id of the team.

                        • Query parameters

                          • limit string

                            Limits the number of events you want in return.

                          • q regex

                            Search events by title using a regex.

                          • filter string

                            Filter events by status. Value can be confirmed or upcoming.

                          Returns

                          An array of Event objects. If there is no events available, return an empty array.

                          CODE SAMPLE

                          curl \
                          --request GET 'https://api.vyte.in/v2/teams/5ef9e5489b10b33ad0898ca3/events' \
                          --header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0' \
                          

                          RESPONSE SAMPLE

                          [
                            {
                              "_id": "569c3b6105dc780300951bd0",
                              "key_store": "569c3b6105dc780300951bd7",
                              "email": "reply-to-participants-to-meeting-for-project-vqdhhcxqd@vyte.in",
                              "invitees_length": 3,
                              "createdAt": "2016-01-18T01:09:53.477Z",
                              "updatedAt": "2016-01-18T01:10:05.670Z",
                              "alias": "alias_web_522984fb35eaa70200000007_1453079356811",
                              "app_url": "https://www.vyte.in",
                              "lang": "en",
                              "locale": "en",
                              "timezone": "Europe/Paris",
                              "title": "Meeting for project",
                              "__v": 3,
                              "version": 3,
                              "third_party": {
                                "app": "569c2e2fa28cc30300778c4c",
                                "group_ids": ["project_85fc5"],
                                "name": "superapp"
                              },
                              "ics_sequence": 0,
                              "confirmed": {
                                "updated_at": null,
                                "flag": false
                              },
                              "places": [
                                {
                                  "createdAt": "2016-01-18T01:09:53.290Z",
                                  "updatedAt": "2016-01-18T01:10:05.665Z",
                                  "name": "Appear.in",
                                  "address": "http://appear.in/cool-meeting",
                                  "icon": "P",
                                  "_id": "569c3b6105dc780300951bd3",
                                  "votes": {
                                    "no": [],
                                    "yes": [
                                      {
                                        "_id": "569c3b6105dc780300951bd6",
                                        "createdAt": "2016-01-18T01:09:54.161Z",
                                        "updatedAt": "2016-01-18T01:10:05.664Z",
                                        "created_by": {
                                          "user": "522984fb35eaa70200000007"
                                        }
                                      }
                                    ]
                                  },
                                  "created_by": {
                                    "user": "522984fb35eaa70200000007"
                                  },
                                  "source": "Appear.in"
                                }
                              ],
                              "dates": [
                                {
                                  "createdAt": "2016-01-18T01:10:05.665Z",
                                  "updatedAt": "2016-01-18T01:10:05.665Z",
                                  "date": "2016-01-22T10:00:00.000Z",
                                  "end_date": "2016-01-22T11:00:00.000Z",
                                  "_id": "569c3b6da28cc30300778c72",
                                  "votes": {
                                    "no": [],
                                    "yes": [
                                      {
                                        "_id": "569c3b6da28cc30300778c74",
                                        "created_by": {
                                          "user": "522984fb35eaa70200000007"
                                        }
                                      }
                                    ]
                                  },
                                  "created_by": {
                                    "user": "522984fb35eaa70200000007"
                                  },
                                  "all_day": false
                                },
                                {
                                  "createdAt": "2016-01-18T01:10:05.665Z",
                                  "updatedAt": "2016-01-18T01:10:05.665Z",
                                  "date": "2016-01-22T15:00:00.000Z",
                                  "end_date": "2016-01-22T16:00:00.000Z",
                                  "_id": "569c3b6da28cc30300778c73",
                                  "votes": {
                                    "no": [],
                                    "yes": [
                                      {
                                        "_id": "569c3b6da28cc30300778c76",
                                        "created_by": {
                                          "user": "522984fb35eaa70200000007"
                                        }
                                      }
                                    ]
                                  },
                                  "created_by": {
                                    "user": "522984fb35eaa70200000007"
                                  },
                                  "all_day": false
                                }
                              ],
                              "declines": [],
                              "messages": [
                                {
                                  "from": "martin.saintmac@gmail.com",
                                  "createdAt": "2016-01-18T01:09:53.290Z",
                                  "updatedAt": "2016-01-18T01:10:05.664Z",
                                  "body": "Another meeting for that project",
                                  "_id": "569c3b6105dc780300951bd4",
                                  "created_by": {
                                    "user": "522984fb35eaa70200000007"
                                  }
                                }
                              ],
                              "invitees": [],
                              "created_by": {
                                "full_name": "Martin Saint-Macary",
                                "picture_url": "https://lh3.googleusercontent.com/-PWeG6KmcyVw/AAAAAAAAAAI/AAAAAAAAJa4/kcQXhsmUmTQ/photo.jpg",
                                "user": "522984fb35eaa70200000007",
                                "email": "martin.saintmac@gmail.com"
                              }
                            },
                            {
                              "_id": "569c3afaa28cc30300778c69",
                              "key_store": "569c3afba28cc30300778c71",
                              "email": "reply-to-participants-to-meeting-martin-saint-macary-martin-saint-macary-awtdmgsnm@vyte.in",
                              "invitees_length": 2,
                              "createdAt": "2016-01-18T01:08:11.524Z",
                              "updatedAt": "2016-01-18T01:08:12.691Z",
                              "alias": "alias_web_522984fb35eaa70200000007_1453079284514",
                              "app_url": "https://www.vyte.in",
                              "lang": "en",
                              "locale": "en",
                              "timezone": "Europe/Paris",
                              "title": "Meeting Martin Saint-Macary, Martin Saint-Macary",
                              "__v": 1,
                              "version": 1,
                              "third_party": {
                                "app": "569c2e2fa28cc30300778c4c",
                                "group_ids": ["project_85fc5"],
                                "name": "superapp"
                              },
                              "ics_sequence": 0,
                              "confirmed": {
                                "updated_at": null,
                                "flag": false
                              },
                              "places": [
                                {
                                  "createdAt": "2016-01-18T01:08:10.933Z",
                                  "updatedAt": "2016-01-18T01:08:12.688Z",
                                  "name": "Skype",
                                  "address": "martin.saint-macary",
                                  "_id": "569c3afaa28cc30300778c6c",
                                  "votes": {
                                    "no": [],
                                    "yes": [
                                      {
                                        "_id": "569c3afba28cc30300778c6f",
                                        "createdAt": "2016-01-18T01:08:12.688Z",
                                        "updatedAt": "2016-01-18T01:08:12.688Z",
                                        "created_by": {
                                          "user": "522984fb35eaa70200000007"
                                        }
                                      }
                                    ]
                                  },
                                  "created_by": {
                                    "user": "522984fb35eaa70200000007"
                                  },
                                  "source": "app"
                                },
                                {
                                  "createdAt": "2016-01-18T01:08:10.934Z",
                                  "updatedAt": "2016-01-18T01:08:12.689Z",
                                  "name": "Google Hangouts",
                                  "address": "martin@vytein.com",
                                  "_id": "569c3afaa28cc30300778c6b",
                                  "votes": {
                                    "no": [],
                                    "yes": [
                                      {
                                        "_id": "569c3afba28cc30300778c70",
                                        "createdAt": "2016-01-18T01:08:12.688Z",
                                        "updatedAt": "2016-01-18T01:08:12.688Z",
                                        "created_by": {
                                          "user": "522984fb35eaa70200000007"
                                        }
                                      }
                                    ]
                                  },
                                  "created_by": {
                                    "user": "522984fb35eaa70200000007"
                                  },
                                  "source": "app"
                                }
                              ],
                              "dates": [],
                              "declines": [],
                              "messages": [
                                {
                                  "from": "martin.saintmac@gmail.com",
                                  "createdAt": "2016-01-18T01:08:10.934Z",
                                  "updatedAt": "2016-01-18T01:08:12.688Z",
                                  "body": "Hi Martin, please find my suggestions for our 15 min call setup session on vyte.in. Best",
                                  "_id": "569c3afaa28cc30300778c6d",
                                  "created_by": {
                                    "user": "522984fb35eaa70200000007"
                                  }
                                }
                              ],
                              "invitees": [],
                              "created_by": {
                                "full_name": "Martin Saint-Macary",
                                "picture_url": "https://lh3.googleusercontent.com/-PWeG6KmcyVw/AAAAAAAAAAI/AAAAAAAAJa4/kcQXhsmUmTQ/photo.jpg",
                                "user": "522984fb35eaa70200000007",
                                "email": "martin.saintmac@gmail.com"
                              }
                            }
                          ]
                          

                          # List public team

                          ENDPOINT No authorization

                          GET /v2/teams/:team_id/public HTTP/1.1
                          

                          Path parameters

                          • team_id string required

                            The _id of the team.

                          • Query parameters

                            No parameters.

                              Returns

                              Returns team _id, team name and list of members. Member description includes first and last names, photo and member _id. Works only if public property of the team is set true.

                              curl --request GET 'https://api.vyte.in/v2/teams/5ef9e5489b10b33ad0898ca3/public' \
                              

                              RESPONSE SAMPLE

                              {
                                "_id": "5ef9e5489b10b33ad0898ca3"
                                "name": "test public team"
                                "members": [
                                   {"_id": "5fda0414a4d645001d148243"
                                    "first_name": "John"
                                    "last_name": "Dow"
                                    "picture_url": "https://domain.com/john.jpg"
                                   },
                                   {"_id": "5fda0414a4d645001d148241"
                                    "first_name": "Jane"
                                    "last_name": "Dow"
                                    "picture_url": "https://domain.com/jane.jpg"
                                   }
                                ]
                                
                              }