Organizations and Members

Account Registration

POST /api/auth/registration/

Request Body

Parameters

Field
Type
Required
Description

email

string (email)

Yes

password1

string

Yes

password2

string

Yes

name

string

Yes

company

string

Yes

referralCode

string

No

authSource

object (contains 2 properties: id, name)

No

authSource.id

string (uuid)

Yes

Request Structure Example

{
  "email": string (email)
  "password1": string
  "password2": string
  "name": string
  "company": string
  "referralCode"?: string // Optional
  "authSource"?:  // Optional
  {
    "id": string (uuid)
  }
}

Request Example Value

{
  "email": "[email protected]",
  "password1": "Example String",
  "password2": "Example String",
  "name": "Example Name",
  "company": "Example String",
  "referralCode": "Example String",
  "authSource": {
    "id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Code Examples

# Call API Example (Shell)
curl -X POST "https://api.maiagent.ai/api/auth/registration/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password1": "sample_string",
    "password2": "sample_string",
    "name": "Sample Name",
    "company": "sample_string",
    "referralCode": "sample_string",
    "authSource": {
      "id": "550e8400-e29b-41d4-a716-446655440000"
    }
  }'

# Please replace YOUR_API_KEY and verify the request data before execution.

Response Body

Status Code: 201

Response Schema Example

{
  "detail": string
}

Response Example Value

{
  "detail": "Response string"
}

Change Password

POST /api/auth/password/change/

Request Body

Request Parameters

Field
Type
Required
Description

oldPassword

string

Yes

newPassword1

string

Yes

newPassword2

string

Yes

Request Structure Example

{
  "oldPassword": string
  "newPassword1": string
  "newPassword2": string
}

Request Example Value

{
  "oldPassword": "Sample String",
  "newPassword1": "Sample String",
  "newPassword2": "Sample String"
}

Code Examples

# Call API Example (Shell)
curl -X POST "https://api.maiagent.ai/api/auth/password/change/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "oldPassword": "example_string",
    "newPassword1": "example_string",
    "newPassword2": "example_string"
  }'

# Please replace YOUR_API_KEY and verify the request data before execution.

Response Body

Status Code: 200

Response Schema Example

{
  "detail": string
}

Response Example Value

{
  "detail": "Response string"
}

Create a New Organization

POST /api/organizations/

Request Body

Request Parameters

Field
Type
Required
Description

name

string

Yes

compactLogo

string (uri)

No

fullLogo

string (uri)

No

Request Structure Example

{
  "name": string
  "compactLogo"?: string (uri) // Optional
  "fullLogo"?: string (uri) // Optional
}

Request Example Value

{
  "name": "Example Name",
  "compactLogo": "https://example.com/file.jpg",
  "fullLogo": "https://example.com/file.jpg"
}

Code Examples

# API Call Example (Shell)
curl -X POST "https://api.maiagent.ai/api/organizations/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Example Name",
    "compactLogo": "https://example.com/file.jpg",
    "fullLogo": "https://example.com/file.jpg"
  }'

# Please replace YOUR_API_KEY and verify the request data before execution.

Response Body

Status Code: 201

Response Schema Example

{
  "id": string (uuid)
  "name": string
  "createdAt": string (timestamp)
  "compactLogo"?: string (uri) // Optional
  "fullLogo"?: string (uri) // Optional
  "usageStatistics": object
  "organizationPlan": object
  "maigptInboxId": string (uuid)
}

Response Example Value

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Response String",
  "createdAt": "Response String",
  "compactLogo": "https://example.com/file.jpg",
  "fullLogo": "https://example.com/file.jpg",
  "usageStatistics": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Example Response Name",
    "description": "Example Response Description"
  },
  "organizationPlan": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Example Response Name",
    "description": "Example Response Description"
  },
  "maigptInboxId": "550e8400-e29b-41d4-a716-446655440000"
}

Add Member to a Specific Organization

POST /api/organizations/{organizationPk}/members/

Parameters

Parameter Name
Required
Type
Description

organizationPk

string

A UUID string identifying this Organization ID

Request Body

Request Parameters

