Mem0 projects API

The projects API from Mem0 — 3 operation(s) for projects.

OpenAPI Specification

mem0-projects-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Mem0 API Docs agents projects API
  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: []
tags:
- name: projects
paths:
  /api/v1/orgs/organizations/{org_id}/projects/:
    get:
      tags:
      - projects
      summary: Get projects
      description: Retrieve a list of projects for a specific organization.
      operationId: get_projects
      parameters:
      - name: org_id
        in: path
        required: true
        description: Unique identifier of the organization.
        schema:
          type: string
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: Unique numeric identifier of the project
                    project_id:
                      type: string
                      description: Unique string identifier of the project
                    name:
                      type: string
                      description: Name of the project.
                    description:
                      type: string
                      description: Description of the project
                    created_at:
                      type: string
                      format: date-time
                      description: Timestamp of when the project was created
                    updated_at:
                      type: string
                      format: date-time
                      description: Timestamp of when the project was last updated
                    members:
                      type: array
                      items:
                        type: object
                        properties:
                          username:
                            type: string
                            description: Username of the project member
                          role:
                            type: string
                            description: Role of the member in the project.
                      description: List of members belonging to the project.
      x-code-samples:
      - lang: Python
        source: 'import requests


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


          headers = {"Authorization": "Token <api-key>"}


          response = requests.request("GET", url, headers=headers)


          print(response.text)'
      - lang: JavaScript
        source: "const options = {method: 'GET', headers: {Authorization: 'Token <api-key>'}};\n\nfetch('https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/', options)\n  .then(response => response.json())\n  .then(response => console.log(response))\n  .catch(err => console.error(err));"
      - lang: cURL
        source: "curl --request GET \\\n  --url https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/ \\\n  --header 'Authorization: Token <api-key>'"
      - lang: Go
        source: "package main\n\nimport (\n\t\"fmt\"\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/\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Authorization\", \"Token <api-key>\")\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\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Token <api-key>\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"
      - lang: Java
        source: "HttpResponse<String> response = Unirest.get(\"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/\")\n  .header(\"Authorization\", \"Token <api-key>\")\n  .asString();"
    post:
      tags:
      - projects
      summary: Create project
      description: Create a new project within an organization.
      operationId: create_project
      parameters:
      - name: org_id
        in: path
        required: true
        description: Unique identifier of the organization.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              properties:
                name:
                  type: string
                  description: Name of the project to be created
      responses:
        '200':
          description: Project created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Project created successfully.
                  project_id:
                    type: string
                    format: uuid
                    description: Unique identifier for the project.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Project could not be created.
        '403':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Unauthorized to create projects in this organization.
      x-code-samples:
      - lang: Python
        source: "import requests\n\nurl = \"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/\"\n\npayload = {\"name\": \"<string>\"}\nheaders = {\n    \"Authorization\": \"Token <api-key>\",\n    \"Content-Type\": \"application/json\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"
      - lang: JavaScript
        source: "const options = {\n  method: 'POST',\n  headers: {Authorization: 'Token <api-key>', 'Content-Type': 'application/json'},\n  body: '{\"name\":\"<string>\"}'\n};\n\nfetch('https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/', options)\n  .then(response => response.json())\n  .then(response => console.log(response))\n  .catch(err => console.error(err));"
      - lang: cURL
        source: "curl --request POST \\\n  --url https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/ \\\n  --header 'Authorization: Token <api-key>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"name\": \"<string>\"\n}'"
      - 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/\"\n\n\tpayload := strings.NewReader(\"{\n  \\\"name\\\": \\\"<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\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_POSTFIELDS => \"{\n  \\\"name\\\": \\\"<string>\\\"\n}\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Token <api-key>\",\n    \"Content-Type: application/json\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"
      - lang: Java
        source: "HttpResponse<String> response = Unirest.post(\"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/\")\n  .header(\"Authorization\", \"Token <api-key>\")\n  .header(\"Content-Type\", \"application/json\")\n  .body(\"{\n  \\\"name\\\": \\\"<string>\\\"\n}\")\n  .asString();"
  /api/v1/orgs/organizations/{org_id}/projects/{project_id}/:
    get:
      tags:
      - projects
      summary: Get project details
      description: Retrieve details of a specific project within an organization.
      operationId: get_project
      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
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    description: Unique numeric identifier of the project
                  project_id:
                    type: string
                    description: Unique string identifier of the project
                  name:
                    type: string
                    description: Name of the project
                  description:
                    type: string
                    description: Description of the project
                  created_at:
                    type: string
                    format: date-time
                    description: Timestamp of when the project was created
                  updated_at:
                    type: string
                    format: date-time
                    description: Timestamp of when the project was last updated
                  members:
                    type: array
                    items:
                      type: object
                      properties:
                        username:
                          type: string
                          description: Username of the project member
                        role:
                          type: string
                          description: Role of the member in the project.
                    description: List of members belonging to the project
        '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: '# To use the Python SDK, install the package:

          # pip install mem0ai


          from mem0 import MemoryClient


          client = MemoryClient(api_key="your_api_key")


          response = client.get_project()

          print(response)'
      - lang: JavaScript
        source: "// To use the JavaScript SDK, install the package:\n// npm i mem0ai\n\nimport MemoryClient from 'mem0ai';\nconst client = new MemoryClient({ apiKey: \"your-api-key\" });\n\nclient.getProject()\n  .then(response => console.log(response))\n  .catch(err => console.error(err));"
      - lang: cURL
        source: "curl --request GET \\\n  --url https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/ \\\n  --header 'Authorization: Token <api-key>'"
      - lang: Go
        source: "// To use the Go SDK, install the package:\n// go get github.com/mem0ai/mem0-go\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/mem0ai/mem0-go\"\n)\n\nfunc main() {\n\tclient := mem0.NewClient(\"your-api-key\")\n\n\tresponse, err := client.GetProject()\n\tif err != nil {\n\t\tfmt.Printf(\"Error: %v\\n\", err)\n\t\treturn\n\t}\n\tfmt.Printf(\"%+v\\n\", response)\n}"
      - lang: PHP
        source: "<?php\n// To use the PHP SDK, install the package:\n// composer require mem0ai/mem0-php\n\nrequire_once('vendor/autoload.php');\n\nuse Mem0\\MemoryClient;\n\n$client = new MemoryClient('your-api-key');\n\ntry {\n    $response = $client->getProject();\n    print_r($response);\n} catch (Exception $e) {\n    echo 'Error: ' . $e->getMessage();\n}"
      - lang: Java
        source: "// To use the Java SDK, add this dependency to your pom.xml:\n// <dependency>\n//     <groupId>ai.mem0</groupId>\n//     <artifactId>mem0-java</artifactId>\n//     <version>1.0.0</version>\n// </dependency>\n\nimport ai.mem0.MemoryClient;\n\npublic class Example {\n    public static void main(String[] args) {\n        MemoryClient client = new MemoryClient(\"your-api-key\");\n        \n        try {\n            Object response = client.getProject();\n            System.out.println(response);\n        } catch (Exception e) {\n            System.err.println(\"Error: \" + e.getMessage());\n        }\n    }\n}"
    patch:
      tags:
      - projects
      summary: Update Project
      description: Update a specific project's settings.
      operationId: update_project
      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 to be updated.
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the project
                description:
                  type: string
                  description: Description of the project
                custom_instructions:
                  type: array
                  items:
                    type: string
                  description: Custom instructions for memory processing in this project
                custom_categories:
                  type: array
                  items:
                    type: object
                  description: List of custom categories to be used for memory categorization.
                multilingual:
                  type: boolean
                  description: Whether to use the input language for memory storage and retrieval.
      responses:
        '200':
          description: Project updated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Project updated successfully
        '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: "# To use the Python SDK, install the package:\n# pip install mem0ai\n\nfrom mem0 import MemoryClient\n\nclient = MemoryClient(api_key=\"your_api_key\")\n\nnew_categories = [\n    {\"cooking\": \"For users interested in cooking and culinary experiences\"},\n    {\"fitness\": \"Includes content related to fitness and workouts\"}\n]\n\nresponse = client.update_project(custom_categories=new_categories)\nprint(response)"
      - lang: JavaScript
        source: "// To use the JavaScript SDK, install the package:\n// npm i mem0ai\n\nimport MemoryClient from 'mem0ai';\nconst client = new MemoryClient({ apiKey: \"your-api-key\" });\n\nconst newCategories = [\n    {\"cooking\": \"For users interested in cooking and culinary experiences\"},\n    {\"fitness\": \"Includes content related to fitness and workouts\"}\n];\n\nclient.updateProject({ custom_categories: newCategories })\n  .then(response => console.log(response))\n  .catch(err => console.error(err));"
      - lang: cURL
        source: "curl --request PATCH \\\n  --url https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/ \\\n  --header 'Authorization: Token <api-key>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"custom_categories\": [\n      {\"cooking\": \"For users interested in cooking and culinary experiences\"},\n      {\"fitness\": \"Includes content related to fitness and workouts\"}\n    ]\n  }'"
      - lang: Go
        source: "// To use the Go SDK, install the package:\n// go get github.com/mem0ai/mem0-go\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/mem0ai/mem0-go\"\n)\n\nfunc main() {\n\tclient := mem0.NewClient(\"your-api-key\")\n\n\tnewCategories := []map[string]string{\n\t\t{\"cooking\": \"For users interested in cooking and culinary experiences\"},\n\t\t{\"fitness\": \"Includes content related to fitness and workouts\"},\n\t}\n\n\tresponse, err := client.UpdateProject(mem0.UpdateProjectParams{\n\t\tCustomCategories: newCategories,\n\t})\n\tif err != nil {\n\t\tfmt.Printf(\"Error: %v\\n\", err)\n\t\treturn\n\t}\n\tfmt.Printf(\"%+v\\n\", response)\n}"
      - lang: PHP
        source: "<?php\n// To use the PHP SDK, install the package:\n// composer require mem0ai/mem0-php\n\nrequire_once('vendor/autoload.php');\n\nuse Mem0\\MemoryClient;\n\n$client = new MemoryClient('your-api-key');\n\n$newCategories = [\n    ['cooking' => 'For users interested in cooking and culinary experiences'],\n    ['fitness' => 'Includes content related to fitness and workouts']\n];\n\ntry {\n    $response = $client->updateProject(['custom_categories' => $newCategories]);\n    print_r($response);\n} catch (Exception $e) {\n    echo 'Error: ' . $e->getMessage();\n}"
      - lang: Java
        source: "// To use the Java SDK, add this dependency to your pom.xml:\n// <dependency>\n//     <groupId>ai.mem0</groupId>\n//     <artifactId>mem0-java</artifactId>\n//     <version>1.0.0</version>\n// </dependency>\n\nimport ai.mem0.MemoryClient;\nimport java.util.*;\n\npublic class Example {\n    public static void main(String[] args) {\n        MemoryClient client = new MemoryClient(\"your-api-key\");\n        \n        List<Map<String, String>> newCategories = Arrays.asList(\n            Collections.singletonMap(\"cooking\", \"For users interested in cooking and culinary experiences\"),\n            Collections.singletonMap(\"fitness\", \"Includes content related to fitness and workouts\")\n        );\n        \n        try {\n            Map<String, Object> params = new HashMap<>();\n            params.put(\"custom_categories\", newCategories);\n            \n            Object response = client.updateProject(params);\n            System.out.println(response);\n        } catch (Exception e) {\n            System.err.println(\"Error: \" + e.getMessage());\n        }\n    }\n}"
    delete:
      tags:
      - projects
      summary: Delete Project
      description: Delete a specific project and its related data.
      operationId: delete_project
      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 to be deleted.
        schema:
          type: string
      responses:
        '200':
          description: Project and related data deleted successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Project and related data deleted successfully.
        '403':
          description: Unauthorized to modify this project
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Unauthorized to modify this project.
        '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}/"


          headers = {"Authorization": "Token <api-key>"}


          response = requests.request("DELETE", url, headers=headers)


          print(response.text)'
      - lang: JavaScript
        source: "const options = {method: 'DELETE', headers: {Authorization: 'Token <api-key>'}};\n\nfetch('https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/', options)\n  .then(response => response.json())\n  .then(response => console.log(response))\n  .catch(err => console.error(err));"
      - lang: cURL
        source: "curl --request DELETE \\\n  --url https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/ \\\n  --header 'Authorization: Token <api-key>'"
      - lang: Go
        source: "package main\n\nimport (\n\t\"fmt\"\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}/\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"Authorization\", \"Token <api-key>\")\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\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"DELETE\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Token <api-key>\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"
      - lang: Java
        source: "HttpResponse<String> response = Unirest.delete(\"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/\")\n  .header(\"Authorization\", \"Token <api-key>\")\n  .asString();"
  /api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/:
    get:
      tags:
      - projects
      summary: Get Project Members
      description: Retrieve a list of members for a specific project.
      operationId: get_project_members
      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
      responses:
        '200':
          description: Successfully retrieved project members
          content:
            application/json:
              schema:
                type: object
                properties:
                  members:
                    type: array
                    items:
                      type: object
                      properties:
                        username:
                          type: string
                        role:
                          type: string
        '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/"


          headers = {"Authorization": "Token <api-key>"}


          response = requests.request("GET", url, headers=headers)


          print(response.text)'
      - lang: JavaScript
        source: "const options = {method: 'GET', headers: {Authorization: 'Token <api-key>'}};\n\nfetch('https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/', options)\n  .then(response => response.json())\n  .then(response => console.log(response))\n  .catch(err => console.error(err));"
      - lang: cURL
        source: "curl --request GET \\\n  --url https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/ \\\n  --header 'Authorization: Token <api-key>'"
      - lang: Go
        source: "package main\n\nimport (\n\t\"fmt\"\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\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Authorization\", \"Token <api-key>\")\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\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Token <api-key>\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"
      - lang: Java
        source: "HttpResponse<String> response = Unirest.get(\"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/\")\n  .header(\"Authorization\", \"Token <api-key>\")\n  .asString();"
    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\n\nurl = \"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/\"\n\npayload = {\n    \"email\": \"<string>\",\n    \"role\": \"<string>\"\n}\nheaders = {\n    \"Authorization\": \"Token <api-key>\",\n    \"Content-Type\": \"application/json\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"
      - lang: JavaScript
        source: "const options = {\n  method: 'POST',\n  headers: {Authorization: 'Token <api-key>', 'Content-Type': 'application/json'},\n  body: '{\"email\":\"<string>\",\"role\":\"<string>\"}'\n};\n\nfetch('https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/', options)\n  .then(response => response.json())\n  .then(response => console.log(response))\n  .catch(err => console.error(err));"
      - lang: cURL
        source: "curl --request POST \\\n  --url https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/ \\\n  --header 'Authorization: Token <api-key>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"email\": \"<string>\",\n  \"role\": \"<string>\"\n}'"
      - 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\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_POSTFIELDS => \"{\n  \\\"email\\\": \\\"<string>\\\",\n  \\\"role\\\": \\\"<string>\\\"\n}\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Token <api-key>\",\n    \"Content-Type: application/json\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"
      - lang: Java
        source: "HttpResponse<String> response = Unirest.post(\"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/\")\n  .header(\"Authorization\", \"Token <api-key>\")\n  .header(\"Content-Type\", \"application/json\")\n  .body(\"{\n  \\\"email\\\": \\\"<string>\\\",\n  \\\"role\\\": \\\"<string>\\\"\n}\")\n  .asString();"
    put:
      tags:
      - projects
      summary: Update project member role
      description: Update the role of a member in a specific project within an organization.
      operationId: update_project_member
      parameters:
      - name: org_id
        in: path
        re

# --- truncated at 32 KB (36 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/mem0/refs/heads/main/openapi/mem0-projects-api-openapi.yml