---
title: Update a member
description: Updates a member from your team.
url: /api/members/updateMember
---

# Update a member

`PATCH /members/{memberId}`

````yaml
openapi: 3.1.0
info:
  title: Spoke API
  version: v1
servers:
  - url: https://api.spoke.com/public/v1
security:
  - BasicAuth: []
paths:
  /members/{memberId}:
    patch:
      operationId: updateMember
      summary: Update a member
      tags:
        - Members
      description: Updates a member from your team.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  description: The member's full name
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 255
                    - type: "null"
                displayName:
                  description: The name displayed for the member in the UI
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 255
                    - type: "null"
                role:
                  description: The operational role given to the member.
                  anyOf:
                    - type: string
                      enum:
                        - admin
                        - depot-manager
                        - dispatcher
                        - read-only
                      description: The operational role given to the member.
                    - type: "null"
                depots:
                  description: The depot IDs associated with the member in the format `depots/<id>`, duplicates will be ignored. If set to null or not provided, the team's Main depot will be set as member depot.
                  anyOf:
                    - minItems: 1
                      maxItems: 50
                      type: array
                      items:
                        type: string
                        pattern: ^depots\/[a-zA-Z0-9---_]{1,50}$
                        description: The depot ID, in the format `depots/<id>`
                    - type: "null"
              additionalProperties: false
              description: The request body for updating a member.
        description: The request body for updating a member.
      parameters:
        - schema:
            type: string
            pattern: ^[a-zA-Z0-9---_]{1,50}$
          in: path
          name: memberId
          required: true
          description: The member id
      responses:
        "200":
          description: The updated member
          content:
            application/json:
              schema:
                description: The updated member
                $ref: "#/components/schemas/memberSchema"
        "400":
          description: Failed to validate the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  code:
                    type: string
                    description: The error code.
                  param:
                    type: string
                    description: The parameter that caused the error.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: Failed to validate the request
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: Unauthorized
        "404":
          description: The provided member id does not exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    anyOf:
                      - type: string
                        enum:
                          - Member not found
                      - type: string
                required:
                  - message
                description: The provided member id does not exist
                title: Member not found
        "422":
          description: Failed to update member.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    anyOf:
                      - type: string
                        enum:
                          - An error occured when updating the member, but the error is not due to a validation error, instead it is another conflict, check if the provided data is semantically valid.
                      - type: string
                required:
                  - message
                description: Failed to update member.
        "500":
          description: An internal server error occurred
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  code:
                    type: string
                    description: The error code.
                  param:
                    type: string
                    description: The parameter that caused the error.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: An internal server error occurred
        default:
          description: The default error model
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  code:
                    type: string
                    description: The error code.
                  param:
                    type: string
                    description: The parameter that caused the error.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: The default error model
components:
  schemas:
    driverIdSchema:
      type: string
      pattern: ^drivers\/[a-zA-Z0-9---_]{1,50}$
    memberIdSchema:
      type: string
      pattern: ^members\/[a-zA-Z0-9---_]{1,50}$
    memberSchema:
      type: object
      properties:
        id:
          allOf:
            - $ref: "#/components/schemas/memberIdSchema"
          description: The member id, in the format `members/<id>`
        name:
          description: The name of the member.
          type:
            - "null"
            - string
        email:
          description: The email of the member.
          type:
            - "null"
            - string
        phone:
          description: The phone number of the member.
          type:
            - "null"
            - string
        linkedDriverId:
          anyOf:
            - $ref: "#/components/schemas/driverIdSchema"
            - type: "null"
          description: The driver linked to the member (where applicable).
        displayName:
          description: The display name of the member.
          type:
            - "null"
            - string
        active:
          type: boolean
          description: Whether the member membership is active or paused.
        depots:
          type: array
          items:
            type: string
            pattern: ^depots\/[a-zA-Z0-9---_]{1,50}$
          description: Depots associated with the member.
        roles:
          $ref: "#/components/schemas/roleSchema"
      required:
        - id
        - name
        - email
        - phone
        - linkedDriverId
        - displayName
        - active
        - depots
        - roles
      additionalProperties: false
      description: A dashboard member.
    roleSchema:
      type: array
      items:
        type: string
        enum:
          - owner
          - admin
          - depot-manager
          - dispatcher
          - read-only
          - driver
      description: The role(s) given to the member.
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: Use the API key as the username and leave the password empty.
````