---
title: "Import multiple members"
method: POST
path: "/members:import"
tags: ["Members"]
---

# Import multiple members

`POST /members:import`

## Request

- Base URL: `https://api.spoke.com/public/v1`
- URL: `https://api.spoke.com/public/v1/members:import`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/spoke/apis/spoke-api/docs/members:import/post.ts> (a function with typed inputs; its response is checked against the schema)

Import multiple members at once.

## Request body

- object[]: An array of member descriptions to be created in batch.
  - `name` string, nullable: The member's full name
  - `displayName` string, nullable: The name displayed for the member in the UI
  - `email` string, email, nullable: Member's email
  - `linkedDriverId` string, nullable: The existing driver to link the member to
  - `role` 'admin' | 'depot-manager' | 'dispatcher' | 'read-only', required: The operational role given to the member.
  - `depots` string[], nullable: 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.

## Response `200`

The imported members

- object: The imported members
  - `success` string[], required: The ids of the successfully imported members
  - `failed` object[], required: The failed members
    - `error` object, required
      - `message` string, required: The error that occurred during import
    - `member` object, required: The request body for creating a member.
      - `name` string, nullable: The member's full name
      - `displayName` string, nullable: The name displayed for the member in the UI
      - `email` string, email, nullable: Member's email
      - `linkedDriverId` string, nullable: The existing driver to link the member to
      - `role` 'admin' | 'depot-manager' | 'dispatcher' | 'read-only', required: The operational role given to the member.
      - `depots` string[], nullable: 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.

## Other responses

- `400`: Failed to validate the request
- `401`: Unauthorized
- `409`: Conflict when creating member.
- `422`: Failed to import members.
- `500`: An internal server error occurred
- `default`: The default error model

---

[API](https://skmtc.dev/spoke/apis/spoke-api.md) - [All operations](https://skmtc.dev/spoke/apis/spoke-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spoke/apis/spoke-api/revisions/a09d9194ae1c?raw)
