Snowflake User Defined Function API
The Snowflake User Defined Function API is a REST API that you can use to access, update, and perform certain actions on User Defined Function resource in a Snowflake database.
The Snowflake User Defined Function API is a REST API that you can use to access, update, and perform certain actions on User Defined Function resource in a Snowflake database.
openapi: 3.0.0
servers:
- description: Snowflake REST Server
url: https://org-account.snowflakecomputing.com
info:
version: 0.0.1
title: Snowflake User Defined Function API
description: The Snowflake User Defined Function API is a REST API that you can use to access, update, and perform certain actions on User Defined Function resource in a Snowflake database.
contact:
name: Snowflake, Inc.
url: https://snowflake.com
email: support@snowflake.com
paths:
/api/v2/databases/{database}/schemas/{schema}/user-defined-functions:
post:
summary: Create a Udf
tags:
- user-defined-function
description: Create a UDF
operationId: createUserDefinedFunction
parameters:
- $ref: common.yaml#/components/parameters/database
- $ref: common.yaml#/components/parameters/schema
- $ref: common.yaml#/components/parameters/createMode
- $ref: common.yaml#/components/parameters/copyGrants
responses:
'200':
$ref: common.yaml#/components/responses/200SuccessResponse
'202':
$ref: common.yaml#/components/responses/202SuccessAcceptedResponse
'400':
$ref: common.yaml#/components/responses/400BadRequest
'401':
$ref: common.yaml#/components/responses/401Unauthorized
'403':
$ref: common.yaml#/components/responses/403Forbidden
'404':
$ref: common.yaml#/components/responses/404NotFound
'405':
$ref: common.yaml#/components/responses/405MethodNotAllowed
'408':
$ref: common.yaml#/components/responses/408RequestTimeout
'409':
$ref: common.yaml#/components/responses/409Conflict
'410':
$ref: common.yaml#/components/responses/410Gone
'429':
$ref: common.yaml#/components/responses/429LimitExceeded
'500':
$ref: common.yaml#/components/responses/500InternalServerError
'503':
$ref: common.yaml#/components/responses/503ServiceUnavailable
'504':
$ref: common.yaml#/components/responses/504GatewayTimeout
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UserDefinedFunction'
examples:
CreateuserdefinedfunctionRequestExample:
summary: Default createUserDefinedFunction request
x-microcks-default: true
value:
name: Example Title
is_temporary: true
is_aggregate: true
is_memoizable: true
is_table_function: true
valid_for_clustering: true
is_secure: true
arguments:
- name: Example Title
datatype: ARRAY
default_value: example_value
return_type:
type: example_value
language_config:
language: example_value
called_on_null_input: true
is_volatile: true
comment: example_value
body: example_value
created_on: '2026-01-15T10:30:00Z'
schema_name: example_value
database_name: example_value
min_num_arguments: 10
max_num_arguments: 10
owner: example_value
owner_role_type: example_value
is_builtin: true
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
get:
summary: List Udfs
tags:
- user-defined-function
description: List UDFs
operationId: listUserDefinedFunctions
parameters:
- $ref: common.yaml#/components/parameters/database
- $ref: common.yaml#/components/parameters/schema
- $ref: common.yaml#/components/parameters/like
responses:
'200':
description: successful
headers:
X-Snowflake-Request-ID:
$ref: common.yaml#/components/headers/X-Snowflake-Request-ID
Link:
$ref: common.yaml#/components/headers/Link
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/UserDefinedFunction'
examples:
Listuserdefinedfunctions200Example:
summary: Default listUserDefinedFunctions 200 response
x-microcks-default: true
value:
- name: Example Title
is_temporary: true
is_aggregate: true
is_memoizable: true
is_table_function: true
valid_for_clustering: true
is_secure: true
arguments:
- {}
return_type:
type: example_value
language_config:
language: example_value
called_on_null_input: true
is_volatile: true
comment: example_value
body: example_value
created_on: '2026-01-15T10:30:00Z'
schema_name: example_value
database_name: example_value
min_num_arguments: 10
max_num_arguments: 10
owner: example_value
owner_role_type: example_value
is_builtin: true
'202':
$ref: common.yaml#/components/responses/202SuccessAcceptedResponse
'400':
$ref: common.yaml#/components/responses/400BadRequest
'401':
$ref: common.yaml#/components/responses/401Unauthorized
'403':
$ref: common.yaml#/components/responses/403Forbidden
'404':
$ref: common.yaml#/components/responses/404NotFound
'405':
$ref: common.yaml#/components/responses/405MethodNotAllowed
'408':
$ref: common.yaml#/components/responses/408RequestTimeout
'409':
$ref: common.yaml#/components/responses/409Conflict
'410':
$ref: common.yaml#/components/responses/410Gone
'429':
$ref: common.yaml#/components/responses/429LimitExceeded
'500':
$ref: common.yaml#/components/responses/500InternalServerError
'503':
$ref: common.yaml#/components/responses/503ServiceUnavailable
'504':
$ref: common.yaml#/components/responses/504GatewayTimeout
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/api/v2/databases/{database}/schemas/{schema}/user-defined-functions/{nameWithArgs}:
get:
summary: Fetch a Udf
tags:
- user-defined-function
description: Fetch a UDF
operationId: fetchUserDefinedFunction
parameters:
- $ref: common.yaml#/components/parameters/database
- $ref: common.yaml#/components/parameters/schema
- $ref: common.yaml#/components/parameters/nameWithArgs
responses:
'200':
description: successful
headers:
X-Snowflake-Request-ID:
$ref: common.yaml#/components/headers/X-Snowflake-Request-ID
Link:
$ref: common.yaml#/components/headers/Link
content:
application/json:
schema:
$ref: '#/components/schemas/UserDefinedFunction'
examples:
Fetchuserdefinedfunction200Example:
summary: Default fetchUserDefinedFunction 200 response
x-microcks-default: true
value:
name: Example Title
is_temporary: true
is_aggregate: true
is_memoizable: true
is_table_function: true
valid_for_clustering: true
is_secure: true
arguments:
- name: Example Title
datatype: ARRAY
default_value: example_value
return_type:
type: example_value
language_config:
language: example_value
called_on_null_input: true
is_volatile: true
comment: example_value
body: example_value
created_on: '2026-01-15T10:30:00Z'
schema_name: example_value
database_name: example_value
min_num_arguments: 10
max_num_arguments: 10
owner: example_value
owner_role_type: example_value
is_builtin: true
'202':
$ref: common.yaml#/components/responses/202SuccessAcceptedResponse
'400':
$ref: common.yaml#/components/responses/400BadRequest
'401':
$ref: common.yaml#/components/responses/401Unauthorized
'403':
$ref: common.yaml#/components/responses/403Forbidden
'404':
$ref: common.yaml#/components/responses/404NotFound
'405':
$ref: common.yaml#/components/responses/405MethodNotAllowed
'408':
$ref: common.yaml#/components/responses/408RequestTimeout
'409':
$ref: common.yaml#/components/responses/409Conflict
'410':
$ref: common.yaml#/components/responses/410Gone
'429':
$ref: common.yaml#/components/responses/429LimitExceeded
'500':
$ref: common.yaml#/components/responses/500InternalServerError
'503':
$ref: common.yaml#/components/responses/503ServiceUnavailable
'504':
$ref: common.yaml#/components/responses/504GatewayTimeout
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
delete:
summary: Delete a Udf
tags:
- user-defined-function
description: Delete a UDF
operationId: deleteUserDefinedFunction
parameters:
- $ref: common.yaml#/components/parameters/database
- $ref: common.yaml#/components/parameters/schema
- $ref: common.yaml#/components/parameters/nameWithArgs
- $ref: common.yaml#/components/parameters/ifExists
responses:
'200':
$ref: common.yaml#/components/responses/200SuccessResponse
'202':
$ref: common.yaml#/components/responses/202SuccessAcceptedResponse
'400':
$ref: common.yaml#/components/responses/400BadRequest
'401':
$ref: common.yaml#/components/responses/401Unauthorized
'403':
$ref: common.yaml#/components/responses/403Forbidden
'404':
$ref: common.yaml#/components/responses/404NotFound
'405':
$ref: common.yaml#/components/responses/405MethodNotAllowed
'408':
$ref: common.yaml#/components/responses/408RequestTimeout
'409':
$ref: common.yaml#/components/responses/409Conflict
'410':
$ref: common.yaml#/components/responses/410Gone
'429':
$ref: common.yaml#/components/responses/429LimitExceeded
'500':
$ref: common.yaml#/components/responses/500InternalServerError
'503':
$ref: common.yaml#/components/responses/503ServiceUnavailable
'504':
$ref: common.yaml#/components/responses/504GatewayTimeout
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/api/v2/databases/{database}/schemas/{schema}/user-defined-functions/{nameWithArgs}:rename:
post:
summary: Rename a Udf
tags:
- user-defined-function
description: Rename a UDF
operationId: renameUserDefinedFunction
parameters:
- $ref: common.yaml#/components/parameters/database
- $ref: common.yaml#/components/parameters/schema
- $ref: common.yaml#/components/parameters/nameWithArgs
- $ref: common.yaml#/components/parameters/ifExists
- name: targetDatabase
description: Database of the target resource. Defaults to the source's database
in: query
required: true
schema:
type: string
pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$
example: example_value
- name: targetSchema
description: Schema of the target resource. Defaults to the source's schema
in: query
required: true
schema:
type: string
pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$
example: example_value
- name: targetName
description: Name of the target resource.
in: query
required: true
schema:
type: string
pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$
example: example_value
responses:
'200':
$ref: common.yaml#/components/responses/200SuccessResponse
'202':
$ref: common.yaml#/components/responses/202SuccessAcceptedResponse
'400':
$ref: common.yaml#/components/responses/400BadRequest
'401':
$ref: common.yaml#/components/responses/401Unauthorized
'403':
$ref: common.yaml#/components/responses/403Forbidden
'404':
$ref: common.yaml#/components/responses/404NotFound
'405':
$ref: common.yaml#/components/responses/405MethodNotAllowed
'408':
$ref: common.yaml#/components/responses/408RequestTimeout
'409':
$ref: common.yaml#/components/responses/409Conflict
'410':
$ref: common.yaml#/components/responses/410Gone
'429':
$ref: common.yaml#/components/responses/429LimitExceeded
'500':
$ref: common.yaml#/components/responses/500InternalServerError
'503':
$ref: common.yaml#/components/responses/503ServiceUnavailable
'504':
$ref: common.yaml#/components/responses/504GatewayTimeout
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
components:
schemas:
UserDefinedFunction:
type: object
description: A snowflake UDF
properties:
name:
type: string
pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$
description: The name of the UDF
example: Example Title
is_temporary:
type: boolean
description: Specifies whether the UDF is temporary or not
example: true
is_aggregate:
type: boolean
description: Specifies whether the UDF is an aggregate function. Applicable only for Python language type
example: true
is_memoizable:
type: boolean
description: Indicates whether the function is memoizable. Applicable only for Python language type.
example: true
is_table_function:
type: boolean
readOnly: true
description: True if the UDF is a table function; false otherwise.
example: true
valid_for_clustering:
type: boolean
readOnly: true
description: True if the UDF is valid for clustering; false otherwise.
example: true
is_secure:
type: boolean
description: Specifies whether the function/procedure is secure or not
example: true
arguments:
type: array
items:
$ref: '#/components/schemas/Argument'
description: List of arguments for the function/procedure
example: []
return_type:
$ref: '#/components/schemas/ReturnType'
description: Return type of the function/procedure. Should be a SQL data type or a table
language_config:
$ref: '#/components/schemas/FunctionLanguage'
description: Language that the function/procedure is written in
comment:
type: string
description: Specifies a comment for the function/procedure
example: example_value
body:
type: string
description: Function/procedure definition
example: example_value
created_on:
type: string
format: date-time
readOnly: true
description: The date and time when the function/procedure was created
example: '2026-01-15T10:30:00Z'
schema_name:
type: string
pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$
readOnly: true
description: The name of the schema in which the function/procedure exists.
example: example_value
database_name:
type: string
pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$
readOnly: true
description: The name of the database in which the function/procedure exists.
example: example_value
min_num_arguments:
type: integer
readOnly: true
description: The minimum number of arguments
example: 10
max_num_arguments:
type: integer
readOnly: true
description: The maximum number of arguments
example: 10
owner:
type: string
pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$
readOnly: true
description: Role that owns the function/procedure
example: example_value
owner_role_type:
type: string
pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$
readOnly: true
description: The type of role that owns the function/procedure
example: example_value
is_builtin:
type: boolean
readOnly: true
description: If the function/procedure is built-in or not (user-defined)
example: true
required:
- name
- arguments
- return_type
- language_config
Argument:
type: object
properties:
name:
type: string
pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$
description: Argument name
example: Example Title
datatype:
type: string
enum:
- ARRAY
- BIGINT
- BINARY
- BOOLEAN
- BYTEINT
- CHAR
- CHARACTER
- DATE
- DATETIME
- DECIMAL
- DOUBLE
- DOUBLE PRECISION
- FLOAT
- FLOAT4
- FLOAT8
- GEOGRAPHY
- GEOMETRY
- INT
- INTEGER
- NUMBER
- NUMERIC
- OBJECT
- REAL
- STRING
- SMALLINT
- TEXT
- TIME
- TIMESTAMP_LTZ
- TIMESTAMP_NTZ
- TIMESTAMP_TZ
- TINYINT
- VARBINARY
- VARCHAR
- VARIANT
- VECTOR
x-enum-varnames:
- ARRAY
- BIGINT
- BINARY
- BOOLEAN
- BYTEINT
- CHAR
- CHARACTER
- DATE
- DATETIME
- DECIMAL
- DOUBLE
- DOUBLE_PRECISION
- FLOAT
- FLOAT4
- FLOAT8
- GEOGRAPHY
- GEOMETRY
- INT
- INTEGER
- NUMBER
- NUMERIC
- OBJECT
- REAL
- STRING
- SMALLINT
- TEXT
- TIME
- TIMESTAMP_LTZ
- TIMESTAMP_NTZ
- TIMESTAMP_TZ
- TINYINT
- VARBINARY
- VARCHAR
- VARIANT
- VECTOR
description: Argument data type
example: ARRAY
default_value:
type: string
description: Default value of the argument
example: example_value
required:
- name
- datatype
ReturnType:
type: object
properties:
type:
type: string
pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$
description: Type of the return, can be either DATATYPE or TABLE
example: example_value
required:
- type
discriminator:
propertyName: type
mapping:
DATATYPE: ReturnDataType
TABLE: ReturnTable
ReturnDataType:
allOf:
- $ref: '#/components/schemas/ReturnType'
properties:
datatype:
type: string
enum:
- ARRAY
- BIGINT
- BINARY
- BOOLEAN
- BYTEINT
- CHAR
- CHARACTER
- DATE
- DATETIME
- DECIMAL
- DOUBLE
- DOUBLE PRECISION
- FLOAT
- FLOAT4
- FLOAT8
- GEOGRAPHY
- GEOMETRY
- INT
- INTEGER
- NUMBER
- NUMERIC
- OBJECT
- REAL
- STRING
- SMALLINT
- TEXT
- TIME
- TIMESTAMP_LTZ
- TIMESTAMP_NTZ
- TIMESTAMP_TZ
- TINYINT
- VARBINARY
- VARCHAR
- VARIANT
- VECTOR
x-enum-varnames:
- ARRAY
- BIGINT
- BINARY
- BOOLEAN
- BYTEINT
- CHAR
- CHARACTER
- DATE
- DATETIME
- DECIMAL
- DOUBLE
- DOUBLE_PRECISION
- FLOAT
- FLOAT4
- FLOAT8
- GEOGRAPHY
- GEOMETRY
- INT
- INTEGER
- NUMBER
- NUMERIC
- OBJECT
- REAL
- STRING
- SMALLINT
- TEXT
- TIME
- TIMESTAMP_LTZ
- TIMESTAMP_NTZ
- TIMESTAMP_TZ
- TINYINT
- VARBINARY
- VARCHAR
- VARIANT
- VECTOR
description: Return data type
example: ARRAY
nullable:
type: boolean
description: Argument null return acceptance criteria
example: true
required:
- datatype
ReturnTable:
allOf:
- $ref: '#/components/schemas/ReturnType'
properties:
column_list:
type: array
items:
$ref: '#/components/schemas/ColumnType'
description: List of table columns to return
example: []
ColumnType:
type: object
properties:
name:
type: string
pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$
description: Argument name
example: Example Title
datatype:
type: string
enum:
- ARRAY
- BIGINT
- BINARY
- BOOLEAN
- BYTEINT
- CHAR
- CHARACTER
- DATE
- DATETIME
- DECIMAL
- DOUBLE
- DOUBLE PRECISION
- FLOAT
- FLOAT4
- FLOAT8
- GEOGRAPHY
- GEOMETRY
- INT
- INTEGER
- NUMBER
- NUMERIC
- OBJECT
- REAL
- STRING
- SMALLINT
- TEXT
- TIME
- TIMESTAMP_LTZ
- TIMESTAMP_NTZ
- TIMESTAMP_TZ
- TINYINT
- VARBINARY
- VARCHAR
- VARIANT
- VECTOR
x-enum-varnames:
- ARRAY
- BIGINT
- BINARY
- BOOLEAN
- BYTEINT
- CHAR
- CHARACTER
- DATE
- DATETIME
- DECIMAL
- DOUBLE
- DOUBLE_PRECISION
- FLOAT
- FLOAT4
- FLOAT8
- GEOGRAPHY
- GEOMETRY
- INT
- INTEGER
- NUMBER
- NUMERIC
- OBJECT
- REAL
- STRING
- SMALLINT
- TEXT
- TIME
- TIMESTAMP_LTZ
- TIMESTAMP_NTZ
- TIMESTAMP_TZ
- TINYINT
- VARBINARY
- VARCHAR
- VARIANT
- VECTOR
description: Argument data type
example: ARRAY
required:
- name
- datatype
FunctionLanguage:
type: object
properties:
language:
type: string
description: 'Language that the function/procedure is written in. Possible values include: JAVA, JAVASCRIPT, PYTHON, SCALA, SQL'
example: example_value
called_on_null_input:
type: boolean
description: Decide if the function/procedure can receive null input
example: true
is_volatile:
type: boolean
description: " Specifies the behavior of the UDF when returning results. This Field is deprecated for Procedure.\n \n If true, UDF might return different values for different
rows, even for the same input. \n This field is deprecated for Procedure.\n\n If false, UDF assumes that the function, when called with the same inputs, will always return
the same result. \n This guarantee is not checked. Specifying IMMUTABLE for a UDF that returns different values for the same input will result in undefined behavior.\n "
example: true
required:
- language
discriminator:
propertyName: language
mapping:
JAVA: JavaFunction
PYTHON: PythonFunction
SCALA: ScalaFunction
JAVASCRIPT: JavaScriptFunction
SQL: SQLFunction
BaseLanguage:
allOf:
- $ref: '#/components/schemas/FunctionLanguage'
properties:
packages:
type: array
items:
type: string
description: Packages to include with the function/procedure
example: []
imports:
type: array
items:
type: string
description: List of imports
example: []
handler:
type: string
description: Fully qualified method name including the package and the class
example: example_value
required:
- packages
- handler
JavaFunction:
allOf:
- $ref: '#/components/schemas/BaseLanguage'
properties:
external_access_integrations:
type: array
items:
type: string
description: List of external access integrations attached to this function/procedure
example: []
secrets:
type: object
additionalProperties:
type: string
description: Secrets to be used with this function/procedure for external access
example: example_value
target_path:
type: string
description: Specifies where Snowflake should write the compiled code for inline procedures
example: example_value
runtime_version:
type: string
description: "Specifies the Java JDK runtime version to use. \n The supported versions of Java are 11.x and 17.x (Preview support)"
example: example_value
required:
- runtime_version
PythonFunction:
allOf:
- $ref: '#/components/schemas/BaseLanguage'
properties:
external_access_integrations:
type: array
items:
type: string
description: List of external access integrations attached to this function/procedure
example: []
secrets:
type: object
additionalProperties:
type: string
description: Secrets to be used with this function/procedure for external access
example: example_value
runtime_version:
type: string
description: "Specifies the Python version to use. The supported versions of Python are:\n * 3.8\n * 3.9\n * 3.10\n \
\ * 3.11"
example: example_value
required:
- runtime_version
ScalaFunction:
allOf:
- $ref: '#/components/schemas/BaseLanguage'
properties:
target_path:
type: string
description: Specifies where Snowflake should write the compiled code for inline function/procedures
example: example_value
runtime_version:
type: string
description: 'Specifies the Scala runtime version to use. The supported versions of Scala are: 2.12'
example: example_value
required:
- runtime_version
JavaScriptFunction:
allOf:
- $ref: '#/components/schemas/FunctionLanguage'
SQLFunction:
allOf:
- $ref: '#/components/schemas/FunctionLanguage'
securitySchemes:
KeyPair:
$ref: common.yaml#/components/securitySchemes/KeyPair
ExternalOAuth:
$ref: common.yaml#/components/securitySchemes/ExternalOAuth
SnowflakeOAuth:
$ref: common.yaml#/components/securitySchemes/SnowflakeOAuth
security:
- KeyPair: []
- ExternalOAuth: []
- SnowflakeOAuth: []