Create Function
/functionsAuthorization
bearerAuth Your Maton API key, sent as Authorization: Bearer <MATON_API_KEY>. Create one at https://maton.ai/settings.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST \ "https://api.maton.ai/functions" \ -H "Authorization: Bearer $MATON_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "my-fn", "runtime": "python3.12", "files": {"main.py": "def handler(event, context):\n return {\"hello\": \"ada\"}\n"}}'{
"function_id": "7c1e2f3a-9b4d-4c8e-a1f2-3b4c5d6e7f80"
}{
"message": "Invalid app name.",
"type": "Bad Request",
"code": 400
}{
"message": "Invalid API key.",
"type": "Unauthorized",
"code": 401
}{
"message": "Too many requests.",
"type": "Too Many Requests",
"code": 429
}{
"message": "Internal server error.",
"type": "Internal Server Error",
"code": 500
}