> For the complete documentation index, see [llms.txt](https://docs.we360.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.we360.ai/deployment-and-it-ops/integrations-and-api-access/integrations/oauth-for-direct-api-access/project-suite/add-project-member-api.md).

# Add Project Member API

Add users to projects and grant project roles.

Add a user to a project with a project role. Membership is required before task assignment.

{% hint style="warning" %}
This route maps to an internal API. Confirm its external gateway path, OAuth scopes, and rate limits before client use.
{% endhint %}

### Endpoint

```http
POST https://api.in.we360.ai/api/v1/project_memberships/
```

### Resolve required IDs

* Resolve `identity_id` with `POST /api/v1/user_infos/search`, filtering by email or employee ID.
* You can list the directory with `GET /api/v1/user_infos/public-list/?page=1&size=25000`.
* Get `project_role_id` using `GET /api/v1/project_roles/by-project/{projectId}`.
* Create a role, if needed, with `POST /api/v1/project_roles/`.

### Request body

```json
{
  "project_id": "a1b2c3d4-1111-2222-3333-444455556666",
  "identity_id": "f9c8f8f8-1111-2222-3333-444455556666",
  "project_role_id": "d4e5f6a7-9999-8888-7777-666655554444",
  "read_only": false,
  "cost_config": {
    "billable_rate": 150,
    "cost_rate": 90
  }
}
```

| Parameter         | Required | Description                                           |
| ----------------- | -------- | ----------------------------------------------------- |
| `project_id`      | Yes      | Project UUID.                                         |
| `identity_id`     | Yes      | User UUID.                                            |
| `project_role_id` | Yes      | Role granted on this project.                         |
| `read_only`       | No       | Set `true` for view-only access. Defaults to `false`. |
| `cost_config`     | No       | Per-member rate override.                             |

### Response

Returns `201 Created`.

```json
{
  "id": "e1f2a3b4-0000-1111-2222-333344445555",
  "project_id": "a1b2c3d4-1111-2222-3333-444455556666",
  "identity_id": "f9c8f8f8-1111-2222-3333-444455556666",
  "project_role_id": "d4e5f6a7-9999-8888-7777-666655554444",
  "read_only": false
}
```

### Example

```bash
curl -X POST "https://api.in.we360.ai/api/v1/project_memberships/" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${access_token}" \
  -d '{"project_id":"a1b2c3d4-...","identity_id":"f9c8f8f8-...","project_role_id":"d4e5f6a7-...","read_only":false}'
```

Assign members to tasks through `assignee_ids` during task creation or with `PUT /api/v1/tasks/{id}`. Update memberships with `PUT /api/v1/project_memberships/{id}`. Remove them with `DELETE /api/v1/project_memberships/{id}`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.we360.ai/deployment-and-it-ops/integrations-and-api-access/integrations/oauth-for-direct-api-access/project-suite/add-project-member-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
