Authorization: Bearer header. See
Authentication for private keys and token signing.
Each endpoint page names the scopes that the token needs, for example “Scope: git:write on the
repository.” Authentication gives the rules for the scopes and for the
repo claim that names the repository.
Base config
SetPIERRE_ORG to your organization name. For the default domain, set the API base URL as shown:
/api, and the examples append it, as in $PIERRE_API_BASE_URL/api/meta. The SDKs and
the CLI read the same PIERRE_API_BASE_URL, with no path.
The organization settings page in the dashboard shows your exact API host and Git host. The OpenAPI
document declares the server https://api.{org}.code.storage. Here, {org} is the subdomain of
your API host, which is usually your organization name. Every operation path starts with /api.
Replace YOUR_JWT_TOKEN with a token from the
signing examples. Send it in the Authorization
header:
PIERRE_TOKEN. A token in it replaces the private key, so the SDK
cannot sign its own tokens, for example for a Git remote URL. Unset PIERRE_TOKEN before you run
SDK code with a private key. See Create a client.
Requests and responses
Use the method, path, and content types shown on the endpoint page. Responses can contain JSON, file content, archives, or diffs. Check the response status and content type before you read its body. Use the current endpoints for new integrations.Repository names in paths
A repository name can contain/, for example acme/web. In a path, encode the name as one
segment: /api/repos/acme%2Fweb/branches. A name with only URL-safe characters needs no encoding.
Encode the name once. The server decodes it once.
Pagination
For endpoints that support cursor pagination, uselimit to request a page size and cursor to
continue a previous request. Defaults, maximum page sizes, and result fields vary by endpoint.
When a response includes has_more and next_cursor:
- Read the results from the response field documented for that endpoint.
- If
has_moreistrue, passnext_cursoras the next request’scursor. Keep other filters unchanged. - Stop when
has_moreisfalse.
Error handling
Errors use RFC 9457 problem details with theapplication/problem+json content type:
codeis a stable, snake_case value. Branch oncode.detailis a message for people. Its text can change.errorrepeatsdetailfor older clients.
400 response for a request body can name the invalid fields in invalid_params. Each item has
the dotted path of the field in name and the rule that the value breaks in reason:
Error codes
Each HTTP status has a generic code. A specific code replaces it when you must take a different action. New codes can be added. Treat an unknown code as the generic code for its status. Generic codes:
Specific codes:
github_repository_inaccessible uses 412, or the 4xx status that GitHub returns, for example 422.
The “Error codes” section of the OpenAPI document description has the same list.
Resolve authentication errors
A401 means that the request has no supported credential. A 403 with the detail
Invalid or expired token means that Code Storage cannot verify the token.
Resolve token errors lists each cause and the
400, 403, and 404 responses for scopes and the repo claim.