Field
Type
Required
Description

email

string (email)

Yes

organization

string (uuid)

No

Request Structure Example

{
  "email": string (email)
  "organization"?: string (uuid) // optional
}

Request Example Value

{
  "organization": "613c86f7-a45f-4e29-b255-29caff89de32",
  "is_owner": false
}

Code Examples

# API Call Example (Shell)
curl -X POST "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/members/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "organization": "613c86f7-a45f-4e29-b255-29caff89de32",
    "is_owner": false
  }'

# Please replace YOUR_API_KEY and verify the request data before execution.

Response Body

Status Code: 201

Response Schema Example

{
  "organization": string (uuid) // Organization ID
  "is_owner": boolean // Whether the user is the organization owner
}

Response Example Value

{
  "organization": "613c86f7-a45f-4e29-b255-29caff89de32",
  "is_owner": false
}

Get Organization List

GET /api/organizations/

Parameters

Parameter Name
Required
Type
Description

page

integer

A page number within the paginated result set.

pageSize

integer

Number of results to return per page.

pagination

string

Whether to paginate (true/false)

Code Examples

# Call API Example (Shell)
curl -X GET "https://api.maiagent.ai/api/organizations/?page=1&pageSize=1&pagination=example" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# Please replace YOUR_API_KEY and verify the request data before execution.

Response Body

Status Code: 200

Response Schema Example

{
  "count": integer
  "next"?: string (uri) // optional
  "previous"?: string (uri) // optional
  "results": [
    {
      "id": string (uuid)
      "name": string
      "createdAt": string (timestamp)
    }
  ]
}

Response Example Value

{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Response String",
      "createdAt": "Response String"
    }
  ]
}

Get Specific Organization Information

GET /api/organizations/{id}/

Parameters

Parameter Name
Required
Type
Description

id

string

A UUID string identifying this organization.

Code Examples

# API Call Example (Shell)
curl -X GET "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# Please replace YOUR_API_KEY and verify the request data before execution.

Response Body

Status Code: 200

Response Schema Example

{
  "id": string (uuid)
  "name": string
  "createdAt": string (timestamp)
  "compactLogo"?: string (uri) // Optional
  "fullLogo"?: string (uri) // Optional
  "usageStatistics": object
  "organizationPlan": object
  "maigptInboxId": string (uuid)
}

Response Example Value

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Response String",
  "createdAt": "Response String",
  "compactLogo": "https://example.com/file.jpg",
  "fullLogo": "https://example.com/file.jpg",
  "usageStatistics": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Example Response Name",
    "description": "Example Response Description"
  },
  "organizationPlan": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Example Response Name",
    "description": "Example Response Description"
  },
  "maigptInboxId": "550e8400-e29b-41d4-a716-446655440000"
}

Get Current User Details

GET /api/users/current/

Code Example

# API Call Example (Shell)
curl -X GET "https://api.maiagent.ai/api/users/current/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# Please replace YOUR_API_KEY and verify the request data before execution.

Response Body

Status Code: 200

Response Schema Example

{
  "id": string (uuid)
  "avatar"?: string (uri) // Optional
  "name": string
  "email": string (email)
  "authSource": 
  {
    "id": string (uuid)
    "name": string
  }
  "company"?: string // Optional
  "invitationCode"?: string // Optional
  "apiKeys": [
    object
  ]
  "permissions": [
    string
  ]
}

Response Example Value

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "avatar": "https://example.com/file.jpg",
  "name": "Response string",
  "email": "[email protected]",
  "authSource": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Response string"
  },
  "company": "Response string",
  "invitationCode": "Response string",
  "apiKeys": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Response example name",
      "description": "Response example description"
    }
  ],
  "permissions": [
    "Response string"
  ]
}

Get Current User Permissions

GET /api/permissions/

Code Examples

# API Call Example (Shell)
curl -X GET "https://api.maiagent.ai/api/permissions/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# Please replace YOUR_API_KEY and verify the request data before execution.

Response Body

Status Code: 200

Response Schema Example

[
  {
    "id": string (uuid)
    "name": string
    "description"?: string // Optional
  }
]

