Skip to main content

Get started with Magic AI API

You can create, customize and train your own chat bots by using Magic AI API.

The Magic AI API is organized around REST. Our API has predictable resource-oriented URLs, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Getting Started

  • Initially you will need to create an account on Magic AI API.
  • Login to your Magic AI account and navigate to the Organisation page.
  • Generate your API key under the API Keys tab.
  • Copy the API key and store it in a safe place.

Authentication

The Magic AI API uses API keys to authenticate requests.

Your API keys are private, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.

Here is a sample API request with curl

curl https://api.magicai.ai/v1/projects \
-u YOUR_API_KEY:

Postman Collection

You can download postman collection here.

After downloading this collection, import it into your Postman app. Go to the Variables tab and update apiKey variable with your API key. Now you can start using Magic AI API.

Errors

Magic AI uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with our server, if you get any 5xx error please let us know. We are proactively monitoring these errors.