GitHub Actions Artifacts API

Download and manage workflow run artifacts

Documentation

Specifications

Schemas & Data

Other Resources

🔗
ChangeLog
https://github.blog/changelog/label/actions/
🔗
SDKs
https://github.com/octokit/octokit.js
🔗
SDKs
https://github.com/octokit/octokit.rb
🔗
SDKs
https://github.com/octokit/octokit.net
🔗
SDKs
https://github.com/google/go-github
🔗
CLI
https://cli.github.com/manual/gh_workflow_run
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/json-ld/github-actions-context.jsonld
🔗
APIsJSON
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/apis.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/arazzo/_index.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/arazzo/github-actions-approve-pending-deployment-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/arazzo/github-actions-cancel-run-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/arazzo/github-actions-collect-run-artifacts-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/arazzo/github-actions-dispatch-and-track-run-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/arazzo/github-actions-inspect-failed-job-logs-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/arazzo/github-actions-prune-repo-caches-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/arazzo/github-actions-register-runner-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/arazzo/github-actions-rerun-failed-run-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/arazzo/github-actions-share-org-secret-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/arazzo/github-actions-upsert-repo-secret-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github-actions/refs/heads/main/arazzo/github-actions-upsert-repo-variable-workflow.yml

OpenAPI Specification

github-actions-artifacts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: GitHub Actions Artifacts API
  description: REST API for managing GitHub Actions workflows, runs, artifacts, secrets, runners, caches, variables, permissions, and OIDC.
  version: 1.0.0
  contact:
    name: GitHub Support
    url: https://support.github.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
- url: https://api.github.com
  description: GitHub REST API
security:
- bearerAuth: []
- personalAccessToken: []
tags:
- name: Artifacts
  description: Download and manage workflow run artifacts
paths:
  /repos/{owner}/{repo}/actions/artifacts:
    get:
      operationId: listArtifactsForRepo
      summary: Github Actions List Artifacts for a Repository
      description: Lists all artifacts for a repository.
      tags:
      - Artifacts
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - name: name
        in: query
        schema:
          type: string
        example: Example Title
      - $ref: '#/components/parameters/perPage'
      - $ref: '#/components/parameters/page'
      responses:
        '200':
          description: Successfully retrieved artifacts
          content:
            application/json:
              schema:
                type: object
                properties:
                  total_count:
                    type: integer
                  artifacts:
                    type: array
                    items:
                      $ref: '#/components/schemas/Artifact'
              examples:
                Listartifactsforrepo200Example:
                  summary: Default listArtifactsForRepo 200 response
                  x-microcks-default: true
                  value:
                    total_count: 10
                    artifacts:
                    - id: abc123
                      node_id: '500123'
                      name: Example Title
                      size_in_bytes: 10
                      url: https://www.example.com
                      archive_download_url: https://www.example.com
                      expired: true
                      created_at: '2026-01-15T10:30:00Z'
                      expires_at: '2026-01-15T10:30:00Z'
                      updated_at: '2026-01-15T10:30:00Z'
                      workflow_run:
                        id: abc123
                        repository_id: '500123'
                        head_repository_id: '500123'
                        head_branch: example_value
                        head_sha: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/actions/artifacts/{artifact_id}:
    get:
      operationId: getArtifact
      summary: Github Actions Get an Artifact
      description: Gets a specific artifact for a workflow run.
      tags:
      - Artifacts
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/artifactId'
      responses:
        '200':
          description: Successfully retrieved artifact
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Artifact'
              examples:
                Getartifact200Example:
                  summary: Default getArtifact 200 response
                  x-microcks-default: true
                  value:
                    id: abc123
                    node_id: '500123'
                    name: Example Title
                    size_in_bytes: 10
                    url: https://www.example.com
                    archive_download_url: https://www.example.com
                    expired: true
                    created_at: '2026-01-15T10:30:00Z'
                    expires_at: '2026-01-15T10:30:00Z'
                    updated_at: '2026-01-15T10:30:00Z'
                    workflow_run:
                      id: abc123
                      repository_id: '500123'
                      head_repository_id: '500123'
                      head_branch: example_value
                      head_sha: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      operationId: deleteArtifact
      summary: Github Actions Delete an Artifact
      description: Deletes an artifact for a workflow run.
      tags:
      - Artifacts
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/artifactId'
      responses:
        '204':
          description: Successfully deleted artifact
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}:
    get:
      operationId: downloadArtifact
      summary: Github Actions Download an Artifact
      description: Gets a redirect URL to download an archive for a repository. The archive_format must be zip.
      tags:
      - Artifacts
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/artifactId'
      - name: archive_format
        in: path
        required: true
        schema:
          type: string
          enum:
          - zip
        example: zip
      responses:
        '302':
          description: Redirect to artifact download URL
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts:
    get:
      operationId: listWorkflowRunArtifacts
      summary: Github Actions List Workflow Run Artifacts
      description: Lists artifacts for a workflow run.
      tags:
      - Artifacts
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/runId'
      - name: name
        in: query
        schema:
          type: string
        example: Example Title
      - $ref: '#/components/parameters/perPage'
      - $ref: '#/components/parameters/page'
      responses:
        '200':
          description: Successfully retrieved artifacts
          content:
            application/json:
              schema:
                type: object
                properties:
                  total_count:
                    type: integer
                  artifacts:
                    type: array
                    items:
                      $ref: '#/components/schemas/Artifact'
              examples:
                Listworkflowrunartifacts200Example:
                  summary: Default listWorkflowRunArtifacts 200 response
                  x-microcks-default: true
                  value:
                    total_count: 10
                    artifacts:
                    - id: abc123
                      node_id: '500123'
                      name: Example Title
                      size_in_bytes: 10
                      url: https://www.example.com
                      archive_download_url: https://www.example.com
                      expired: true
                      created_at: '2026-01-15T10:30:00Z'
                      expires_at: '2026-01-15T10:30:00Z'
                      updated_at: '2026-01-15T10:30:00Z'
                      workflow_run:
                        id: abc123
                        repository_id: '500123'
                        head_repository_id: '500123'
                        head_branch: example_value
                        head_sha: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  parameters:
    runId:
      name: run_id
      in: path
      required: true
      schema:
        type: integer
      description: The unique identifier of the workflow run.
    perPage:
      name: per_page
      in: query
      schema:
        type: integer
        default: 30
        maximum: 100
      description: The number of results per page (max 100).
    repo:
      name: repo
      in: path
      required: true
      schema:
        type: string
      description: The name of the repository without the .git extension.
    page:
      name: page
      in: query
      schema:
        type: integer
        default: 1
      description: The page number of the results to fetch.
    owner:
      name: owner
      in: path
      required: true
      schema:
        type: string
      description: The account owner of the repository.
    artifactId:
      name: artifact_id
      in: path
      required: true
      schema:
        type: integer
      description: The unique identifier of the artifact.
  schemas:
    Artifact:
      type: object
      properties:
        id:
          type: integer
          example: abc123
        node_id:
          type: string
          example: '500123'
        name:
          type: string
          description: The name of the artifact.
          example: Example Title
        size_in_bytes:
          type: integer
          description: The size in bytes of the artifact.
          example: 10
        url:
          type: string
          format: uri
          example: https://www.example.com
        archive_download_url:
          type: string
          format: uri
          example: https://www.example.com
        expired:
          type: boolean
          example: true
        created_at:
          type: string
          format: date-time
          nullable: true
          example: '2026-01-15T10:30:00Z'
        expires_at:
          type: string
          format: date-time
          nullable: true
          example: '2026-01-15T10:30:00Z'
        updated_at:
          type: string
          format: date-time
          nullable: true
          example: '2026-01-15T10:30:00Z'
        workflow_run:
          type: object
          nullable: true
          properties:
            id:
              type: integer
            repository_id:
              type: integer
            head_repository_id:
              type: integer
            head_branch:
              type: string
            head_sha:
              type: string
          example: example_value
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: GitHub personal access token or OAuth token
    personalAccessToken:
      type: http
      scheme: bearer
      description: Fine-grained personal access token with Actions permissions