Updated on 2026-10-27 GMT+08:00

Updating the URL of a Function

Function

This API is used to update the URL of a function.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

URI

PUT /v2/{project_id}/fgs/functions/{function_urn}/function-url

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Parameter description:

Project ID. For details, see Obtaining a Project ID.

Constraints:

None

Value range:

32 characters, including letters and digits.

Default value:

None

function_urn

Yes

String

Parameter description:

URN of the function. For details, see Function Model.

Constraints:

None

Value range:

Only letters, digits, underscores (_), hyphens (-), and colons (:) are allowed.

Default value:

None

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Parameter description:

User token.

The token can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Constraints:

None

Value range:

None

Default value:

None

Content-Type

Yes

String

Parameter description:

Specifies the type (or format) of the message body.

Constraints:

None

Value range:

Only application/json is supported.

Default value:

application/json

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

auth_type

Yes

String

URL authentication mode.

cors

Yes

CorsConfig object

Cross-origin resource sharing (CORS) configuration for the URL.

Table 4 CorsConfig

Parameter

Mandatory

Type

Description

is_cors

No

Boolean

Whether CORS is supported.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

auth_type

String

URL authentication mode.

cors

CorsConfig object

function_url

String

Function URN.

create_time

String

Time when the URL was created.

last_modified_time

String

Time when the URL was last modified.

Table 6 CorsConfig

Parameter

Type

Description

is_cors

Boolean

Whether CORS is supported.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

Update the URL of a function.

PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/function-url

{
  "auth_type" : "IAM",
  "cors" : {
    "is_cors" : false
  }
}

Example Responses

Status code: 200

{
  "function_url" : "",
  "auth_type" : "",
  "cors" : {
    "is_cors" : false
  },
  "create_time" : "",
  "last_modified_time" : ""
}

Status Codes

Status Code

Description

200

OK

400

Bad request.

401

Unauthorized.

403

Forbidden.

404

Not found.

500

Internal server error.

Error Codes

See Error Codes.