Discussions

Ask a Question
Back to All

Issue using base URL from /api/config – "Invalid API Key"

Hi Zuper team,

I'm currently working on integrating with the Zuper API and I encountered a question regarding the correct base URL to use.

According to the documentation, I used the following endpoint to retrieve the API base URL for my account:

POST https://accounts.zuperpro.com/api/config
Body:
{
"company_name": "my-company-login-name"
}

{
"type": "success",
"title": "Company config",
"config": {
"dc_name": "us-west-1c",
"dc_provider": "AWS",
"dc_country": "US WEST",
"dc_api_url": "https://us-west-1c.zuperpro.com",
"dc_socket_url": "https://us-west-1c.zuperpro.com",
"dc_connect_url": "https://us-west-1-connect.zuperpro.com",
"dc_workflow_builder_url": "https://us-west-1-workflow.zuperpro.com",
"dc_type": 1
}
}

However, when I try to make a request to any endpoint using the provided dc_api_url (e.g., https://us-west-1c.zuperpro.com/api/teams/summary), I always receive the following error:

{
"type": "error",
"message": "Invalid API Key"
}


I’ve confirmed that I’m sending the correct x-api-key header with the API key from my account, but the issue persists.

Interestingly, when I instead use the URL https://stagingv2.zuperpro.com, the same request works perfectly:

GET https://stagingv2.zuperpro.com/api/teams/summary

This returns a successful response.

My questions are:

Is it correct to use https://stagingv2.zuperpro.com as the base URL, even if /api/config returns a different one?

Is stagingv2 the default or recommended base URL for all accounts?

Am I misunderstanding how to build the correct base URL from the dc_api_url returned by /api/config?

Could this be related to the environment (staging vs. production) or the API key I was given?

I’m building a custom connector and need to ensure it works for different Zuper accounts, so understanding this is critical.

Thank you in advance for your help!