---
title: Create workspace members
slug: api-guide/create-workspace-members
docTags: 
createdAt: 2025-01-09T16:01:41.147Z
---

{
  "id": "9Xpk3wdGDXK1OwZjITKr6",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.app.kognic.com/v1/workspace-members",
    "servers": [
      {
        "url": "https://api.app.kognic.com/v1/workspace-members"
      }
    ],
    "name": "Create workspace members",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "CreateWorkspaceMembers",
          "schema": [
            {
              "name": "organizationIds",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "integer",
              "customType": "integer[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "roles",
              "kind": "optional",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/WorkspaceRole",
              "customType": "WorkspaceRole[]",
              "schema": []
            },
            {
              "name": "userIds",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "integer",
              "customType": "integer[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "workspaceId",
              "kind": "required",
              "type": "string<uuid>",
              "description": "",
              "format": "uuid"
            }
          ],
          "modelRef": "#/components/schemas/CreateWorkspaceMembers",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "Created",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Enveloped_WorkspaceMembersCreated",
            "schema": [
              {
                "name": "data",
                "kind": "required",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/WorkspaceMembersCreated",
                "customType": "WorkspaceMembersCreated",
                "schema": [
                  {
                    "name": "ids",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/Enveloped_WorkspaceMembersCreated",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Bad request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "BadRequest",
            "schema": [
              {
                "name": "errorCode",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/BadRequest",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Unauthorized",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Unauthorized",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/Unauthorized",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "Forbidden",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Forbidden",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/Forbidden",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Not found",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "NotFound",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/NotFound",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "pYE-ozJKE_8Z8haBi7QdK",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.app.kognic.com/v1/workspace-members\"\n\npayload = json.dumps({\n   \"workspaceId\": \"\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "pYE-ozJKE_8Z8haBi7QdK"
    },
    "results": {
      "languages": [
        {
          "id": "qpD74u-GojS0Me7g3Hnp0",
          "language": "201",
          "code": "// Created\n{\n  \"data\": {\n    \"ids\": [\n      \"\"\n    ]\n  }\n}"
        },
        {
          "id": "_tqtkSWS5o0gtsAUiB8_S",
          "language": "400",
          "code": "// Bad request\n{\n  \"errorCode\": \"\",\n  \"message\": \"\"\n}"
        },
        {
          "id": "xcfdhtjKO5G9rL2n7m0dQ",
          "language": "401",
          "code": "// Unauthorized\n{\n  \"message\": \"\"\n}"
        },
        {
          "id": "SmEw_W78-FjpM58nKnX7d",
          "language": "403",
          "code": "// Forbidden\n{\n  \"message\": \"\"\n}"
        },
        {
          "id": "HiGRGnBB8unBXwZT4VFKw",
          "language": "404",
          "code": "// Not found\n{\n  \"message\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "qpD74u-GojS0Me7g3Hnp0"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}