Base URL

What is a Base URL? Why do you need one?

In the Developer Portal, some extensions have a Base URL field. The presence of this field indicates that you must provide Canva with the URL of a web server.

Throughout the lifecycle of the extension, Canva:

  • Sends HTTP requests to the web server.

  • Uses the responses to determine the extension’s behavior.

Handling requests

Unlike some APIs that you may be familiar with — e.g. Stripe’s Webhooks API — Canva doesn’t send all requests to a single endpoint.

Instead, when sending requests, Canva appends a path to the Base URL. (This is why the field is called Base URL and not Endpoint URL.)

The appended path identifies:

  • The purpose of the request.

  • The structure of the request that Canva sends.

  • The structure of the response that Canva expects to receive.

For example, if the Base URL of a publish extension is example.com, Canva may send requests to the following endpoints:

  • example.com/publish/resources/find

  • example.com/publish/resources/get

  • example.com/publish/resources/upload

For each of these endpoints, Canva sends a request that conforms to a schema and expects the responses to conform to a schema of their own.

The documentation for each extension point explains:

  • The endpoints an extension needs to support. (This can change depending on the extension's configuration.)

  • The structure of the requests that Canva sends to an extension.

  • The structure of the responses that an extension must send back to Canva.

You can find this documentation in the sidebar, under the Extension points heading.

Setting up a Base URL

You can use any programming language, framework, or architecture to set up a Base URL, but for Canva to send requests and receive responses, the server must be available via public URL (i.e. not localhost).

For examples of how to set up a Base URL, see the following guides:

All server-side examples in this documentation use Express.js. This is because the framework is not opinionated, which keeps the examples simple.