Response Example Value

[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Response String",
    "description": "Response String"
  }
]

Get a list of members for a specific organization

GET /api/organizations/{organizationPk}/members/

Parameters

Parameter Name
Required
Type
Description

organizationPk

string

A UUID string identifying this Organization ID

page

integer

A page number within the paginated result set.

pageSize

integer

Number of results to return per page.

pagination

string

Whether to paginate (true/false)

query

string

Code Examples

# Call API Example (Shell)
curl -X GET "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/members/?page=1&pageSize=1&pagination=example&query=example" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# Please replace YOUR_API_KEY and check the request data before execution.

Response Body

Status Code: 200

Response Schema Example

{
  "count": integer
  "next"?: string (uri) // Optional
  "previous"?: string (uri) // Optional
  "results": [
    {
      "id": string (uuid)
      "name": string
      "email": string
      "isOwner": boolean // Check if the member is the organization owner (via OWNER Group)
      "permissions": object
      "createdAt": string (timestamp)
    }
  ]
}

Response Example Value

{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Response string",
      "email": "Response string",
      "isOwner": false,
      "permissions": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "Response sample name",
        "description": "Response sample description"
      },
      "createdAt": "Response string"
    }
  ]
}

Get Specific Member Details

GET /api/organizations/{organizationPk}/members/{id}/

Parameters

Parameter Name
Required
Type
Description

id

string

A UUID string identifying this Member.

organizationPk

string

A UUID string identifying this Organization ID

Code Examples

# API Call Example (Shell)
curl -X GET "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/members/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# Please replace YOUR_API_KEY and verify the request data before execution.

Response Body

Status Code: 200

Response Schema Example

{
  "id": string (uuid)
  "name": string
  "email": string
  "isOwner": boolean // Check if the member is the organization owner (via OWNER Group)
  "permissions": object
  "createdAt": string (timestamp)
}

Response Example Value

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Response String",
  "email": "Response String",
  "isOwner": false,
  "permissions": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Response Sample Name",
    "description": "Response Sample Description"
  },
  "createdAt": "Response String"
}

Update Organization Information

PUT /api/organizations/{id}/

Parameters

Parameter Name
Required
Type
Description

id

string

A UUID string identifying this organization.

Request Body

Request Parameters

Field
Type
Required
Description

name

string

Yes

compactLogo

string (uri)

No

fullLogo

string (uri)

No

Request Structure Example

{
  "name": string
  "compactLogo"?: string (uri) // Optional
  "fullLogo"?: string (uri) // Optional
}

Request Example Value

{
  "id": "5b01e0b9-0b0e-4079-8150-d12015576d2c",
  "name": "Updated Org Name",
  "created_at": "1748336288000",
  "usage_statistics": {
    "chatbots_count": 0,
    "can_create_chatbot": true,
    "has_create_chatbot_limit": true,
    "current_month_words_count_total": 1000000,
    "current_month_used_words_count_total": 0,
    "current_month_used_conversations_count_total": 0,
    "available_upload_files_size_total": 104857600,
    "used_upload_file_size_total": 0
  },
  "organization_plan": {
    "id": "cac825e8-cb9b-4a16-b440-4ff6b2e73911",
    "plan_name": "Free Plan",
    "expired_at": null
  }
}

Code Examples

# API Call Example (Shell)
curl -X PUT "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "5b01e0b9-0b0e-4079-8150-d12015576d2c",
    "name": "Updated Org Name",
    "created_at": "1748336288000",
    "usage_statistics": {
      "chatbots_count": 0,
      "can_create_chatbot": true,
      "has_create_chatbot_limit": true,
      "current_month_words_count_total": 1000000,
      "current_month_used_words_count_total": 0,
      "current_month_used_conversations_count_total": 0,
      "available_upload_files_size_total": 104857600,
      "used_upload_file_size_total": 0
    },
    "organization_plan": {
      "id": "cac825e8-cb9b-4a16-b440-4ff6b2e73911",
      "plan_name": "Free Plan",
      "expired_at": null
    }
  }'

# Please replace YOUR_API_KEY and verify the request data before execution.

