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

# Create Workspace Membership



## OpenAPI

````yaml post /api/v1/workspace-memberships
openapi: 3.1.0
info:
  title: AskUI Workspaces API
  version: 0.2.15
servers: []
security: []
paths:
  /api/v1/workspace-memberships:
    post:
      tags:
        - workspace-memberships
      summary: Create Workspace Membership
      operationId: create_workspace_membership_api_v1_workspace_memberships_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkspaceMembershipRequestDto'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWorkspaceMembershipResponseDto'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
        - Basic: []
components:
  schemas:
    CreateWorkspaceMembershipRequestDto:
      properties:
        userId:
          type: string
          title: Userid
        workspaceId:
          type: string
          format: uuid4
          title: Workspaceid
        privileges:
          items:
            $ref: '#/components/schemas/WorkspacePrivilege'
          type: array
          maxItems: 1
          title: Privileges
      type: object
      required:
        - userId
        - workspaceId
      title: CreateWorkspaceMembershipRequestDto
    CreateWorkspaceMembershipResponseDto:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        createdAt:
          type: string
          format: date-time
          title: Createdat
        updatedAt:
          type: string
          format: date-time
          title: Updatedat
        userId:
          type: string
          title: Userid
        workspaceId:
          type: string
          format: uuid4
          title: Workspaceid
        privileges:
          items:
            $ref: '#/components/schemas/WorkspacePrivilege'
          type: array
          title: Privileges
        accessTokens:
          items:
            $ref: '#/components/schemas/WorkspaceAccessToken'
          type: array
          title: Accesstokens
          default: []
      type: object
      required:
        - userId
        - workspaceId
        - privileges
      title: CreateWorkspaceMembershipResponseDto
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    WorkspacePrivilege:
      type: string
      enum:
        - ROLE_WORKSPACE_OWNER
        - ROLE_WORKSPACE_ADMIN
        - ROLE_WORKSPACE_MEMBER
      title: WorkspacePrivilege
    WorkspaceAccessToken:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        name:
          type: string
          title: Name
        hash:
          type: string
          title: Hash
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
      type: object
      required:
        - name
        - hash
        - expires_at
      title: WorkspaceAccessToken
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
    Basic:
      type: apiKey
      in: header
      name: Authorization

````