Help Center/ CodeArts Repo/ API Reference/ Historical APIs/ Adding a Hook to a Specified Repository/ Setting a Repository to Public or Private (Deprecated)
Updated on 2026-01-27 GMT+08:00

Setting a Repository to Public or Private (Deprecated)

Function

Set a repository to public or private.

URI

PUT /v1/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 parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

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

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

templateType

Yes

String

Explanation:

Template type

Range:

  • SHARE: personal sample template
  • PUBLIC: public read-only

codeTitle

No

String

Code template name

creatorName

No

String

Creator name

codeDescription

No

String

Code template description

languages

No

Array of strings

Template Language

plateform

No

Array of strings

Template platform

entertype

No

Array of strings

Explanation:

Template tag.

Range:

None

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

error

Error object

Response error

result

String

Response result

status

String

Explanation:

Response status

Range:

  • success: The API call is successful.
  • failed: The API call failed.
Table 5 Error

Parameter

Type

Description

code

String

Error codes

message

String

Error message

Request Example

PUT https://{endpoint}/v1/repositories/{repository_uuid}/template_status

{
	"templateType": "SHARE", 
	"codeTitle": "exampleTitle", 
	"creatorName": "exampleName", 
	"codeDescription": "exampleDescription", 
	"languages": ['Java'], 
	"plateform": ['Console'], 
	"entertype": ['AI']
}

Response Example

Status code: 200

OK

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

Status Codes

Status Codes

Description

200

OK

Error Codes

See error codes.