> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mem0.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Member

> Add a new member to a project with a specified role such as READER or OWNER access level.

The API provides two roles for project members:

* `READER`: Allows viewing of project resources.
* `OWNER`: Grants full administrative access to manage the project and its resources.


## OpenAPI

````yaml post /api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/
openapi: 3.0.1
info:
  title: Mem0 API Docs
  description: mem0.ai API Docs
  contact:
    email: support@mem0.ai
  license:
    name: Apache 2.0
  version: v1
servers:
  - url: https://api.mem0.ai/
security:
  - ApiKeyAuth: []
paths:
  /api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/:
    post:
      tags:
        - projects
      summary: Add member to project
      description: Add a new member to a specific project within an organization.
      operationId: add_project_member
      parameters:
        - name: org_id
          in: path
          required: true
          description: Unique identifier of the organization.
          schema:
            type: string
        - name: project_id
          in: path
          required: true
          description: Unique identifier of the project.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - role
              properties:
                email:
                  type: string
                  description: Email of the member to be added.
                role:
                  type: string
                  description: Role of the member in the project.
      responses:
        '200':
          description: User added to the project successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: User added to the project successfully.
        '403':
          description: Unauthorized to modify project members
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Unauthorized to modify project members.
        '404':
          description: Organization or project not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Organization or project not found
      x-code-samples:
        - lang: Python
          source: >-
            import requests


            url =
            "https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/"


            payload = {
                "email": "<string>",
                "role": "<string>"
            }

            headers = {
                "Authorization": "Token <api-key>",
                "Content-Type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: JavaScript
          source: >-
            const options = {
              method: 'POST',
              headers: {Authorization: 'Token <api-key>', 'Content-Type': 'application/json'},
              body: '{"email":"<string>","role":"<string>"}'
            };


            fetch('https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: cURL
          source: |-
            curl --request POST \
              --url https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/ \
              --header 'Authorization: Token <api-key>' \
              --header 'Content-Type: application/json' \
              --data '{
              "email": "<string>",
              "role": "<string>"
            }'
        - lang: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/\"\n\n\tpayload := strings.NewReader(\"{\n  \\\"email\\\": \\\"<string>\\\",\n  \\\"role\\\": \\\"<string>\\\"\n}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"Authorization\", \"Token <api-key>\")\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: PHP
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{
              \"email\": \"<string>\",
              \"role\": \"<string>\"
            }",
              CURLOPT_HTTPHEADER => [
                "Authorization: Token <api-key>",
                "Content-Type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: Java
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/")
              .header("Authorization", "Token <api-key>")
              .header("Content-Type", "application/json")
              .body("{
              \"email\": \"<string>\",
              \"role\": \"<string>\"
            }")
              .asString();
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Prefix your Mem0 API key with 'Token '. Example:
        'Token your_api_key'

````