Skip to content

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
Shell
# 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:?}"
NameInTypeDescription
integration requiredpathstring

Pattern ^int_[0-9A-Za-z]+$

repository requiredpathstring

Pattern ^rep_[0-9A-Za-z]+$

The integration with the grant

Response fields

Content type application/json

  • id string required

    The integration, int_…

  • workspace_id string required

  • name string required

  • destination IntegrationDestination required

    destination fields
    • type string required

      github_dispatch sends each event to its repository's GitHub Actions as a repository_dispatch named theseus.<type>. https posts it to url, signed per Standard Webhooks. New types may be added

      One of github_dispatch, https

    • url string

      The endpoint, for https

  • event_types array of string required

    Which events it receives: a type, a family such as guide.*, or *

  • enabled boolean required

  • disabled_reason string or null required

    Why 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 added

    One of gone, failing, null

  • failing_since string (date-time) or null required

    When an HTTPS endpoint's current run of failed deliveries began

  • previous_secret_expires_at string (date-time) or null required

    After a secret rotation, until when the replaced secret still signs beside the new one

  • paused boolean required

    True while the workspace's plan does not include integrations

  • repositories array of IntegrationRepository required

    The granted repositories you can see; the integration covers no other

    repositories fields
    • id string required

    • full_name string required

  • hidden_repository_count integer required

    Granted repositories you cannot see, which are not listed

  • created_at string (date-time) required

Example responses

Link to this section

Repository 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"
    }
  ]
}
400 · The request is not valid

Error response fields

401 · A valid bearer token is required

Error response fields

402 · The workspace's plan does not include this

Error response fields

403 · The credential's scopes do not allow this

Error response fields

404 · Not found

Error response fields

426 · Upgrade the CLI: run theseus update

Error response fields

429 · Too many requests

Headers

  • Retry-After integer

    Seconds to wait before the next request, when known

Error response fields

500 · Theseus could not complete the request; retrying will not help

Error response fields

503 · Theseus is unavailable; retry the same request

Headers

  • Retry-After integer

    Seconds to wait before the next request, when known

Error response fields

Error response fields

Content type application/problem+json

  • type string (uri) required

    Identifies the problem type; branch on code instead

  • title string required

  • status integer required

  • detail string

  • code string required

    Why 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_required

  • request_id string required

    Quote this when reporting the problem

  • errors array of FieldError

    With invalid_request: what is wrong with each field

    errors fields
    • path string required

      Where in the request, as dotted segments

    • message string required

  • required_scope string

    With insufficient_scope: the scope the operation needs

  • next string

    Recovery action, such as theseus update

  • candidates array of Candidate

    With ambiguous: what the request could mean; ask which

    candidates fields
    • id string required

    • path string required

    • kind string required

    • title string required

    • url string (uri) required