API docs

zpe repo access

mount /repo-access · base https://zpe.vc/repo-access · v2.0.0 · 13 operations · 8 write · 0 need no account · wip

the document this app serves now. Contract: https://zpe.vc/repo-access/_/api/v1/openapi.json · sha256 126bce665402

GET /_/api/v1/tenants The caller's tenant, the names of its stored credentials, and how the call authenticated getTenants

The caller's tenant, the names of its stored credentials, and how the call authenticated

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The caller's tenant, or `null` before one exists; the names of its stored credentials; and how the call authenticated (`session` or `token`).object
401The credential is missing or does not open this accountobject
403This account may not do that: the credential's grant does not name this appobject
429Too many requests: this caller has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

The caller's tenant, the names of its stored credentials, and how the call authenticated, with a token from the door.

GET /_/api/v1/tenants
curl -X GET 'https://zpe.vc/repo-access/_/api/v1/tenants' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/tenants Create or update the caller's tenant (the same write as PUT) postTenants

Create or update the caller's tenant (the same write as PUT)

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The tenant as saved, with the webhook address the engine calls for this seller's payments.object
400The body was not a JSON object, so there was no tenant to write.object
401The credential is missing or does not open this accountobject
403This account may not do that: the credential's grant does not name this appobject
409That GitHub org already belongs to another tenant on this deployment; one org cannot be sold from twice.object
422`org`, `product_team_map` or `branding` did not pass the vendored guard: an org is `owner/name`, and the map and branding are objects.object
429Too many requests: this caller has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Create or update the caller's tenant (the same write as PUT), with a token from the door.

POST /_/api/v1/tenants
curl -X POST 'https://zpe.vc/repo-access/_/api/v1/tenants' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

PUT /_/api/v1/tenants Create or update the caller's tenant: its label, org, product-to-team map and branding putTenants

Create or update the caller's tenant: its label, org, product-to-team map and branding

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The tenant as saved, with the webhook address the engine calls for this seller's payments.object
400The body was not a JSON object, so there was no tenant to write.object
401The credential is missing or does not open this accountobject
403This account may not do that: the credential's grant does not name this appobject
409That GitHub org already belongs to another tenant on this deployment; one org cannot be sold from twice.object
422`org`, `product_team_map` or `branding` did not pass the vendored guard: an org is `owner/name`, and the map and branding are objects.object
429Too many requests: this caller has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Create or update the caller's tenant: its label, org, product-to-team map and branding, with a token from the door.

PUT /_/api/v1/tenants
curl -X PUT 'https://zpe.vc/repo-access/_/api/v1/tenants' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

DELETE /_/api/v1/tenants Revoke the tenant: remove its buyers from the org, expire its claims, drop its credentials deleteTenants

Revoke the tenant: remove its buyers from the org, expire its claims, drop its credentials

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The tenant is revoked: its claims expired, its stored credentials dropped and its queued jobs cancelled. The counts say what moved.object
401The credential is missing or does not open this accountobject
403This account may not do that: the credential's grant does not name this appobject
429Too many requests: this caller has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Revoke the tenant: remove its buyers from the org, expire its claims, drop its credentials, with a token from the door.

DELETE /_/api/v1/tenants
curl -X DELETE 'https://zpe.vc/repo-access/_/api/v1/tenants' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/tenants/secrets The names of the tenant's stored credentials, never their values getTenantsSecrets

The names of the tenant's stored credentials, never their values

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The names of the tenant's stored credentials. No call returns a value.object
401The credential is missing or does not open this accountobject
403This account may not do that: the credential's grant does not name this appobject
429Too many requests: this caller has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

The names of the tenant's stored credentials, never their values, with a token from the door.

GET /_/api/v1/tenants/secrets
curl -X GET 'https://zpe.vc/repo-access/_/api/v1/tenants/secrets' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

PUT /_/api/v1/tenants/secrets/{name} Store one credential (payment_webhook_secret or github_token), sealed under the tenant's key putTenantsSecretsById

Store one credential (payment_webhook_secret or github_token), sealed under the tenant's key

Parameters

nameinrequiredtypenotes
namepathyesstring

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The credential is stored and sealed under the tenant's key; the answer repeats every stored name.object
401The credential is missing or does not open this accountobject
403This account may not do that: the credential's grant does not name this appobject
422`name` is not `payment_webhook_secret` or `github_token`, or `value` is missing or blank.object
429Too many requests: this caller has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503The tenant's sealing key or the door did not answer, so nothing was stored.object

Example

Store one credential (payment_webhook_secret or github_token), sealed under the tenant's key, with a token from the door.

