Updated on 2026-07-14 GMT+08:00

Listing private hook versions

Function

ListPrivateHookVersions

You can use this API to list all private hook versions of the private hook.

  • You can use sort_key and sort_dir as keywords to sort the returned results by creation time (create_time). The number of sort_keys must be the same as that of sort_dirs. Otherwise, error code 400 is returned. If sort_key and sort_dir are not assigned, results are sorted by creation time in descending order by default.

  • If both hook_name and hook_id are provided, RFS verifies whether they match. If hook_id does not match the current private hook ID, 400 is returned.

  • If there is no hook version under the private hook, an empty list will be returned.

  • If private hook does not exist, error code 404 will be returned.

  • Support pagination. If there is next_marker in the response, more output is available than is included in the current response. Use this value in the marker request parameter in a subsequent call to get the next part of the outputs. You should repeat this until the next_marker response is set to null.

URI

GET /v1/private-hooks/{hook_name}/versions

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

hook_name

Yes

String

Private hook name. The name is unique within its domain (domain_id) and region. It can contain Chinese characters, uppercase and lowercase letters, digits, underscores (_), and hyphens (-). The first character must be a Chinese or English character. It is case sensitive.

Minimum: 1

Maximum: 128

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

hook_id

No

String

Unique ID of a private hook.

It is an UUID generated by RFS when a private hook is created.

Private hook names are unique only at one specific time, so you can create a private hook named helloWorld and another private hook with the same name after deleting the first one.

For parallel development in a team, users may want to ensure that the private hook they operate is the one created by themselves, not the one with the same name created by other teammates after deleting the previous one. Therefore, they can use this ID for strong matching.

RFS ensures that the ID of each private hook is different and does not change with updates. If the hook_id value is different from the current private hook ID, error code 400 is returned.

Minimum: 36

Maximum: 36

sort_key

No

Array of strings

Sorting field. Only create_time is supported.

Minimum: 1

sort_dir

No

Array of strings

Specify an ascending or descending order.

  • asc: ascending order

  • desc: descending order

Minimum: 1

marker

No

String

Pagination marker. When a single page cannot return all results, the previous request will return a next_marker to indicate there are more pages. Users can place the value of next_marker here to query information from the next page. This marker can only be used for requests with the same parameters as the previous request. If not specified, the query will start from the first page by default.

Minimum: 1

Maximum: 512

limit

No

Integer

The maximum number of results to return per page

Minimum: 10

Maximum: 1000

Default: 1000

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Client-Request-Id

Yes

String

Unique request ID. It is specified by a user and is used to locate a request. UUID is recommended.

Minimum: 36

Maximum: 128

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

versions

Array of PrivateHookVersionSummary objects

Private hook versions, sorted by creation time in descending order by default.

page_info

PageInfo object

Pagination information

Table 5 PrivateHookVersionSummary

Parameter

Type

Description

hook_name

String

Private hook name. The name is unique within its domain (domain_id) and region. It can contain Chinese characters, uppercase and lowercase letters, digits, underscores (_), and hyphens (-). The first character must be a Chinese or English character. It is case sensitive.

Minimum: 1

Maximum: 128

hook_id

String

Unique ID of a private hook.

It is an UUID generated by RFS when a private hook is created.

Private hook names are unique only at one specific time, so you can create a private hook named helloWorld and another private hook with the same name after deleting the first one.

For parallel development in a team, users may want to ensure that the private hook they operate is the one created by themselves, not the one with the same name created by other teammates after deleting the previous one. Therefore, they can use this ID for strong matching.

RFS ensures that the ID of each private hook is different and does not change with updates. If the hook_id value is different from the current private hook ID, error code 400 is returned.

Minimum: 36

Maximum: 36

hook_version

String

Private hook version. The version number follows the Semantic Version and is customized by the user. Each component (Major.Minor.Patch) is an unsigned 64-bit integer (uint64).

Minimum: 5

