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

# Update a membership

> Update a certain membership. <h3>OAuth</h3>Required scopes: <code>community</code>



## OpenAPI

````yaml /assets/openapi.json put /community/memberships/v1/{id}
openapi: 3.0.2
info:
  title: Spacebring
  version: 1.0.0
  termsOfService: https://www.spacebring.com/terms
servers:
  - url: https://api.spacebring.com
security: []
paths:
  /community/memberships/v1/{id}:
    put:
      tags:
        - Community
      summary: Update a membership
      description: >-
        Update a certain membership. <h3>OAuth</h3>Required scopes:
        <code>community</code>
      operationId: updateMembership
      parameters:
        - name: id
          in: path
          description: The id of the membership.
          schema:
            format: int64
            type: integer
          required: true
        - in: header
          name: spacebring-network-id
          schema:
            type: string
            format: uuid
          required: false
          description: >-
            The id of the network. Required when using bearer token
            authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                membership:
                  type: object
                  properties:
                    metadata:
                      $ref: '#/components/schemas/metadata'
                    role:
                      type: string
                      enum:
                        - admin
                        - member
                  required:
                    - metadata
                    - role
              required:
                - membership
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  membership:
                    $ref: '#/components/schemas/membership'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
      security:
        - BasicAuth: []
        - OAuth2:
            - community
components:
  schemas:
    metadata:
      type: object
      description: Use to attach key-value data to the object. Available only for admins.
    membership:
      type: object
      properties:
        companyRef:
          type: string
          format: uuid
        companyRole:
          type: string
          enum:
            - manager
            - member
        createDate:
          $ref: '#/components/schemas/dateSchema'
        credits:
          type: object
          properties:
            expiring:
              type: number
            permanent:
              type: number
        dayPasses:
          type: object
          properties:
            expiring:
              type: number
        deleteDate:
          $ref: '#/components/schemas/dateSchema'
        id:
          type: string
          format: uuid
        invitationDate:
          $ref: '#/components/schemas/dateSchema'
        locationRef:
          type: string
        metadata:
          $ref: '#/components/schemas/metadata'
        notes:
          type: string
        role:
          type: string
          enum:
            - member
            - admin
        status:
          type: string
          enum:
            - requested
            - approved
        subscriptionRef:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - member
            - nonmember
        user:
          $ref: '#/components/schemas/user'
        userRef:
          type: string
          format: uuid
    responseError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
    dateSchema:
      format: date-time
      type: string
      description: The date and time in ISO 8601 format, e.g. 2021-05-21T10:00:00Z
    user:
      type: object
      properties:
        about:
          type: string
        email:
          type: string
        id:
          type: string
          format: uuid
        name:
          type: string
        phoneNumber:
          type: string
        photoUrl:
          type: string
        surname:
          type: string
  securitySchemes:
    BasicAuth:
      type: http
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#basic-authentication)
        for how to authorize your requests
      scheme: basic
    OAuth2:
      type: oauth2
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#oauth2)
        for how to authorize your requests
      flows:
        authorizationCode:
          authorizationUrl: https://api.spacebring.com/oauth2/authorize
          tokenUrl: https://api.spacebring.com/oauth2/token
          refreshUrl: https://api.spacebring.com/oauth2/token
          scopes:
            benefits.readonly: Read benefits and applications
            benefits: Read and write benefits and applications
            community.readonly: Read community companies and memberships
            community: Read and write community companies and memberships
            events.readonly: Read events and tickets
            events: Read and write events and tickets
            feed.readonly: Read feed posts
            feed: Read and write feed posts
            invoices.readonly: Read invoices
            invoices: Read and write invoices
            locations.readonly: Read locations
            locations: Read and write locations
            plans.readonly: Read plans
            plans: Read and write plans
            resources.readonly: Read resources and bookings
            resources: Read and write resources and bookings
            subscriptions.readonly: Read subscriptions
            subscriptions: Read and write subscriptions
            shop.readonly: Read products and orders
            shop: Read and write products and orders
            support.readonly: Read support tickets
            support: Read and write support tickets
            transactions.readonly: Read transactions
            transactions: Read and write transactions
            visitors.readonly: Read visitors
            visitors: Read and write visitors

````