APIs
Email Inbox API
Reference

API - Email Inbox - Reference

GET /email-inboxes/

Get all email inboxes associated with the user.

Example request

curl --request GET \
 --url https://api.aidbase.ai/v1/email-inboxes \
 --header 'accept: application/json' \
 --header 'Authorization: Bearer [YOUR_API_KEY]'

Example response

{
  "success": true,
  "data": [
    {
      "id": "d25a64c9-7531-487f-a5ed-02a333cb7775",
      "alias": "support-mycompany",
      "title": "Main Email Inbox",
    },
    {
      "id": "fd023cb9-be89-4a45-a158-eaf977b6235e",
      "alias": "privacy-mycompany",
      "title": "Privacy Inbox",
      "description": "Emails related to privacy concerns",
    }
    ...
  ]
}

GET /email-inbox/:id/

Get a specific email inbox by ID.

Example request

curl --request GET \
 --url https://api.aidbase.ai/v1/email-inbox/d25a64c9-7531-487f-a5ed-02a333cb7775 \
 --header 'accept: application/json' \
 --header 'Authorization: Bearer [YOUR_API_KEY]'

Example response

{
  "success": true,
  "data": {
    "id": "d25a64c9-7531-487f-a5ed-02a333cb7775",
    "alias": "support-mycompany",
    "title": "Main Email Inbox",
  },
}

GET /email-inbox/:id/knowledge

Get all knowledge items associated with a email inbox.

ℹ️

Both an id and an alias can be used to identify the email inbox.

Example request

curl --request GET \
 --url https://api.aidbase.ai/v1/email-inbox/d71efbf4-a37d-4f44-9fc9-a600b8afad29/knowledge \
 --header 'accept: application/json' \
 --header 'Authorization: Bearer [YOUR_API_KEY]'

Example response

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "24019214-f4ea-417b-9741-e13bc3b6c471",
        "type": "website",
        "base_url": "https://www.mywebsite.com/",
        "trained_at": "2023-12-24T06:05:17.365Z",
        "is_training": false,
        "training_failed_at": null,
        "training_failed_with": null
      },
      ...
    ],
    "total": 40,
    "has_more": true,
    "next_cursor": "MjUuNTA="
  }
}

PUT /email-inbox/:id/knowledge

Add a new knowledge item to a email-inbox.

ℹ️

The knowledge item must have a trained model.
The model can be trained using the /knowledge/:id/train endpoint.

Example request

curl --request PUT \
 --url https://api.aidbase.ai/v1/email-inbox/d71efbf4-a37d-4f44-9fc9-a600b8afad29/knowledge \
 --header 'accept: application/json' \
 --header 'Authorization: Bearer [YOUR_API_KEY]' \
 --data '{
    "knowledge_id": "24019214-f4ea-417b-9741-e13bc3b6c471"
 }'

Example response

{
  "success": true,
}

DELETE /email-inbox/:id/knowledge

Remove a knowledge item from a email inbox.

ℹ️

The knowledge item will be removed from the email inbox, but the knowledge item itself will not be deleted.

Example request

curl --request DELETE \
 --url https://api.aidbase.ai/v1/email-inbox/d71efbf4-a37d-4f44-9fc9-a600b8afad29/knowledge \
 --header 'accept: application/json' \
 --header 'Authorization: Bearer [YOUR_API_KEY]' \
 --data '{
    "knowledge_id": "24019214-f4ea-417b-9741-e13bc3b6c471"
 }'

Example response

{
  "success": true,
}

Aidbase Docs © 2024