Help Center/ CodeArts Repo/ API Reference/ APIs/ Repository/ Setting a Repository to Public or Private
Updated on 2025-03-28 GMT+08:00

Setting a Repository to Public or Private

Function

This API is used to set a repository to public or private.

URI

PUT /v2/repositories/{repository_uuid}/template-status

Table 1 Path parameters

Parameter

Mandatory

Type

Description

repository_uuid

Yes

String

Repository ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation:

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

Constraints:

Mandatory

Range:

1–100,000 characters.

Default value:

None

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

template_type

Yes

String

Template type.

code_title

No

String

Code template name.

creator_name

No

String

Creator name.

code_description

No

String

Code template description.

languages

No

Array of strings

Template language.

plateform

No

Array of strings

Template platform.

entertype

No

Array of strings

Template type.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

error

Error object

Response error.

result

String

Response result.

status

String

Response status.

Table 5 Error

Parameter

Type

Description

code

String

Error code.

message

String

Error message.

Example Requests

PUT https://{endpoint}/v2/repositories/{repository_uuid}/template-status

{
	"template_type": "SHARE", 
	"code_title": "exampleTitle", 
	"creator_name": "exampleName", 
	"code_description": "exampleDescription", 
	"languages": ['Java'], 
	"plateform": ['Console'], 
	"entertype": ['AI']
}

Example Responses

Status code: 200

OK

{
  "result" : null,
  "error" : null,
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.