Invite Users to Group
    • Dark
      Light
    • PDF

    Invite Users to Group

    • Dark
      Light
    • PDF

    Article summary

    Post
    /api/v1/groups.invite

    Invite one user or bulk users to the group/channel.

    Changelog

    VersionDescription
    0.48.0Added
    Header parameters
    X-Auth-Token
    stringRequired

    The authToken of the authenticated user.

    ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
    X-User-Id
    stringRequired

    The userId of the authenticated user.

    ExamplerbAXPnMktTFbNpwtJ
    Body parameters
    Example
    {
      "roomId": "ByehQjC44FwMeiLbX",
      "userId": "nSYqWzZ4GsKTX4dyK"
    }
    object
    roomId
    string Required

    The group ID

    userId
    string Required

    The ID of the user to be invited. You can also use the parameter userIds as an array to invite more than one user. For example, ["nSYqWzZ4GsKTX4dyK", "SYqWzZ4Gsasdfgh"]

    Responses
    200

    OK

    Success
    {
      "group": {
        "_id": "ByehQjC44FwMeiLbX",
        "ts": "2016-11-30T21:23:04.737Z",
        "t": "p",
        "name": "testing",
        "usernames": [
          "testing",
          "testing1"
        ],
        "u": {
          "_id": "aobEdbYhXfu5hkeqG",
          "username": "testing1"
        },
        "msgs": 1,
        "_updatedAt": "2016-12-09T12:50:51.575Z",
        "lm": "2016-12-09T12:50:51.555Z"
      },
      "success": true
    }
    Expand All
    object
    group
    object
    _id
    string
    ts
    string
    t
    string
    name
    string
    usernames
    Array of string
    string
    u
    object
    _id
    string
    username
    string
    msgs
    integer
    _updatedAt
    string
    lm
    string
    success
    boolean
    400

    Bad Request

    Permission required
    {
      "success": false,
      "error": "Not allowed [error-not-allowed]",
      "errorType": "error-not-allowed",
      "details": {
        "method": "addUsersToRoom"
      }
    }
    Expand All
    object
    success
    boolean
    error
    string
    errorType
    string
    details
    object
    method
    string

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.