Resolve a persisted repository grant to its active replacement
const url = 'https://example.com/v1/repository-grants/9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731/replacement';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/v1/repository-grants/9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731/replacement \ --header 'Authorization: Bearer <token>'Requires wamp.cloud.repositories:read. Returns the active grant for the exact same provider installation and repository after an administrator explicitly re-grants access. Unknown grants, grants from another installation, and repositories without an active replacement all return null without exposing provider identifiers.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A UUID identifying one Cloud resource; Session, Turn, Publication and Merge ids are minted by the caller so an ambiguous retry addresses the same durable command instead of creating a second one.
Example
9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731A repository grant id you persisted earlier, which may since have been revoked; ids are minted by WAMP when an administrator grants access
Responses
Section titled “Responses”Current grant or null
object
An administrator-approved authority over one exact GitHub repository. Installation capabilities never imply repository access — a grant is the only thing that does, and only a human organization administrator can create or revoke one.
object
Grant id to send as source.grantId; persist it beside your own repository record, and re-resolve it through the replacement endpoint if an administrator re-grants the same repository
The exact repository the grant covers, with its fullName, defaultBranch and whether it is private
object
What this grant permits — CHECKOUT to clone into a sandbox and PUBLISH to push a branch and open a pull request; a grant may carry one without the other
Example
{ "repositoryGrant": { "id": "74c5a903-8e6f-4b1d-a052-3c9e18d7f64b", "repository": { "fullName": "acme/checkout-service", "defaultBranch": "main", "private": true }, "operations": [ "CHECKOUT", "PUBLISH" ] }}Malformed request
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "invalid_request"}Missing, expired or wrong-audience bearer
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "unauthorized"}Live installation, scope or organization policy denies the operation
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "insufficient_scope", "requiredScope": "wamp.cloud.sessions:create"}