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

# Create workspace membership

> Invite a member to the workspace. If user doesn't exist, they will be created. Requires admin role.



## OpenAPI

````yaml /swagger.json post /v1/workspaces/{workspace_id}/memberships
openapi: 3.0.1
info:
  title: Scute API
  version: v1
  description: API for managing users in Scute applications
servers:
  - url: https://{defaultHost}
    variables:
      defaultHost:
        default: api.scute.io
  - url: http://localhost:3333
    description: Development server
security:
  - apiSecret: []
    userAccess: []
paths:
  /v1/workspaces/{workspace_id}/memberships:
    parameters:
      - name: workspace_id
        in: path
        description: Workspace ID
        required: true
        schema:
          type: string
    post:
      tags:
        - Workspace Memberships
      summary: Create workspace membership
      description: >-
        Invite a member to the workspace. If user doesn't exist, they will be
        created. Requires admin role.
      operationId: createWorkspaceMembership
      parameters: []
      responses:
        '200':
          description: existing member - role updated or invitation resent
          content:
            application/json:
              schema:
                type: object
                properties:
                  membership:
                    type: object
                    properties:
                      id:
                        type: string
                      user_id:
                        type: string
                      workspace_id:
                        type: string
                      role:
                        type: string
                      status:
                        type: string
                      invitation_token:
                        type: string
                        nullable: true
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                      user:
                        type: object
                        properties:
                          id:
                            type: string
                          email:
                            type: string
                          name:
                            type: string
                  workspace_membership:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: string
                      role:
                        type: string
                      status:
                        type: string
                      created_at:
                        type: string
                        format: date-time
        '201':
          description: created
          content:
            application/json:
              schema:
                type: object
                properties:
                  membership:
                    type: object
                    properties:
                      id:
                        type: string
                      user_id:
                        type: string
                      workspace_id:
                        type: string
                      role:
                        type: string
                      status:
                        type: string
                      invitation_token:
                        type: string
                        nullable: true
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                      user:
                        type: object
                        properties:
                          id:
                            type: string
                          email:
                            type: string
                          name:
                            type: string
                  workspace_membership:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: string
                      role:
                        type: string
                      status:
                        type: string
                      created_at:
                        type: string
                        format: date-time
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '422':
          description: unprocessable entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
      security:
        - userAccess: []
components:
  securitySchemes:
    apiSecret:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API Secret token
    userAccess:
      type: apiKey
      name: X-Authorization
      in: header
      description: User Access token

````