> ## Documentation Index
> Fetch the complete documentation index at: https://sleekplan.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Assign a member to a group

> An end-user may belong to several groups. Assigning an existing member again succeeds without duplicating.



## OpenAPI

````yaml /docs/api/openapi-v2.yaml post /groups/{group_id}/members
openapi: 3.1.0
info:
  title: Sleekplan API v2
  version: '2.0'
  description: >-
    The `/v2` namespace sits alongside the existing [`/v1`
    API](/docs/api/overview) — it is not a replacement. The same API key
    authenticates both.


    `/v2` accepts **Bearer tokens only**, and carries no workspace ID in the URL
    because the key identifies the workspace. Changes are additive: fields and
    endpoints are added, never removed or renamed.


    See [API v2](/docs/api/v2) for authentication, the error keys, and the rate
    limit.
servers:
  - url: https://api.sleekplan.com/v2
    description: API Version 2
security:
  - BearerAuth: []
tags:
  - name: Group
    description: B2B groups — companies, accounts or teams — and their members.
  - name: Document
    description: >-
      The thinking behind your feedback — a plan, a spec, research, or the
      record of a decision.
paths:
  /groups/{group_id}/members:
    parameters:
      - name: group_id
        in: path
        required: true
        schema:
          type: integer
    post:
      tags:
        - Group
      summary: Assign a member to a group
      description: >-
        An end-user may belong to several groups. Assigning an existing member
        again succeeds without duplicating.
      operationId: v2-add-group-member
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - user_id
              properties:
                user_id:
                  type: integer
                  description: >-
                    The Sleekplan user ID. Read it from this endpoint's `GET`,
                    or from `GET /v1/users`.
      responses:
        '201':
          description: Assigned
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  data:
                    type: object
                    properties:
                      group_id:
                        type: integer
                      user_id:
                        type: integer
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: No such group, or no such end-user in this workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  responses:
    ValidationError:
      description: A field is missing or malformed
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
              data:
                type: object
                properties:
                  key:
                    type: string
                    example: validation_error
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                        message:
                          type: string
    Unauthorized:
      description: Missing, malformed, or non-API-key credential
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The key's user lacks the permission for this action
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Over 300 requests in 60 seconds
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        status:
          type: string
          example: error
        data:
          type: object
          properties:
            key:
              type: string
            message:
              type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: '`Authorization: Bearer YOUR_API_KEY`. /v2 accepts no other method.'

````