Organization API Fresh
Manage organizations, members, and access control.
Base URL: https://api.mem0.ai
Authentication: Authorization: Token <MEM0_API_KEY>
Create Organization
POST /api/v1/orgs/organizations/
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the new organization. |
Response (201)
json
{
"message": "Organization created successfully.",
"org_id": "uuid"
}Error (400)
json
{
"errors": { "name": ["This field is required."] }
}python
import requests
response = requests.post(
"https://api.mem0.ai/api/v1/orgs/organizations/",
headers={"Authorization": "Token <api-key>", "Content-Type": "application/json"},
json={"name": "My Organization"}
)bash
curl -X POST https://api.mem0.ai/api/v1/orgs/organizations/ \
-H 'Authorization: Token <api-key>' \
-H 'Content-Type: application/json' \
-d '{"name": "My Organization"}'Get Organizations (List)
GET /api/v1/orgs/organizations/
Response (200)
Returns an array of organization objects:
json
[
{
"id": 1,
"org_id": "uuid",
"name": "My Organization",
"description": "",
"address": "",
"contact_email": "admin@example.com",
"phone_number": "",
"website": "",
"on_paid_plan": false,
"created_at": "2024-07-15T10:30:00Z",
"updated_at": "2024-07-15T10:30:00Z",
"owner": 1,
"members": [1, 2, 3]
}
]Get Organization (Single)
GET /api/v1/orgs/organizations/{org_id}/
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id | string (UUID) | Yes | Organization identifier. |
Response (200)
Same schema as list response, single object.
Error (404)
json
{ "message": "Organization not found" }Get Organization Members
GET /api/v1/orgs/organizations/{org_id}/members/
Response (200)
json
{
"members": [
{ "user_id": "string", "role": "OWNER" },
{ "user_id": "string", "role": "READER" }
]
}Add Organization Member
POST /api/v1/orgs/organizations/{org_id}/members/
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email of the member to add. |
role | string | Yes | READER or OWNER. |
Response (201)
json
{ "message": "User added to the organization." }Roles
| Role | Description |
|---|---|
READER | View-only access to resources. |
OWNER | Full administrative access. |
Delete Organization
DELETE /api/v1/orgs/organizations/{org_id}/
Permanently delete an organization and all associated resources.
Response (200)
json
{ "message": "Organization deleted successfully!" }Error (403)
json
{ "message": "Unauthorized" }