Grant repository access
Grant a repository you can see to an integration (owners and admins)
PUT /api/v1/integrations/{integration}/repositories/{repository}
Personal token · webhooks:manage
Example request
Link to this section# Set your token and resource IDs first.
API_BASE_URL="https://app.theseus.dev/api/v1"
curl --fail-with-body --request PUT \
-H "Authorization: Bearer ${THESEUS_API_TOKEN:?}" \
"${API_BASE_URL}/integrations/${INTEGRATION_ID:?}/repositories/${REPOSITORY_ID:?}"Parameters
Link to this section| Name | In | Type | Description |
|---|---|---|---|
integration required | path | string | Pattern |
repository required | path | string | Pattern |
Responses
Link to this sectionThe integration with the grant
Response fields
Content type application/json
idstring requiredThe integration,
int_…workspace_idstring requirednamestring requireddestinationIntegrationDestination requireddestination fields
typestring requiredgithub_dispatchsends each event to its repository's GitHub Actions as arepository_dispatchnamedtheseus.<type>.httpsposts it tourl, signed per Standard Webhooks. New types may be addedOne of
github_dispatch,httpsurlstringThe endpoint, for
https
event_typesarray of string requiredWhich events it receives: a type, a family such as
guide.*, or*enabledboolean requireddisabled_reasonstring or null requiredWhy Theseus disabled an HTTPS endpoint itself: it answered 410 (
gone), or failed for 5 days with no success (failing). Null when it did not. New reasons may be addedOne of
gone,failing,nullfailing_sincestring (date-time) or null requiredWhen an HTTPS endpoint's current run of failed deliveries began
previous_secret_expires_atstring (date-time) or null requiredAfter a secret rotation, until when the replaced secret still signs beside the new one
pausedboolean requiredTrue while the workspace's plan does not include integrations
repositoriesarray of IntegrationRepository requiredThe granted repositories you can see; the integration covers no other
repositories fields
idstring requiredfull_namestring required
hidden_repository_countinteger requiredGranted repositories you cannot see, which are not listed
created_atstring (date-time) required
Example responses
Link to this sectionRepository granted
Illustrative response · selected fields
{
"id": "int_EXAMPLE",
"workspace_id": "wsp_EXAMPLE",
"name": "PR follow-up",
"destination": {
"type": "github_dispatch"
},
"event_types": [
"guide.ready"
],
"enabled": true,
"disabled_reason": null,
"paused": false,
"repositories": [
{
"id": "rep_EXAMPLE",
"full_name": "example/project"
}
]
}Errors
Link to this section400 · The request is not valid
401 · A valid bearer token is required
402 · The workspace's plan does not include this
403 · The credential's scopes do not allow this
404 · Not found
426 · Upgrade the CLI: run theseus update
429 · Too many requests
Headers
Retry-AfterintegerSeconds to wait before the next request, when known
500 · Theseus could not complete the request; retrying will not help
503 · Theseus is unavailable; retry the same request
Headers
Retry-AfterintegerSeconds to wait before the next request, when known
Error response fields
Content type application/problem+json
typestring (uri) requiredIdentifies the problem type; branch on
codeinsteadtitlestring requiredstatusinteger requireddetailstringcodestring requiredWhy the request failed. New codes may be added: treat an unknown one by its status
One of
invalid_request,unauthenticated,not_in_plan,insufficient_scope,admission_required,not_found,ambiguous,conflict,rate_limited,internal_error,unavailable,search_authorization_pending,search_unavailable,cli_upgrade_requiredrequest_idstring requiredQuote this when reporting the problem
errorsarray of FieldErrorWith
invalid_request: what is wrong with each fielderrors fields
pathstring requiredWhere in the request, as dotted segments
messagestring required
required_scopestringWith
insufficient_scope: the scope the operation needsnextstringRecovery action, such as theseus update
candidatesarray of CandidateWith
ambiguous: what the request could mean; ask whichcandidates fields
idstring requiredpathstring requiredkindstring requiredtitlestring requiredurlstring (uri) required