--- title: "API (Local development)" slug: "api-local-development" tags: ["Local Development"] updated: 2025-07-14T21:14:58Z published: 2025-07-14T21:14:58Z canonical: "legacy-docs.strata.io/api-local-development" --- > ## Documentation Index > Fetch the complete documentation index at: https://legacy-docs.strata.io/llms.txt > Use this file to discover all available pages before exploring further. # API (Local development) APIs are used primarily to expose custom HTTP endpoints on the Orchestrator server. These HTTP endpoints can serve custom HTML pages or help facilitate arbitrary identity flows. The API extensions can also be used for other tasks such as running a custom script. ## Configuration Properties The `apis` block takes a list of APIs. ### Name `name` represents the name of the API. ### Serve Service Extension `serveSE` is used to define a custom API Service Extension. For more details on how to define an extension, please see the [Service Extension docs](/v1/docs/service-extensions-1). ## Examples ```yaml apis:  - name: exampleAPI    serveSE:      funcName: Serve      file: /etc/maverics/extensions/api.go ``` > [!NOTE] > In order to register HTTP endpoints on the Orchestrator's server, the router found in the `github.com/strata-io/service-extension/router` package must be used. The extension below demonstrates how to register an endpoint. `/etc/maverics/extensions/api.go` ```go package main import ( "fmt" "net/http" "github.com/strata-io/service-extension/log" "github.com/strata-io/service-extension/orchestrator" ) func Serve(api orchestrator.Orchestrator) error { var ( logger = api.Logger() router = api.Router() ) logger.Info("msg", "exposing custom API") // Register a custom HTTP endpoint. For more info on registering endpoints, // please see the docs. // https://pkg.go.dev/github.com/strata-io/service-extension/router err := router.HandleFunc("/error.html", func(rw http.ResponseWriter, req *http.Request) { // Please note that a different logger is used here as this service extension // registers its own HTTP handler. For more info, please see the docs. // https://pkg.go.dev/github.com/strata-io/service-extension/log#WithRequest logger = api.Logger(log.WithRequest(req)) logger.Info("msg", "received error page request") _, _ = rw.Write([]byte(errorPageText)) }) if err != nil { return fmt.Errorf("failed to register route: %w", err) } logger.Info( "msg", "successfully exposed custom HTTP endpoint", "path", "/error.html", ) return nil } const errorPageText = "Oops, it looks like there was an error. Please contact support@example.com for help." ```