Humanitec Artefact API
Artefacts can be registered with Humanitec. Continuous Integration (CI) pipelines notify Humanitec when a new version of an Artefact becomes available. Humanitec tracks the Artefact along with metadata about how it was built.
Artefacts can be registered with Humanitec. Continuous Integration (CI) pipelines notify Humanitec when a new version of an Artefact becomes available. Humanitec tracks the Artefact along with metadata about how it was built.
openapi: 3.0.0
info:
title: Humanitec AccountType Artefact API
version: 0.28.24
description: '# Introduction
The *Humanitec API* allows you to automate and integrate Humanitec into your developer and operational workflows.
The API is a REST based API. It is based around a set of concepts:
* Core
* External Resources
* Sets and Deltas
## Authentication
Almost all requests made to the Humanitec API require Authentication. See our [Developer Docs on API Authentication](https://developer.humanitec.com/platform-orchestrator/reference/api-references/#authentication) for instructions.
## Content Types
The Humanitec API, unless explicitly specified, only accepts content types of `application/json` and will always return valid `application/json` or an empty response.
## Response Codes
### Success
Any response code in the `2xx` range should be regarded as success.
| **Code** | **Meaning** |
|----------|-------------------------------------|
| `200` | Success |
| `201` | Success, a new resource was created |
| `204` | Success, but no content in response |
_Note: We plan to simplify the interface by replacing 201 with 200 status codes._
### Failure
Any response code in the `4xx` range should be regarded as an error that can be rectified by the client. `5xx` error codes indicate errors that cannot be corrected by the client.
| **Code** | **Meaning** |
|----------|-----------------------------------------------------------------------------------------------------------------------|
| `400` | General error. (Body will contain details) |
| `401` | Attempt to access protected resource without `Authorization` Header. |
| `403` | The `Bearer` or `JWT` does not grant access to the requested resource. |
| `404` | Resource not found. |
| `405` | Method not allowed |
| `409` | Conflict. Usually indicated a resource with that ID already exists. |
| `422` | Unprocessable Entity. The body was not valid JSON, was empty or contained an object different from what was expected. |
| `429` | Too many requests - request rate limit has been reached. |
| `500` | Internal Error. If it occurs repeatedly, contact support. |
'
contact:
name: Humanitec Support
email: support@humanitec.com
x-logo:
url: humanitec-logo.png
altText: Humanitec logo
servers:
- url: https://api.humanitec.io/
tags:
- name: Artefact
x-displayName: Artefact
description: 'Artefacts can be registered with Humanitec. Continuous Integration (CI) pipelines notify Humanitec when a new version of an Artefact becomes available. Humanitec tracks the Artefact along with metadata about how it was built.
<SchemaDefinition schemaRef="#/components/schemas/ArtefactResponse" />
'
paths:
/orgs/{orgId}/artefact-versions/{artefactVersionId}/workload-spec:
get:
tags:
- Artefact
summary: Get the spec of this Workload Artefact Version
description: 'Returns the spec of this Artefact Version if it is of type workload. An error will be
returned if it is not.
'
operationId: getWorkloadArtefactVersionSpec
parameters:
- name: orgId
in: path
description: The organization ID.
required: true
example: sample-org
schema:
type: string
- name: artefactVersionId
in: path
description: The Artefact Version ID.
example: 662b80db-cc71-40cf-b601-08d57983f6e4
required: true
schema:
type: string
- name: Accept
in: header
description: The accepted content type.
example: application/json
required: false
schema:
type: string
responses:
'200':
description: The workload spec, returned in JSON format by default or in YAML if specified by the Accept header.
content:
application/json:
schema:
type: object
additionalProperties: true
application/x-yaml:
schema:
type: object
additionalProperties: true
'400':
description: Malformed Artefact Version ID.
content:
application/json:
schema:
$ref: '#/components/schemas/HumanitecErrorResponse'
'404':
description: Artefact Version not found.
content:
application/json:
schema:
$ref: '#/components/schemas/HumanitecErrorResponse'
/orgs/{orgId}/artefact-versions/{artefactVersionId}/workload-deployment-set:
get:
tags:
- Artefact
summary: Get the Humanitec module definition of this Workload Artefact Version as a deployment set
description: 'Returns the Humanitec workload module of this Artefact Version if it is of type workload. An error will be
returned if it is not.
'
operationId: getWorkloadArtefactVersionDeploymentSet
parameters:
- name: orgId
in: path
description: The organization ID.
required: true
example: sample-org
schema:
type: string
- name: artefactVersionId
in: path
description: The Artefact Version ID.
example: 662b80db-cc71-40cf-b601-08d57983f6e4
required: true
schema:
type: string
- name: Accept
in: header
description: The accepted content type.
example: application/json
required: false
schema:
type: string
responses:
'200':
description: The workload spec as a Humanitec deployment set, returned in JSON format by default or in YAML if specified by the Accept header.
content:
application/json:
schema:
$ref: '#/components/schemas/WorkloadArtefactVersionDeploymentSet'
application/x-yaml:
schema:
$ref: '#/components/schemas/WorkloadArtefactVersionDeploymentSet'
'400':
description: Malformed Artefact Version ID.
content:
application/json:
schema:
$ref: '#/components/schemas/HumanitecErrorResponse'
'404':
description: Artefact Version not found.
content:
application/json:
schema:
$ref: '#/components/schemas/HumanitecErrorResponse'
/orgs/{orgId}/artefacts:
get:
tags:
- Artefact
summary: List all Artefacts.
description: Returns the Artefacts registered with your organization. If no elements are found, an empty list is returned.
operationId: listArtefacts
parameters:
- name: orgId
in: path
description: The organization ID.
required: true
example: sample-org
schema:
type: string
- name: type
in: query
description: (Optional) Filter Artefacts by type.
example: container
schema:
type: string
- name: name
in: query
description: (Optional) Filter Artefacts by name.
example: registry.humanitec.io/public/sample-app
schema:
type: string
responses:
'200':
description: The list of Artefacts within the organization.
content:
application/json:
schema:
items:
$ref: '#/components/schemas/ArtefactResponse'
type: array
/orgs/{orgId}/artefacts/{artefactId}:
delete:
tags:
- Artefact
summary: Delete Artefact and all related Artefact Versions
description: The specified Artefact and its Artefact Versions will be permanently deleted. Only Administrators can delete an Artefact.
operationId: deleteArtefact
parameters:
- name: orgId
in: path
description: The organization ID.
required: true
example: sample-org
schema:
type: string
- name: artefactId
in: path
description: The Artefact ID.
example: da97af75-2e7c-4ef3-bec0-755ce1e8dd29
required: true
schema:
type: string
responses:
'204':
description: Artefact and related Artefact Versions successfully deleted.
'403':
description: Request forbidden. This action can only be performed by users holding the Administrator role. It is not possible to delete a built-in artefact.
content:
application/json:
schema:
$ref: '#/components/schemas/HumanitecErrorResponse'
'404':
description: Artefact not found within your organization.
content:
application/json:
schema:
$ref: '#/components/schemas/HumanitecErrorResponse'
components:
schemas:
HumanitecErrorResponse:
description: HumanitecError represents a standard Humanitec Error
properties:
details:
additionalProperties: true
type: object
description: (Optional) Additional information is enclosed here.
error:
type: string
example: API-000
description: A short code to help with error identification.
message:
type: string
example: Could not validate token
description: A Human readable message about the error.
required:
- error
- message
type: object
example:
error: API-000
message: Could not validate token.
WorkloadArtefactVersionDeploymentSet:
description: Humanitec definition for a Workload Artefact.
required:
- modules
- shared
properties:
modules:
description: The set of workloads to add when deployed, the key is the name of the workload.
type: object
additionalProperties:
type: object
additionalProperties: true
shared:
description: The set of shared resources to depend on, the key is the resource identifier.
type: object
additionalProperties:
type: object
additionalProperties: true
ArtefactResponse:
description: Artefacts can be registered with Humanitec. Continuous Integration (CI) pipelines notify Humanitec when a new version of an Artefact becomes available. Humanitec tracks the Artefact along with metadata about how it was built.
properties:
created_at:
description: The time when the Artefact was added to Humanitec.
example: '2020-06-22T09:37:23.523Z'
pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{3})?Z$
title: Simplified extended ISO format date/time string.
type: string
created_by:
description: The user ID of the user who added the Artefact to Humanitec.
type: string
example: 01234567-89ab-cdef-0123-456789abcdef
id:
description: The UUID of the Artefact.
example: 01234567-89ab-cdef-0123-456789abcdef
type: string
name:
description: The name of the Artefact.
example: registry.humanitec.io/my-org/my-service
type: string
type:
description: The type of the Artefact.
example: container
type: string
updated_at:
description: The time when the Artefact was updated for the last time.
example: '2020-06-22T09:37:23.523Z'
pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{3})?Z$
title: Simplified extended ISO format date/time string.
type: string
updated_by:
description: The user ID of the user who updated the Artefact for the last time.
example: 01234567-89ab-cdef-0123-456789abcdef
type: string
required:
- id
- name
- type
type: object
externalDocs:
description: Find out more about how to use Humanitec in your every-day development work.
url: https://developer.humanitec.com/
x-tagGroups:
- name: Core
tags:
- Agents
- Application
- Artefact
- ArtefactVersion
- AuditLogs
- Logs
- Deployment
- EnvironmentType
- Environment
- Image
- PublicKeys
- Organization
- Registry
- RuntimeInfo
- SecretStore
- Value
- ValueSetVersion
- name: App Configuration
tags:
- Delta
- Set
- WorkloadProfile
- name: Resources
tags:
- ActiveResource
- DriverDefinition
- MatchingCriteria
- ResourceDefinition
- ResourceDefinitionVersion
- ResourceProvision
- AccountType
- ResourceAccount
- ResourceType
- ResourceClass
- name: Automation
tags:
- AutomationRule
- Event
- Pipelines
- PipelineRuns
- PipelineApprovals
- name: Users
tags:
- UserProfile
- UserRole
- Group
- TokenInfo