### Start a build with overrides (Python) Source: https://northflank.com/docs/v1/api/project/jobs/start-job-build.md This Python example shows how to start a job build with overrides for build arguments, files, and Docker settings. Remember to replace {projectId}, {jobId}, and NORTHFLANK_API_TOKEN. ```python import requests url = "https://api.northflank.com/v1/projects/{projectId}/jobs/{jobId}/build" payload = {"sha":"262ed9817b3cad5142fbceabe0c9e371e390d616","overrides":{"buildArguments":{"ARGUMENT_1":"abcdef","ARGUMENT_2":"12345"},"buildFiles":{"/dir/fileName":{"data":"VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=","encoding":"utf-8"}},"dockerSecretMounts":{"example-secret-mount_1":{"data":"VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=","encoding":"utf-8"}},"docker":{"dockerFilePath":"/Dockerfile","dockerWorkDir":"/"}}} headers = {"Content-Type": "application/json", "Authorization": "Bearer NORTHFLANK_API_TOKEN"} response = requests.request("POST", url, headers = headers, json = payload) print(response.json()) ``` -------------------------------- ### CLI Example Response for Get Preview Blueprint Source: https://northflank.com/docs/v1/api/project/preview-blueprints/get-preview-blueprint.md Details about a preview blueprint retrieved via the CLI. ```json { "apiVersion": "v1.2", "gitops": { "vcsService": "github", "accountLogin": "github-user", "repoUrl": "https://github.com/northflank-examples/remix-postgres-redis-demo", "branch": "main", "filePath": "/Dockerfile" }, "spec": { "kind": "Workflow", "spec": { "type": "sequential" } }, "options": { "concurrencyPolicy": "allow", "autorun": false }, "triggers": [ { "spec": { "vcs": { "vcsService": "github", "accountLogin": "github-user", "repoUrl": "https://github.com/northflank-examples/remix-postgres-redis-demo" }, "commitMessageFlags": { "flags": [ "[skip ci]" ] }, "filePaths": { "paths": [ "README.md" ] } } } ], "concurrencyPolicy": "allow", "status": "success", "paused": false, "createdAt": "2021-01-01 12:00:00.000Z", "updatedAt": "2021-01-01 12:00:00.000Z" } ``` -------------------------------- ### Run Preview Environment using Go HTTP Client Source: https://northflank.com/docs/v1/api/project/pipelines/run-preview-environment.md This Go example illustrates how to make a POST request to run a preview environment. It sets up the HTTP client, request, headers, and handles the response. ```go package main import ( "bytes" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://api.northflank.com/v1/projects/{projectId}/pipelines/{pipelineId}/preview-envs/runs" var jsonStr = []byte(`undefined`) req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer NORTHFLANK_API_TOKEN") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() fmt.Println("Response status:", resp.Status) fmt.Println("Response headers:", resp.Header) body, _ := ioutil.ReadAll(resp.Body) fmt.Println("Response body:", string(body)) } ``` -------------------------------- ### Get Volume JavaScript Client Example Source: https://northflank.com/docs/v1/api/project/volumes/get-volume.md Example of how to retrieve volume details using the JavaScript client. ```APIDOC ## JavaScript Client Reference ### Example Request ```javascript await apiClient.get.volume({ parameters: { "projectId": "default-project", "volumeId": "example-volume" } }); ``` ### Example Response Details about the specified Volume. ```json { "data": { "id": "example-volume", "name": "Example Volume", "spec": { "storageClassName": "ssd", "storageSize": 6144 }, "attachedObjects": [ { "id": "example-service", "type": "service" } ], "status": "BOUND", "createdAt": "2021-01-01 12:00:00.000Z", "updatedAt": "2021-01-01 12:00:00.000Z" }, "rawResponse": "...", "request": "...", "error": "..." } ``` ``` -------------------------------- ### Create Build Service using Go Source: https://northflank.com/docs/v1/api/project/services/create-build-service.md This Go example shows how to create a build service by making a POST request. It includes setting up the request body, headers, and handling the response. ```go package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { url := "https://api.northflank.com/v1/projects/{projectId}/services/build" payload := map[string]interface{}{ "name": "Example Service", "description": "A service description", "billing": map[string]string{ "deploymentPlan": "nf-compute-20", "buildPlan": "nf-compute-200-8", }, "buildSource": "git", "vcsData": map[string]string{ "projectUrl": "https://github.com/northflank/gatsby-with-northflank", "projectType": "github", "accountLogin": "github-user", }, "buildSettings": map[string]interface{}{ "storage": map[string]interface{}{ "ephemeralStorage": map[string]int{ "storageSize": 16384, }, }, "dockerfile": map[string]interface{}{ "buildEngine": "buildkit", "dockerFilePath": "/Dockerfile", "dockerWorkDir": "/", "buildkit": map[string]interface{}{ "useCache": true, "cacheStorageSize": 32768, }, }, }, "buildConfiguration": map[string]interface{}{ "prRestrictions": []string{ "feature/*", }, "branchRestrictions": []string{ "feature/*", }, "crossProjectAccess": map[string]interface{}{ "enabled": true, "projects": []string{ "example-project", }, }, "pathIgnoreRules": []string{ "README.md", }, "isAllowList": false, "ciIgnoreFlags": []string{ "[skip ci]", }, "dockerCredentials": []string{ "example-docker-credential", }, "storage": map[string]interface{}{ "ephemeralStorage": map[string]int{ "storageSize": 16384, }, }, }, "buildArguments": map[string]string{ "ARGUMENT_1": "abcdef", "ARGUMENT_2": "12345", }, "buildFiles": map[string]interface{}{ "/dir/fileName": map[string]string{ "data": "VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=", "encoding": "utf-8", }, }, "dockerSecretMounts": map[string]interface{}{ "example-secret-mount_1": map[string]string{ "data": "VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=", "encoding": "utf-8", }, }, } jsonPayload, err := json.Marshal(payload) if err != nil { fmt.Println("Error marshalling JSON:", err) return } req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload)) if err != nil { fmt.Println("Error creating request:", err) return } req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer NORTHFLANK_API_TOKEN") client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Println("Error sending request:", err) return } defer resp.Body.Close() var result map[string]interface{} err = json.NewDecoder(resp.Body).Decode(&result) if err != nil { fmt.Println("Error decoding response:", err) return } fmt.Println(result) } ``` -------------------------------- ### API Example Response Source: https://northflank.com/docs/v1/api/org/billing/get-invoice.md Example JSON response for a successful GET request to retrieve invoice details. ```json { "data": { "currency": "usd" } } ``` -------------------------------- ### Example Project Creation Request Source: https://northflank.com/docs/v1/api/team/projects/create-project.md This snippet shows how to read the response headers and body after creating a project. ```Go fmt.Println("Response headers:", resp.Header) body, _ := ioutil.ReadAll(resp.Body) fmt.Println("Response body:", string(body)) } ``` -------------------------------- ### Get Team CLI Example Response Source: https://northflank.com/docs/v1/api/org/teams/get-team.md This JSON shows the output when using the Northflank CLI to get team details. ```json { "id": "my-team", "name": "My Team", "description": "This is my team.", "createdAt": "2021-01-20T11:19:53.175Z", "updatedAt": "2021-01-20T11:19:53.175Z" } ``` -------------------------------- ### Example Request using Go Source: https://northflank.com/docs/v1/api/project/services/edit-service-build-arguments.md This Go program demonstrates how to send a POST request to update service build arguments. It includes setting up the HTTP client, request details, and handling the response. ```go package main import ( "bytes" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://api.northflank.com/v1/projects/{projectId}/services/{serviceId}/build-arguments" var jsonStr = []byte(`{"buildArguments":{"ARGUMENT_1":"abcdef","ARGUMENT_2":"12345"},"buildFiles":{"/dir/fileName":{"data":"VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=","encoding":"utf-8"}},"dockerSecretMounts":{"example-secret-mount_1":{"data":"VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=","encoding":"utf-8"}}}`) req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer NORTHFLANK_API_TOKEN") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() fmt.Println("Response status:", resp.Status) fmt.Println("Response headers:", resp.Header) body, _ := ioutil.ReadAll(resp.Body) fmt.Println("Response body:", string(body)) } ``` -------------------------------- ### JavaScript Client Example Request Source: https://northflank.com/docs/v1/api/org/billing/get-invoice.md Example of how to make a request to get invoice details using the Northflank JavaScript client. ```javascript await apiClient.get.invoice({ parameters: { "invoiceId": "835994C3-14310" }, options: {} }); ``` -------------------------------- ### Initiate Addon Backup (Go) Source: https://northflank.com/docs/v1/api/addons/backup-addon A Go program to initiate an addon backup. This example demonstrates how to send a POST request with the necessary headers and JSON payload. ```go package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { projectId := "{projectId}" addonId := "{addonId}" url := fmt.Sprintf("https://api.northflank.com/v1/projects/%s/addons/%s/backups", projectId, addonId) payload := map[string]interface{}{ "name": "Example Backup", "backupType": "snapshot", "compressionType": "gz", "additionalDestinations": []map[string]interface{}{ { "destinationId": "example-backup-destination", "retentionTime": 7, "type": "custom" } } } jsonPayload, err := json.Marshal(payload) if err != nil { fmt.Println("Error marshalling JSON:", err) return } req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload)) if err != nil { fmt.Println("Error creating request:", err) return } req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer NORTHFLANK_API_TOKEN") client := &http.Client{} res, err := client.Do(req) if err != nil { fmt.Println("Error sending request:", err) return } defer res.Body.Close() var result map[string]interface{} if err := json.NewDecoder(res.Body).Decode(&result); err != nil { fmt.Println("Error decoding response:", err) return } fmt.Println(result) } ``` -------------------------------- ### JavaScript Client Example Request Source: https://northflank.com/docs/v1/api/team/tags/get-tag.md Example of how to call the get tag API using the Northflank JavaScript client, specifying the resourceTagId. ```javascript await apiClient.get.tag({ parameters: { "resourceTagId": "example-tag" } }); ``` -------------------------------- ### Go HTTP Client Example for Runtime Environment Update Source: https://northflank.com/docs/v1/api/project/services/edit-service-runtime-environment.md This Go program demonstrates how to make an HTTP POST request to update a service's runtime environment and files. It includes setting up the request, headers, and handling the response. ```go package main import ( "bytes" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://api.northflank.com/v1/projects/{projectId}/services/{serviceId}/runtime-environment" var jsonStr = []byte(`{"runtimeEnvironment":{"VARIABLE_1":"abcdef","VARIABLE_2":"12345"},"runtimeFiles":{"/dir/fileName":{"data":"VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=","encoding":"utf-8"}}}`) req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer NORTHFLANK_API_TOKEN") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() fmt.Println("Response status:", resp.Status) fmt.Println("Response headers:", resp.Header) body, _ := ioutil.ReadAll(resp.Body) fmt.Println("Response body:", string(body)) } ``` -------------------------------- ### Get Backup Destination JavaScript Client Example Source: https://northflank.com/docs/v1/api/team/backup-destinations/get-backup-destination.md Example of how to retrieve backup destination details using the JavaScript client library. ```APIDOC ### JavaScript Client #### Example Request ```javascript await apiClient.get.backupDestination({ parameters: { "backupDestinationId": "example-destination" } }); ``` ### Example Response Details of the backup destination. ```json { "data": { "name": "Example Backup Destination", "id": "example-backup-destination" }, "rawResponse": "...", "request": "...", "error": "..." } ``` ``` -------------------------------- ### Start Service Build with Go Source: https://northflank.com/docs/v1/api/project/services/start-service-build.md Initiates a new build for a service using a provided bundle URL. Requires project and service IDs, along with an API token for authentication. This example demonstrates making an HTTP POST request. ```go package main import ( "bytes" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://api.northflank.com/v1/projects/{projectId}/services/{serviceId}/build" var jsonStr = []byte(`{"bundleUrl":"https://example.com/archive.tar"}`) req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer NORTHFLANK_API_TOKEN") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() fmt.Println("Response status:", resp.Status) fmt.Println("Response headers:", resp.Header) body, _ := ioutil.ReadAll(resp.Body) fmt.Println("Response body:", string(body)) } ``` -------------------------------- ### Get Job Build JavaScript Client Example Source: https://northflank.com/docs/v1/api/project/jobs/get-job-build.md Example of how to use the JavaScript client to fetch details about a specific job build. ```APIDOC ### JavaScript Client #### Example Request ```javascript await apiClient.get.job.build({ parameters: { "projectId": "default-project", "jobId": "example-job", "buildId": "joyous-view-6290" } }); ``` #### Example Response Returns data about the specified build. ```json { "data": { "id": "joyous-view-6290", "branch": "main", "status": "SUCCESS", "sha": "12c15e7ee25fd78f567ebf87f9178b8ad70025b3", "concluded": true, "createdAt": "2021-07-28T15:55:38.296Z", "success": true, "message": "Image successfully built", "buildConcludedAt": 1606237973 }, "rawResponse": "...", "request": "...", "error": "..." } ``` ``` -------------------------------- ### Example Create Build Service Response Source: https://northflank.com/docs/v1/api/project/services/create-build-service.md Details about the newly created service, including build source, settings, and arguments. ```json { "data": { "name": "Example Service", "description": "A service description", "billing": { "deploymentPlan": "nf-compute-20", "buildPlan": "nf-compute-200-8" }, "buildSource": "git", "vcsData": { "projectUrl": "https://github.com/northflank/gatsby-with-northflank", "projectType": "github", "accountLogin": "github-user" }, "buildSettings": { "storage": { "ephemeralStorage": { "storageSize": 16384 } }, "dockerfile": { "buildEngine": "buildkit", "dockerFilePath": "/Dockerfile", "dockerWorkDir": "/", "buildkit": { "useCache": true, "cacheStorageSize": 32768 } } }, "buildConfiguration": { "prRestrictions": [ "feature/*" ], "branchRestrictions": [ "feature/*" ], "crossProjectAccess": { "enabled": true, "projects": [ "example-project" ] }, "pathIgnoreRules": [ "README.md" ], "isAllowList": false, "ciIgnoreFlags": [ "[skip ci]" ], "dockerCredentials": [ "example-docker-credential" ], "storage": { "ephemeralStorage": { "storageSize": 16384 } } }, "buildArguments": { "ARGUMENT_1": "abcdef", "ARGUMENT_2": "12345" }, "buildFiles": { "/dir/fileName": { "data": "VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=", "encoding": "utf-8" } }, "dockerSecretMounts": { "example-secret-mount_1": { "data": "VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=", "encoding": "utf-8" } }, "serviceType": "build", "id": "example-service", "appId": "/example-user/default-project/example-service", "cluster": { "id": "nf-europe-west", "name": "nf-europe-west", "namespace": "ns-8zy2mcjh9zn2", "loadBalancers": [ "lb.659200800000000000000000.northflank.com" ] }, "status": { "build": { "status": "SUCCESS", "lastTransitionTime": "2021-11-29T11:47:16.624Z" } } }, "rawResponse": "...", "request": "...", "error": "..." } ``` -------------------------------- ### Get Job Build JavaScript Request Source: https://northflank.com/docs/v1/api/project/jobs/get-job-build.md Example of how to make a request to get job build details using the Northflank JavaScript client. ```javascript await apiClient.get.job.build({ parameters: { "projectId": "default-project", "jobId": "example-job", "buildId": "joyous-view-6290" } }); ``` -------------------------------- ### Create Template with Python Source: https://northflank.com/docs/v1/api/team/templates/create-template.md This Python example demonstrates creating a template using the requests library. Ensure you have the library installed (`pip install requests`). ```python import requests url = "https://api.northflank.com/v1/templates" payload = {"name":"Example Template","description":"This is a sample template.","teardownSpec":{"spec":{"kind":"Workflow"}},"options":{"autorun":false,"concurrencyPolicy":"allow","runOnCreation":true},"gitops":{"vcsService":"github","accountLogin":"github-user","repoUrl":"https://github.com/northflank-examples/remix-postgres-redis-demo","branch":"main","filePath":"/Dockerfile"}} headers = {"Content-Type": "application/json", "Authorization": "Bearer NORTHFLANK_API_TOKEN"} response = requests.request("POST", url, headers = headers, json = payload) print(response.json()) ``` -------------------------------- ### Example Build Service Creation Request Source: https://northflank.com/docs/v1/api/project/services/create-build-service.md This snippet shows how to create a build service using the JavaScript client. It includes detailed configuration for billing, build source, VCS data, build settings, and build arguments. ```javascript await apiClient.create.service.build({ parameters: { "projectId": "default-project" }, data: { "name": "Example Service", "description": "A service description", "billing": { "deploymentPlan": "nf-compute-20", "buildPlan": "nf-compute-200-8" }, "buildSource": "git", "vcsData": { "projectUrl": "https://github.com/northflank/gatsby-with-northflank", "projectType": "github", "accountLogin": "github-user" }, "buildSettings": { "storage": { "ephemeralStorage": { "storageSize": 16384 } }, "dockerfile": { "buildEngine": "buildkit", "dockerFilePath": "/Dockerfile", "dockerWorkDir": "/", "buildkit": { "useCache": true, "cacheStorageSize": 32768 } } }, "buildConfiguration": { "prRestrictions": [ "feature/*" ], "branchRestrictions": [ "feature/*" ], "crossProjectAccess": { "enabled": true, "projects": [ "example-project" ] }, "pathIgnoreRules": [ "README.md" ], "isAllowList": false, "ciIgnoreFlags": [ "[skip ci]" ], "dockerCredentials": [ "example-docker-credential" ], "storage": { "ephemeralStorage": { "storageSize": 16384 } } }, "buildArguments": { "ARGUMENT_1": "abcdef", "ARGUMENT_2": "12345" }, "buildFiles": { "/dir/fileName": { "data": "VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=", "encoding": "utf-8" } }, "dockerSecretMounts": { "example-secret-mount_1": { "data": "VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=", "encoding": "utf-8" } } } }); ``` -------------------------------- ### JavaScript Client Request to Get Load Balancer Source: https://northflank.com/docs/v1/api/team/load-balancers/get-load-balancer.md Example of how to make a request to get load balancer details using the Northflank JavaScript client. ```javascript await apiClient.get.loadBalancer({ parameters: { "loadBalancerId": "my-load-balancer" } }); ``` -------------------------------- ### Start a build with current settings (JavaScript) Source: https://northflank.com/docs/v1/api/project/jobs/start-job-build.md Initiate a job build with default settings using JavaScript's fetch API. This example requires replacing {projectId}, {jobId}, and NORTHFLANK_API_TOKEN with your specific values. ```javascript const payload = { "sha": "262ed9817b3cad5142fbceabe0c9e371e390d616" } const response = await fetch('https://api.northflank.com/v1/projects/{projectId}/jobs/{jobId}/build', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${NORTHFLANK_API_TOKEN}` }, body: JSON.stringify(payload) }) const json = await response.json() console.log(json) ``` -------------------------------- ### Start a build with current settings (Python) Source: https://northflank.com/docs/v1/api/project/jobs/start-job-build.md This Python script demonstrates how to start a job build using the requests library. Remember to substitute {projectId}, {jobId}, and NORTHFLANK_API_TOKEN. ```python import requests url = "https://api.northflank.com/v1/projects/{projectId}/jobs/{jobId}/build" payload = {"sha":"262ed9817b3cad5142fbceabe0c9e371e390d616"} headers = {"Content-Type": "application/json", "Authorization": "Bearer NORTHFLANK_API_TOKEN"} response = requests.request("POST", url, headers = headers, json = payload) print(response.json()) ``` -------------------------------- ### Get Team JavaScript Client Request Source: https://northflank.com/docs/v1/api/org/teams/get-team.md Example of how to call the get team endpoint using the Northflank JavaScript client. Ensure the apiClient is properly initialized. ```javascript await apiClient.get.team({ parameters: { "teamId": "my-team" } }); ``` -------------------------------- ### Get Billing Usage API Request Source: https://northflank.com/docs/v1/api/org/billing/get-usage.md This is an example of how to make a GET request to the billing usage API endpoint. Ensure you provide the required timestamp parameter. ```bash GET /v1/billing/usage/{timestamp} ``` ```bash GET /v1/teams/{teamId}/billing/usage/{timestamp} ``` -------------------------------- ### CLI Example Response: List Projects Source: https://northflank.com/docs/v1/api/team/projects/list-projects.md This JSON shows the output format for listing projects via the CLI. ```json { "projects": [ { "id": "default-project", "name": "Default Project", "description": "The project description" } ] } ``` -------------------------------- ### Get Pipeline JavaScript Client Request Source: https://northflank.com/docs/v1/api/project/pipelines/get-pipeline.md Example of how to call the get pipeline API using the JavaScript client. Ensure the apiClient is initialized and parameters are correctly set. ```javascript await apiClient.get.pipeline({ parameters: { "projectId": "default-project", "pipelineId": "example-pipeline" } }); ``` -------------------------------- ### Run Preview Blueprint using Go Source: https://northflank.com/docs/v1/api/project/preview-blueprints/run-preview-blueprint.md This Go program shows how to make an HTTP POST request to run a preview blueprint. It includes setting up the request body, headers, and handling the response. ```go package main import ( "bytes" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://api.northflank.com/v1/projects/{projectId}/preview-blueprints/{previewBlueprintId}/runs" var jsonStr = []byte(`{"name":"Example Run","description":"This is a description for the preview blueprint run.","arguments":{"ARG_1":"value"},"triggers":{"example-trigger":{"branch":"devel"}}}`) req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer NORTHFLANK_API_TOKEN") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() fmt.Println("Response status:", resp.Status) fmt.Println("Response headers:", resp.Header) body, _ := ioutil.ReadAll(resp.Body) fmt.Println("Response body:", string(body)) } ```