Skip to content

Blueprint endpoints

Endpoints turn your Python functions into API endpoints to form a serverless backend for your applications. You can build and test endpoints from the web IDE.

The @route decorator

The @route decorator transforms a Python function in Blueprint into an endpoint.


    path: str,
    is_public: bool = False,
    allowed_domains: List[str] = [],
    allowed_methods: List[str] = ["GET"],

Decorator: transform a Python function in Blueprint into an endpoint.


def my_route(request):
    allowed_domains=["", ""],
    allowed_methods=["GET", "POST"]
def my_route(request):


Name Type Description Default
path str

Path to use for the route

is_public bool

is this a public endpoint? (Public endpoints do not require an API key to request.)

allowed_domains List[str]

Allowed domains prevent CORS issues when invoking public endpoints.

allowed_methods List[str]

Choose to support 'GET', 'POST', 'PUT', and 'DELETE' methods.



Routes' pathes must start with /. The root route (just /) is not supported, the path must be /something.

Invoking endpoints

You can invoke endpoints from the Blueprint web IDE or anywhere that can send an HTTP request: terminal, code, testing tools like Postman, and applications.

The url to invoke is formatted as follows:


Requests to private endpoints (by default, endpoints are private) must be accompanied with an API key for authentication.

Create an API key here

Pass the API key with an authorization header in the HTTP request. In cURL, that looks like:

curl -X GET
- h "Authorization: API-KEY"

Input Format

Your Python function should accept a single positional argument, request, which passes in a dictionary of input. Input includes HTTP method, headers (all request headers are passed to the function), and body (for non-GET methods).

Blueprint endpoints support GET, POST, PUT, and DELETE methods. For GET and DELETE requests, you can pass data with query parameters. For POST and PUT, use the HTTP request body.

Example POST requests:


Find your PROJECT_ID in the URL of your Blueprint project.

e.g. in, abcd0123 is your PROJECT_ID.

Form parameters:

curl -X POST \
  -H 'Authorization: Api-Key YOUR_API_KEY' \
  -d 'url='


curl -X POST \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Api-Key YOUR_API_KEY' \
  -d '{"url": ""}'

Output format

Your Python function can output anything JSON-serializable. Blueprint will serialize it and wrap it in a dictionary with the following format:

    "success": true,
    "output": YOUR_OUTPUT

You do not need to return success: true from your function, Blueprint does that for you. The endpoint will return success: false in the error case.

Note that for now, functions always return a 200 HTTP code, even in error cases. Proper HTTP codes will be added in the future.