Humanitec Event API
Webhook is a special type of a Job. It performs an HTTPS request to a specified URL with specified headers.
Webhook is a special type of a Job. It performs an HTTPS request to a specified URL with specified headers.
openapi: 3.0.0
info:
title: Humanitec AccountType Event 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: Event
x-displayName: Webhooks
description: 'Webhook is a special type of a Job. It performs an HTTPS request to a specified URL with specified headers.
<SchemaDefinition schemaRef="#/components/schemas/WebhookRequest" />
'
paths:
/orgs/{orgId}/apps/{appId}/jobs:
delete:
tags:
- Event
summary: Deletes all Jobs for the Application
parameters:
- name: orgId
in: path
description: 'The Organization ID.
'
required: true
schema:
type: string
- name: appId
in: path
description: 'The Application ID.
'
required: true
schema:
type: string
responses:
'204':
description: 'Deleted successfully.
'
/orgs/{orgId}/apps/{appId}/webhooks:
get:
tags:
- Event
summary: List Webhooks
parameters:
- name: orgId
in: path
description: 'The Organization ID.
'
required: true
schema:
type: string
- name: appId
in: path
description: 'The Application ID.
'
required: true
schema:
type: string
responses:
'200':
description: 'A list of Webhooks.
'
content:
application/json:
schema:
items:
$ref: '#/components/schemas/WebhookResponse'
type: array
post:
tags:
- Event
summary: Create a new Webhook
parameters:
- name: orgId
in: path
description: 'The Organization ID.
'
required: true
schema:
type: string
- name: appId
in: path
description: 'The Application ID.
'
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookRequest'
responses:
'201':
description: 'A created webhook.
'
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookResponse'
'400':
description: 'Some of the values supplied are invalid.
'
content:
application/json:
schema:
$ref: '#/components/schemas/HumanitecErrorResponse'
'409':
description: 'The supplied `id` clashes with an existing Job.
'
content:
application/json:
schema:
$ref: '#/components/schemas/HumanitecErrorResponse'
/orgs/{orgId}/apps/{appId}/webhooks/{jobId}:
get:
tags:
- Event
summary: Get a Webhook
parameters:
- name: orgId
in: path
description: 'The Organization ID.
'
required: true
schema:
type: string
- name: appId
in: path
description: 'The Application ID.
'
required: true
schema:
type: string
- name: jobId
in: path
description: 'The Webhook ID.
'
required: true
schema:
type: string
responses:
'200':
description: 'The requested webhook.
'
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookResponse'
'404':
description: 'The requested webhook not found.
'
content:
application/json:
schema:
$ref: '#/components/schemas/HumanitecErrorResponse'
delete:
tags:
- Event
summary: Delete a Webhook
parameters:
- name: orgId
in: path
description: 'The Organization ID.
'
required: true
schema:
type: string
- name: appId
in: path
description: 'The Application ID.
'
required: true
schema:
type: string
- name: jobId
in: path
description: 'The Webhook ID.
'
required: true
schema:
type: string
responses:
'204':
description: 'Deleted successfully
'
'404':
description: 'The requested webhook not found.
'
content:
application/json:
schema:
$ref: '#/components/schemas/HumanitecErrorResponse'
patch:
tags:
- Event
summary: Update a Webhook
parameters:
- name: orgId
in: path
description: 'The Organization ID.
'
required: true
schema:
type: string
- name: appId
in: path
description: 'The Application ID.
'
required: true
schema:
type: string
- name: jobId
in: path
description: 'The Webhook ID.
'
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookRequest'
responses:
'200':
description: 'Updated successfully, return the webhook
'
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookUpdateResponse'
'400':
description: 'Bad request
'
content:
application/json:
schema:
$ref: '#/components/schemas/HumanitecErrorResponse'
'404':
description: 'The requested webhook not found.
'
content:
application/json:
schema:
$ref: '#/components/schemas/HumanitecErrorResponse'
/orgs/{orgId}/events:
get:
tags:
- Event
summary: List Events
parameters:
- name: orgId
in: path
description: 'The Organization ID.
'
required: true
schema:
type: string
responses:
'200':
description: 'A list of Events.
'
content:
application/json:
schema:
items:
$ref: '#/components/schemas/EventResponse'
type: array
components:
schemas:
JSONFieldRequest:
additionalProperties: {}
type: object
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.
EventBaseRequest:
description: Properties which identify an event .
properties:
scope:
description: Event scope
type: string
type:
description: Event type
type: string
type: object
WebhookResponse:
description: Webhook is a special type of a Job. It performs an HTTPS request to a specified URL with specified headers.
properties:
created_at:
description: The timestamp of when this Job was created.
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 who created this Job
type: string
disabled:
description: Defines whether this job is currently disabled.
nullable: true
type: boolean
headers:
$ref: '#/components/schemas/JSONFieldResponse'
description: The webhook's HTTP headers.
id:
description: Job ID, unique within the Organization
type: string
payload:
$ref: '#/components/schemas/JSONFieldResponse'
description: The webhook's HTTP headers.
triggers:
description: A list of Events by which the Job is triggered
items:
$ref: '#/components/schemas/EventBaseResponse'
type: array
url:
description: The webhook's URL (without protocol, only HTTPS is supported).
nullable: true
type: string
required:
- id
- disabled
- triggers
- url
- headers
- payload
type: object
JSONFieldResponse:
additionalProperties: {}
type: object
WebhookRequest:
description: Webhook is a special type of a Job. It performs an HTTPS request to a specified URL with specified headers.
properties:
disabled:
description: Defines whether this job is currently disabled.
nullable: true
type: boolean
headers:
$ref: '#/components/schemas/JSONFieldRequest'
description: The webhook's HTTP headers.
id:
description: Job ID, unique within the Organization
type: string
payload:
$ref: '#/components/schemas/JSONFieldRequest'
description: The webhook's HTTP headers.
triggers:
description: A list of Events by which the Job is triggered
items:
$ref: '#/components/schemas/EventBaseRequest'
type: array
url:
description: The webhook's URL (without protocol, only HTTPS is supported).
nullable: true
type: string
type: object
WebhookUpdateResponse:
description: Webhook is a special type of a Job. It performs an HTTPS request to a specified URL with specified headers.
properties:
disabled:
description: Defines whether this job is currently disabled.
nullable: true
type: boolean
headers:
$ref: '#/components/schemas/JSONFieldResponse'
description: The webhook's HTTP headers.
payload:
$ref: '#/components/schemas/JSONFieldResponse'
description: The webhook's HTTP headers.
triggers:
description: A list of Events by which the Job is triggered
items:
$ref: '#/components/schemas/EventBaseResponse'
nullable: true
type: array
url:
description: The webhook's URL (without protocol, only HTTPS is supported)
nullable: true
type: string
required:
- disabled
- triggers
- url
- headers
- payload
type: object
EventResponse:
description: Events available for triggering automated jobs.
properties:
properties:
description: List of event properties which can be used as variables for this event
items:
type: string
type: array
scope:
description: Event scope
type: string
type:
description: Event type
type: string
required:
- scope
- type
- properties
type: object
EventBaseResponse:
description: Properties which identify an event .
properties:
scope:
description: Event scope
type: string
type:
description: Event type
type: string
required:
- scope
- 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