---
title: "Add Service Accounts To Projects"
method: POST
path: "/organizations/{organizationId}/service-accounts/add-to-project"
tags: ["Project Membership"]
---

# Add Service Accounts To Projects

`POST /organizations/{organizationId}/service-accounts/add-to-project`

Adds a list of service account ids to a list of project ids with the specified role

## Request body

- AddServiceAccountsToProjectsRequest
  - `projects` object[], required — List of project/roles
    - `id` integer, required — The project id to add the service account to
    - `role` 'owner' | 'admin' | 'analyst' | 'consumer', required — The service account's role
  - `service_account_ids` integer[], required — List of service account ids

## Response `200`

Service accounts added to projects

- object
  - `status` 'ok' — "ok" if the request succeeded, "error" otherwise.

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found

---

[API](https://skmtc.net/mixpanel/apis/query-api.md) · [All operations](https://skmtc.net/mixpanel/apis/query-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mixpanel/query-api/revisions/f442da95252a/schema)
