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 "} response = requests.request("GET", url, headers=headers) print(response.text)' - lang: JavaScript source: "const options = {method: 'GET', headers: {Authorization: 'Token '}};\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 '" - 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 \")\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: " \"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 \"\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 response = Unirest.get(\"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/\")\n .header(\"Authorization\", \"Token \")\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\": \"\"}\nheaders = {\n \"Authorization\": \"Token \",\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 ', 'Content-Type': 'application/json'},\n body: '{\"name\":\"\"}'\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 ' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"name\": \"\"\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\\\": \\\"\\\"\n}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"Authorization\", \"Token \")\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: " \"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\\\": \\\"\\\"\n}\",\n CURLOPT_HTTPHEADER => [\n \"Authorization: Token \",\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 response = Unirest.post(\"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/\")\n .header(\"Authorization\", \"Token \")\n .header(\"Content-Type\", \"application/json\")\n .body(\"{\n \\\"name\\\": \\\"\\\"\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 '" - 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: "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// \n// ai.mem0\n// mem0-java\n// 1.0.0\n// \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 ' \\\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: " '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// \n// ai.mem0\n// mem0-java\n// 1.0.0\n// \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> 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 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 "} response = requests.request("DELETE", url, headers=headers) print(response.text)' - lang: JavaScript source: "const options = {method: 'DELETE', headers: {Authorization: 'Token '}};\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 '" - 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 \")\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: " \"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 \"\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 response = Unirest.delete(\"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/\")\n .header(\"Authorization\", \"Token \")\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 "} response = requests.request("GET", url, headers=headers) print(response.text)' - lang: JavaScript source: "const options = {method: 'GET', headers: {Authorization: 'Token '}};\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 '" - 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 \")\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: " \"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 \"\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 response = Unirest.get(\"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/\")\n .header(\"Authorization\", \"Token \")\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\": \"\",\n \"role\": \"\"\n}\nheaders = {\n \"Authorization\": \"Token \",\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 ', 'Content-Type': 'application/json'},\n body: '{\"email\":\"\",\"role\":\"\"}'\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 ' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"email\": \"\",\n \"role\": \"\"\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\\\": \\\"\\\",\n \\\"role\\\": \\\"\\\"\n}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"Authorization\", \"Token \")\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: " \"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\\\": \\\"\\\",\n \\\"role\\\": \\\"\\\"\n}\",\n CURLOPT_HTTPHEADER => [\n \"Authorization: Token \",\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 response = Unirest.post(\"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/\")\n .header(\"Authorization\", \"Token \")\n .header(\"Content-Type\", \"application/json\")\n .body(\"{\n \\\"email\\\": \\\"\\\",\n \\\"role\\\": \\\"\\\"\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 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 updated role: type: string description: New role of the member in the project responses: '200': description: User role updated successfully. content: application/json: schema: type: object properties: message: type: string example: User role updated 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\": \"\",\n \"role\": \"\"\n}\nheaders = {\n \"Authorization\": \"Token \",\n \"Content-Type\": \"application/json\"\n}\n\nresponse = requests.request(\"PUT\", url, json=payload, headers=headers)\n\nprint(response.text)" - lang: JavaScript source: "const options = {\n method: 'PUT',\n headers: {Authorization: 'Token ', 'Content-Type': 'application/json'},\n body: '{\"email\":\"\",\"role\":\"\"}'\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 PUT \\\n --url https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/ \\\n --header 'Authorization: Token ' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"email\": \"\",\n \"role\": \"\"\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\\\": \\\"\\\",\n \\\"role\\\": \\\"\\\"\n}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"Authorization\", \"Token \")\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: " \"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 => \"PUT\",\n CURLOPT_POSTFIELDS => \"{\n \\\"email\\\": \\\"\\\",\n \\\"role\\\": \\\"\\\"\n}\",\n CURLOPT_HTTPHEADER => [\n \"Authorization: Token \",\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 response = Unirest.put(\"https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/members/\")\n .header(\"Authorization\", \"Token \")\n .header(\"Content-Type\", \"application/json\")\n .body(\"{\n \\\"email\\\": \\\"\\\",\n \\\"role\\\": \\\"\\\"\n}\")\n .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''' x-original-swagger-version: '2.0'