---
agentTools:
  projectIndex: https://uspacy.readme.io/llms.txt
---

# Transfer groups to another user.

Transfer groups to another user.

# OpenAPI definition

````json
{
  "openapi": "3.1.0",
  "info": {
    "description": "This is [Uspacy](https://uspacy.com)  API documentation. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\nor on [irc.freenode.net, #swagger](http://swagger.io/irc/).\n\n# Introduction\nTo use this API you need to get Bearer token. To get Bearer token you have two options:\n  - sign in on user's Uspacy using email and password\n  - create Marketplace application and get token in callback after your application was installed by user\n\n# SDKs and boilerplates\nWe provide SDKs for different languages to simplify integration with Uspacy API. You can find them on [Uspacy GitHub](https://github.com/Uspacy/)\nWe have also prepared a few boilerplates to help you start developing your application\n  - [Uspacy Marketplace application boilerplate](https://github.com/Uspacy/app-laravel-template) - Laravel application with Uspacy authentication and token refreshment\n  - [Uspacy Golang SDK](https://github.com/Uspacy/uspacy-go-sdk) – Golang SDK for Uspacy API, in active development\n  - [Uspacy TypeScript SDK](https://github.com/Uspacy/uspacy-sdk) – TypeScript SDK for Uspacy API, deprecated\n\n# Marketplace applications development\nTo develop Marketplace application you need to create an application in Uspacy Marketplace. You can do it via request to [Uspacy support](mailto:support@uspacy.com).\nYou will receive ```client_id``` and ```client_secret``` for your application. You will also need to provide ```callback_url``` for your application.\nAfter that, the install/uninstall endpoints for your applications should be implemented. Please note that the path for these endpoints should follow this format:\n```{{callback_url}}/portals/install``` and ```{{callback_url}}/portals/uninstall```, respectively.\nFor example, if your ```callback_url``` is ```https://google.com/handler/v1```, we will send webhook to ```https://google.com/handler/v1/portals/install``` on install and ```https://google.com/handler/v1/portals/uninstall``` on uninstall.\nAfter a user installs your application, you will receive a POST request with JSON in the callback.\nThis will contain the ```token```, ```refresh_token```, and ```expiry_date``` fields.\nAdditionally, the ```integration_token``` will be provided as a Bearer token in the Authorization header.\nIt is signed using the ```client_secret``` and the SHA-256 algorithm. All future requests from your application's frontend to its backend should be secured with the ```integration_token```.\nThe ```integration_token``` is accessible through using the [appService](#tag/appService) for users with administrative rights.\nExample of request:\n```json\n{\n  \"expiry_date\": 1683649235,\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEyMzEyMzEyMyIsImZpcnN0TmFtZSI6IlN0YXMiLCJsYXN0TmFtZSI6IlJhcmFuZXRza3lpIiwiZW1haWwiOiJyYXIuc3Rhc0BnbWFpbC5jb20iLCJyb2xlcyI6WyJVU0VSIiwiQURNSU4iLCJPV05FUiJdfQ.au16u5LHJqdvhiPrpXDhN4NZn8Cae09I6BEmed7mt8w\",\n  \"refresh_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEyMzEyMzEyMyIsImZpcnN0TmFtZSI6IlN0YXMiLCJsYXN0TmFtZSI6IlJhcmFuZXRza3lpIiwiZW1haWwiOiJyYXIuc3Rhc0BnbWFpbC5jb20iLCJyb2xlcyI6WyJVU0VSIiwiQURNSU4iLCJPV05FUiJdfQ.au16u5LHJqdvhiPrpXDhN4NZn8Cae09I6BEmed7mt8w\"\n}\n```\nYou need to save ```token```, ```refresh_token``` and ```expiry_date```  in your database. You will need to use ```token``` to make requests to Uspacy API. ```refresh_token``` is used to refresh ```token``` when it expires.\nYou should refresh the ```token``` before it expires. To do this, make a POST request to ```https://{domain}/auth/v1/auth/refresh_token/``` with the ```refresh_token``` in the body. The ```domain``` refers to the portal's domain that you received from the user's token headers upon application installation.\nYou will receive new ```jwt```, ```refreshToken``` and ```expireInSeconds``` in response. You need to save new ```token```, ```refresh_token``` and update ```expiry_date``` in your database.\n",
    "title": "Uspacy api",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://{domain}.uspacy.ua",
      "description": "Ukrainian server"
    },
    {
      "url": "https://{domain}.uspacy.eu",
      "description": "EU server"
    },
    {
      "url": "https://{domain}.uspacy.com.br",
      "description": "Brazilian server"
    },
    {
      "url": "https://{domain}.uspacy.com",
      "description": "International server"
    }
  ],
  "tags": [
    {
      "name": "groupService"
    }
  ],
  "paths": {
    "/groups/v1/transferToGroupMembers": {
      "post": {
        "summary": "Transfer groups to another user.",
        "description": "Transfer groups to another user.",
        "tags": [
          "groupService"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferGroupToMembers"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/TransferGroupToMembersSuccess"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "responses": {
      "UnauthorizedError": {
        "description": "Access token is missing or invalid"
      }
    },
    "schemas": {
      "TransferGroupToMembers": {
        "type": "object",
        "properties": {
          "oldUserId": {
            "type": "string",
            "example": 2
          }
        },
        "required": [
          "oldUserId"
        ]
      },
      "TransferGroupToMembersSuccess": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "example": true
          },
          "countGroups": {
            "type": "integer",
            "example": 2
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 101,
      "1": 36,
      "2": 32,
      "3": 193,
      "4": 231,
      "5": 38,
      "6": 198,
      "7": 0,
      "8": 19,
      "9": 99,
      "10": 232,
      "11": 3
    }
  }
}
````