Map an already authorized repository
PUT
/api/public/v1/projects/{project_id}/repository
const url = 'https://testperch.com/api/public/v1/projects/example/repository';const options = { method: 'PUT', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"github_repository_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://testperch.com/api/public/v1/projects/example/repository \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "github_repository_id": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”project_id
required
ID of a project visible to the authenticated credential.
string
ID of a project visible to the authenticated credential.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
github_repository_id
required
string
Example generated
{ "github_repository_id": "example"}Responses
Section titled “Responses”Map an already authorized repository.
Media typeapplication/json
object
has_workspace_connection
required
boolean
mapping
required
object
id
required
string
full_name
required
string
html_url
required
string format: uri
installation_id
required
string
account_login
required
string
installation_status
required
string
active
required
boolean
archived
required
boolean
visibility
required
string
selectable
required
boolean
repositories
required
Array<object>
object
id
required
string
full_name
required
string
html_url
required
string format: uri
installation_id
required
string
account_login
required
string
installation_status
required
string
active
required
boolean
archived
required
boolean
visibility
required
string
selectable
required
boolean
Example generated
{ "has_workspace_connection": true, "mapping": { "id": "example", "full_name": "example", "html_url": "https://example.com", "installation_id": "example", "account_login": "example", "installation_status": "example", "active": true, "archived": true, "visibility": "example", "selectable": true }, "repositories": [ { "id": "example", "full_name": "example", "html_url": "https://example.com", "installation_id": "example", "account_login": "example", "installation_status": "example", "active": true, "archived": true, "visibility": "example", "selectable": true } ]}Invalid parameters, query, or cursor.
Media typeapplication/json
object
error
required
object
code
required
string
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid
Example
{ "error": { "code": "invalid_request" }}Missing or invalid OAuth bearer token or API key.
Media typeapplication/json
object
error
required
object
code
required
string
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid
Example
{ "error": { "code": "invalid_request" }}The project workspace does not have product access.
Media typeapplication/json
object
error
required
object
code
required
string
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid
Example
{ "error": { "code": "invalid_request" }}The credential lacks the required permission; configuration writes require a Read + write project key.
Media typeapplication/json
object
error
required
object
code
required
string
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid
Example
{ "error": { "code": "invalid_request" }}The resource is inaccessible or does not exist.
Media typeapplication/json
object
error
required
object
code
required
string
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid
Example
{ "error": { "code": "invalid_request" }}Configuration conflicts with an existing resource or integration requirements.
Media typeapplication/json
object
error
required
object
code
required
string
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid
Example
{ "error": { "code": "invalid_request" }}Credential or workspace rate limit exceeded.
Media typeapplication/json
object
error
required
object
code
required
string
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid
Example
{ "error": { "code": "invalid_request" }}Headers
Section titled “Headers”Retry-After
required
Seconds before retrying.
integer
Seconds before retrying.
Internal server error.
Media typeapplication/json
object
error
required
object
code
required
string
details
Array<object>
object
code
required
string
message
required
string
path
required
Array
message
required
string
request_id
required
string format: uuid
Example
{ "error": { "code": "invalid_request" }}