Maximum: 128

hook_version_description

String

Description of the private hook version. It can be used by users to identify and manage private hook versions. Note: The private hook version is immutable, so the description cannot be updated. If it needs to be updated, please delete private hook version and rebuild it.

Minimum: 0

Maximum: 1024

create_time

String

Time when a private hook version is created. It uses a UTC (YYYY-MM-DDTHH:mm:ss.SSSZ) format, for example, 1970-01-01T00:00:00.000Z.

Table 6 PageInfo

Parameter

Type

Description

next_marker

String

Forward pagination identifier. Marker for the next set of results. If present, more output is available than is included in the current response. Use this value in the marker request parameter in a subsequent call to get the next part of the outputs. You should repeat this until the next_marker response is set to null.

previous_marker

String

Backward pagination identifier.

current_count

Integer

The number of items returned on current page.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Response code

Minimum: 11

Maximum: 11

error_msg

String

Response message

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 8 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 401

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Response code

Minimum: 11

Maximum: 11

error_msg

String

Response message

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 10 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 403

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Response code

Minimum: 11

Maximum: 11

error_msg

String

Response message

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 12 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 404

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Response code

Minimum: 11

Maximum: 11

error_msg

String

Response message

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 14 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 429

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Response code

Minimum: 11

Maximum: 11

error_msg

String

Response message

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 16 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 500

Table 17 Response body parameters

Parameter

Type

Description

error_code

String

Response code

Minimum: 11

Maximum: 11

error_msg

String

Response message

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 18 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Example Requests

  • You can obtain all private hook versions of the private hook named my-hello-world-hook-name. The returned private hook versions are sorted in descending order by creation time.

    GET https://{endpoint}/v1/private-hooks/my-hello-world-hook-name/versions
  • You can obtain all private hook versions of the private hook named my-hello-world-hook-name. The returned private hook versions are sorted in ascending order by creation time.

    GET https://{endpoint}/v1/private-hooks/my-hello-world-hook-name/versions?sort_key=create_time&sort_dir=asc
  • You can obtain all private hook versions of the private hook named my-hello-world-hook-name and check whether the provided private hook ID matches the current private hook. The returned private hook versions are sorted in ascending order by creation time.

    GET https://{endpoint}/v1/private-hooks/my-hello-world-hook-name/versions?hook_id=ea6a4f0e-ee8a-494e-b12a-8be4a1e65af2&sort_key=create_time&sort_dir=asc

Example Responses

Status code: 200

List private hook versions succeeded.

{
  "versions" : [ {
    "hook_id" : "1b15e005-bdbb-4bd7-8f9a-a09b6774b4b3",
    "hook_name" : "my-hello-world-hook-name",
    "hook_version" : "3.7.10",
    "hook_version_description" : "my second hello world private hook version",
    "create_time" : "2024-01-01T00:00:00.000Z"
  }, {
    "hook_id" : "1b15e005-bdbb-4bd7-8f9a-a09b6774b4b3",
    "hook_name" : "my-hello-world-hook-name",
    "hook_version" : "3.7.9",
    "hook_version_description" : "my first hello world private hook version",
    "create_time" : "2023-01-01T00:00:00.000Z"
  } ],
  "page_info" : {
    "current_count" : 2,
    "next_marker" : null,
    "previous_marker" : "zxc1oHc08HcCmypYGTsOoRcvoHUvHRUAW5NOSnc1oHc08HcCPZrwP5NOeTlRiukJgtGxeujJeuGwGIihaIUCmypYGTsOtqvKPr2xmH8fPqpGWyQ0axGwGZp9aqvx8pQ7m5FvGTsJiKk7gtNFiuaxetdRCks="
  }
}

Status Codes

Status Code

Description

200

List private hook versions succeeded.

400

Invalid request.

401

Authentication failed.

403

The user does not have the permission to call this API.

404

The private hook does not exist.

429

Too frequent requests.

500

Internal server error.