For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://modelgates.ai/docs/_mcp/server.
Bulk add members to a workspace
POST https://modelgates.ai/api/v1/workspaces//members/add Content-Type: application/json
Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. Management key required.
Reference: https://modelgates.ai/docs/api/api-reference/workspaces/bulk-add-workspace-members
OpenAPI Specification
yaml
openapi: 3.1.0info: title: ModelGates API version: 1.0.0paths: /workspaces//members/add: post: operationId: bulk-add-workspace-members summary: Bulk add members to a workspace description: >- Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. tags: - subpackage_workspaces parameters: - name: id in: path description: The workspace ID (UUID) or slug required: true schema: type: string - name: Authorization in: header description: API key as bearer token in Authorization header required: true schema: type: string responses: '200': description: Members added successfully content: application/json: schema: $ref: '#/components/schemas/BulkAddWorkspaceMembersResponse' '400': description: Bad Request - Invalid request parameters or malformed input content: application/json: schema: $ref: '#/components/schemas/BadRequestResponse' '401': description: Unauthorized - Authentication required or invalid credentials content: application/json: schema: $ref: '#/components/schemas/UnauthorizedResponse' '403': description: Forbidden - Authentication successful but insufficient permissions content: application/json: schema: $ref: '#/components/schemas/ForbiddenResponse' '404': description: Not Found - Resource does not exist content: application/json: schema: $ref: '#/components/schemas/NotFoundResponse' '500': description: Internal Server Error - Unexpected server error content: application/json: schema: $ref: '#/components/schemas/InternalServerResponse' requestBody: content: application/json: schema: $ref: '#/components/schemas/BulkAddWorkspaceMembersRequest'servers: - url: https://modelgates.ai/api/v1components: schemas: BulkAddWorkspaceMembersRequest: type: object properties: user_ids: type: array items: type: string description: >- List of user IDs to add to the workspace. Members are assigned the same role they hold in the organization. required: - user_ids title: BulkAddWorkspaceMembersRequest WorkspaceMemberRole: type: string enum: - admin - member description: Role of the member in the workspace title: WorkspaceMemberRole WorkspaceMember: type: object properties: created_at: type: string description: ISO 8601 timestamp of when the membership was created id: type: string format: uuid description: Unique identifier for the workspace membership role: $ref: '#/components/schemas/WorkspaceMemberRole' description: Role of the member in the workspace user_id: type: string description: Clerk user ID of the member workspace_id: type: string format: uuid description: ID of the workspace required: - created_at - id - role - user_id - workspace_id title: WorkspaceMember BulkAddWorkspaceMembersResponse: type: object properties: added_count: type: integer description: Number of workspace memberships created or updated data: type: array items: $ref: '#/components/schemas/WorkspaceMember' description: List of added workspace memberships required: - added_count - data title: BulkAddWorkspaceMembersResponse BadRequestResponseErrorData: type: object properties: code: type: integer message: type: string metadata: type: - object - 'null' additionalProperties: description: Any type required: - code - message description: Error data for BadRequestResponse title: BadRequestResponseErrorData BadRequestResponse: type: object properties: error: $ref: '#/components/schemas/BadRequestResponseErrorData' modelgates_metadata: type: - object - 'null' additionalProperties: description: Any type user_id: type: - string - 'null' required: - error description: Bad Request - Invalid request parameters or malformed input title: BadRequestResponse UnauthorizedResponseErrorData: type: object properties: code: type: integer message: type: string metadata: type: - object - 'null' additionalProperties: description: Any type required: - code - message description: Error data for UnauthorizedResponse title: UnauthorizedResponseErrorData UnauthorizedResponse: type: object properties: error: $ref: '#/components/schemas/UnauthorizedResponseErrorData' modelgates_metadata: type: - object - 'null' additionalProperties: description: Any type user_id: type: - string - 'null' required: - error description: Unauthorized - Authentication required or invalid credentials title: UnauthorizedResponse ForbiddenResponseErrorData: type: object properties: code: type: integer message: type: string metadata: type: - object - 'null' additionalProperties: description: Any type required: - code - message description: Error data for ForbiddenResponse title: ForbiddenResponseErrorData ForbiddenResponse: type: object properties: error: $ref: '#/components/schemas/ForbiddenResponseErrorData' modelgates_metadata: type: - object - 'null' additionalProperties: description: Any type user_id: type: - string - 'null' required: - error description: Forbidden - Authentication successful but insufficient permissions title: ForbiddenResponse NotFoundResponseErrorData: type: object properties: code: type: integer message: type: string metadata: type: - object - 'null' additionalProperties: description: Any type required: - code - message description: Error data for NotFoundResponse title: NotFoundResponseErrorData NotFoundResponse: type: object properties: error: $ref: '#/components/schemas/NotFoundResponseErrorData' modelgates_metadata: type: - object - 'null' additionalProperties: description: Any type user_id: type: - string - 'null' required: - error description: Not Found - Resource does not exist title: NotFoundResponse InternalServerResponseErrorData: type: object properties: code: type: integer message: type: string metadata: type: - object - 'null' additionalProperties: description: Any type required: - code - message description: Error data for InternalServerResponse title: InternalServerResponseErrorData InternalServerResponse: type: object properties: error: $ref: '#/components/schemas/InternalServerResponseErrorData' modelgates_metadata: type: - object - 'null' additionalProperties: description: Any type user_id: type: - string - 'null' required: - error description: Internal Server Error - Unexpected server error title: InternalServerResponse securitySchemes: apiKey: type: http scheme: bearer description: API key as bearer token in Authorization headerSDK Code Examples
python
import requests url = "https://modelgates.ai/api/v1/workspaces/production/members/add" payload = { "user_ids": ["user_abc123", "user_def456"] }headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json())