Authentication and Headers

Using API CredentialsCopied!

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.

Notes & Best Practices:Copied!

  • 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: