Skip to content

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.

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 os
from alter_sdk import App
from 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()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.orgstringRequired within parent
bodyobjectRequired within parent
body.artifact_urlstringOptionalThe URL where the artifact is stored.
Format: uri
Maximum length: 152
Pattern: ^https://
body.digeststringRequired within parentThe digest of the artifact (algorithm:hex-encoded-digest).
Maximum length: 71
Minimum length: 71
Pattern: ^sha256:[a-f0-9]{64}$
body.github_repositorystringOptionalThe 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.namestringRequired within parentThe name of the artifact.
Maximum length: 256
Minimum length: 1
body.pathstringOptionalThe path of the artifact.
Format: uri
Maximum length: 512
body.registry_urlstringRequired within parentThe base URL of the artifact registry.
Format: uri
Maximum length: 256
Minimum length: 1
Pattern: ^https://
body.repositorystringOptionalThe repository name within the registry.
Maximum length: 128
body.return_recordsbooleanOptionalIf true, the endpoint will return the created record in the response body.

Default: true
body.statusstringOptionalThe status of the artifact (e.g., active, inactive).
Default: active
One of: active, eol, deleted
body.versionstringOptionalThe artifact version.
Maximum length: 100
Minimum length: 1

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$objectRoot
storage_recordsarrayOptional
storage_records[]objectEach item
storage_records[].artifact_urlJSONOptional
storage_records[].artifact_url (anyOf 1)stringAlternative
storage_records[].artifact_url (anyOf 2)nullAlternative
storage_records[].created_atstringOptional
storage_records[].digeststringOptional
storage_records[].idJSONOptional
storage_records[].id (anyOf 1)integerAlternative
storage_records[].id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
storage_records[].namestringOptional
storage_records[].registry_urlstringOptional
storage_records[].repositoryJSONOptional
storage_records[].repository (anyOf 1)stringAlternative
storage_records[].repository (anyOf 2)nullAlternative
storage_records[].statusstringOptional
storage_records[].updated_atstringOptional
total_countJSONRequired within parent
total_count (anyOf 1)integerAlternative
total_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

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"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.