GitHub: Create artifact metadata storage record
GitHub orgs.orgsCreateArtifactStorageRecord: arguments, response, policy and SDK examples.
← Orgs operations · Get started
Operation github.orgs_create_artifact_storage_record
Provider route: POST /orgs/{org}/artifacts/metadata/storage-record. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/github with npm, or alter-sdk-github with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { GitHubIntegration } from "@alter-ai/github";
async function execute(input: Parameters<GitHubIntegration["orgs"]["orgsCreateArtifactStorageRecord"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new GitHubIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.orgs.orgsCreateArtifactStorageRecord(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_github import GitHubIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = GitHubIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.orgs.orgs_create_artifact_storage_record(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.org | string | Required within parent | |
body | object | Required within parent | |
body.artifact_url | string | Optional | The URL where the artifact is stored. Format: uri Maximum length: 152 Pattern: ^https:// |
body.digest | string | Required within parent | The digest of the artifact (algorithm:hex-encoded-digest). Maximum length: 71 Minimum length: 71 Pattern: ^sha256:[a-f0-9]{64}$ |
body.github_repository | string | Optional | The name of the GitHub repository associated with the artifact. This should be used when there are no provenance attestations available for the artifact. The repository must belong to the organization specified in the path parameter. If a provenance attestation is available for the artifact, the API will use the repository information from the attestation instead of this parameter. Maximum length: 100 Minimum length: 1 Pattern: ^[A-Za-z0-9.-_]+$ |
body.name | string | Required within parent | The name of the artifact. Maximum length: 256 Minimum length: 1 |
body.path | string | Optional | The path of the artifact. Format: uri Maximum length: 512 |
body.registry_url | string | Required within parent | The base URL of the artifact registry. Format: uri Maximum length: 256 Minimum length: 1 Pattern: ^https:// |
body.repository | string | Optional | The repository name within the registry. Maximum length: 128 |
body.return_records | boolean | Optional | If true, the endpoint will return the created record in the response body. Default: true |
body.status | string | Optional | The status of the artifact (e.g., active, inactive). Default: active One of: active, eol, deleted |
body.version | string | Optional | The artifact version. Maximum length: 100 Minimum length: 1 |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
storage_records | array | Optional | |
storage_records[] | object | Each item | |
storage_records[].artifact_url | JSON | Optional | |
storage_records[].artifact_url (anyOf 1) | string | Alternative | |
storage_records[].artifact_url (anyOf 2) | null | Alternative | |
storage_records[].created_at | string | Optional | |
storage_records[].digest | string | Optional | |
storage_records[].id | JSON | Optional | |
storage_records[].id (anyOf 1) | integer | Alternative | |
storage_records[].id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
storage_records[].name | string | Optional | |
storage_records[].registry_url | string | Optional | |
storage_records[].repository | JSON | Optional | |
storage_records[].repository (anyOf 1) | string | Alternative | |
storage_records[].repository (anyOf 2) | null | Alternative | |
storage_records[].status | string | Optional | |
storage_records[].updated_at | string | Optional | |
total_count | JSON | Required within parent | |
total_count (anyOf 1) | integer | Alternative | |
total_count (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: github.orgs_create_artifact_storage_record. Catalog operation: orgs/create-artifact-storage-record. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Pinned headers: {"X-GitHub-Api-Version": "2026-03-10", "User-Agent": "Alter", "Accept": "application/vnd.github+json"}