Skip to content
v2.7

Create execution

Trigger a function execution.

POST/functions/{functionId}/executionsScope executions.write

Trigger a function execution. The returned object will return you the current execution status. You can ping the Get Execution endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.

functionId string required

Function ID.

body string

HTTP body of execution. Default value is empty string.

async boolean

Execute code in the background. Default value is false.

xpath string

HTTP path of execution. Path can include query params. Default value is /

method ExecutionMethod

HTTP method of execution. Default value is POST. Values: GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD.

headers object

HTTP headers of execution. Defaults to empty.

scheduledAt string

Scheduled execution time in ISO 8601 format. DateTime value must be in future with precision in minutes.

Access: API key with the executions.write scope (also accepts execution.write) or user session, or even no session (the resource’s permissions apply).

201Success
400Invalid or missing parameter
401No session, no permission on the resource or key without the scope
404Resource in the path not found
429Rate limit

Every error comes as JSON with code, type and message: see Errors.

import { Client, Functions, ExecutionMethod } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const functions = new Functions(client);
const result = await functions.createExecution({
functionId: '<FUNCTION_ID>',
body: '<BODY>', // optional
async: false, // optional
xpath: '<PATH>', // optional
method: ExecutionMethod.GET, // optional
headers: {}, // optional
scheduledAt: '<SCHEDULED_AT>', // optional
});
console.log(result);
Response201 Created
{
"$id": "5e5ea5c16897e",
"$createdAt": "2020-10-15T06:38:00.000+00:00",
"$updatedAt": "2020-10-15T06:38:00.000+00:00",
"$permissions": [
"any"
],
"resourceId": "5e5ea6g16897e",
"resourceType": "functions",
"deploymentId": "5e5ea5c16897e",
"trigger": "http",
"status": "processing",
"requestMethod": "GET",
"requestPath": "/articles?id=5",
"requestHeaders": [
{
"name": "Content-Type",
"value": "application/json"
}
],
"responseStatusCode": 200,
"responseBody": "",
"responseHeaders": [
{
"name": "Content-Type",
"value": "application/json"
}
],
"logs": "",
"errors": "",
"duration": 1.23,
"scheduledAt": "2020-10-15T06:38:00.000+00:00"
}

The descriptions on this page come from the server API specification (BSD-3-Clause license), and the examples come from the SDK generator (MIT license). The full notices are in the NOTICE file of the @owbase/web and @owbase/node packages.

Was this page helpful?