PUT /_/api/v1/tenants/secrets/{name}
curl -X PUT 'https://zpe.vc/repo-access/_/api/v1/tenants/secrets/string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/tenants/purchases The account's 100 most recently updated purchases getTenantsPurchases

The account's 100 most recently updated purchases

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200Up to 100 of the account's purchases, most recently updated first.object
401The credential is missing or does not open this accountobject
403This account may not do that: the credential's grant does not name this appobject
429Too many requests: this caller has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

The account's 100 most recently updated purchases, with a token from the door.

GET /_/api/v1/tenants/purchases
curl -X GET 'https://zpe.vc/repo-access/_/api/v1/tenants/purchases' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/tenants/events The account's 100 most recent engine events getTenantsEvents

The account's 100 most recent engine events

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200Up to 100 of the account's engine events, most recent first, each with an ISO timestamp.object
401The credential is missing or does not open this accountobject
403This account may not do that: the credential's grant does not name this appobject
429Too many requests: this caller has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

The account's 100 most recent engine events, with a token from the door.

GET /_/api/v1/tenants/events
curl -X GET 'https://zpe.vc/repo-access/_/api/v1/tenants/events' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/tenants/reconcile Re-assert every grant the tenant should hold against GitHub, and report what changed postTenantsReconcile

Re-assert every grant the tenant should hold against GitHub, and report what changed

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200Every grant the tenant should hold was re-asserted against GitHub; the report says what changed.object
401The credential is missing or does not open this accountobject
403This account may not do that: the credential's grant does not name this appobject
404The caller has no tenant yet, so there is nothing to reconcile.object
429Too many requests: this caller has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Re-assert every grant the tenant should hold against GitHub, and report what changed, with a token from the door.

POST /_/api/v1/tenants/reconcile
curl -X POST 'https://zpe.vc/repo-access/_/api/v1/tenants/reconcile' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/tenants/sweep Run the queue sweep now: retry what is due, expire stale claim links postTenantsSweep

Run the queue sweep now: retry what is due, expire stale claim links

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200What the sweep retried, and how many stale claim links it expired. Counts only.object
401The credential is missing or does not open this accountobject
403This account may not do that: the credential's grant does not name this appobject
429Too many requests: this caller has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Run the queue sweep now: retry what is due, expire stale claim links, with a token from the door.

POST /_/api/v1/tenants/sweep
curl -X POST 'https://zpe.vc/repo-access/_/api/v1/tenants/sweep' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/tokens The account's API tokens: id, label and dates, never the token getTokens

The account's API tokens: id, label and dates, never the token

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The account's tokens by id, label and dates. The token itself is never returned.object
401The credential is missing or does not open this accountobject
403This account may not do that: the credential's grant does not name this appobject
429Too many requests: this caller has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

The account's API tokens: id, label and dates, never the token, with a token from the door.

GET /_/api/v1/tokens
curl -X GET 'https://zpe.vc/repo-access/_/api/v1/tokens' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/tokens Mint an API token. It is shown once, in this answer, and never again postTokens

Mint an API token. It is shown once, in this answer, and never again

Parameters

nameinrequiredtypenotes
Idempotency-KeyheadernostringA retry handle: a second POST carrying the same value answers `200` with the first call's token id and label, `token: null`, and mints nothing.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200A replay: this `Idempotency-Key` was already answered. The token id, label and date the first call returned, with `token: null`, and nothing minted.object
201A new token, shown once in this answer and never again.object
400The `Idempotency-Key` was sent empty or longer than 200 characters: a retry is found by that value, so a blank or oversized one names nothing and is refused rather than read as absent.object
401The credential is missing or does not open this accountobject
403This account may not do that: the credential's grant does not name this appobject
409A live token already uses that label, or the store refused the write.object
429Too many requests: this caller has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503The deployment has no token pepper or no store, so no token was minted; or the door did not answer.object

Example

Mint an API token. It is shown once, in this answer, and never again, with a token from the door.

POST /_/api/v1/tokens
curl -X POST 'https://zpe.vc/repo-access/_/api/v1/tokens' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

DELETE /_/api/v1/tokens/{id} Revoke an API token by id deleteTokensById

Revoke an API token by id

Parameters

nameinrequiredtypenotes
idpathyesstring

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The token is revoked. A caller presenting it is refused from now on.object
401The credential is missing or does not open this accountobject
403This account may not do that: the credential's grant does not name this appobject
404No live token with that id belongs to this account.object
429Too many requests: this caller has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Revoke an API token by id, with a token from the door.

DELETE /_/api/v1/tokens/{id}
curl -X DELETE 'https://zpe.vc/repo-access/_/api/v1/tokens/string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.