Response Body

Status Code: 200

Response Schema Example

{
  "id": string (uuid) // Organization ID
  "name": string // Organization name
  "created_at": string (timestamp) // Creation timestamp
  "usage_statistics": { // Usage statistics
  {
    "chatbots_count"?: integer // Number of chatbots (optional)
    "can_create_chatbot"?: boolean // Whether a chatbot can be created (optional)
    "has_create_chatbot_limit"?: boolean // Whether there is a limit on creating chatbots (optional)
    "current_month_words_count_total"?: integer // Total word count limit for the current month (optional)
    "current_month_used_words_count_total"?: integer // Words used in the current month (optional)
    "current_month_used_conversations_count_total"?: integer // Conversations used in the current month (optional)
    "available_upload_files_size_total"?: integer // Total available upload file size (bytes) (optional)
    "used_upload_file_size_total"?: integer // Total used upload file size (bytes) (optional)
  }
  }
  "organization_plan": { // Organization plan information
  {
    "id"?: string (uuid) // Plan ID (optional)
    "plan_name"?: string // Plan name (optional)
    "expired_at"?: string (date-time) // Expiration time (optional)
  }
  }
}

Response Example Value

{
  "id": "5b01e0b9-0b0e-4079-8150-d12015576d2c",
  "name": "Updated Org Name",
  "created_at": "1748336288000",
  "usage_statistics": {
    "chatbots_count": 0,
    "can_create_chatbot": true,
    "has_create_chatbot_limit": true,
    "current_month_words_count_total": 1000000,
    "current_month_used_words_count_total": 0,
    "current_month_used_conversations_count_total": 0,
    "available_upload_files_size_total": 104857600,
    "used_upload_file_size_total": 0
  },
  "organization_plan": {
    "id": "cac825e8-cb9b-4a16-b440-4ff6b2e73911",
    "plan_name": "Free Plan",
    "expired_at": null
  }
}

Update Current User Details

PUT /api/users/current/

Request Body

Request Parameters

Field
Type
Required
Description

avatar

string (uri)

No

name

string

Yes

email

string (email)

Yes

company

string

No

invitationCode

string

No

Request Structure Example

{
  "avatar"?: string (uri) // Optional
  "name": string
  "email": string (email)
  "company"?: string // Optional
  "invitationCode"?: string // Optional
}

Request Example Value

{
  "avatar": "https://example.com/file.jpg",
  "name": "Example Name",
  "email": "[email protected]",
  "company": "Example String",
  "invitationCode": "Example String"
}

Code Examples

# Call API Example (Shell)
curl -X PUT "https://api.maiagent.ai/api/users/current/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "avatar": "https://example.com/file.jpg",
    "name": "Example Name",
    "email": "[email protected]",
    "company": "Example String",
    "invitationCode": "Example String"
  }'

# Please replace YOUR_API_KEY and verify the request data before execution.

Response Body

Status Code: 200

Response Schema Example

{
  "id": string (uuid)
  "avatar"?: string (uri) // Optional
  "name": string
  "email": string (email)
  "authSource": 
  {
    "id": string (uuid)
    "name": string
  }
  "company"?: string // Optional
  "invitationCode"?: string // Optional
  "apiKeys": [
    object
  ]
  "permissions": [
    string
  ]
}

Response Example Value

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "avatar": "https://example.com/file.jpg",
  "name": "Response string",
  "email": "[email protected]",
  "authSource": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Response string"
  },
  "company": "Response string",
  "invitationCode": "Response string",
  "apiKeys": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Response example name",
      "description": "Response example description"
    }
  ],
  "permissions": [
    "Response string"
  ]
}

Delete a specific member

DELETE /api/organizations/{organizationPk}/members/{id}/

Parameters

Parameter Name
Required
Type
Description

id

string

A UUID string identifying this member.

organizationPk

string

A UUID string identifying this organization ID

Code Examples

# API Call Example (Shell)
curl -X DELETE "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/members/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# Please replace YOUR_API_KEY and verify the request data before execution.

Response

Status Code
Description

204

No response body


Last updated

Was this helpful?