openapi: 3.1.0
info:
title: Serverless Functions API
description: |-
Deploying applications to the cloud becomes simpler with Serverless Functions. Instead of provisioning and maintaining servers, you just need to install a "function" of your business logic on the Scaleway cloud platform. The platform executes this function on demand, managing resource allocation for you. If the system needs to accommodate a hundred simultaneous requests, it creates a hundred (or more) copies of your service. Conversely, if demand drops to two concurrent requests, it destroys the unneeded ones. You only pay for the resources your functions use when they need them.
The benefits of Scaleway Serverless Functions include:
* Saving money while code is not running, as functions are only executed when an event is triggered
* Auto-scalability:
* Scaling up and down automatically based on user configuration (e.g., min: 0, max: 100 replicas of my function).
* Scaling to zero when the function is not executed, which saves money for the user and computing resources for the cloud provider.
* Endpoint-only scaling.
### Deploying functions
This page explains how to use the Scaleway Serverless Functions API, including a quickstart and the full API documentation. However, we provide [several methods to deploy functions](https://www.scaleway.com/en/docs/serverless/functions/reference-content/deploy-function/).
To learn how to package and upload your function code, refer to the [dedicated documentation](https://www.scaleway.com/en/docs/serverless/functions/how-to/package-function-dependencies-in-zip/).
## Concepts
Refer to our [dedicated concepts](https://www.scaleway.com/en/docs/serverless/functions/concepts/) page to find definitions of all terminology related to Scaleway Serverless Functions.
## Quickstart
For functions concepts and advanced documentation, please refer to [Scaleway Quickstart for Functions](https://www.scaleway.com/en/docs/serverless/functions/quickstart/).
1. Configure your environment variables.
```bash
export SCW_SECRET_KEY=""
export SCW_DEFAULT_REGION=""
export SCW_DEFAULT_PROJECT_ID=""
```
A namespace is a project that allows you to group your functions. Functions in the same namespace can share environment variables and access tokens, defined at the namespace level.
2. Set the name for your namespace and set your Project ID.
```bash
curl -X POST \
"https://api.scaleway.com/functions/v1beta1/regions/$SCW_DEFAULT_REGION/namespaces" \
-H "accept: application/json" \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
name: your-namespace-name, \
project_id: "$SCW_DEFAULT_PROJECT_ID", \
environment_variables: \
{
YOUR_VARIABLE: content
} \
}'
```
3. Copy the `id` field of the response to use in the next steps. For the sake of simplicity, we will save the ID to a variable, which we will use in the following examples.
```bash
export SCW_NAMESPACE_ID=""
```
4. Edit the POST request payload that we will use in the next step to create a function. Modify the values in the example according to your needs, using the information in the table to help.
```
{
"name": "string",
"namespace_id": "string",
"environment_variables": {
"": "string"
},
"min_scale": "integer",
"max_scale": "integer",
"runtime": "unknown_runtime",
"memory_limit": "integer",
"timeout": "2.5s",
"handler": "string",
"privacy": "unknown_privacy",
"description": "string",
"secret_environment_variables": [
{
"key": "string",
"value": "string"
}
],
"http_option": "enabled"
}
```
| Parameter | Description |
| :--------------- | :----------------------------------------------------------------- |
| `name` | The name of your function |
| `namespace_id` | ID of the namespace in which you want to create your function |
| `runtime` | Your function's runtime, check the supported runtimes above |
| `environment_variables` | **NULLABLE** Environment variables of the function. |
| `memory_limit` |**NULLABLE** Memory (in MB) allocated to your function, see the table of memory/CPU allocation above (increasing the memory limit will increase the cost of your function executions as we allocate more resources to your functions). |
| `min_scale` | **NULLABLE** Minimum replicas for your function, defaults to `0`, **Note** that a function is `billed` when it gets executed, and using a `min_scale` greater than 0 will cause your function to run all the time. |
| `max_scale` | **NULLABLE** Maximum replicas for your function (defaults to `20`), our system will scale your functions automatically based on incoming workload, but will never scale the number of replicas above the configured `max_scale`. |
| `timeout` | **NULLABLE** Holds the max duration (in seconds) the function is allowed for responding to a request |
| `description` | **NULLABLE** Description of the function. |
| `handler` | **NULLABLE** More details with examples in each language/runtime section below |
Note that the meaning of the value set in `handler` will change depending on the `runtime` parameter:
* `Node`, `PHP` and `Python` runtimes: `handler` is the path to the function file, followed by the name of the function to call. For example, `src/handler.handle` specifies a function file at `src/handler.js`, `src/handler.php` and `src/handler.py` respectively, with a function called `handle`.
* `Go` and `Rust` runtimes: `handler` is the path to the package containing the handler. For example, `my_handler` specifies that the function file is located in a `my_handler` directory. The functions must then be part of a `main` package, exposing a `main` function.
All parameters, except the ones marked with `nullable` are **required**.
5. Run the following command to create your function. Make sure you include the payload you edited in the previous step.
```bash
curl -X POST \
-H "X-Auth-Token: $SCW_SECRET_KEY"\
"https://api.scaleway.com/functions/v1beta1/regions/$SCW_DEFAULT_REGION/functions"\
-d '{
name: function-name, \
namespace_id: "$SCW_NAMESPACE_ID", \
memory_limit: 128, \
min_scale: 0, \
max_scale: 20, \
runtime: node16", \
handler: handler.myHandler \
}'
export SCW_FUNCTION_ID = ""
```
6. Upload your code from the console or directly via the API. Refer to the [dedicated documentation](https://www.scaleway.com/en/docs/serverless/functions/how-to/package-function-dependencies-in-zip/#how-to-upload-your-zip-file) for more information.
7. Run the following command to deploy your function.
```bash
curl -X POST \
-H "X-Auth-Token: $SCW_SECRET_KEY" "https://api.scaleway.com/functions/v1beta1/regions/$SCW_DEFAULT_REGION/functions/$SCW_FUNCTION_ID/deploy" \
-d "{}"
```
The process may take some minutes, as we have to build your source code into an executable function (wrapped by our runtimes), and deploy it to the Scaleway cloud platform.
8. Retrieve your function's HTTP(s) endpoint with the following command once your function has been properly deployed.
```bash
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" "https://api.scaleway.com/functions/v1beta1/regions/$SCW_DEFAULT_REGION/functions/$SCW_FUNCTION_ID"
export FUNCTION_ENDPOINT=""
```
9. Call your function via its endpoint.
```bash
curl -X GET "$FUNCTION_ENDPOINT"
```
10. (optional) Connect to your [Cockpit](https://www.scaleway.com/en/docs/observability/cockpit/how-to/access-grafana-and-managed-dashboards/), and access the **Serverless Functions Logs** dashboard to see your logs.
11. (optional) Destroy the namespace (along with all functions and cron jobs) by using the following call:
```bash
curl -s \
-H "X-Auth-Token: $SCW_SECRET_KEY" -X DELETE "https://api.scaleway.com/functions/v1beta1/regions/$SCW_DEFAULT_REGION/namespaces/$SCW_NAMESPACE_ID"
```
To perform the following steps, you must first ensure that:
- You have a [Scaleway account](https://console.scaleway.com/)
- You have created an [API key](https://www.scaleway.com/en/docs/iam/how-to/create-api-keys/) and that the API key has sufficient [IAM permissions](https://www.scaleway.com/en/docs/iam/reference-content/permission-sets/) to perform the actions described on this page
- You have [installed `curl`](https://curl.se/download.html)
- You have [installed `jq`](https://stedolan.github.io/jq/) to improve readability of the API outputs
## Technical information
- Functions are fully isolated environments
- Scaling to zero (save money and computing resources while code is not executed)
- High Availability and Scalability (Automated and configurable, each function may scale automatically according to incoming workloads)
- Different programming languages supported
- Multiple event sources:
- HTTP (request on our Gateway will execute the function)
- CRON (time-based job, runs according to configurable cron schedule)
- Integrated with the Scaleway Container Registry product
- Each of your functions namespace has an associated registry namespace
- All your functions are available as docker image in this registry namespace
- Each version of your function matches a tag of this image
### Token management
To get all tokens associated with a function:
```bash
export SCW_SECRET_KEY=
export SCW_DEFAULT_REGION=""
export SCW_FUNCTION_ID=
curl -X GET \
"https://api.scaleway.com/functions/v1beta1/regions/$SCW_DEFAULT_REGION/tokens?function_id=$SCW_FUNCTION_ID" \
-H "accept: application/json" \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json"
```
Tokens can only be read at creation time, and are not stored, hence they can not be retrieved if lost.
To generate a token for a function:
```bash
export SCW_SECRET_KEY=""
export SCW_DEFAULT_REGION=""
export SCW_FUNCTION_ID=
export EXPIRE_AT=$(date -d "+90 days" +%Y-%m-%dT%H:%M:%S.000Z)
curl -X POST \
"https://api.scaleway.com/functions/v1beta1/regions/$SCW_DEFAULT_REGION/tokens" \
-H "accept: application/json" \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
description:desc, \
expire_at:"$EXPIRE_AT", \
function_id:"$SCW_FUNCTION_ID"
}'
```
`expire_at` is optional, and in this example is set to 90 days from today (see `EXPIRE_AT`). If you don't set `expire_at`, your token will never expire.
To revoke a token you need to delete it:
```bash
export SCW_ACCESS_KEY=""
export SCW_SECRET_KEY=""
export TOKEN_ID=
curl -X DELETE \
"https://api.scaleway.com/functions/v1beta1/regions/$SCW_DEFAULT_REGION/tokens/$SCW_ACCESS_KEY" \
-H "accept: application/json" \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json"
```
### Authentication
By default, new functions are `public` meaning that no credentials are required to invoke functions.
A function can be `private` or `public`. This can be configured through the `privacy` parameter.
Calling a `private` function without authentication will return HTTP code `403`.
### Authentication for private functions
A `private` function will:
- Reject a call without an `X-Auth-Token` header, returning HTTP status Code `403`
- Validate the token _before_ invoking your code if it is provided via the `X-Auth-Token` header
For example, to execute a private function by providing a token using `curl`, you may run the following command:
```bash
curl \
-H "X-Auth-Token: "
```
### Logs
Functions logs are sent to the project's [Cockpit](https://www.scaleway.com/en/docs/observability/cockpit/how-to/access-grafana-and-managed-dashboards/).
The **Serverless Functions Logs** dashboard allows you to see functions logs. You can perform complex queries using the **Explore** section of Grafana, and with LogQL queries:
```logql
{resource_type="serverless_function"}
```
Additionally, you can use the Grafana Loki endpoint (`https://logs.cockpit.fr-par.scw.cloud`) to query programmatically the functions logs using a [token](https://www.scaleway.com/en/docs/observability/cockpit/how-to/create-token/).
### Pagination
Most listing requests receive a paginated response. Requests against paginated endpoints accept two `query` arguments:
- `page`, a positive integer to choose which page to return.
- `page_size`, an positive integer lower or equal to 100 to select the number of items to return per page. The default value is `20`.
Paginated endpoints usually also accept filters to search and sort results. These filters are documented along each endpoint documentation.
### Regions
Serverless Functions is available in the Paris, Amsterdam and Warsaw regions, which are represented by the following path parameters:
* `fr-par`
* `nl-ams`
* `pl-waw`
## Technical limitations
### Supported runtimes and function lifecycle
You can find all information about runtimes and functions in the [Functions' lifecycle reference page](https://www.scaleway.com/en/docs/compute/functions/reference-content/functions-runtimes/#runtime-lifecycle).
## Going further
For more help using Scaleway Serverless functions, check out the following resources:
- Our [main documentation](https://www.scaleway.com/en/docs/serverless/functions/)
- The #serverless-functions channel on our [Slack Community](https://www.scaleway.com/en/docs/tutorials/scaleway-slack-community/)
- Our [support ticketing system](https://www.scaleway.com/en/docs/account/how-to/open-a-support-ticket)
### Local testing
Scaleway provides a number of open-source tools for offline testing. The details can be found in the [local testing docs](https://www.scaleway.com/en/docs/serverless/functions/reference-content/local-testing/).
version: v1beta1
servers:
- url: https://api.scaleway.com
tags:
- name: Namespaces
description: A namespace is a project that allows you to group functions. Functions
in the same namespace can share environment variables and access tokens, defined
at the namespace level.
- name: Functions
description: A function defines a procedure on how to change one element into another.
The function remains static, while the variables that pass through it can vary.
- name: Crons
description: Crons allow you to schedule the execution of functions
- name: Domains
description: Assign a custom domain to function.
- name: Tokens
description: Tokens allow you to manage access control to your function.
- name: Triggers
description: Triggers enable to trigger your Functions using events from a message
queue.
components:
schemas:
google.protobuf.StringValue:
type: string
nullable: true
scaleway.functions.v1beta1.Cron:
type: object
properties:
id:
type: string
description: UUID of the cron.
function_id:
type: string
description: UUID of the function the cron applies to.
schedule:
type: string
description: Schedule of the cron.
args:
type: object
description: Arguments to pass with the cron.
properties:
:
type: object
status:
type: string
description: Status of the cron.
enum:
- unknown
- ready
- deleting
- error
- locked
- creating
- pending
default: unknown
name:
type: string
description: Name of the cron.
x-properties-order:
- id
- function_id
- schedule
- args
- status
- name
scaleway.functions.v1beta1.Domain:
type: object
properties:
id:
type: string
description: UUID of the domain.
hostname:
type: string
description: Hostname associated with the function.
function_id:
type: string
description: UUID of the function the domain is associated with.
url:
type: string
description: URL of the function.
status:
type: string
description: State of the domain.
enum:
- unknown
- ready
- deleting
- error
- creating
- pending
default: unknown
error_message:
type: string
description: Error message if the domain is in "error" state.
nullable: true
x-properties-order:
- id
- hostname
- function_id
- url
- status
- error_message
scaleway.functions.v1beta1.DownloadURL:
type: object
properties:
url:
type: string
headers:
type: object
properties:
:
$ref: '#/components/schemas/scaleway.std.StringsValue'
additionalProperties: true
x-properties-order:
- url
- headers
scaleway.functions.v1beta1.Function:
type: object
properties:
id:
type: string
description: UUID of the function.
name:
type: string
description: Name of the function.
namespace_id:
type: string
description: UUID of the namespace the function belongs to.
status:
type: string
description: Status of the function.
enum:
- unknown
- ready
- deleting
- error
- locked
- creating
- pending
- created
default: unknown
environment_variables:
type: object
description: Environment variables of the function.
properties:
:
type: string
description: Environment variables of the function.
additionalProperties: true
min_scale:
type: integer
description: Minimum number of instances to scale the function to.
format: uint32
max_scale:
type: integer
description: Maximum number of instances to scale the function to.
format: uint32
runtime:
type: string
description: Runtime of the function.
enum:
- unknown_runtime
- golang
- python
- python3
- node8
- node10
- node14
- node16
- node17
- python37
- python38
- python39
- python310
- go113
- go117
- go118
- node18
- rust165
- go119
- python311
- php82
- node19
- go120
- node20
- go121
- node22
- python312
- php83
- go122
- rust179
- go123
- go124
- python313
- rust185
- php84
default: unknown_runtime
memory_limit:
type: integer
description: Memory limit of the function in MB.
format: uint32
cpu_limit:
type: integer
description: CPU limit of the function.
format: uint32
timeout:
type: string
description: Request processing time limit for the function. (in seconds)
example: 2.5s
nullable: true
handler:
type: string
description: Handler to use for the function.
error_message:
type: string
description: Error message if the function is in "error" state.
nullable: true
build_message:
type: string
description: Description of the current build step.
nullable: true
privacy:
type: string
description: Privacy setting of the function.
enum:
- unknown_privacy
- public
- private
default: unknown_privacy
description:
type: string
description: Description of the function.
nullable: true
domain_name:
type: string
description: Domain name associated with the function.
secret_environment_variables:
type: array
description: Secret environment variables of the function.
items:
$ref: '#/components/schemas/scaleway.functions.v1beta1.SecretHashedValue'
region:
type: string
description: Region in which the function is deployed.
http_option:
type: string
description: |-
Configuration for handling of HTTP and HTTPS requests.
Possible values:
- redirected: Responds to HTTP request with a 301 redirect to ask the clients to use HTTPS.
- enabled: Serve both HTTP and HTTPS traffic.
enum:
- unknown_http_option
- enabled
- redirected
default: enabled
runtime_message:
type: string
sandbox:
type: string
description: Execution environment of the function.
enum:
- unknown_sandbox
- v1
- v2
x-enum-descriptions:
values:
unknown_sandbox: Unknown sandbox
v1: Legacy sandboxing with slower cold starts. Fully supports the Linux
system call interface
v2: Recommended sandboxing with faster cold starts
default: unknown_sandbox
created_at:
type: string
description: Creation date of the function. (RFC 3339 format)
format: date-time
example: "2022-03-22T12:34:56.123456Z"
nullable: true
updated_at:
type: string
description: Last update date of the function. (RFC 3339 format)
format: date-time
example: "2022-03-22T12:34:56.123456Z"
nullable: true
ready_at:
type: string
description: Last date when the function was successfully deployed and set
to ready. (RFC 3339 format)
format: date-time
example: "2022-03-22T12:34:56.123456Z"
nullable: true
tags:
type: array
description: List of tags applied to the Serverless Function.
items:
type: string
private_network_id:
type: string
description: |-
ID of the Private Network the function is connected to.
When connected to a Private Network, the function can access other Scaleway resources in this Private Network.
nullable: true
x-properties-order:
- id
- name
- namespace_id
- status
- environment_variables
- min_scale
- max_scale
- runtime
- memory_limit
- cpu_limit
- timeout
- handler
- error_message
- build_message
- privacy
- description
- domain_name
- secret_environment_variables
- region
- http_option
- runtime_message
- sandbox
- created_at
- updated_at
- ready_at
- tags
- private_network_id
scaleway.functions.v1beta1.ListCronsResponse:
type: object
properties:
crons:
type: array
description: Array of crons.
items:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Cron'
total_count:
type: integer
description: Total number of crons.
format: uint32
x-properties-order:
- crons
- total_count
scaleway.functions.v1beta1.ListDomainsResponse:
type: object
properties:
domains:
type: array
description: Array of domains.
items:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Domain'
total_count:
type: integer
description: Total number of domains.
format: uint32
x-properties-order:
- domains
- total_count
scaleway.functions.v1beta1.ListFunctionRuntimesResponse:
type: object
properties:
runtimes:
type: array
description: Array of runtimes available.
items:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Runtime'
total_count:
type: integer
description: Total number of runtimes.
format: uint32
x-properties-order:
- runtimes
- total_count
scaleway.functions.v1beta1.ListFunctionsResponse:
type: object
properties:
functions:
type: array
description: Array of functions.
items:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Function'
total_count:
type: integer
description: Total number of functions.
format: uint32
x-properties-order:
- functions
- total_count
scaleway.functions.v1beta1.ListNamespacesResponse:
type: object
properties:
namespaces:
type: array
items:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Namespace'
total_count:
type: integer
description: Total number of namespaces.
format: uint32
x-properties-order:
- namespaces
- total_count
scaleway.functions.v1beta1.ListTokensResponse:
type: object
properties:
tokens:
type: array
items:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Token'
total_count:
type: integer
format: uint32
x-properties-order:
- tokens
- total_count
scaleway.functions.v1beta1.ListTriggersResponse:
type: object
properties:
total_count:
type: integer
description: Total count of existing triggers (matching any filters specified).
format: uint32
triggers:
type: array
description: Triggers on this page.
items:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Trigger'
x-properties-order:
- total_count
- triggers
scaleway.functions.v1beta1.Namespace:
type: object
properties:
id:
type: string
description: UUID of the namespace.
name:
type: string
description: Name of the namespace.
environment_variables:
type: object
description: Environment variables of the namespace.
properties:
:
type: string
description: Environment variables of the namespace.
additionalProperties: true
organization_id:
type: string
description: UUID of the Organization the namespace belongs to.
project_id:
type: string
description: UUID of the Project the namespace belongs to.
status:
type: string
description: Status of the namespace.
enum:
- unknown
- ready
- deleting
- error
- locked
- creating
- pending
default: unknown
registry_namespace_id:
type: string
description: UUID of the registry namespace.
error_message:
type: string
description: Error message if the namespace is in "error" state.
nullable: true
registry_endpoint:
type: string
description: Registry endpoint of the namespace.
description:
type: string
description: Description of the namespace.
nullable: true
secret_environment_variables:
type: array
description: Secret environment variables of the namespace.
items:
$ref: '#/components/schemas/scaleway.functions.v1beta1.SecretHashedValue'
region:
type: string
description: Region in which the namespace is located.
tags:
type: array
description: List of tags applied to the Serverless Function Namespace.
items:
type: string
created_at:
type: string
description: Creation date of the namespace. (RFC 3339 format)
format: date-time
example: "2022-03-22T12:34:56.123456Z"
nullable: true
updated_at:
type: string
description: Last update date of the namespace. (RFC 3339 format)
format: date-time
example: "2022-03-22T12:34:56.123456Z"
nullable: true
vpc_integration_activated:
type: boolean
description: |-
[DEPRECATED] By default, as of 2025/08/20, all namespaces are now compatible with VPC.
The value of this field doesn't matter anymore, and will be removed in a near future.
deprecated: true
x-properties-order:
- id
- name
- environment_variables
- organization_id
- project_id
- status
- registry_namespace_id
- error_message
- registry_endpoint
- description
- secret_environment_variables
- region
- tags
- created_at
- updated_at
- vpc_integration_activated
scaleway.functions.v1beta1.Runtime:
type: object
properties:
name:
type: string
language:
type: string
version:
type: string
default_handler:
type: string
code_sample:
type: string
status:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Runtime.Status'
status_message:
type: string
extension:
type: string
implementation:
type: string
logo_url:
type: string
x-properties-order:
- name
- language
- version
- default_handler
- code_sample
- status
- status_message
- extension
- implementation
- logo_url
scaleway.functions.v1beta1.Runtime.Status:
type: string
enum:
- unknown_status
- beta
- available
- deprecated
- end_of_support
- end_of_life
default: unknown_status
scaleway.functions.v1beta1.Secret:
type: object
properties:
key:
type: string
value:
$ref: '#/components/schemas/google.protobuf.StringValue'
x-properties-order:
- key
- value
scaleway.functions.v1beta1.SecretHashedValue:
type: object
properties:
key:
type: string
hashed_value:
type: string
x-properties-order:
- key
- hashed_value
scaleway.functions.v1beta1.Token:
type: object
properties:
id:
type: string
description: UUID of the token.
token:
type: string
description: String of the token.
function_id:
type: string
description: UUID of the function the token is associated with.
nullable: true
x-one-of: scope
namespace_id:
type: string
description: UUID of the namespace the token is associated with.
nullable: true
x-one-of: scope
public_key:
type: string
description: Public key of the token.
deprecated: true
status:
type: string
description: Status of the token.
enum:
- unknown
- ready
- deleting
- error
- creating
default: unknown
description:
type: string
description: Description of the token.
nullable: true
expires_at:
type: string
description: Date on which the token expires. (RFC 3339 format)
format: date-time
example: "2022-03-22T12:34:56.123456Z"
nullable: true
x-properties-order:
- id
- token
- function_id
- namespace_id
- public_key
- status
- description
- expires_at
scaleway.functions.v1beta1.Trigger:
type: object
properties:
id:
type: string
description: ID of the trigger.
name:
type: string
description: Name of the trigger.
description:
type: string
description: Description of the trigger.
function_id:
type: string
description: ID of the function to trigger.
input_type:
type: string
description: Type of the input.
enum:
- unknown_input_type
- sqs
- scw_sqs
- nats
- scw_nats
x-enum-descriptions:
values:
unknown_input_type: Unknown input type
scw_sqs: Scaleway Messaging and Queuing SQS queue
scw_nats: Scaleway Messaging and Queuing NATS subject
default: unknown_input_type
status:
type: string
description: Status of the trigger.
enum:
- unknown_status
- ready
- deleting
- error
- creating
- pending
x-enum-descriptions:
values:
unknown_status: Unknown status
ready: Ready status
deleting: Deleting status
error: Error status
creating: Creating status
pending: Pending status
default: unknown_status
error_message:
type: string
description: Error message of the trigger.
nullable: true
scw_sqs_config:
type: object
description: Configuration for a Scaleway Messaging and Queuing SQS queue.
properties:
queue:
type: string
description: Name of the SQS queue the trigger listens to.
mnq_project_id:
type: string
description: ID of the Messaging and Queuing project.
mnq_region:
type: string
description: |-
Region in which the Messaging and Queuing project is activated.
Currently, only the `fr-par` and `nl-ams` regions are available.
mnq_credential_id:
type: string
description: ID of the Messaging and Queuing credentials used to read
from the SQS queue.
nullable: true
nullable: true
x-properties-order:
- queue
- mnq_project_id
- mnq_region
- mnq_credential_id
x-one-of: config
scw_nats_config:
type: object
description: Configuration for a Scaleway Messaging and Queuing NATS subject.
properties:
subject:
type: string
description: Name of the NATS subject the trigger listens to.
mnq_nats_account_id:
type: string
description: ID of the Messaging and Queuing NATS account.
mnq_project_id:
type: string
description: ID of the Messaging and Queuing project.
mnq_region:
type: string
description: |-
Region in which the Messaging and Queuing project is activated.
Currently, only the `fr-par` and `nl-ams` regions are available.
mnq_credential_id:
type: string
description: ID of the Messaging and Queuing credentials used to subscribe
to the NATS subject.
nullable: true
nullable: true
x-properties-order:
- subject
- mnq_nats_account_id
- mnq_project_id
- mnq_region
- mnq_credential_id
x-one-of: config
x-properties-order:
- id
- name
- description
- function_id
- input_type
- status
- error_message
- scw_sqs_config
- scw_nats_config
scaleway.functions.v1beta1.UploadURL:
type: object
properties:
url:
type: string
description: Upload URL to upload the function to.
headers:
type: object
description: HTTP headers.
properties:
:
type: array
description: HTTP headers.
nullable: true
items:
type: string
additionalProperties: true
x-properties-order:
- url
- headers
scaleway.std.StringsValue:
type: array
nullable: true
items:
type: string
securitySchemes:
scaleway:
in: header
name: X-Auth-Token
type: apiKey
paths:
/functions/v1beta1/regions/{region}/crons:
get:
tags:
- Crons
operationId: ListCrons
summary: List all crons
description: List all the cronjobs in a specified region.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: query
name: page
description: Page number.
schema:
type: integer
format: int32
- in: query
name: page_size
description: Number of crons per page.
schema:
type: integer
format: uint32
- in: query
name: order_by
description: Order of the crons.
schema:
type: string
enum:
- created_at_asc
- created_at_desc
default: created_at_asc
- in: query
name: function_id
description: UUID of the function.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.ListCronsResponse'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/crons?function_id=string"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/crons" \
X-Auth-Token:$SCW_SECRET_KEY \
function_id==string
post:
tags:
- Crons
operationId: CreateCron
summary: Create a new cron
description: Create a new cronjob for a function with the specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Cron'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
function_id:
type: string
description: UUID of the function to use the cron with.
schedule:
type: string
description: Schedule of the cron in UNIX cron format.
args:
type: object
description: Arguments to use with the cron.
properties:
:
type: object
name:
type: string
description: Name of the cron.
nullable: true
x-properties-order:
- function_id
- schedule
- args
- name
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X POST \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"function_id":"string","schedule":"string"}' \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/crons"
- lang: HTTPie
source: |-
http POST "https://api.scaleway.com/functions/v1beta1/regions/{region}/crons" \
X-Auth-Token:$SCW_SECRET_KEY \
function_id="string" \
schedule="string"
/functions/v1beta1/regions/{region}/crons/{cron_id}:
get:
tags:
- Crons
operationId: GetCron
summary: Get a cron
description: Get the cron associated with the specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: cron_id
description: UUID of the cron to get.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Cron'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/crons/{cron_id}"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/crons/{cron_id}" \
X-Auth-Token:$SCW_SECRET_KEY
patch:
tags:
- Crons
operationId: UpdateCron
summary: Update an existing cron
description: Update the cron associated with the specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: cron_id
description: UUID of the cron to update.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Cron'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
function_id:
type: string
description: UUID of the function to use the cron with.
nullable: true
schedule:
type: string
description: Schedule of the cron in UNIX cron format.
nullable: true
args:
type: object
description: Arguments to use with the cron.
properties:
:
type: object
name:
type: string
description: Name of the cron.
nullable: true
x-properties-order:
- function_id
- schedule
- args
- name
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X PATCH \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/crons/{cron_id}"
- lang: HTTPie
source: |-
http PATCH "https://api.scaleway.com/functions/v1beta1/regions/{region}/crons/{cron_id}" \
X-Auth-Token:$SCW_SECRET_KEY
delete:
tags:
- Crons
operationId: DeleteCron
summary: Delete an existing cron
description: Delete the cron associated with the specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: cron_id
description: UUID of the cron to delete.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Cron'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X DELETE \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/crons/{cron_id}"
- lang: HTTPie
source: |-
http DELETE "https://api.scaleway.com/functions/v1beta1/regions/{region}/crons/{cron_id}" \
X-Auth-Token:$SCW_SECRET_KEY
/functions/v1beta1/regions/{region}/domains:
get:
tags:
- Domains
operationId: ListDomains
summary: List all domain name bindings
description: List all domain name bindings in a specified region.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: query
name: page
description: Page number.
schema:
type: integer
format: int32
- in: query
name: page_size
description: Number of domains per page.
schema:
type: integer
format: uint32
- in: query
name: order_by
description: Order of the domains.
schema:
type: string
enum:
- created_at_asc
- created_at_desc
- hostname_asc
- hostname_desc
default: created_at_asc
- in: query
name: function_id
description: UUID of the function the domain is associated with.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.ListDomainsResponse'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/domains?function_id=string"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/domains" \
X-Auth-Token:$SCW_SECRET_KEY \
function_id==string
post:
tags:
- Domains
operationId: CreateDomain
summary: Create a domain name binding
description: Create a domain name binding for the function with the specified
ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Domain'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
hostname:
type: string
description: Hostname to create.
function_id:
type: string
description: UUID of the function to associate the domain with.
x-properties-order:
- hostname
- function_id
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X POST \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"function_id":"string","hostname":"string"}' \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/domains"
- lang: HTTPie
source: |-
http POST "https://api.scaleway.com/functions/v1beta1/regions/{region}/domains" \
X-Auth-Token:$SCW_SECRET_KEY \
function_id="string" \
hostname="string"
/functions/v1beta1/regions/{region}/domains/{domain_id}:
get:
tags:
- Domains
operationId: GetDomain
summary: Get a domain name binding
description: Get a domain name binding for the function with the specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: domain_id
description: UUID of the domain to get.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Domain'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/domains/{domain_id}"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/domains/{domain_id}" \
X-Auth-Token:$SCW_SECRET_KEY
delete:
tags:
- Domains
operationId: DeleteDomain
summary: Delete a domain name binding
description: Delete a domain name binding for the function with the specified
ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: domain_id
description: UUID of the domain to delete.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Domain'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X DELETE \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/domains/{domain_id}"
- lang: HTTPie
source: |-
http DELETE "https://api.scaleway.com/functions/v1beta1/regions/{region}/domains/{domain_id}" \
X-Auth-Token:$SCW_SECRET_KEY
/functions/v1beta1/regions/{region}/functions:
get:
tags:
- Functions
operationId: ListFunctions
summary: List all your functions
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: query
name: page
description: Page number.
schema:
type: integer
format: int32
- in: query
name: page_size
description: Number of functions per page.
schema:
type: integer
format: uint32
- in: query
name: order_by
description: Order of the functions.
schema:
type: string
enum:
- created_at_asc
- created_at_desc
- name_asc
- name_desc
default: created_at_asc
- in: query
name: namespace_id
description: UUID of the namespace the function belongs to.
required: true
schema:
type: string
- in: query
name: name
description: Name of the function.
schema:
type: string
- in: query
name: organization_id
description: UUID of the Organization the function belongs to.
schema:
type: string
- in: query
name: project_id
description: UUID of the Project the function belongs to.
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.ListFunctionsResponse'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/functions?namespace_id=string"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/functions" \
X-Auth-Token:$SCW_SECRET_KEY \
namespace_id==string
post:
tags:
- Functions
operationId: CreateFunction
summary: Create a new function
description: Create a new function in the specified region for a specified Organization
or Project.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Function'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: Name of the function to create.
namespace_id:
type: string
description: UUID of the namespace the function will be created
in.
environment_variables:
type: object
description: Environment variables of the function.
properties:
:
type: string
nullable: true
min_scale:
type: integer
description: Minimum number of instances to scale the function to.
format: uint32
nullable: true
max_scale:
type: integer
description: Maximum number of instances to scale the function to.
format: uint32
nullable: true
runtime:
type: string
description: Runtime to use with the function.
enum:
- unknown_runtime
- golang
- python
- python3
- node8
- node10
- node14
- node16
- node17
- python37
- python38
- python39
- python310
- go113
- go117
- go118
- node18
- rust165
- go119
- python311
- php82
- node19
- go120
- node20
- go121
- node22
- python312
- php83
- go122
- rust179
- go123
- go124
- python313
- rust185
- php84
default: unknown_runtime
memory_limit:
type: integer
description: Memory limit of the function in MB.
format: uint32
nullable: true
timeout:
type: string
description: Request processing time limit for the function. (in
seconds)
example: 2.5s
nullable: true
handler:
type: string
description: Handler to use with the function.
nullable: true
privacy:
type: string
description: Privacy setting of the function.
enum:
- unknown_privacy
- public
- private
default: unknown_privacy
description:
type: string
description: Description of the function.
nullable: true
secret_environment_variables:
type: array
items:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Secret'
http_option:
type: string
description: |-
Configure how HTTP and HTTPS requests are handled.
Possible values:
- redirected: Responds to HTTP request with a 301 redirect to ask the clients to use HTTPS.
- enabled: Serve both HTTP and HTTPS traffic.
enum:
- unknown_http_option
- enabled
- redirected
default: unknown_http_option
sandbox:
type: string
description: Execution environment of the function.
enum:
- unknown_sandbox
- v1
- v2
x-enum-descriptions:
values:
unknown_sandbox: Unknown sandbox
v1: Legacy sandboxing with slower cold starts. Fully supports
the Linux system call interface
v2: Recommended sandboxing with faster cold starts
default: unknown_sandbox
tags:
type: array
description: Tags of the Serverless Function.
items:
type: string
private_network_id:
type: string
description: |-
ID of the Private Network the function is connected to.
When connected to a Private Network, the function can access other Scaleway resources in this Private Network.
nullable: true
x-properties-order:
- name
- namespace_id
- environment_variables
- min_scale
- max_scale
- runtime
- memory_limit
- timeout
- handler
- privacy
- description
- secret_environment_variables
- http_option
- sandbox
- tags
- private_network_id
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X POST \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","namespace_id":"string"}' \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/functions"
- lang: HTTPie
source: |-
http POST "https://api.scaleway.com/functions/v1beta1/regions/{region}/functions" \
X-Auth-Token:$SCW_SECRET_KEY \
name="string" \
namespace_id="string"
/functions/v1beta1/regions/{region}/functions/{function_id}:
get:
tags:
- Functions
operationId: GetFunction
summary: Get a function
description: Get the function associated with the specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: function_id
description: UUID of the function.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Function'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/functions/{function_id}"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/functions/{function_id}" \
X-Auth-Token:$SCW_SECRET_KEY
patch:
tags:
- Functions
operationId: UpdateFunction
summary: Update an existing function
description: |-
Update the function associated with the specified ID.
When updating a function, the function is automatically redeployed to apply the changes.
This behavior can be changed by setting the `redeploy` field to `false` in the request.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: function_id
description: UUID of the function to update.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Function'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
environment_variables:
type: object
description: Environment variables of the function to update.
properties:
:
type: string
nullable: true
min_scale:
type: integer
description: Minimum number of instances to scale the function to.
format: uint32
nullable: true
max_scale:
type: integer
description: Maximum number of instances to scale the function to.
format: uint32
nullable: true
runtime:
type: string
description: Runtime to use with the function.
enum:
- unknown_runtime
- golang
- python
- python3
- node8
- node10
- node14
- node16
- node17
- python37
- python38
- python39
- python310
- go113
- go117
- go118
- node18
- rust165
- go119
- python311
- php82
- node19
- go120
- node20
- go121
- node22
- python312
- php83
- go122
- rust179
- go123
- go124
- python313
- rust185
- php84
default: unknown_runtime
memory_limit:
type: integer
description: Memory limit of the function in MB.
format: uint32
nullable: true
timeout:
type: string
description: Processing time limit for the function. (in seconds)
example: 2.5s
nullable: true
redeploy:
type: boolean
description: Redeploy failed function.
nullable: true
handler:
type: string
description: Handler to use with the function.
nullable: true
privacy:
type: string
description: Privacy setting of the function.
enum:
- unknown_privacy
- public
- private
default: unknown_privacy
description:
type: string
description: Description of the function.
nullable: true
secret_environment_variables:
type: array
description: |-
Secret environment variables of the function.
During an update, secret environment variables that are not specified in this field will be kept unchanged.
In order to delete a specific secret environment variable, you must reference its key, but not provide any value for it.
For example, the following payload will delete the `TO_DELETE` secret environment variable:
```json
{
"secret_environment_variables":[
{"key":"TO_DELETE"}
]
}
```.
items:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Secret'
http_option:
type: string
description: |-
Configure how HTTP and HTTPS requests are handled.
Possible values:
- redirected: Responds to HTTP request with a 301 redirect to ask the clients to use HTTPS.
- enabled: Serve both HTTP and HTTPS traffic.
enum:
- unknown_http_option
- enabled
- redirected
default: unknown_http_option
sandbox:
type: string
description: Execution environment of the function.
enum:
- unknown_sandbox
- v1
- v2
x-enum-descriptions:
values:
unknown_sandbox: Unknown sandbox
v1: Legacy sandboxing with slower cold starts. Fully supports
the Linux system call interface
v2: Recommended sandboxing with faster cold starts
default: unknown_sandbox
tags:
type: array
description: Tags of the Serverless Function.
nullable: true
items:
type: string
private_network_id:
type: string
description: |-
ID of the Private Network the function is connected to.
When connected to a Private Network, the function can access other Scaleway resources in this Private Network.
nullable: true
x-properties-order:
- environment_variables
- min_scale
- max_scale
- runtime
- memory_limit
- timeout
- redeploy
- handler
- privacy
- description
- secret_environment_variables
- http_option
- sandbox
- tags
- private_network_id
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X PATCH \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/functions/{function_id}"
- lang: HTTPie
source: |-
http PATCH "https://api.scaleway.com/functions/v1beta1/regions/{region}/functions/{function_id}" \
X-Auth-Token:$SCW_SECRET_KEY
delete:
tags:
- Functions
operationId: DeleteFunction
summary: Delete a function
description: Delete the function associated with the specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: function_id
description: UUID of the function to delete.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Function'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X DELETE \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/functions/{function_id}"
- lang: HTTPie
source: |-
http DELETE "https://api.scaleway.com/functions/v1beta1/regions/{region}/functions/{function_id}" \
X-Auth-Token:$SCW_SECRET_KEY
/functions/v1beta1/regions/{region}/functions/{function_id}/deploy:
post:
tags:
- Functions
operationId: DeployFunction
summary: Deploy a function
description: Deploy a function associated with the specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: function_id
description: UUID of the function to deploy.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Function'
requestBody:
required: true
content:
application/json:
schema:
type: object
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X POST \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/functions/{function_id}/deploy"
- lang: HTTPie
source: |-
http POST "https://api.scaleway.com/functions/v1beta1/regions/{region}/functions/{function_id}/deploy" \
X-Auth-Token:$SCW_SECRET_KEY
/functions/v1beta1/regions/{region}/functions/{function_id}/download-url:
get:
tags:
- Functions
operationId: GetFunctionDownloadURL
summary: Get a download URL of a function
description: Get a download URL for a function associated with the specified
ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: function_id
description: UUID of the function to get the download URL for.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.DownloadURL'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/functions/{function_id}/download-url"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/functions/{function_id}/download-url" \
X-Auth-Token:$SCW_SECRET_KEY
/functions/v1beta1/regions/{region}/functions/{function_id}/upload-url:
get:
tags:
- Functions
operationId: GetFunctionUploadURL
summary: Get an upload URL of a function
description: Get an upload URL of a function associated with the specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: function_id
description: UUID of the function to get the upload URL for.
required: true
schema:
type: string
- in: query
name: content_length
description: Size of the archive to upload in bytes.
required: true
schema:
type: integer
format: uint64
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.UploadURL'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/functions/{function_id}/upload-url?content_length=42"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/functions/{function_id}/upload-url" \
X-Auth-Token:$SCW_SECRET_KEY \
content_length==42
/functions/v1beta1/regions/{region}/namespaces:
get:
tags:
- Namespaces
operationId: ListNamespaces
summary: List all your namespaces
description: List all existing namespaces in the specified region.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: query
name: page
description: Page number.
schema:
type: integer
format: int32
- in: query
name: page_size
description: Number of namespaces per page.
schema:
type: integer
format: uint32
- in: query
name: order_by
description: Order of the namespaces.
schema:
type: string
enum:
- created_at_asc
- created_at_desc
- name_asc
- name_desc
default: created_at_asc
- in: query
name: name
description: Name of the namespace.
schema:
type: string
- in: query
name: organization_id
description: UUID of the Organization the namespace belongs to.
schema:
type: string
- in: query
name: project_id
description: UUID of the Project the namespace belongs to.
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.ListNamespacesResponse'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/namespaces"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/namespaces" \
X-Auth-Token:$SCW_SECRET_KEY
post:
tags:
- Namespaces
operationId: CreateNamespace
summary: Create a new namespace
description: Create a new namespace in a specified Organization or Project.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Namespace'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
environment_variables:
type: object
description: Environment variables of the namespace.
properties:
:
type: string
nullable: true
project_id:
type: string
description: UUID of the project in which the namespace will be
created.
description:
type: string
description: Description of the namespace.
nullable: true
secret_environment_variables:
type: array
description: Secret environment variables of the namespace.
items:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Secret'
tags:
type: array
description: Tags of the Serverless Function Namespace.
items:
type: string
activate_vpc_integration:
type: boolean
description: |-
[DEPRECATED] By default, as of 2025/08/20, all namespaces are now compatible with VPC.
Setting this field to true doesn't matter anymore. It will be removed in a near future.
deprecated: true
x-properties-order:
- name
- environment_variables
- project_id
- description
- secret_environment_variables
- tags
- activate_vpc_integration
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X POST \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"activate_vpc_integration": false,
"name": "string",
"project_id": "string"
}' \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/namespaces"
- lang: HTTPie
source: |-
http POST "https://api.scaleway.com/functions/v1beta1/regions/{region}/namespaces" \
X-Auth-Token:$SCW_SECRET_KEY \
activate_vpc_integration:=false \
name="string" \
project_id="string"
/functions/v1beta1/regions/{region}/namespaces/{namespace_id}:
get:
tags:
- Namespaces
operationId: GetNamespace
summary: Get a namespace
description: Get the namespace associated with the specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: namespace_id
description: UUID of the namespace.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Namespace'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/namespaces/{namespace_id}"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/namespaces/{namespace_id}" \
X-Auth-Token:$SCW_SECRET_KEY
patch:
tags:
- Namespaces
operationId: UpdateNamespace
summary: Update an existing namespace
description: Update the namespace associated with the specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: namespace_id
description: UUID of the namespapce.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Namespace'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
environment_variables:
type: object
description: Environment variables of the namespace.
properties:
:
type: string
nullable: true
description:
type: string
description: Description of the namespace.
nullable: true
secret_environment_variables:
type: array
description: Secret environment variables of the namespace.
items:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Secret'
tags:
type: array
description: Tags of the Serverless Function Namespace.
nullable: true
items:
type: string
x-properties-order:
- environment_variables
- description
- secret_environment_variables
- tags
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X PATCH \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/namespaces/{namespace_id}"
- lang: HTTPie
source: |-
http PATCH "https://api.scaleway.com/functions/v1beta1/regions/{region}/namespaces/{namespace_id}" \
X-Auth-Token:$SCW_SECRET_KEY
delete:
tags:
- Namespaces
operationId: DeleteNamespace
summary: Delete an existing namespace
description: Delete the namespace associated with the specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: namespace_id
description: UUID of the namespace.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Namespace'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X DELETE \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/namespaces/{namespace_id}"
- lang: HTTPie
source: |-
http DELETE "https://api.scaleway.com/functions/v1beta1/regions/{region}/namespaces/{namespace_id}" \
X-Auth-Token:$SCW_SECRET_KEY
/functions/v1beta1/regions/{region}/runtimes:
get:
tags:
- Functions
operationId: ListFunctionRuntimes
summary: List function runtimes
description: List available function runtimes.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.ListFunctionRuntimesResponse'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/runtimes"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/runtimes" \
X-Auth-Token:$SCW_SECRET_KEY
/functions/v1beta1/regions/{region}/tokens:
get:
tags:
- Tokens
operationId: ListTokens
summary: List all tokens
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: query
name: page
description: Page number.
schema:
type: integer
format: int32
- in: query
name: page_size
description: Number of tokens per page.
schema:
type: integer
format: uint32
- in: query
name: order_by
description: Sort order for the tokens.
schema:
type: string
enum:
- created_at_asc
- created_at_desc
default: created_at_asc
- in: query
name: function_id
description: UUID of the function the token is associated with.
schema:
type: string
- in: query
name: namespace_id
description: UUID of the namespace the token is associated with.
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.ListTokensResponse'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/tokens"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/tokens" \
X-Auth-Token:$SCW_SECRET_KEY
post:
tags:
- Tokens
operationId: CreateToken
summary: Create a new revocable token
description: Deprecated in favor of IAM authentication.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Token'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
function_id:
type: string
description: UUID of the function to associate the token with.
nullable: true
x-one-of: scope
namespace_id:
type: string
description: UUID of the namespace to associate the token with.
nullable: true
x-one-of: scope
description:
type: string
description: Description of the token.
nullable: true
expires_at:
type: string
description: Date on which the token expires. (RFC 3339 format)
format: date-time
example: "2022-03-22T12:34:56.123456Z"
nullable: true
x-properties-order:
- function_id
- namespace_id
- description
- expires_at
security:
- scaleway: []
deprecated: true
x-codeSamples:
- lang: cURL
source: |-
curl -X POST \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/tokens"
- lang: HTTPie
source: |-
http POST "https://api.scaleway.com/functions/v1beta1/regions/{region}/tokens" \
X-Auth-Token:$SCW_SECRET_KEY
/functions/v1beta1/regions/{region}/tokens/{token_id}:
get:
tags:
- Tokens
operationId: GetToken
summary: Get a token
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: token_id
description: UUID of the token to get.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Token'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/tokens/{token_id}"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/tokens/{token_id}" \
X-Auth-Token:$SCW_SECRET_KEY
delete:
tags:
- Tokens
operationId: DeleteToken
summary: Delete a token
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: token_id
description: UUID of the token to delete.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Token'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X DELETE \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/tokens/{token_id}"
- lang: HTTPie
source: |-
http DELETE "https://api.scaleway.com/functions/v1beta1/regions/{region}/tokens/{token_id}" \
X-Auth-Token:$SCW_SECRET_KEY
/functions/v1beta1/regions/{region}/triggers:
get:
tags:
- Triggers
operationId: ListTriggers
summary: List all triggers
description: List all triggers belonging to a specified Organization or Project.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: query
name: page
description: Page number to return.
schema:
type: integer
format: int32
- in: query
name: page_size
description: Maximum number of triggers to return per page.
schema:
type: integer
format: uint32
- in: query
name: order_by
description: Order in which to return results.
schema:
type: string
enum:
- created_at_asc
- created_at_desc
x-enum-descriptions:
values:
created_at_asc: Order by creation date ascending
created_at_desc: Order by creation date descending
default: created_at_asc
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.ListTriggersResponse'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/triggers"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/triggers" \
X-Auth-Token:$SCW_SECRET_KEY
post:
tags:
- Triggers
operationId: CreateTrigger
summary: Create a trigger
description: Create a new trigger for a specified function.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Trigger'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: Name of the trigger.
function_id:
type: string
description: ID of the function to trigger.
description:
type: string
description: Description of the trigger.
nullable: true
scw_sqs_config:
type: object
description: Configuration for a Scaleway Messaging and Queuing
SQS queue.
properties:
queue:
type: string
description: Name of the SQS queue the trigger should listen
to.
mnq_project_id:
type: string
description: |-
ID of the Messaging and Queuing project.
You must have activated SQS on this project.
mnq_region:
type: string
description: |-
Region in which the Messaging and Queuing project is activated.
Currently, only the `fr-par` and `nl-ams` regions are available.
nullable: true
required:
- queue
- mnq_project_id
- mnq_region
x-properties-order:
- queue
- mnq_project_id
- mnq_region
x-one-of: config
scw_nats_config:
type: object
description: Configuration for a Scaleway Messaging and Queuing
NATS subject.
properties:
subject:
type: string
description: Name of the NATS subject the trigger should listen
to.
mnq_nats_account_id:
type: string
description: ID of the Messaging and Queuing NATS account.
mnq_project_id:
type: string
description: ID of the Messaging and Queuing project.
mnq_region:
type: string
description: |-
Region in which the Messaging and Queuing project is activated.
Currently, only the `fr-par` and `nl-ams` regions are available.
nullable: true
required:
- subject
- mnq_nats_account_id
- mnq_region
x-properties-order:
- subject
- mnq_nats_account_id
- mnq_project_id
- mnq_region
x-one-of: config
required:
- name
- function_id
x-properties-order:
- name
- function_id
- description
- scw_sqs_config
- scw_nats_config
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X POST \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"function_id":"string","name":"string"}' \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/triggers"
- lang: HTTPie
source: |-
http POST "https://api.scaleway.com/functions/v1beta1/regions/{region}/triggers" \
X-Auth-Token:$SCW_SECRET_KEY \
function_id="string" \
name="string"
/functions/v1beta1/regions/{region}/triggers/{trigger_id}:
get:
tags:
- Triggers
operationId: GetTrigger
summary: Get a trigger
description: Get a trigger with a specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: trigger_id
description: ID of the trigger to get.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Trigger'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/triggers/{trigger_id}"
- lang: HTTPie
source: |-
http GET "https://api.scaleway.com/functions/v1beta1/regions/{region}/triggers/{trigger_id}" \
X-Auth-Token:$SCW_SECRET_KEY
patch:
tags:
- Triggers
operationId: UpdateTrigger
summary: Update a trigger
description: Update a trigger with a specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: trigger_id
description: ID of the trigger to update.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Trigger'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: Name of the trigger.
nullable: true
description:
type: string
description: Description of the trigger.
nullable: true
x-properties-order:
- name
- description
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X PATCH \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/triggers/{trigger_id}"
- lang: HTTPie
source: |-
http PATCH "https://api.scaleway.com/functions/v1beta1/regions/{region}/triggers/{trigger_id}" \
X-Auth-Token:$SCW_SECRET_KEY
delete:
tags:
- Triggers
operationId: DeleteTrigger
summary: Delete a trigger
description: Delete a trigger with a specified ID.
parameters:
- in: path
name: region
description: The region you want to target
required: true
schema:
type: string
enum:
- fr-par
- nl-ams
- pl-waw
- in: path
name: trigger_id
description: ID of the trigger to delete.
required: true
schema:
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
$ref: '#/components/schemas/scaleway.functions.v1beta1.Trigger'
security:
- scaleway: []
x-codeSamples:
- lang: cURL
source: |-
curl -X DELETE \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/functions/v1beta1/regions/{region}/triggers/{trigger_id}"
- lang: HTTPie
source: |-
http DELETE "https://api.scaleway.com/functions/v1beta1/regions/{region}/triggers/{trigger_id}" \
X-Auth-Token:$SCW_SECRET_KEY