Skip to content

Resolve a persisted repository grant to its active replacement

GET
/v1/repository-grants/{grantId}/replacement
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.

grantId
required

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.

string format: uuid
Example
9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731

A repository grant id you persisted earlier, which may since have been revoked; ids are minted by WAMP when an administrator grants access

Current grant or null

Media typeapplication/json
object
repositoryGrant
required
Any of:

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
id
required

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

string format: uuid
repository
required

The exact repository the grant covers, with its fullName, defaultBranch and whether it is private

object
fullName
required
string
defaultBranch
required
string
private
required
boolean
operations
required

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

Array<string>
unique items
Allowed values: CHECKOUT PUBLISH
Example
{
"repositoryGrant": {
"id": "74c5a903-8e6f-4b1d-a052-3c9e18d7f64b",
"repository": {
"fullName": "acme/checkout-service",
"defaultBranch": "main",
"private": true
},
"operations": [
"CHECKOUT",
"PUBLISH"
]
}
}

Malformed request

Media typeapplication/json

Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.

object
error
required

Stable machine code

string
requiredScope

The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request

string
retryAfterSeconds

Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value

integer
>= 1
key
additional properties
any
Example
{
"error": "invalid_request"
}

Missing, expired or wrong-audience bearer

Media typeapplication/json

Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.

object
error
required

Stable machine code

string
requiredScope

The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request

string
retryAfterSeconds

Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value

integer
>= 1
key
additional properties
any
Example
{
"error": "unauthorized"
}

Live installation, scope or organization policy denies the operation

Media typeapplication/json

Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.

object
error
required

Stable machine code

string
requiredScope

The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request

string
retryAfterSeconds

Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value

integer
>= 1
key
additional properties
any
Example
{
"error": "insufficient_scope",
"requiredScope": "wamp.cloud.sessions:create"
}