---
title: "Add a member to a team"
method: POST
path: "/organizations/{organization}/teams/{team}/members"
tags: ["Team members"]
---

# Add a member to a team

`POST /organizations/{organization}/teams/{team}/members`

### Authorization
A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint:

**Service Token Accesses**
 `write_teams`

**OAuth Scopes**

 | Resource | Scopes |
| :------- | :---------- |
| Organization | `write_organization` |

## Path parameters

- `organization` string, required
- `team` string, required

## Request body

- object
  - `user_id` string, required — The ID of the organization member to add to the team

## Response `200`

Returns the created team membership

- object
  - `id` string, required — The ID of the team membership
  - `user` object, required
    - `id` string, required — The ID of the user
    - `display_name` string, required — The display name of the user
    - `name` string, required — The name of the user
    - `email` string, required — The email of the user
    - `avatar_url` string, required — The URL source of the user's avatar
    - `created_at` string, required — When the user was created
    - `updated_at` string, required — When the user was last updated
    - `two_factor_auth_configured` boolean, required — Whether or not the user has configured two factor authentication
    - `default_organization` object, nullable
      - `id` string, required — The ID for the resource
      - `name` string, required — The name for the resource
      - `created_at` string, required — When the resource was created
      - `updated_at` string, required — When the resource was last updated
      - `deleted_at` string, nullable, required — When the resource was deleted, if deleted
    - `sso` boolean, nullable — Whether or not the user is managed by SSO.
    - `managed` boolean, nullable — Whether or not the user is managed by an authentication provider.
    - `directory_managed` boolean, nullable — Whether or not the user is managed by a SSO directory.
    - `email_verified` boolean, nullable — Whether or not the user is verified by email.
  - `actor` object, required
    - `id` string, required — The ID of the actor
    - `display_name` string, required — The name of the actor
    - `avatar_url` string, required — The URL of the actor's avatar
  - `created_at` string, required — When the membership was created
  - `updated_at` string, required — When the membership was last updated
  - `passwords` object[], required
    - `id` string, required — The ID for the password
    - `name` string, required — The display name for the password
    - `role` 'reader' | 'writer' | 'admin' | 'readwriter', required — The role for the password
    - `cidrs` string[], nullable, required — List of IP addresses or CIDR ranges that can use this password
    - `created_at` string, required — When the password was created
    - `deleted_at` string, nullable, required — When the password was deleted
    - `expires_at` string, nullable, required — When the password will expire
    - `last_used_at` string, nullable, required — When the password was last used to execute a query
    - `expired` boolean, required — True if the credentials are expired
    - `direct_vtgate` boolean, required — True if the credentials connect directly to a vtgate, bypassing load balancers
    - `direct_vtgate_addresses` string[], required — The list of hosts in each availability zone providing direct access to a vtgate
    - `ttl_seconds` integer, nullable, required — Time to live (in seconds) for the password. The password will be invalid when TTL has passed
    - `access_host_url` string, required — The host URL for the password
    - `access_host_regional_url` string, required — The regional host URL
    - `access_host_regional_urls` string[], required — The read-only replica host URLs
    - `actor` object, nullable, required
      - `id` string, required — The ID of the actor
      - `display_name` string, required — The name of the actor
      - `avatar_url` string, required — The URL of the actor's avatar
    - `region` object, required
      - `id` string, required — The ID of the region
      - `provider` string, required — Provider for the region (ex. AWS)
      - `enabled` boolean, required — Whether or not the region is currently active
      - `public_ip_addresses` string[], required — Public IP addresses for the region
      - `display_name` string, required — Name of the region
      - `location` string, required — Location of the region
      - `slug` string, required — The slug of the region
      - `current_default` boolean, required — True if the region is the default for new branch creation
      - `mysql_supported` boolean, required — Whether the region supports MySQL/Vitess databases
      - `postgresql_supported` boolean, required — Whether the region supports PostgreSQL databases
    - `username` string, required — The username for the password
    - `plain_text` string, nullable, required — The plaintext password. Null except in the response from the create endpoint.
    - `replica` boolean, required — Whether or not the password is for a read replica
    - `renewable` boolean, required — Whether or not the password can be renewed
    - `database_branch` object, required
      - `name` string, required — The name for the branch
      - `id` string, required — The ID for the branch
      - `production` boolean, required — Whether or not the branch is a production branch
      - `mysql_edge_address` string, required — The address of the MySQL provider for the branch
      - `private_edge_connectivity` boolean, required — True if private connectivity is enabled

## Other responses

- `400` — Bad Request - Invalid operation or SSO-managed team
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Unprocessable Entity - Validation errors
- `500` — Internal Server Error

## Changes

- **2026-06-01** `72506953f367` — 18 breaking, 2 info
  - the response property `passwords/items/actor` became nullable for the status `200`
  - the response property `passwords/items/cidrs` became nullable for the status `200`
  - the response property `passwords/items/deleted_at` became nullable for the status `200`
  - the response property `passwords/items/expires_at` became nullable for the status `200`
  - …16 more
- **2026-02-10** `ed1825db11c6` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/planetscale/apis/planetscale-api/changes/organizations/:organization/teams/:team/members/post.md)

---

[API](https://skmtc.dev/planetscale/apis/planetscale-api.md) · [All operations](https://skmtc.dev/planetscale/apis/planetscale-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/planetscale/planetscale-api/revisions/d3bf8cec0492/schema)
