Authentication and Headers

Using API Credentials

To interact with the magicplan REST API, you must include both an API Key and a Customer ID in the request headers of every API call. These credentials ensure that requests are authorized and associated with the correct magicplan account.

Unlike many APIs that use a bearer token format, the magicplan API requires two dedicated headers:

  • customer: Your Customer ID

  • key: Your API Key

Example Request

curl --location "https://cloud.magicplan.app/api/v2/workspace" \
  --header "customer: YOUR_CUSTOMER_ID" \
  --header "key: YOUR_API_KEY"

Replace YOUR_CUSTOMER_ID and YOUR_API_KEY with the actual values you obtained during the Generating API Credentials step.

Accept-Language Header

You can specify the language of the API response by including the Accept-Language header in your request.
If the header is not provided, the API will return responses in the default language (English).

Example:

GET /api/v2/projects
Accept-Language: fr-FR

In this example, the API will return the response in French.

Supported languages (format: language-COUNTRY):

  • en-US (English)

  • de-DE (German)

  • fr-FR (French)

  • pt-PT (Portuguese)

  • es-ES (Spanish)

Notes & Best Practices:

  • Use HTTPS: Always send requests over HTTPS to protect your credentials during transmission.

  • Security of Credentials:

    • Never commit your API Key to public repositories or share it openly.

    • If you suspect that your credentials have been compromised, rotate your API Key immediately from the magicplan Cloud dashboard.

  • Testing Connectivity:

    The /workspace endpoint is a good starting point to confirm that your headers are correct. A 200 OK response with workspace details indicates that your credentials and request format are correct.

  • Next Steps:

    After confirming successful authentication, proceed to: