ArchiveRepository - Archive a code repository

Updated at:

Applicable editions

Central edition, Region edition

Endpoint and authorization

  • Get a service endpoint to replace the {domain} placeholder in the request syntax.
  • Get a personal access token.
  • Get the organization ID: Required for Central edition only. Go to Organization Management > Basic Information to get the organization ID.

Product

Resource

Required permission

Codeup

code repository

Read/Write

Request syntax

Central edition

POST https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/archive

Region edition

POST https://{domain}/oapi/v1/codeup/repositories/{repositoryId}/archive

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

Your personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

In

Required

Description

Example

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

The organization ID.

60d54f3daccf2bbd6659f3ad

repositoryId

string

path

Yes

The ID of the code repository or its URL-encoded full path.

2813489 or 60de7a6852743a5162b5f957%2FDemoRepo

Request examples

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489/archive' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/codeup/repositories/2813489/archive' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example

-

object

result

boolean

Indicates if the repository was archived.

true

Response example

{
    "result": true
}

Error codes

For error codes, see the Error Code Center.