Functions
Start a run
POST /v1/functions/{id}/runs- Permission
write:functions- Tokens
- API key, CLI user token
Start a run of a function with an input. A run is a background job, so read it until its status is completed, failed, or cancelled. Set wait to hold the request for up to 45 seconds and get the run back as it is then.
Path parameters
idstringrequired
{
"wait": bool
}
{
}
1
import os
2
3
from ellipsis import Ellipsis
4
5
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
6
7
result = client.functions.runs.create(
8
"...",
9
input={"repository": "api-repo"},
10
wait=True,
11
)
12
print(result)
1
import { Ellipsis } from '@ellipsis-dev/sdk';
2
3
const client = new Ellipsis({
4
apiKey: process.env.ELLIPSIS_API_TOKEN!,
5
});
6
7
const request: Parameters<typeof client.functions.runs.create>[1] = {
8
input: { 'repository': 'api-repo' },
9
wait: true,
10
};
11
12
const result = await client.functions.runs.create('...', request);
13
console.log(result);
1
curl -X POST "https://api.ellipsis.dev/v1/functions/{id}/runs" \
2
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN" \
3
-H "Content-Type: application/json" \
4
-d '{
5
"input": {
6
"repository": "api-repo"
7
},
8
"wait": true
9
}'
Request
inputobject
The input the handler receives. It must satisfy the function's `input.json_schema` when the function declares one.
waitboolean
Hold the request until the run finishes, for up to 45 seconds, and return the run as it is then. Leave it out to return at once with the run in `queued`.
Response
runFunctionRunrequired
The run.